commit:     b6f4e5bd8aeeea00704ffd77554d8c3d7291f1d4
Author:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
AuthorDate: Wed Jul 31 16:16:21 2019 +0000
Commit:     Lars Wendler <polynomial-c <AT> gentoo <DOT> org>
CommitDate: Wed Jul 31 16:18:10 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6f4e5bd

sys-apps/kbd: Respect user CFLAGS

Thanks-to: Michał Górny <mgorny <AT> gentoo.org>
Bug: https://bugs.gentoo.org/691142
Package-Manager: Portage-2.3.69, Repoman-2.3.16
Signed-off-by: Lars Wendler <polynomial-c <AT> gentoo.org>

 sys-apps/kbd/files/kbd-2.2.0-cflags.patch          | 33 ++++++++++++++++++++++
 .../kbd/{kbd-2.2.0.ebuild => kbd-2.2.0-r1.ebuild}  | 10 ++++---
 2 files changed, 39 insertions(+), 4 deletions(-)

diff --git a/sys-apps/kbd/files/kbd-2.2.0-cflags.patch 
b/sys-apps/kbd/files/kbd-2.2.0-cflags.patch
new file mode 100644
index 00000000000..86c0f45074a
--- /dev/null
+++ b/sys-apps/kbd/files/kbd-2.2.0-cflags.patch
@@ -0,0 +1,33 @@
+From 3b4f3ffbc9fedff83a0618f3dd3c6aafced3e72a Mon Sep 17 00:00:00 2001
+From: Lars Wendler <[email protected]>
+Date: Wed, 31 Jul 2019 18:07:33 +0200
+Subject: [PATCH] configure.ac: respect user CFLAGS
+
+Do not override user CFLAGS. Do not unconditionally add -g to CFLAGS.
+
+Gentoo-bug: https://bugs.gentoo.org/691142
+Signed-off-by: Lars Wendler <[email protected]>
+---
+ configure.ac | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 6bf6401..0f5ed2f 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -72,9 +72,9 @@ if test "$enable_code_coverage" = yes; then
+ fi
+ 
+ case "$GCC,$ac_cv_prog_cc_g" in
+-      yes,yes) CFLAGS="-g $CC_O_LEVEL $FORTIFY_SOURCE" ;;
+-      yes,)    CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE" ;;
+-         ,yes) CFLAGS="-g" ;;
++      yes,yes) CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
++      yes,)    CFLAGS="$CC_O_LEVEL $FORTIFY_SOURCE $CFLAGS" ;;
++         ,yes) CFLAGS="$CFLAGS" ;;
+ esac
+ 
+ CC_CHECK_CFLAGS_APPEND([\
+-- 
+2.22.0
+

diff --git a/sys-apps/kbd/kbd-2.2.0.ebuild b/sys-apps/kbd/kbd-2.2.0-r1.ebuild
similarity index 93%
rename from sys-apps/kbd/kbd-2.2.0.ebuild
rename to sys-apps/kbd/kbd-2.2.0-r1.ebuild
index 097ab17ac29..895a4995c52 100644
--- a/sys-apps/kbd/kbd-2.2.0.ebuild
+++ b/sys-apps/kbd/kbd-2.2.0-r1.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit pam
+inherit autotools pam
 
 if [[ ${PV} == "9999" ]] ; then
        inherit autotools git-r3
@@ -35,6 +35,10 @@ BDEPEND="
        test? ( dev-libs/check )
 "
 
+PATCHES=(
+       "${FILESDIR}/${PN}-2.2.0-cflags.patch" #691142
+)
+
 src_unpack() {
        if [[ ${PV} == "9999" ]] ; then
                git-r3_src_unpack
@@ -52,9 +56,7 @@ src_unpack() {
 
 src_prepare() {
        default
-       if [[ ${PV} == "9999" ]] ; then
-               eautoreconf
-       fi
+       eautoreconf
 }
 
 src_configure() {

Reply via email to