From a5e43d0c94700b75a75cf4e0915622579ba7ceb2 Mon Sep 17 00:00:00 2001 From: Michał Górny Date: Sun, 12 Apr 2015 14:58:21 +0200 Subject: dev-python/pypy-binpackage: add 2.5.1 --- dev-python/pypy-binpackage/Manifest | 1 + .../pypy-binpackage/files/2.5.0-shared-lib.patch | 12 + .../files/2.5.0_all_distutils_cxx.patch | 324 +++++++++++++++++++++ .../pypy-binpackage-2.4.0-r1.ebuild | 210 +++++++++++++ .../pypy-binpackage/pypy-binpackage-2.5.1.ebuild | 198 +++++++++++++ metadata/layout.conf | 3 +- profiles/repo_name | 1 - 7 files changed, 747 insertions(+), 2 deletions(-) create mode 100644 dev-python/pypy-binpackage/files/2.5.0-shared-lib.patch create mode 100644 dev-python/pypy-binpackage/files/2.5.0_all_distutils_cxx.patch create mode 100644 dev-python/pypy-binpackage/pypy-binpackage-2.4.0-r1.ebuild create mode 100644 dev-python/pypy-binpackage/pypy-binpackage-2.5.1.ebuild delete mode 100644 profiles/repo_name diff --git a/dev-python/pypy-binpackage/Manifest b/dev-python/pypy-binpackage/Manifest index 09546e3..7a674b7 100644 --- a/dev-python/pypy-binpackage/Manifest +++ b/dev-python/pypy-binpackage/Manifest @@ -1,3 +1,4 @@ DIST pypy-2.2.1-src.tar.bz2 14439822 SHA256 252045187e443656a2beb412dadac9296e8fe8db0f75a66ed5265db58c35035f SHA512 68b52c5b1a9b96593aa1dd38ad0b1b7b282852008e3ae3c488a5e19ab2bede68e2b40afdb79d85a4ab21cb1da6647b8b958fcefe34c99a1f6cbc1a19d695d3b6 WHIRLPOOL 6eca63959d8ee5663f868daaaac32ad1180b07e2f8b63d839652902095a098ffbfa29c6f83451733270a4b2f73b65450cb3b80a878b9dd1ec71089bfff11e9f6 DIST pypy-2.3.1-src.tar.bz2 15225332 SHA256 3fd10d97c0177c33ed358a78eb26f5bf1f91b266af853564b1a9d8c310a1e439 SHA512 86aab86c5f413cdd6a56680915605de5c1416255b43a8dce1b4dcf8f1febdb3275076a4a9c7de30002387d59e4171a52da2528436eb205d8d947de7edd049c65 WHIRLPOOL c78d41240f1803d9461f797fd0ef647a40a6990a4e3a504e80a0eaaf460d052bb60fe6240cacdb3ee8737500c9c7f418b1d55c619d01ac7b73aace3d82157aa6 DIST pypy-2.4.0-src.tar.bz2 15495214 SHA256 38810007aee4885ca0703b566db6594dd7649adaaa287df7a1012f10e067740f SHA512 91b41ed80a6ff0d7b2b134a7802f098de35ffd2068dc3e477d27b0bc821c6d329eb8bcad4db4a5ff9ff429830d4abfbeb435a2a2d2d9bbc2c36f2d21af0b2e0c WHIRLPOOL affb14b805b2dcb8b579dd421bfb8276e80d3b31cea41bf57ad5dd9260e2e27d838b0303e4a3af5ca38b0b4f08ac88b142d6f1db20753bec6f8cbfdfc482099b +DIST pypy-2.5.1-src.tar.bz2 16740876 SHA256 ddb3a580b1ee99c5a699172d74be91c36dda9a38946d4731d8c6a63120a3ba2a SHA512 ac4cab47566d7d4e1a293a680e0dffa301c99a8329c2e68f645f186c0266cbe8f045a03e392c0cc2112a16178037cd978b7867ad073bf5dd957dd19f4c818067 WHIRLPOOL 6f16c4090780081dfe1d4642186262c66d4ac1a4b3b8311e573bfa6029eb7aac0483b3e48cad5ce03879391a4e316c0186d33fac5e86d0024ff20cc6d4dc0dd3 diff --git a/dev-python/pypy-binpackage/files/2.5.0-shared-lib.patch b/dev-python/pypy-binpackage/files/2.5.0-shared-lib.patch new file mode 100644 index 0000000..ddd7473 --- /dev/null +++ b/dev-python/pypy-binpackage/files/2.5.0-shared-lib.patch @@ -0,0 +1,12 @@ +diff -ur pypy-2.5.0-src.orig/rpython/translator/platform/posix.py pypy-2.5.0-src/rpython/translator/platform/posix.py +--- rpython/translator/platform/posix.py 2015-02-03 05:12:49.000000000 +0800 ++++ rpython/translator/platform/posix.py 2015-03-22 07:36:01.420116684 +0800 +@@ -183,7 +183,7 @@ + 'int main(int argc, char* argv[]) ' + '{ return $(PYPY_MAIN_FUNCTION)(argc, argv); }" > $@') + m.rule('$(DEFAULT_TARGET)', ['$(TARGET)', 'main.o'], +- '$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) -o $@ $(RPATH_FLAGS)') ++ '$(CC_LINK) $(LDFLAGS_LINK) main.o -L. -l$(SHARED_IMPORT_LIB) \'-Wl,-rpath,$$ORIGIN\' -o $@') + + return m + diff --git a/dev-python/pypy-binpackage/files/2.5.0_all_distutils_cxx.patch b/dev-python/pypy-binpackage/files/2.5.0_all_distutils_cxx.patch new file mode 100644 index 0000000..aa298d0 --- /dev/null +++ b/dev-python/pypy-binpackage/files/2.5.0_all_distutils_cxx.patch @@ -0,0 +1,324 @@ +http://bugs.python.org/issue1222585 + +--- _osx_support.py ++++ _osx_support.py +@@ -14,13 +14,13 @@ + # configuration variables that may contain universal build flags, + # like "-arch" or "-isdkroot", that may need customization for + # the user environment +-_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'LDFLAGS', 'CPPFLAGS', 'BASECFLAGS', +- 'BLDSHARED', 'LDSHARED', 'CC', 'CXX', +- 'PY_CFLAGS', 'PY_LDFLAGS', 'PY_CPPFLAGS', +- 'PY_CORE_CFLAGS') ++_UNIVERSAL_CONFIG_VARS = ('CFLAGS', 'CXXFLAGS', 'LDFLAGS', 'CPPFLAGS', ++ 'BASECFLAGS', 'BLDSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'CC', 'CXX', 'PY_CFLAGS', 'PY_LDFLAGS', ++ 'PY_CPPFLAGS', 'PY_CORE_CFLAGS') + + # configuration variables that may contain compiler calls +-_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'CC', 'CXX') ++_COMPILER_CONFIG_VARS = ('BLDSHARED', 'LDSHARED', 'LDCXXSHARED', 'CC', 'CXX') + + # prefix added to original configuration variable names + _INITPRE = '_OSX_SUPPORT_INITIAL_' +--- distutils/sysconfig_pypy.py ++++ distutils/sysconfig_pypy.py +@@ -123,7 +123,55 @@ + optional C speedup components. + """ + if compiler.compiler_type == "unix": +- compiler.compiler_so.extend(['-O2', '-fPIC', '-Wimplicit']) ++ cc = ' '.join(compiler.compiler) ++ cxx = ' '.join(compiler.compiler_cxx) ++ ldshared = ' '.join(compiler.linker_so) ++ ldcxxshared = ' '.join(compiler.linker_so_cxx) ++ ++ cflags = '' ++ cxxflags = '' ++ ccshared = '-fPIC' ++ ++ if 'CC' in os.environ: ++ cc = os.environ['CC'] ++ if 'CXX' in os.environ: ++ cxx = os.environ['CXX'] ++ if 'LDSHARED' in os.environ: ++ ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] ++ if 'CPP' in os.environ: ++ cpp = os.environ['CPP'] ++ else: ++ cpp = cc + " -E" # not always ++ if 'LDFLAGS' in os.environ: ++ ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] ++ if 'CFLAGS' in os.environ: ++ cflags = os.environ['CFLAGS'] ++ ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] ++ if 'CPPFLAGS' in os.environ: ++ cpp = cpp + ' ' + os.environ['CPPFLAGS'] ++ cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] ++ ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] ++ ++ cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags ++ compiler.set_executables( ++ preprocessor=cpp, ++ compiler=cc_cmd, ++ compiler_so=cc_cmd + ' ' + ccshared, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, ++ linker_so=ldshared, ++ linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx) + compiler.shared_lib_extension = get_config_var('SO') + if "CPPFLAGS" in os.environ: + cppflags = shlex.split(os.environ["CPPFLAGS"]) +--- distutils/cygwinccompiler.py ++++ distutils/cygwinccompiler.py +@@ -117,8 +117,10 @@ + # dllwrap 2.10.90 is buggy + if self.ld_version >= "2.10.90": + self.linker_dll = "gcc" ++ self.linker_dll_cxx = "g++" + else: + self.linker_dll = "dllwrap" ++ self.linker_dll_cxx = "dllwrap" + + # ld_version >= "2.13" support -shared so use it instead of + # -mdll -static +@@ -132,9 +134,13 @@ + self.set_executables(compiler='gcc -mcygwin -O -Wall', + compiler_so='gcc -mcygwin -mdll -O -Wall', + compiler_cxx='g++ -mcygwin -O -Wall', ++ compiler_so_cxx='g++ -mcygwin -mdll -O -Wall', + linker_exe='gcc -mcygwin', + linker_so=('%s -mcygwin %s' % +- (self.linker_dll, shared_option))) ++ (self.linker_dll, shared_option)), ++ linker_exe_cxx='g++ -mcygwin', ++ linker_so_cxx=('%s -mcygwin %s' % ++ (self.linker_dll_cxx, shared_option))) + + # cygwin and mingw32 need different sets of libraries + if self.gcc_version == "2.91.57": +@@ -160,8 +166,12 @@ + raise CompileError, msg + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +@@ -327,9 +337,14 @@ + self.set_executables(compiler='gcc%s -O -Wall' % no_cygwin, + compiler_so='gcc%s -mdll -O -Wall' % no_cygwin, + compiler_cxx='g++%s -O -Wall' % no_cygwin, ++ compiler_so_cxx='g++%s -mdll -O -Wall' % no_cygwin, + linker_exe='gcc%s' % no_cygwin, + linker_so='%s%s %s %s' + % (self.linker_dll, no_cygwin, ++ shared_option, entry_point), ++ linker_exe_cxx='g++%s' % no_cygwin, ++ linker_so_cxx='%s%s %s %s' ++ % (self.linker_dll_cxx, no_cygwin, + shared_option, entry_point)) + # Maybe we should also append -mthreads, but then the finished + # dlls need another dll (mingwm10.dll see Mingw32 docs) +http://bugs.python.org/issue1222585 + +--- distutils/emxccompiler.py ++++ distutils/emxccompiler.py +@@ -65,8 +65,12 @@ + # XXX optimization, warnings etc. should be customizable. + self.set_executables(compiler='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', + compiler_so='gcc -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', ++ compiler_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', ++ compiler_so_cxx='g++ -Zomf -Zmt -O3 -fomit-frame-pointer -mprobe -Wall', + linker_exe='gcc -Zomf -Zmt -Zcrtdll', +- linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll') ++ linker_so='gcc -Zomf -Zmt -Zcrtdll -Zdll', ++ linker_exe_cxx='g++ -Zomf -Zmt -Zcrtdll', ++ linker_so_cxx='g++ -Zomf -Zmt -Zcrtdll -Zdll') + + # want the gcc library statically linked (so that we don't have + # to distribute a version dependent on the compiler we have) +@@ -83,8 +87,12 @@ + raise CompileError, msg + else: # for other files use the C-compiler + try: +- self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(self.compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(self.compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +--- distutils/sysconfig_cpython.py ++++ distutils/sysconfig_cpython.py +@@ -170,10 +170,12 @@ + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, opt, cflags, ccshared, ldshared, so_ext, ar, ar_flags) = \ +- get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SO', 'AR', +- 'ARFLAGS') ++ (cc, cxx, ccshared, ldshared, ldcxxshared, so_ext, ar, ar_flags) = \ ++ get_config_vars('CC', 'CXX', 'CCSHARED', 'LDSHARED', 'LDCXXSHARED', ++ 'SO', 'AR', 'ARFLAGS') ++ ++ cflags = '' ++ cxxflags = '' + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -188,19 +190,27 @@ + cxx = os.environ['CXX'] + if 'LDSHARED' in os.environ: + ldshared = os.environ['LDSHARED'] ++ if 'LDCXXSHARED' in os.environ: ++ ldcxxshared = os.environ['LDCXXSHARED'] + if 'CPP' in os.environ: + cpp = os.environ['CPP'] + else: + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['LDFLAGS'] + if 'CFLAGS' in os.environ: +- cflags = opt + ' ' + os.environ['CFLAGS'] ++ cflags = os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ if 'CXXFLAGS' in os.environ: ++ cxxflags = os.environ['CXXFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CXXFLAGS'] + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] ++ cxxflags = cxxflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ ldcxxshared = ldcxxshared + ' ' + os.environ['CPPFLAGS'] + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: +@@ -209,13 +219,17 @@ + archiver = ar + ' ' + ar_flags + + cc_cmd = cc + ' ' + cflags ++ cxx_cmd = cxx + ' ' + cxxflags + compiler.set_executables( + preprocessor=cpp, + compiler=cc_cmd, + compiler_so=cc_cmd + ' ' + ccshared, +- compiler_cxx=cxx, ++ compiler_cxx=cxx_cmd, ++ compiler_so_cxx=cxx_cmd + ' ' + ccshared, + linker_so=ldshared, + linker_exe=cc, ++ linker_so_cxx=ldcxxshared, ++ linker_exe_cxx=cxx, + archiver=archiver) + + compiler.shared_lib_extension = so_ext +--- distutils/unixccompiler.py ++++ distutils/unixccompiler.py +@@ -55,14 +55,17 @@ + # are pretty generic; they will probably have to be set by an outsider + # (eg. using information discovered by the sysconfig about building + # Python extensions). +- executables = {'preprocessor' : None, +- 'compiler' : ["cc"], +- 'compiler_so' : ["cc"], +- 'compiler_cxx' : ["c++"], # pypy: changed, 'cc' is bogus +- 'linker_so' : ["cc", "-shared"], +- 'linker_exe' : ["cc"], +- 'archiver' : ["ar", "-cr"], +- 'ranlib' : None, ++ executables = {'preprocessor' : None, ++ 'compiler' : ["cc"], ++ 'compiler_so' : ["cc"], ++ 'compiler_cxx' : ["c++"], ++ 'compiler_so_cxx' : ["c++"], ++ 'linker_so' : ["cc", "-shared"], ++ 'linker_exe' : ["cc"], ++ 'linker_so_cxx' : ["c++", "-shared"], ++ 'linker_exe_cxx' : ["c++"], ++ 'archiver' : ["ar", "-cr"], ++ 'ranlib' : None, + } + + if sys.platform[:6] == "darwin": +@@ -112,12 +115,19 @@ + + def _compile(self, obj, src, ext, cc_args, extra_postargs, pp_opts): + compiler_so = self.compiler_so ++ compiler_so_cxx = self.compiler_so_cxx + if sys.platform == 'darwin': + compiler_so = _osx_support.compiler_fixup(compiler_so, + cc_args + extra_postargs) ++ compiler_so_cxx = _osx_support.compiler_fixup(compiler_so_cxx, ++ cc_args + extra_postargs) + try: +- self.spawn(compiler_so + cc_args + [src, '-o', obj] + +- extra_postargs) ++ if self.detect_language(src) == 'c++': ++ self.spawn(compiler_so_cxx + cc_args + [src, '-o', obj] + ++ extra_postargs) ++ else: ++ self.spawn(compiler_so + cc_args + [src, '-o', obj] + ++ extra_postargs) + except DistutilsExecError, msg: + raise CompileError, msg + +@@ -174,23 +184,16 @@ + ld_args.extend(extra_postargs) + self.mkpath(os.path.dirname(output_filename)) + try: +- if target_desc == CCompiler.EXECUTABLE: +- linker = self.linker_exe[:] ++ if target_lang == "c++": ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe_cxx[:] ++ else: ++ linker = self.linker_so_cxx[:] + else: +- linker = self.linker_so[:] +- if target_lang == "c++" and self.compiler_cxx: +- # skip over environment variable settings if /usr/bin/env +- # is used to set up the linker's environment. +- # This is needed on OSX. Note: this assumes that the +- # normal and C++ compiler have the same environment +- # settings. +- i = 0 +- if os.path.basename(linker[0]) == "env": +- i = 1 +- while '=' in linker[i]: +- i = i + 1 +- +- linker[i] = self.compiler_cxx[i] ++ if target_desc == CCompiler.EXECUTABLE: ++ linker = self.linker_exe[:] ++ else: ++ linker = self.linker_so[:] + + if sys.platform == 'darwin': + linker = _osx_support.compiler_fixup(linker, ld_args) + diff --git a/dev-python/pypy-binpackage/pypy-binpackage-2.4.0-r1.ebuild b/dev-python/pypy-binpackage/pypy-binpackage-2.4.0-r1.ebuild new file mode 100644 index 0000000..69954d1 --- /dev/null +++ b/dev-python/pypy-binpackage/pypy-binpackage-2.4.0-r1.ebuild @@ -0,0 +1,210 @@ +# Copyright 1999-2014 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-2.2.1.ebuild,v 1.2 2014/03/12 09:14:21 mgorny Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 pypy ) +inherit check-reqs eutils multilib multiprocessing pax-utils \ + python-any-r1 toolchain-funcs 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/downloads/${MY_P}-src.tar.bz2" + +LICENSE="MIT" +SLOT="0/$(get_version_component_range 1-2 ${PV})" +KEYWORDS="amd64 x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory 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[-tinfo] ) + app-arch/xz-utils + ${PYTHON_DEPS}" + +S="${WORKDIR}/${MY_P}-src" + +pkg_pretend() { + if use low-memory; then + if ! has_version dev-python/pypy && ! has_version dev-python/pypy-bin + then + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy" + eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:" + eerror + eerror " $ emerge -1v dev-python/pypy-bin" + eerror + eerror "before attempting to build dev-python/pypy[low-memory]." + die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory" + fi + + CHECKREQS_MEMORY="1750M" + use amd64 && CHECKREQS_MEMORY="3500M" + else + CHECKREQS_MEMORY="3G" + use amd64 && CHECKREQS_MEMORY="6G" + fi + + check-reqs_pkg_pretend + + [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!' +} + +pkg_setup() { + local force_pypy + + pkg_pretend + + if has_version dev-python/pypy || has_version dev-python/pypy-bin + then + if [[ ! ${EPYTHON} ]] || use low-memory; then + einfo "Using already-installed PyPy to perform the translation." + force_pypy=1 + else + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream" + einfo "recommends using PyPy for that. If you wish to do so, please unset" + einfo "the EPYTHON variable." + fi + fi + + if [[ ${force_pypy} ]]; then + # set manually since python_setup needs virtual/pypy + # and we don't force the dep + python_export pypy EPYTHON PYTHON + python_wrapper_setup + else + python-any-r1_pkg_setup + fi + + 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}/1.9-scripts-location.patch" \ + "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \ + "${FILESDIR}"/2.3.1-shared-lib.patch # 517002 + + pushd lib-python/2.7 > /dev/null || die + epatch "${FILESDIR}/2.3-21_all_distutils_c++.patch" + popd > /dev/null || die + + 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=( + --shared + $(usex jit -Ojit -O2) + $(usex shadowstack --gcrootfinder=shadowstack '') + $(usex sandbox --sandbox '') + + ${jit_backend} + --make-jobs=$(makeopts_jobs) + + pypy/goal/targetpypystandalone + ) + + # 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 + + local interp=( "${PYTHON}" ) + if use low-memory; then + interp=( env PYPY_GC_MAX_DELTA=200MB + "${PYTHON}" --jit loop_longevity=300 ) + fi + + set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}" + echo -e "\033[1m${@}\033[0m" + "${@}" || die "compile error" + + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" +} + +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}"{,/include} || die + mv pypy-c libpypy-c.so "${BIN_P}${suffix}"/ || die + mv include/pypy_* "${BIN_P}${suffix}"/include/ || die + chmod +x "${BIN_P}${suffix}"/pypy-c || die + + tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die + xz -vz9e "${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.5.1.ebuild b/dev-python/pypy-binpackage/pypy-binpackage-2.5.1.ebuild new file mode 100644 index 0000000..67933ef --- /dev/null +++ b/dev-python/pypy-binpackage/pypy-binpackage-2.5.1.ebuild @@ -0,0 +1,198 @@ +# Copyright 1999-2015 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/pypy-2.5.0.ebuild,v 1.1 2015/03/22 08:56:03 idella4 Exp $ + +EAPI=5 + +PYTHON_COMPAT=( python2_7 pypy ) +inherit check-reqs eutils multilib multiprocessing pax-utils python-any-r1 toolchain-funcs 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/downloads/${MY_P}-src.tar.bz2" + +LICENSE="MIT" +SLOT="0/$(get_version_component_range 1-2 ${PV})" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 +jit low-memory ncurses sandbox shadowstack cpu_flags_x86_sse2" + +DEPEND=">=sys-libs/zlib-1.1.3:0= + virtual/libffi:0= + virtual/libintl:0= + dev-libs/expat:0= + dev-libs/openssl:0= + bzip2? ( app-arch/bzip2:0= ) + ncurses? ( sys-libs/ncurses:5= ) + app-arch/xz-utils + ${PYTHON_DEPS}" + +S="${WORKDIR}/${MY_P}-src" + +pkg_pretend() { + if use low-memory; then + if ! python_is_installed pypy; then + eerror "USE=low-memory requires a (possibly old) version of dev-python/pypy" + eerror "or dev-python/pypy-bin being installed. Please install it using e.g.:" + eerror + eerror " $ emerge -1v dev-python/pypy-bin" + eerror + eerror "before attempting to build dev-python/pypy[low-memory]." + die "dev-python/pypy-bin (or dev-python/pypy) needs to be installed for USE=low-memory" + fi + + CHECKREQS_MEMORY="1750M" + use amd64 && CHECKREQS_MEMORY="3500M" + else + CHECKREQS_MEMORY="3G" + use amd64 && CHECKREQS_MEMORY="6G" + fi + + check-reqs_pkg_pretend + + [[ ${PYPY_BINPKG_STORE} ]] || die 'PYPY_BINPKG_STORE unset, wtf?!' +} + +pkg_setup() { + pkg_pretend + + if python_is_installed pypy; then + if [[ ! ${EPYTHON} || ${EPYTHON} == pypy ]] || use low-memory; then + einfo "Using already-installed PyPy to perform the translation." + local EPYTHON=pypy + else + einfo "Using ${EPYTHON} to perform the translation. Please note that upstream" + einfo "recommends using PyPy for that. If you wish to do so, please unset" + einfo "the EPYTHON variable." + fi + fi + + 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 cpu_flags_x86_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}/1.9-scripts-location.patch" \ + "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \ + "${FILESDIR}"/2.5.0-shared-lib.patch # 517002 + + pushd lib-python/2.7 > /dev/null || die + epatch "${FILESDIR}"/2.5.0_all_distutils_cxx.patch + popd > /dev/null || die + + 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 cpu_flags_x86_sse2; then + jit_backend+=x86 + else + jit_backend+=x86-without-sse2 + fi + else + jit_backend+=auto + fi + fi + + local args=( + --shared + $(usex jit -Ojit -O2) + $(usex shadowstack --gcrootfinder=shadowstack '') + $(usex sandbox --sandbox '') + + ${jit_backend} + --make-jobs=$(makeopts_jobs) + + pypy/goal/targetpypystandalone + ) + + # 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 + + local interp=( "${PYTHON}" ) + if use low-memory; then + interp=( env PYPY_GC_MAX_DELTA=200MB + "${PYTHON}" --jit loop_longevity=300 ) + fi + + set -- "${interp[@]}" rpython/bin/rpython --batch "${args[@]}" + echo -e "\033[1m${@}\033[0m" + "${@}" || die "compile error" + + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" +} + +src_install() { + local flags=( bzip2 jit ncurses sandbox shadowstack ) + use x86 && flags+=( cpu_flags_x86_sse2 ) + local f suffix="-${ARCH}" + + for f in ${flags[@]}; do + use ${f} && suffix+="+${f#cpu_flags_x86_}" + done + + local BIN_P=pypy-bin-${PV} + + einfo "Zipping PyPy ..." + mkdir "${BIN_P}${suffix}"{,/include} || die + mv pypy-c libpypy-c.so "${BIN_P}${suffix}"/ || die + mv include/pypy_* "${BIN_P}${suffix}"/include/ || die + chmod +x "${BIN_P}${suffix}"/pypy-c || die + + tar -cf "${BIN_P}${suffix}.tar" "${BIN_P}${suffix}" || die + xz -vz9e "${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/metadata/layout.conf b/metadata/layout.conf index 20fcfea..e38a00a 100644 --- a/metadata/layout.conf +++ b/metadata/layout.conf @@ -1,3 +1,4 @@ masters = gentoo -thin-manifests = true +repo-name = mgorny sign-manifests = false +thin-manifests = true diff --git a/profiles/repo_name b/profiles/repo_name deleted file mode 100644 index f9f1ff5..0000000 --- a/profiles/repo_name +++ /dev/null @@ -1 +0,0 @@ -mgorny -- cgit v1.2.3-65-gdbad