Gentoo Archives: gentoo-commits

From: Fabian Groffen <grobian@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pyblake2/
Date: Sun, 22 Oct 2017 09:34:17
Message-Id: 1508664844.fc0ba0fc7c93d56aeb421fbb8154fd57e7695623.grobian@gentoo
1 commit: fc0ba0fc7c93d56aeb421fbb8154fd57e7695623
2 Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
3 AuthorDate: Sun Oct 22 09:32:51 2017 +0000
4 Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
5 CommitDate: Sun Oct 22 09:34:04 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=fc0ba0fc
7
8 dev-python/pyblake2: fix and keyword for *-macos, bug #634936
9
10 Package-Manager: Portage-2.3.11-prefix, Repoman-2.3.3
11
12 dev-python/pyblake2/pyblake2-0.9.3.ebuild | 25 +++++++++++++++++++++++--
13 1 file changed, 23 insertions(+), 2 deletions(-)
14
15 diff --git a/dev-python/pyblake2/pyblake2-0.9.3.ebuild b/dev-python/pyblake2/pyblake2-0.9.3.ebuild
16 index 10da95058c1..cdfe223ded1 100644
17 --- a/dev-python/pyblake2/pyblake2-0.9.3.ebuild
18 +++ b/dev-python/pyblake2/pyblake2-0.9.3.ebuild
19 @@ -4,7 +4,7 @@
20 EAPI=6
21
22 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} pypy )
23 -inherit distutils-r1
24 +inherit distutils-r1 flag-o-matic
25
26 DESCRIPTION="BLAKE2 hash function extension module"
27 HOMEPAGE="https://github.com/dchest/pyblake2 https://pypi.python.org/pypi/pyblake2"
28 @@ -12,7 +12,7 @@ SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz"
29
30 LICENSE="CC0-1.0"
31 SLOT="0"
32 -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
33 +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris"
34 IUSE="cpu_flags_x86_ssse3 cpu_flags_x86_avx cpu_flags_x86_xop"
35
36 python_prepare_all() {
37 @@ -26,6 +26,27 @@ python_prepare_all() {
38 # uncomment the implementation of choice
39 sed -i -e "/BLAKE2_COMPRESS_${impl}/s:^#::" setup.py || die
40
41 + # avoid segfault due to over(?) optimisation
42 + if [[ ${CHOST} == *86*-darwin* ]] ; then
43 + local march=$(get-flag march)
44 + # expand "native" into the used cpu optmisation
45 + if [[ ${march} == native ]] ; then
46 + # we're always on Clang here
47 + march=$(llc --version | grep "Host CPU:")
48 + march=${march##*: }
49 + fi
50 + # compiling for haswell cpu results in a segfault when used
51 + # with optimisation >O1, since optimisation here benefits more
52 + # than cpu specific instructions, reduce to ivybridge level
53 + case ${march} in
54 + haswell|broadwell|skylake*)
55 + local opt=$(get-flag -O)
56 + [[ ${opt#-O} -gt 1 ]] && \
57 + replace-flags -march=* -march=ivybridge
58 + ;;
59 + esac
60 + fi
61 +
62 distutils-r1_python_prepare_all
63 }