commit:     f9741ffa8b1eaf283306886240a31e887012ad7a
Author:     Marek Szuba <marecki <AT> gentoo <DOT> org>
AuthorDate: Sun May 29 22:16:46 2022 +0000
Commit:     Marek Szuba <marecki <AT> gentoo <DOT> org>
CommitDate: Sun May 29 22:16:46 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9741ffa

app-containers/apptainer: trim upstream CFLAGS

-DFORTIFY_SOURCE=2 is a Gentoo default and it being explicitly mentioned
makes things more difficult for those who would rather use level 3.
Nuking -Werror should require no explanation.

Closes: https://bugs.gentoo.org/847895
Signed-off-by: Marek Szuba <marecki <AT> gentoo.org>

 app-containers/apptainer/apptainer-1.0.2.ebuild    |  4 ++++
 .../apptainer-1.0.2-trim_upstream_cflags.patch     | 24 ++++++++++++++++++++++
 2 files changed, 28 insertions(+)

diff --git a/app-containers/apptainer/apptainer-1.0.2.ebuild 
b/app-containers/apptainer/apptainer-1.0.2.ebuild
index 9f711a070ada..56b48324770c 100644
--- a/app-containers/apptainer/apptainer-1.0.2.ebuild
+++ b/app-containers/apptainer/apptainer-1.0.2.ebuild
@@ -30,6 +30,10 @@ BDEPEND="virtual/pkgconfig"
 
 CONFIG_CHECK="~SQUASHFS"
 
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.0.2-trim_upstream_cflags.patch
+)
+
 DOCS=( README.md CONTRIBUTORS.md CONTRIBUTING.md )
 
 src_configure() {

diff --git 
a/app-containers/apptainer/files/apptainer-1.0.2-trim_upstream_cflags.patch 
b/app-containers/apptainer/files/apptainer-1.0.2-trim_upstream_cflags.patch
new file mode 100644
index 000000000000..b1329b5d9d3e
--- /dev/null
+++ b/app-containers/apptainer/files/apptainer-1.0.2-trim_upstream_cflags.patch
@@ -0,0 +1,24 @@
+--- a/mconfig
++++ b/mconfig
+@@ -42,14 +42,14 @@
+ 
+ # user_cflags - user-defined CFLAGS without all the cflags_opts
+ user_cflags="$CFLAGS"
+-cflags_opts="-Wall -Werror -Wfatal-errors -Wno-unknown-warning-option \
++cflags_opts="-Wall -Wfatal-errors -Wno-unknown-warning-option \
+ -Wstrict-prototypes -Wpointer-arith -Wbad-function-cast \
+ -Woverlength-strings -Wframe-larger-than=2047 \
+ -Wno-sign-compare -Wclobbered -Wempty-body -Wmissing-parameter-type \
+ -Wtype-limits -Wunused-parameter -Wunused-but-set-parameter \
+ -Wno-discarded-qualifiers -Wno-incompatible-pointer-types \
+ -pipe -fmessage-length=0 -fPIC"
+-cflags="$CFLAGS -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security 
-fstack-protector --param ssp-buffer-size=4"
++cflags="$CFLAGS -Wformat -Wformat-security -fstack-protector --param 
ssp-buffer-size=4"
+ ldflags=$LDFLAGS
+ 
+ package_name=apptainer
+--- a/mlocal/frags/go_runtime_opts.mk
++++ b/mlocal/frags/go_runtime_opts.mk
+@@ -1 +1 @@
+-CGO_CFLAGS += -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security 
-fstack-protector --param ssp-buffer-size=4
++CGO_CFLAGS += -O2 -Wformat -Wformat-security -fstack-protector --param 
ssp-buffer-size=4

Reply via email to