From: "Michał Górny" <mgorny@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] dev/mgorny:master commit in: dev-python/pypy-binpackage/
Date: Mon, 22 Jul 2013 07:01:20 +0000 (UTC) [thread overview]
Message-ID: <1374443817.39b7e4f445aeeb27e2e765b615e4b4b4bb614fc4.mgorny@gentoo> (raw)
commit: 39b7e4f445aeeb27e2e765b615e4b4b4bb614fc4
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun Jul 21 21:32:50 2013 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun Jul 21 21:56:57 2013 +0000
URL: http://git.overlays.gentoo.org/gitweb/?p=dev/mgorny.git;a=commit;h=39b7e4f4
dev-python/pypy-binpackage: Sync to dev-python/pypy changes, clean up CFLAGS.
Package-Manager: portage-2.2.0_alpha188
---
.../pypy-binpackage/pypy-binpackage-1.9-r2.ebuild | 175 +++++++++++++++++++++
.../pypy-binpackage/pypy-binpackage-2.0.2.ebuild | 48 ++++--
2 files changed, 214 insertions(+), 9 deletions(-)
diff --git a/dev-python/pypy-binpackage/pypy-binpackage-1.9-r2.ebuild b/dev-python/pypy-binpackage/pypy-binpackage-1.9-r2.ebuild
new file mode 100644
index 0000000..178192c
--- /dev/null
+++ b/dev-python/pypy-binpackage/pypy-binpackage-1.9-r2.ebuild
@@ -0,0 +1,175 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-1.9-r2.ebuild,v 1.4 2013/02/17 22:45:18 floppym Exp $
+
+EAPI=5
+
+# pypy should be preferred, per upstream.
+# that's the easiest way of forcing it.
+PYTHON_COMPAT=( pypy{1_8,1_9,2_0} )
+inherit check-reqs eutils multilib multiprocessing python-any-r1 toolchain-funcs vcs-snapshot versionator
+
+MY_P=pypy-${PV}
+
+DESCRIPTION="A fast, compliant alternative implementation of the Python language"
+HOMEPAGE="http://pypy.org/"
+SRC_URI="https://bitbucket.org/pypy/pypy/get/release-${PV}.tar.bz2 -> ${MY_P}.tar.bz2"
+
+LICENSE="MIT"
+SLOT=$(get_version_component_range 1-2 ${PV})
+KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
+IUSE="bzip2 +jit ncurses sandbox shadowstack sse2"
+
+DEPEND=">=sys-libs/zlib-1.1.3
+ virtual/libffi
+ virtual/libintl
+ dev-libs/expat
+ dev-libs/openssl
+ bzip2? ( app-arch/bzip2 )
+ ncurses? ( sys-libs/ncurses )
+ app-arch/xz-utils
+ ${PYTHON_DEPS}"
+
+pkg_pretend() {
+ if [[ ! ${PYPY_BINPKG_STORE} ]]; then
+ eerror "Please set PYPY_BINPKG_STORE to the location where built"
+ eerror "packages are to be stored."
+
+ die "Set PYPY_BINPKG_STORE."
+ fi
+
+ CHECKREQS_MEMORY="2G"
+ use amd64 && CHECKREQS_MEMORY="4G"
+ check-reqs_pkg_pretend
+}
+
+pkg_setup() {
+ pkg_pretend
+ python-any-r1_pkg_setup
+
+ local cpu
+ if use amd64; then
+ # common denominator between Intel & AMD
+ cpu='x86-64'
+ elif use x86; then
+ if use sse2; then
+ # lowest with SSE2
+ cpu='pentium-m'
+ else
+ # lowest with SSE, compat. with athlon-xp
+ # TODO: do we want to support something older?
+ cpu='pentium3'
+ fi
+ else
+ die "Unsupported arch ${ARCH}"
+ fi
+
+ export CFLAGS="-march=${cpu} -mtune=generic -O2 -pipe"
+ export CXXFLAGS=${CFLAGS}
+
+ elog "CFLAGS: ${CFLAGS}"
+}
+
+src_prepare() {
+ epatch "${FILESDIR}/${PV}-no-bytecode-4151f9c406b6.patch"
+ epatch "${FILESDIR}/${PV}-scripts-location.patch"
+ epatch "${FILESDIR}/${PV}-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch"
+ epatch "${FILESDIR}/${PV}-distutils-fix_handling_of_executables_and_flags.patch"
+ epatch "${FILESDIR}/${PV}-ssl-threads-1-34b3b5aac082.patch"
+ epatch "${FILESDIR}/${PV}-ssl-threads-2-25cd11066d95.patch"
+ epatch "${FILESDIR}/${PV}-get_python_lib_standard_lib-04ea518e5b71.patch"
+ epatch "${FILESDIR}/${PV}-more-ignored-ops-a9a8faa76bca.patch"
+ epatch "${FILESDIR}/${PV}-more-ignored-ops-146ddf82a279.patch"
+ epatch "${FILESDIR}/${PV}-pybuffer-release-double-decref-4ec2a5b49386.patch"
+ epatch "${FILESDIR}/${PV}-signal-a33052b17f4e.patch"
+ epatch "${FILESDIR}/${PV}-getargs-freelist-c26dc70ee340.patch"
+ epatch "${FILESDIR}/${PV}-ssl-errors-25d3418150d2.patch"
+
+ # The following is Gentoo-specific.
+ epatch "${FILESDIR}/${PV}-no-static-hack.patch"
+
+ epatch_user
+}
+
+src_compile() {
+ tc-export CC
+
+ local jit_backend
+ if use jit; then
+ jit_backend='--jit-backend='
+
+ # We only need the explicit sse2 switch for x86.
+ # On other arches we can rely on autodetection which uses
+ # compiler macros. Plus, --jit-backend= doesn't accept all
+ # the modern values...
+
+ if use x86; then
+ if use sse2; then
+ jit_backend+=x86
+ else
+ jit_backend+=x86-without-sse2
+ fi
+ else
+ jit_backend+=auto
+ fi
+ fi
+
+ local args=(
+ $(usex jit -Ojit -O2)
+ $(usex shadowstack --gcrootfinder=shadowstack '')
+ $(usex sandbox --sandbox '')
+
+ ${jit_backend}
+ --make-jobs=$(makeopts_jobs)
+
+ ./pypy/translator/goal/targetpypystandalone.py
+ )
+
+ # Avoid linking against libraries disabled by use flags
+ local opts=(
+ bzip2:bz2
+ ncurses:_minimal_curses
+ )
+
+ local opt
+ for opt in "${opts[@]}"; do
+ local flag=${opt%:*}
+ local mod=${opt#*:}
+
+ args+=(
+ $(usex ${flag} --withmod --withoutmod)-${mod}
+ )
+ done
+
+ set -- "${PYTHON}" ./pypy/translator/goal/translate.py --batch "${args[@]}"
+ echo -e "\033[1m${@}\033[0m"
+ "${@}" || die "compile error"
+}
+
+src_install() {
+ local flags=( bzip2 jit ncurses sandbox shadowstack )
+ use x86 && flags+=( sse2 )
+ local f suffix="-${ARCH}"
+
+ for f in ${flags[@]}; do
+ use ${f} && suffix+="+${f}"
+ done
+
+ local BIN_P=pypy-bin-${PV}
+
+ einfo "Zipping PyPy ..."
+ mkdir "${BIN_P}${suffix}" || die
+ mv pypy-c "${BIN_P}${suffix}"/ || die
+ chmod +x "${BIN_P}${suffix}"/pypy-c || die
+
+ tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die
+ xz -vz9 "${BIN_P}${suffix}.tar" || die
+}
+
+# Yup, very hacky.
+pkg_preinst() {
+ # integrity check.
+ [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
+ mkdir -p "${ROOT%/}${PYPY_BINPKG_STORE}" || die
+ mv "${S}"/*.tar.xz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
+}
diff --git a/dev-python/pypy-binpackage/pypy-binpackage-2.0.2.ebuild b/dev-python/pypy-binpackage/pypy-binpackage-2.0.2.ebuild
index 4cb0ff8..4286827 100644
--- a/dev-python/pypy-binpackage/pypy-binpackage-2.0.2.ebuild
+++ b/dev-python/pypy-binpackage/pypy-binpackage-2.0.2.ebuild
@@ -18,15 +18,15 @@ SRC_URI="mirror://bitbucket/pypy/pypy/downloads/${MY_P}-src.tar.bz2"
LICENSE="MIT"
SLOT=$(get_version_component_range 1-2 ${PV})
KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux"
-IUSE="bzip2 +jit ncurses sandbox shadowstack ssl"
+IUSE="bzip2 +jit ncurses sandbox shadowstack sse2"
DEPEND=">=sys-libs/zlib-1.1.3
virtual/libffi
virtual/libintl
dev-libs/expat
+ dev-libs/openssl
bzip2? ( app-arch/bzip2 )
ncurses? ( sys-libs/ncurses )
- ssl? ( dev-libs/openssl )
app-arch/xz-utils
${PYTHON_DEPS}"
@@ -53,17 +53,26 @@ pkg_setup() {
python-any-r1_pkg_setup
local cpu
- if use amd64 || use amd64-linux; then
+ if use amd64; then
+ # common denominator between Intel & AMD
cpu='x86-64'
- elif use x86 || use x86-linux; then
- # lowest with SSE2
- cpu='pentium-m'
+ elif use x86; then
+ if use sse2; then
+ # lowest with SSE2
+ cpu='pentium-m'
+ else
+ # lowest with SSE, compat. with athlon-xp
+ # TODO: do we want to support something older?
+ cpu='pentium3'
+ fi
else
die "Unsupported arch ${ARCH}"
fi
export CFLAGS="-march=${cpu} -mtune=generic -O2 -pipe"
export CXXFLAGS=${CFLAGS}
+
+ elog "CFLAGS: ${CFLAGS}"
}
src_prepare() {
@@ -77,11 +86,32 @@ src_prepare() {
src_compile() {
tc-export CC
+ local jit_backend
+ if use jit; then
+ jit_backend='--jit-backend='
+
+ # We only need the explicit sse2 switch for x86.
+ # On other arches we can rely on autodetection which uses
+ # compiler macros. Plus, --jit-backend= doesn't accept all
+ # the modern values...
+
+ if use x86; then
+ if use sse2; then
+ jit_backend+=x86
+ else
+ jit_backend+=x86-without-sse2
+ fi
+ else
+ jit_backend+=auto
+ fi
+ fi
+
local args=(
$(usex jit -Ojit -O2)
$(usex shadowstack --gcrootfinder=shadowstack '')
$(usex sandbox --sandbox '')
+ ${jit_backend}
--make-jobs=$(makeopts_jobs)
pypy/goal/targetpypystandalone
@@ -91,7 +121,6 @@ src_compile() {
local opts=(
bzip2:bz2
ncurses:_minimal_curses
- ssl:_ssl
)
local opt
@@ -110,7 +139,8 @@ src_compile() {
}
src_install() {
- local flags=( bzip2 jit ncurses sandbox shadowstack ssl )
+ local flags=( bzip2 jit ncurses sandbox shadowstack )
+ use x86 && flags+=( sse2 )
local f suffix="-${ARCH}"
for f in ${flags[@]}; do
@@ -133,5 +163,5 @@ pkg_preinst() {
# integrity check.
[[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!'
mkdir -p "${ROOT%/}${PYPY_BINPKG_STORE}" || die
- mv "${ROOT%/}"/tmp/${BIN_P}*.tar.xz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
+ mv "${S}"/*.tar.xz "${ROOT%/}${PYPY_BINPKG_STORE}" || die
}
next reply other threads:[~2013-07-22 7:01 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-22 7:01 Michał Górny [this message]
-- strict thread matches above, loose matches on Subject: below --
2014-11-05 23:12 [gentoo-commits] dev/mgorny:master commit in: dev-python/pypy-binpackage/ Michał Górny
2014-11-05 22:20 Michał Górny
2014-07-03 6:43 Michał Górny
2014-06-30 8:46 Michał Górny
2014-06-30 8:46 Michał Górny
2013-07-24 20:41 Michał Górny
2013-07-22 7:01 Michał Górny
2013-07-22 7:01 Michał Górny
2013-07-21 11:32 Michał Górny
2013-07-21 11:16 Michał Górny
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1374443817.39b7e4f445aeeb27e2e765b615e4b4b4bb614fc4.mgorny@gentoo \
--to=mgorny@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox