commit: d24bc32440ff3efadf9f424e5a8106e820b97639
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 14 03:28:07 2024 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Jan 14 03:28:11 2024 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=d24bc324
sys-process/atop: respect LDFLAGS, PKG_CONFIG, opt
Signed-off-by: Sam James <sam <AT> gentoo.org>
sys-process/atop/atop-2.10.0.ebuild | 5 ++++-
sys-process/atop/files/atop-2.10.0-ldflags.patch | 20 ++++++++++++++++++++
.../atop/files/atop-2.10.0-respect-PKG_CONFIG.patch | 14 ++++++++++++++
sys-process/atop/files/atop-2.10.0-respect-opt.patch | 12 ++++++++++++
4 files changed, 50 insertions(+), 1 deletion(-)
diff --git a/sys-process/atop/atop-2.10.0.ebuild
b/sys-process/atop/atop-2.10.0.ebuild
index 9bd1a191304c..01c0dfa1ff44 100644
--- a/sys-process/atop/atop-2.10.0.ebuild
+++ b/sys-process/atop/atop-2.10.0.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2023 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
@@ -34,6 +34,9 @@ BDEPEND="virtual/pkgconfig"
PATCHES=(
"${FILESDIR}"/${PN}-2.6.0-build.patch
+ "${FILESDIR}"/${PN}-2.10.0-ldflags.patch
+ "${FILESDIR}"/${PN}-2.10.0-respect-PKG_CONFIG.patch
+ "${FILESDIR}"/${PN}-2.10.0-respect-opt.patch
)
pkg_pretend() {
diff --git a/sys-process/atop/files/atop-2.10.0-ldflags.patch
b/sys-process/atop/files/atop-2.10.0-ldflags.patch
new file mode 100644
index 000000000000..5b2924ef3864
--- /dev/null
+++ b/sys-process/atop/files/atop-2.10.0-ldflags.patch
@@ -0,0 +1,20 @@
+https://github.com/Atoptool/atop/pull/289
+
+From 8411f81a202c9c39aebcc637ef94cc3d454cbaaf Mon Sep 17 00:00:00 2001
+From: Marc 'Zugschlus' Haber <[email protected]>
+Date: Sat, 6 Jan 2024 07:03:53 +0100
+Subject: [PATCH] set LDFLAGS with +=, not overwriting existing variable
+
+this allows the Debian build process to set hardening flags
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,7 @@ PMPATH2 = /usr/lib64/pm-utils/sleep.d
+ PMPATHD = /usr/lib/systemd/system-sleep
+
+ CFLAGS += -O2 -I. -Wall $(shell pkg-config --cflags glib-2.0)
-Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations
-Wformat-security # -DNOPERFEVENT # -DHTTPSTATS
+-LDFLAGS = $(shell pkg-config --libs glib-2.0)
++LDFLAGS += $(shell pkg-config --libs glib-2.0)
+ OBJMOD0 = version.o
+ OBJMOD1 = various.o deviate.o procdbase.o
+ OBJMOD2 = acctproc.o photoproc.o photosyst.o rawlog.o ifprop.o parseable.o
+
diff --git a/sys-process/atop/files/atop-2.10.0-respect-PKG_CONFIG.patch
b/sys-process/atop/files/atop-2.10.0-respect-PKG_CONFIG.patch
new file mode 100644
index 000000000000..483506043490
--- /dev/null
+++ b/sys-process/atop/files/atop-2.10.0-respect-PKG_CONFIG.patch
@@ -0,0 +1,14 @@
+--- a/Makefile
++++ b/Makefile
+@@ -20,8 +20,9 @@ PMPATH1 = /usr/lib/pm-utils/sleep.d
+ PMPATH2 = /usr/lib64/pm-utils/sleep.d
+ PMPATHD = /usr/lib/systemd/system-sleep
+
+-CFLAGS += -O2 -I. -Wall $(shell pkg-config --cflags glib-2.0)
-Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations
-Wformat-security # -DNOPERFEVENT # -DHTTPSTATS
+-LDFLAGS += $(shell pkg-config --libs glib-2.0)
++PKG_CONFIG ?= pkg-config
++CFLAGS += -O2 -I. -Wall $(shell ${PKG_CONFIG} --cflags glib-2.0)
-Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations
-Wformat-security # -DNOPERFEVENT # -DHTTPSTATS
++LDFLAGS += $(shell ${PKG_CONFIG} --libs glib-2.0)
+ OBJMOD0 = version.o
+ OBJMOD1 = various.o deviate.o procdbase.o
+ OBJMOD2 = acctproc.o photoproc.o photosyst.o rawlog.o ifprop.o parseable.o
diff --git a/sys-process/atop/files/atop-2.10.0-respect-opt.patch
b/sys-process/atop/files/atop-2.10.0-respect-opt.patch
new file mode 100644
index 000000000000..5a55e6f2f835
--- /dev/null
+++ b/sys-process/atop/files/atop-2.10.0-respect-opt.patch
@@ -0,0 +1,12 @@
+Don't force -O2.
+--- a/Makefile
++++ b/Makefile
+@@ -21,7 +21,7 @@ PMPATH2 = /usr/lib64/pm-utils/sleep.d
+ PMPATHD = /usr/lib/systemd/system-sleep
+
+ PKG_CONFIG ?= pkg-config
+-CFLAGS += -O2 -I. -Wall $(shell ${PKG_CONFIG} --cflags glib-2.0)
-Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations
-Wformat-security # -DNOPERFEVENT # -DHTTPSTATS
++CFLAGS += -I. -Wall $(shell ${PKG_CONFIG} --cflags glib-2.0)
-Wno-stringop-truncation -Wmissing-prototypes -Wmissing-declarations
-Wformat-security # -DNOPERFEVENT # -DHTTPSTATS
+ LDFLAGS += $(shell ${PKG_CONFIG} --libs glib-2.0)
+ OBJMOD0 = version.o
+ OBJMOD1 = various.o deviate.o procdbase.o