commit:     35e18c7bc896c0a0a8b2a6267874f3f65cab147b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Dec 29 06:50:33 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Dec 29 07:10:39 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=35e18c7b

net-misc/pcapfix: fully respect CFLAGS

Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/pcapfix-1.1.7-respect-CFLAGS.patch        | 21 +++++++++++++++++++++
 net-misc/pcapfix/pcapfix-1.1.7.ebuild               |  7 +++++--
 2 files changed, 26 insertions(+), 2 deletions(-)

diff --git a/net-misc/pcapfix/files/pcapfix-1.1.7-respect-CFLAGS.patch 
b/net-misc/pcapfix/files/pcapfix-1.1.7-respect-CFLAGS.patch
new file mode 100644
index 000000000000..a80419b1a87b
--- /dev/null
+++ b/net-misc/pcapfix/files/pcapfix-1.1.7-respect-CFLAGS.patch
@@ -0,0 +1,21 @@
+https://github.com/Rup0rt/pcapfix/pull/27
+
+From: Sam James <s...@gentoo.org>
+Date: Wed, 29 Dec 2021 06:48:09 +0000
+Subject: [PATCH] build: respect CFLAGS
+
+Allow overriding in the environment by using our value
+as just a default.
+
+Signed-off-by: Sam James <s...@gentoo.org>
+--- a/Makefile
++++ b/Makefile
+@@ -6,7 +6,7 @@ MANDIR ?= $(PREFIX)/share/man
+ OPTFLAGS = $(shell getconf LFS_CFLAGS) -D_FORTIFY_SOURCE=2 -O2 
-fstack-protector --param=ssp-buffer-size=4
+ WARNFLAGS = -Wall -Wextra -std=gnu99 -pedantic -Wformat 
-Werror=format-security
+ DEBUGFLAGS = -g
+-CFLAGS += $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS)
++CFLAGS ?= $(OPTFLAGS) $(WARNFLAGS) $(DEBUGFLAGS)
+ 
+ # Determine extra LDFLAGS
+ OS := $(shell uname)

diff --git a/net-misc/pcapfix/pcapfix-1.1.7.ebuild 
b/net-misc/pcapfix/pcapfix-1.1.7.ebuild
index dd1060063ecc..71f00b4ceb75 100644
--- a/net-misc/pcapfix/pcapfix-1.1.7.ebuild
+++ b/net-misc/pcapfix/pcapfix-1.1.7.ebuild
@@ -3,7 +3,7 @@
 
 EAPI=7
 
-inherit toolchain-funcs
+inherit flag-o-matic toolchain-funcs
 
 DESCRIPTION="Repair and fix broken pcap files"
 HOMEPAGE="https://f00l.de/pcapfix/";
@@ -18,17 +18,20 @@ IUSE="debug"
 DOCS=( Changelog README )
 
 PATCHES=(
+       "${FILESDIR}"/${PN}-1.1.7-respect-CFLAGS.patch
        "${WORKDIR}"/${PN}-1.1.7-musl-stdint.patch
 )
 
 src_prepare() {
        default
-       sed -e 's/gcc/$(CC) $(CFLAGS)/g' -i Makefile || die
+
        use debug || sed -e 's/DEBUGFLAGS = -g/DEBUGFLAGS =/g' -i Makefile || 
die
 }
 
 src_configure() {
        tc-export CC
+
+       append-lfs-flags
 }
 
 src_install() {

Reply via email to