From 8fd9d385e5bc3c01115ec2ddcb2227607eb90861 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Fri, 5 Jan 2024 14:04:26 +0000 Subject: gentoo auto-resync : 05:01:2024 - 14:04:25 --- dev-python/pycryptodome/Manifest | 2 + .../pycryptodome-3.19.1-gcc14-configure.patch | 48 +++++++++++++++++ .../pycryptodome/pycryptodome-3.19.1-r1.ebuild | 61 ++++++++++++++++++++++ 3 files changed, 111 insertions(+) create mode 100644 dev-python/pycryptodome/files/pycryptodome-3.19.1-gcc14-configure.patch create mode 100644 dev-python/pycryptodome/pycryptodome-3.19.1-r1.ebuild (limited to 'dev-python/pycryptodome') diff --git a/dev-python/pycryptodome/Manifest b/dev-python/pycryptodome/Manifest index 91aeb904bf00..eb218d73918a 100644 --- a/dev-python/pycryptodome/Manifest +++ b/dev-python/pycryptodome/Manifest @@ -1,4 +1,6 @@ AUX pycryptodome-3.10.1-system-libtomcrypt.patch 1729 BLAKE2B 57a2022ef17e0b86e98b085336f5ce815304e326a5a2bd5cc8ff5d33b6efba440505767517b79c2f0bba39ab33f04d7434a3f0ee529b880ff7552aee2805dab5 SHA512 d53677c0ad96f161f9aed14b8f353a8cc12c92f31de9733789f9c4151710376d33e974fd611b763de94c631796d7a57cd8787656e3c1e985696e20537b34760e +AUX pycryptodome-3.19.1-gcc14-configure.patch 1344 BLAKE2B 13a6aab0d5eea704b33b80858d5b0df6219e1faa7984dde2cc483ab536a765bc245db331bed3d50689dd7eac01b0a6f52d3658acf3972a03f4e567696a052b87 SHA512 f79ab3841468f1f5da1c65ae2f385dc8a52f79701a9457f392c51ae7e1b2771a17d67f25d76d913ff5caf5fe09d10c0bdef5be5ec30e6226cc09eb83220b926d DIST pycryptodome-3.19.1.gh.tar.gz 17158420 BLAKE2B 2180bb37e2295f0499c6d00237207513ad6c186ff8fd8fac466cc43efa9b068cf8a272b5ae30da08d37db88d354d41c0b426643743251ea8460abb6ff627e3be SHA512 103910b385578732e356145247d3c1a4a3b0fe8acf22ce91f1c1155500cce2342e5caa0dff0a30825b11d7a614853c2dcb8657628f4d65682f6e543adb4db240 +EBUILD pycryptodome-3.19.1-r1.ebuild 1432 BLAKE2B 8bf42ef6036d8d848092e9f6df4820b8efab316927c74c8e29862adbb73714cfec0d507dc10f16b75991d5f1773346f5acedcbe9a0565843cd1c0950e67fb948 SHA512 5d5673fc01d6514dd6403a4502f153f3ac8439437fbb6400f0eefbbaf0f815045f200e087623cf76d294bc98ffdad651541d79f6240080df48417f16d2c9c078 EBUILD pycryptodome-3.19.1.ebuild 1368 BLAKE2B 5eca123b120504866f88490be4a53f36bbd27ec4f40bff397bf0b89f92309cf62dd4e77e8b67a0db62fd2d6912f38733a8813832aba2f8c8465a26c26314ea8f SHA512 ba0b239319f25c26667d0fc51a600d716aa77d4519be17dc05a51b9adae759559f0a530f804d32f0d7a8bff1a500a88b9560d2857cec3bfad0e384efb3d9913a MISC metadata.xml 386 BLAKE2B 1ec04c0cb752414f063177e637f1fc3e3c401db0c1f245cb33a3690e25597098b25fb2cd5f3ab99838a8bf8339906e2b23e325af5c7248fd880563c872c6fb60 SHA512 f19e2537c5a985389182860eaa45ae68a37ef1167c4b76b452513987fae6fcfb3534d102a079a003770372bbdb4f1997460c982b355f76d09f2387996e18091b diff --git a/dev-python/pycryptodome/files/pycryptodome-3.19.1-gcc14-configure.patch b/dev-python/pycryptodome/files/pycryptodome-3.19.1-gcc14-configure.patch new file mode 100644 index 000000000000..ee87f615b814 --- /dev/null +++ b/dev-python/pycryptodome/files/pycryptodome-3.19.1-gcc14-configure.patch @@ -0,0 +1,48 @@ +https://github.com/Legrandin/pycryptodome/issues/787 +https://github.com/Legrandin/pycryptodome/commit/b4083688fde0580de6c2a4d36d84da31a2549a2c + +From b4083688fde0580de6c2a4d36d84da31a2549a2c Mon Sep 17 00:00:00 2001 +From: Helder Eijs +Date: Fri, 29 Dec 2023 14:36:19 +0100 +Subject: [PATCH] Better autodetect of AES support, in case of aggressive + optimization + +--- a/compiler_opt.py ++++ b/compiler_opt.py +@@ -140,7 +140,7 @@ def compiler_has_intrin_h(): + { + int a, b[4]; + __cpuid(b, a); +- return 0; ++ return a; + } + """ + return test_compilation(source, msg="intrin.h header") +@@ -154,7 +154,7 @@ def compiler_has_cpuid_h(): + { + unsigned int eax, ebx, ecx, edx; + __get_cpuid(1, &eax, &ebx, &ecx, &edx); +- return 0; ++ return eax; + } + """ + return test_compilation(source, msg="cpuid.h header") +@@ -163,11 +163,16 @@ def compiler_has_cpuid_h(): + def compiler_supports_aesni(): + source = """ + #include ++ #include + __m128i f(__m128i x, __m128i y) { + return _mm_aesenc_si128(x, y); + } + int main(void) { +- return 0; ++ int ret; ++ __m128i x = _mm_setzero_si128(); ++ x = f(x, x); ++ memcpy(&ret, &x, sizeof(ret)); ++ return ret; + } + """ + + diff --git a/dev-python/pycryptodome/pycryptodome-3.19.1-r1.ebuild b/dev-python/pycryptodome/pycryptodome-3.19.1-r1.ebuild new file mode 100644 index 000000000000..89a5edcca25b --- /dev/null +++ b/dev-python/pycryptodome/pycryptodome-3.19.1-r1.ebuild @@ -0,0 +1,61 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{10..12} pypy3 ) +PYTHON_REQ_USE="threads(+)" + +inherit distutils-r1 + +DESCRIPTION="A self-contained cryptographic library for Python" +HOMEPAGE=" + https://www.pycryptodome.org/ + https://github.com/Legrandin/pycryptodome/ + https://pypi.org/project/pycryptodome/ +" +SRC_URI=" + https://github.com/Legrandin/pycryptodome/archive/v${PV}.tar.gz + -> ${P}.gh.tar.gz +" + +LICENSE="BSD-2 Unlicense" +SLOT="0" +KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~amd64-linux ~x86-linux ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris" + +DEPEND=" + dev-libs/gmp:= + >=dev-libs/libtomcrypt-1.18.2-r1:= +" +BDEPEND=" + $(python_gen_cond_dep 'dev-python/cffi[${PYTHON_USEDEP}]' 'python*') +" +RDEPEND=" + ${DEPEND} + ${BDEPEND} +" + +PATCHES=( + "${FILESDIR}/pycryptodome-3.10.1-system-libtomcrypt.patch" + "${FILESDIR}/pycryptodome-3.19.1-gcc14-configure.patch" +) + +python_prepare_all() { + # make sure we're unbundling it correctly + rm -r src/libtom || die + + distutils-r1_python_prepare_all +} + +python_test() { + local -x PYTHONPATH=${S}/test_vectors:${PYTHONPATH} + "${EPYTHON}" - <<-EOF || die + import sys + from Crypto import SelfTest + SelfTest.run(verbosity=2, stream=sys.stdout) + EOF + + # TODO: run cmake tests from src/test? +} -- cgit v1.2.3