commit:     5b0f61ca5820d9fad9344c6681a79095d2ffa9cf
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  4 16:37:30 2023 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Oct  4 16:47:17 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5b0f61ca

app-crypt/libscrypt: don't redefine _FORTIFY_SOURCE

Closes: https://bugs.gentoo.org/892928
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libscrypt-1.22-no-clobber-fortify-source.patch | 14 ++++++++++
 app-crypt/libscrypt/libscrypt-1.22-r1.ebuild       | 31 ++++++++++++++++++++++
 2 files changed, 45 insertions(+)

diff --git 
a/app-crypt/libscrypt/files/libscrypt-1.22-no-clobber-fortify-source.patch 
b/app-crypt/libscrypt/files/libscrypt-1.22-no-clobber-fortify-source.patch
new file mode 100644
index 000000000000..c54dc522b380
--- /dev/null
+++ b/app-crypt/libscrypt/files/libscrypt-1.22-no-clobber-fortify-source.patch
@@ -0,0 +1,14 @@
+Don't clobber toolchain defaults.
+
+https://bugs.gentoo.org/892928
+--- a/Makefile
++++ b/Makefile
+@@ -5,7 +5,7 @@ MAKE_DIR     ?= install -d
+ INSTALL_DATA ?= install
+ 
+ CC?=gcc
+-CFLAGS?=$(CFLAGS_EXTRA) -D_FORTIFY_SOURCE=2 -fPIC
++CFLAGS?=$(CFLAGS_EXTRA) -fPIC
+ LDFLAGS?=$(LDFLAGS_EXTRA) -Wl,-soname,libscrypt.so.0 
-Wl,--version-script=libscrypt.version
+ CFLAGS_EXTRA?=-Wl,-rpath=. -O2 -Wall -g -fstack-protector
+ LDFLAGS_EXTRA?=-Wl,-z,relro

diff --git a/app-crypt/libscrypt/libscrypt-1.22-r1.ebuild 
b/app-crypt/libscrypt/libscrypt-1.22-r1.ebuild
new file mode 100644
index 000000000000..71ad49bd50fc
--- /dev/null
+++ b/app-crypt/libscrypt/libscrypt-1.22-r1.ebuild
@@ -0,0 +1,31 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Shared library to implement the scrypt algorithm"
+HOMEPAGE="https://github.com/technion/libscrypt";
+SRC_URI="https://github.com/technion/${PN}/archive/v${PV}.tar.gz -> 
${P}.tar.gz"
+
+LICENSE="BSD-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~hppa ~mips ~ppc ~ppc64 ~riscv ~sparc ~x86"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-1.22-no-clobber-fortify-source.patch
+)
+
+src_configure() {
+       export LIBDIR=${PREFIX}/$(get_libdir)
+       export CFLAGS_EXTRA="${CFLAGS}"
+       export LDFLAGS_EXTRA="${LDFLAGS}"
+       export PREFIX=/usr
+       unset CFLAGS
+       unset LDFLAGS
+}
+
+src_compile() {
+       emake CC="$(tc-getCC)"
+}

Reply via email to