dev-python/pyblake2: Default to faster REGS variant
authorMichał Górny <mgorny@gentoo.org>
Fri, 20 Oct 2017 23:33:56 +0000 (01:33 +0200)
committerMichał Górny <mgorny@gentoo.org>
Fri, 20 Oct 2017 23:44:08 +0000 (01:44 +0200)
dev-python/pyblake2/pyblake2-0.9.3.ebuild

index 37d5457bb6d5c73fab9ab84b452648505d7fd128..79f80083bcb755cdc98aff46649f5c9a962d79ea 100644 (file)
@@ -15,6 +15,17 @@ SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE=""
 
+python_prepare_all() {
+       local impl=REGS
+       # note: SSE2 is 2.5x slower than pure REGS...
+       # TODO: test other variants on some capable hardware
+
+       # uncomment the implementation of choice
+       sed -i -e "/BLAKE2_COMPRESS_${impl}/s:^#::" setup.py || die
+
+       distutils-r1_python_prepare_all
+}
+
 python_test() {
        "${EPYTHON}" test/test.py || die "Tests fail with ${EPYTHON}"
 }