commit:     2b4ac4bd6ae654d14218883ac7a298cd1d2d5b42
Author:     Haelwenn (lanodan) Monnier <contact <AT> hacktivis <DOT> me>
AuthorDate: Fri Feb  2 17:12:53 2024 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Wed Feb 28 07:01:47 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=2b4ac4bd

net-misc/tinyssh: respect user CFLAGS

Closes: https://bugs.gentoo.org/887897
Signed-off-by: Haelwenn (lanodan) Monnier <contact <AT> hacktivis.me>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 net-misc/tinyssh/files/tinyssh-20240101_conf_cflags.patch | 10 ++++++++++
 net-misc/tinyssh/tinyssh-20240101.ebuild                  |  7 ++++---
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/net-misc/tinyssh/files/tinyssh-20240101_conf_cflags.patch 
b/net-misc/tinyssh/files/tinyssh-20240101_conf_cflags.patch
new file mode 100644
index 000000000000..8dd35d91b828
--- /dev/null
+++ b/net-misc/tinyssh/files/tinyssh-20240101_conf_cflags.patch
@@ -0,0 +1,10 @@
+diff --git a/conf-cflags b/conf-cflags
+--- a/conf-cflags
++++ b/conf-cflags
+@@ -15,6 +15,3 @@
+ -fstack-protector-strong
+ -fwrapv
+ -fno-strict-overflow
+--Os
+--fomit-frame-pointer
+--funroll-loops

diff --git a/net-misc/tinyssh/tinyssh-20240101.ebuild 
b/net-misc/tinyssh/tinyssh-20240101.ebuild
index 5164323fe0c6..0edea200702b 100644
--- a/net-misc/tinyssh/tinyssh-20240101.ebuild
+++ b/net-misc/tinyssh/tinyssh-20240101.ebuild
@@ -28,10 +28,11 @@ RDEPEND="
        sys-apps/ucspi-tcp
 "
 
-src_prepare() {
-       # Leave optimization level to user CFLAGS
-       sed -i 's/-Os -fomit-frame-pointer -funroll-loops//g' ./conf-cc || die
+PATCHES=(
+       "${FILESDIR}/tinyssh-20240101_conf_cflags.patch"
+)
 
+src_prepare() {
        # Use make-tinysshcc.sh script, which has no tests and doesn't execute
        # binaries. See https://github.com/janmojzis/tinyssh/issues/2
        sed -i 's/make-tinyssh\.sh/make-tinysshcc.sh/g' ./Makefile || die

Reply via email to