commit:     5570cc427432efe0d2dec2f1054ee37ceb08492a
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 14 04:29:26 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jul 14 04:52:56 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5570cc42

dev-libs/newt: fix libcrypt QA warning false positive

* Fix LDFLAGS ordering (respect as-needed, similar to libxml2)
* Fix configure with non-Bash (dash here)

Closes: https://bugs.gentoo.org/798945
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../newt-0.52.21-fix-non-POSIX-backticks.patch     | 27 +++++++++++++++++++
 .../newt-0.52.21-makefile-LDFLAGS-ordering.patch   | 30 ++++++++++++++++++++++
 dev-libs/newt/newt-0.52.21-r1.ebuild               | 14 ++++++----
 3 files changed, 66 insertions(+), 5 deletions(-)

diff --git a/dev-libs/newt/files/newt-0.52.21-fix-non-POSIX-backticks.patch 
b/dev-libs/newt/files/newt-0.52.21-fix-non-POSIX-backticks.patch
new file mode 100644
index 00000000000..3d6b87030dd
--- /dev/null
+++ b/dev-libs/newt/files/newt-0.52.21-fix-non-POSIX-backticks.patch
@@ -0,0 +1,27 @@
+From a37a8c15f4653b4edea414f42a0d76f3b1f5652c Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Wed, 14 Jul 2021 05:19:25 +0100
+Subject: [PATCH] Fix non-POSIX backticks
+
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index cb2b940..9ba4c64 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -23,8 +23,8 @@ AC_CHECK_SIZEOF([void *])
+ AC_MSG_CHECKING([for GNU ld])
+ LD=`$CC -print-prog-name=ld 2>&5`
+ 
+-if test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU ld"` = 0 -a \
+-   test `$LD -v 2>&1 | $ac_cv_path_GREP -c "GNU gold"` = 0; then
++if test $($LD -v 2>&1 | $ac_cv_path_GREP -c "GNU ld") = 0 -a \
++   $($LD -v 2>&1 | $ac_cv_path_GREP -c "GNU gold") = 0; then
+   # Not
+   GNU_LD=""
+   AC_MSG_RESULT([no])
+-- 
+2.32.0
+

diff --git a/dev-libs/newt/files/newt-0.52.21-makefile-LDFLAGS-ordering.patch 
b/dev-libs/newt/files/newt-0.52.21-makefile-LDFLAGS-ordering.patch
new file mode 100644
index 00000000000..f05075adb37
--- /dev/null
+++ b/dev-libs/newt/files/newt-0.52.21-makefile-LDFLAGS-ordering.patch
@@ -0,0 +1,30 @@
+From 22d44d2cbfcbec216d0028ebdf274247139a8045 Mon Sep 17 00:00:00 2001
+From: Sam James <[email protected]>
+Date: Wed, 14 Jul 2021 05:12:32 +0100
+Subject: [PATCH] Swap order of LDFLAGS and P*FLAGS
+
+Needed to respect as-needed.
+
+Bug: https://bugs.gentoo.org/798945
+---
+ Makefile.in | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 1047efc..f0bc417 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -97,8 +97,8 @@ _snack.$(SOEXT):   snack.c $(LIBNEWTSH)
+               PLFLAGS=`$$pyconfig --libs`; \
+               echo $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o 
$$ver/snack.o snack.c; \
+               $(CC) $(SHCFLAGS) $(CPPFLAGS) $$PIFLAGS $$PCFLAGS -c -o 
$$ver/snack.o snack.c; \
+-              echo $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o 
$$ver/_snack.$(SOEXT) $$ver/snack.o -L.  -lnewt $(LIBS); \
+-              $(CC) --shared $$PLDFLAGS $$PLFLAGS $(LDFLAGS) -o 
$$ver/_snack.$(SOEXT) $$ver/snack.o -L.  -lnewt $(LIBS); \
++              echo $(CC) --shared $(LDFLAGS) $$PLDFLAGS $$PLFLAGS -o 
$$ver/_snack.$(SOEXT) $$ver/snack.o -L.  -lnewt $(LIBS); \
++              $(CC) --shared $(LDFLAGS) $$PLDFLAGS $$PLFLAGS -o 
$$ver/_snack.$(SOEXT) $$ver/snack.o -L.  -lnewt $(LIBS); \
+       done || :
+       touch $@
+ 
+-- 
+2.32.0
+

diff --git a/dev-libs/newt/newt-0.52.21-r1.ebuild 
b/dev-libs/newt/newt-0.52.21-r1.ebuild
index 4eb95be8623..b2727a258f8 100644
--- a/dev-libs/newt/newt-0.52.21-r1.ebuild
+++ b/dev-libs/newt/newt-0.52.21-r1.ebuild
@@ -29,6 +29,14 @@ RDEPEND="
        "
 DEPEND="${RDEPEND}"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.52.13-gold.patch
+       "${FILESDIR}"/${PN}-0.52.14-tcl.patch
+       "${FILESDIR}"/${PN}-0.52.21-python-sitedir.patch
+       "${FILESDIR}"/${PN}-0.52.21-makefile-LDFLAGS-ordering.patch
+       "${FILESDIR}"/${PN}-0.52.21-fix-non-POSIX-backticks.patch
+)
+
 src_prepare() {
        # bug 73850
        if use elibc_uclibc; then
@@ -54,11 +62,7 @@ src_prepare() {
                        || die "sed po/Makefile"
        fi
 
-       eapply \
-               "${FILESDIR}"/${PN}-0.52.13-gold.patch \
-               "${FILESDIR}"/${PN}-0.52.14-tcl.patch \
-               "${FILESDIR}"/${PN}-0.52.21-python-sitedir.patch
-       eapply_user
+       default
        eautoreconf
 
        # can't build out-of-source

Reply via email to