diff options
author | Fabian Groffen <grobian@gentoo.org> | 2017-10-22 11:32:51 +0200 |
---|---|---|
committer | Fabian Groffen <grobian@gentoo.org> | 2017-10-22 11:34:04 +0200 |
commit | fc0ba0fc7c93d56aeb421fbb8154fd57e7695623 (patch) | |
tree | 5763afb00159960b47afb246e942193fbf9c5716 /dev-python | |
parent | dev-ruby/multi_json: amd64 stable, bug 628674 (diff) | |
download | gentoo-fc0ba0fc7c93d56aeb421fbb8154fd57e7695623.tar.gz gentoo-fc0ba0fc7c93d56aeb421fbb8154fd57e7695623.tar.bz2 gentoo-fc0ba0fc7c93d56aeb421fbb8154fd57e7695623.zip |
dev-python/pyblake2: fix and keyword for *-macos, bug #634936
Package-Manager: Portage-2.3.11-prefix, Repoman-2.3.3
Diffstat (limited to 'dev-python')
-rw-r--r-- | dev-python/pyblake2/pyblake2-0.9.3.ebuild | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/dev-python/pyblake2/pyblake2-0.9.3.ebuild b/dev-python/pyblake2/pyblake2-0.9.3.ebuild index 10da95058c15..cdfe223ded1f 100644 --- a/dev-python/pyblake2/pyblake2-0.9.3.ebuild +++ b/dev-python/pyblake2/pyblake2-0.9.3.ebuild @@ -4,7 +4,7 @@ EAPI=6 PYTHON_COMPAT=( python{2_7,3_4,3_5,3_6} pypy ) -inherit distutils-r1 +inherit distutils-r1 flag-o-matic DESCRIPTION="BLAKE2 hash function extension module" HOMEPAGE="https://github.com/dchest/pyblake2 https://pypi.python.org/pypi/pyblake2" @@ -12,7 +12,7 @@ SRC_URI="mirror://pypi/${PN::1}/${PN}/${P}.tar.gz" LICENSE="CC0-1.0" SLOT="0" -KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" +KEYWORDS="~amd64 ~ia64 ~ppc ~ppc64 ~x86 ~ppc-macos ~x64-macos ~x86-macos ~sparc-solaris ~sparc64-solaris ~x64-solaris ~x86-solaris" IUSE="cpu_flags_x86_ssse3 cpu_flags_x86_avx cpu_flags_x86_xop" python_prepare_all() { @@ -26,6 +26,27 @@ python_prepare_all() { # uncomment the implementation of choice sed -i -e "/BLAKE2_COMPRESS_${impl}/s:^#::" setup.py || die + # avoid segfault due to over(?) optimisation + if [[ ${CHOST} == *86*-darwin* ]] ; then + local march=$(get-flag march) + # expand "native" into the used cpu optmisation + if [[ ${march} == native ]] ; then + # we're always on Clang here + march=$(llc --version | grep "Host CPU:") + march=${march##*: } + fi + # compiling for haswell cpu results in a segfault when used + # with optimisation >O1, since optimisation here benefits more + # than cpu specific instructions, reduce to ivybridge level + case ${march} in + haswell|broadwell|skylake*) + local opt=$(get-flag -O) + [[ ${opt#-O} -gt 1 ]] && \ + replace-flags -march=* -march=ivybridge + ;; + esac + fi + distutils-r1_python_prepare_all } |