commit: 4682a1f615e7eacf6242767c7e6a663614359e3c Author: Sv. Lockal <lockalsash <AT> gmail <DOT> com> AuthorDate: Mon Dec 25 16:55:23 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Thu Jan 4 00:06:33 2024 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4682a1f6
sys-process/lsof: fix compilation with clang when hip runtime is installed Closes: https://bugs.gentoo.org/919253 Signed-off-by: Sv. Lockal <lockalsash <AT> gmail.com> Closes: https://github.com/gentoo/gentoo/pull/34471 Signed-off-by: Sam James <sam <AT> gentoo.org> .../lsof/files/lsof-4.98.0-fix-clang-version-parser.patch | 15 +++++++++++++++ sys-process/lsof/lsof-4.98.0-r1.ebuild | 10 +++++++++- sys-process/lsof/lsof-4.99.0.ebuild | 13 +++++++++++++ sys-process/lsof/lsof-4.99.3.ebuild | 13 +++++++++++++ 4 files changed, 50 insertions(+), 1 deletion(-) diff --git a/sys-process/lsof/files/lsof-4.98.0-fix-clang-version-parser.patch b/sys-process/lsof/files/lsof-4.98.0-fix-clang-version-parser.patch new file mode 100644 index 000000000000..ebb5d85d2e5d --- /dev/null +++ b/sys-process/lsof/files/lsof-4.98.0-fix-clang-version-parser.patch @@ -0,0 +1,15 @@ +https://bugs.gentoo.org/919253 +https://github.com/lsof-org/lsof/issues/305 + +Ignore HIP or CUDA versions in clang, when checking for compiler version +--- a/configure.ac ++++ b/configure.ac +@@ -410,7 +410,7 @@ AC_CONFIG_FILES([Makefile]) + + # Pass build configurations to version.h.in + AC_SUBST(cc, $CC) +-AC_SUBST(ccv, $($CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p')) ++AC_SUBST(ccv, $($CC -v 2>&1 | sed -n 's/.*version \(.*\)/\1/p;q')) + AC_SUBST(ccflags, $CFLAGS) + AC_SUBST(ldflags, "$LDFLAGS$LIBS") + # Reproducible build diff --git a/sys-process/lsof/lsof-4.98.0-r1.ebuild b/sys-process/lsof/lsof-4.98.0-r1.ebuild index 77f81e741013..715ef0c9a4c3 100644 --- a/sys-process/lsof/lsof-4.98.0-r1.ebuild +++ b/sys-process/lsof/lsof-4.98.0-r1.ebuild @@ -3,7 +3,7 @@ EAPI=8 -inherit flag-o-matic +inherit autotools flag-o-matic MY_P="${P/-/_}" DESCRIPTION="Lists open files for running Unix processes" @@ -30,8 +30,16 @@ RESTRICT="test" PATCHES=( "${FILESDIR}"/${P}-fix-common-include-strftime.patch + "${FILESDIR}"/${PN}-4.98.0-fix-clang-version-parser.patch ) +# TODO: drop this block, "inherit autotools" and clang-version-parser patch after 4.99.3 +# https://github.com/lsof-org/lsof/pull/306 +src_prepare() { + default + eautoreconf +} + src_configure() { # TODO: drop after 4.98.0: https://github.com/lsof-org/lsof/commit/4fbe0b78f63ce115f25cf7a49756745e3bf47fea export ac_cv_header_selinux_selinux_h=$(usex selinux) diff --git a/sys-process/lsof/lsof-4.99.0.ebuild b/sys-process/lsof/lsof-4.99.0.ebuild index d1dba0173182..e77a7a93b7e9 100644 --- a/sys-process/lsof/lsof-4.99.0.ebuild +++ b/sys-process/lsof/lsof-4.99.0.ebuild @@ -3,6 +3,8 @@ EAPI=8 +inherit autotools + MY_P="${P/-/_}" DESCRIPTION="Lists open files for running Unix processes" HOMEPAGE="https://github.com/lsof-org/lsof" @@ -26,6 +28,17 @@ BDEPEND=" # Needs fixing first for sandbox RESTRICT="test" +PATCHES=( + "${FILESDIR}"/${PN}-4.98.0-fix-clang-version-parser.patch +) + +# TODO: drop this block, "inherit autotools" and clang-version-parser patch after 4.99.3 +# https://github.com/lsof-org/lsof/pull/306 +src_prepare() { + default + eautoreconf +} + src_configure() { local myeconfargs=( $(use_with rpc libtirpc) diff --git a/sys-process/lsof/lsof-4.99.3.ebuild b/sys-process/lsof/lsof-4.99.3.ebuild index c22f1df517e3..591b4742d2de 100644 --- a/sys-process/lsof/lsof-4.99.3.ebuild +++ b/sys-process/lsof/lsof-4.99.3.ebuild @@ -3,6 +3,8 @@ EAPI=8 +inherit autotools + MY_P="${P/-/_}" DESCRIPTION="Lists open files for running Unix processes" HOMEPAGE="https://github.com/lsof-org/lsof" @@ -26,6 +28,17 @@ BDEPEND=" # Needs fixing first for sandbox RESTRICT="test" +PATCHES=( + "${FILESDIR}"/${PN}-4.98.0-fix-clang-version-parser.patch +) + +# TODO: drop this block, "inherit autotools" and clang-version-parser patch after 4.99.3 +# https://github.com/lsof-org/lsof/pull/306 +src_prepare() { + default + eautoreconf +} + src_configure() { local myeconfargs=( $(use_with rpc libtirpc)