commit: 3b34816f06a5f8ef0ac2151fea06c99411d67bfa Author: Sam James <sam <AT> gentoo <DOT> org> AuthorDate: Fri Dec 29 23:31:01 2023 +0000 Commit: Sam James <sam <AT> gentoo <DOT> org> CommitDate: Fri Dec 29 23:31:23 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3b34816f
dev-perl/CryptX: fix build w/ sse4.1 but w/o aesni Closes: https://bugs.gentoo.org/916387 Signed-off-by: Sam James <sam <AT> gentoo.org> dev-perl/CryptX/CryptX-0.80.0-r1.ebuild | 52 +++++++++++++++++++++++++ dev-perl/CryptX/files/CryptX-0.80.0-aesni.patch | 38 ++++++++++++++++++ 2 files changed, 90 insertions(+) diff --git a/dev-perl/CryptX/CryptX-0.80.0-r1.ebuild b/dev-perl/CryptX/CryptX-0.80.0-r1.ebuild new file mode 100644 index 000000000000..4e532364d203 --- /dev/null +++ b/dev-perl/CryptX/CryptX-0.80.0-r1.ebuild @@ -0,0 +1,52 @@ +# Copyright 1999-2023 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +# TODO: unbundle libtommath, libtomcrypt. There's experimental support upstream. +# bug #732634 + +DIST_AUTHOR=MIK +DIST_VERSION=0.080 +inherit perl-module + +DESCRIPTION="Self-contained crypto toolkit" + +LICENSE="|| ( Artistic GPL-1+ ) public-domain" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86" +IUSE="minimal" + +RDEPEND=" + virtual/perl-Math-BigInt + !minimal? ( + dev-perl/JSON + ) +" +BDEPEND=" + ${RDEPEND} + virtual/perl-ExtUtils-MakeMaker + test? ( + >=virtual/perl-Test-Simple-0.880.0 + !minimal? ( + >=virtual/perl-Math-BigInt-1.999.715 + >=virtual/perl-Storable-2.0.0 + ) + ) +" + +PERL_RM_FILES=( + t/002_all_pm.t + t/003_all_pm_pod.t + t/004_all_pm_pod_spelling.t + t/005_all_pm_pod_coverage.t +) + +PATCHES=( + "${FILESDIR}"/${PN}-0.80.0-respect-flags.patch + "${FILESDIR}"/${PN}-0.80.0-aesni.patch +) + +#src_configure() { +# CRYPTX_LDFLAGS='-ltommath -ltomcrypt' perl-module_src_configure +#} diff --git a/dev-perl/CryptX/files/CryptX-0.80.0-aesni.patch b/dev-perl/CryptX/files/CryptX-0.80.0-aesni.patch new file mode 100644 index 000000000000..3a6f34c7e885 --- /dev/null +++ b/dev-perl/CryptX/files/CryptX-0.80.0-aesni.patch @@ -0,0 +1,38 @@ +https://github.com/DCIT/perl-CryptX/pull/99 +https://bugs.gentoo.org/916387 +--- a/src/ltc/headers/tomcrypt_cfg.h ++++ b/src/ltc/headers/tomcrypt_cfg.h +@@ -96,6 +96,9 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); + #define LTC_AMD64_SSE4_1 + #endif + #endif ++ #if defined(__AES__) ++ #define LTC_AMD64_AES_NI ++ #endif + #endif + + /* detect PPC32 */ +--- a/src/ltc/headers/tomcrypt_private.h ++++ b/src/ltc/headers/tomcrypt_private.h +@@ -77,7 +77,7 @@ typedef struct + + /* tomcrypt_cipher.h */ + +-#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1) ++#if defined(LTC_AES_NI) && defined(LTC_AMD64_AES_NI) + #define LTC_HAS_AES_NI + #endif + +--- a/src/ltc/misc/crypt/crypt.c ++++ b/src/ltc/misc/crypt/crypt.c +@@ -416,7 +416,7 @@ const char *crypt_build_settings = + #if defined(LTC_ADLER32) + " ADLER32 " + #endif +-#if defined(LTC_AES_NI) && defined(LTC_AMD64_SSE4_1) ++#if defined(LTC_AES_NI) && defined(LTC_AMD64_AES_NI) + " AES-NI " + #endif + #if defined(LTC_BASE64) + +