From ffa27535aade75e37dcddbfcb9be41878e26dea2 Mon Sep 17 00:00:00 2001 From: Ian Delaney Date: Sun, 22 Mar 2015 08:56:32 +0000 Subject: [PATCH] bump; add missed dep for tests, update patches for shared-lib, all_distutils (renamed 2.5.0_all_distutils_cxx.patch) Package-Manager: portage-2.2.14/cvs/Linux x86_64 Manifest-Sign-Key: 0xB8072B0D --- dev-python/pypy/ChangeLog | 9 +- dev-python/pypy/Manifest | 26 +- dev-python/pypy/files/2.5.0-shared-lib.patch | 12 + .../pypy/files/2.5.0_all_distutils_cxx.patch | 324 ++++++++++++++++++ dev-python/pypy/metadata.xml | 5 +- dev-python/pypy/pypy-2.5.0.ebuild | 224 ++++++++++++ 6 files changed, 581 insertions(+), 19 deletions(-) create mode 100644 dev-python/pypy/files/2.5.0-shared-lib.patch create mode 100644 dev-python/pypy/files/2.5.0_all_distutils_cxx.patch create mode 100644 dev-python/pypy/pypy-2.5.0.ebuild diff --git a/dev-python/pypy/ChangeLog b/dev-python/pypy/ChangeLog index 3bf1ff4f20ff..a1061f9b7937 100644 --- a/dev-python/pypy/ChangeLog +++ b/dev-python/pypy/ChangeLog @@ -1,6 +1,13 @@ # ChangeLog for dev-python/pypy # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/ChangeLog,v 1.83 2015/01/28 19:47:38 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-python/pypy/ChangeLog,v 1.84 2015/03/22 08:56:03 idella4 Exp $ + +*pypy-2.5.0 (22 Mar 2015) + + 22 Mar 2015; Ian Delaney +files/2.5.0-shared-lib.patch, + +files/2.5.0_all_distutils_cxx.patch, +pypy-2.5.0.ebuild, metadata.xml: + bump; add missed dep for tests, update patches for shared-lib, all_distutils + (renamed 2.5.0_all_distutils_cxx.patch) 28 Jan 2015; Michał Górny pypy-2.3.1-r2.ebuild, pypy-2.4.0.ebuild: diff --git a/dev-python/pypy/Manifest b/dev-python/pypy/Manifest index 5c3dfa067800..adab45482dba 100644 --- a/dev-python/pypy/Manifest +++ b/dev-python/pypy/Manifest @@ -5,28 +5,20 @@ AUX 1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch 5 AUX 1.9-scripts-location.patch 354 SHA256 efceb2fabe7e2a9ca8cc3d8b86653d19b1a7e729c01ce70486da597f1fe9b1a0 SHA512 739f3620cf5c71d292e9a4c8cd2341184961313f42a23d794e2031ea165d82fab9628924800425fa70d27b3fd759138f62bf04345654c97ee1883bb069d8d261 WHIRLPOOL 6e607663498bf62d39cf420a586a82cad4c7ba660228987133c0ba9ebec3a20257e7dccb677815a0ad886de466cad79daa79dc8a434a52b21d44e84f46c00830 AUX 2.3-21_all_distutils_c++.patch 14825 SHA256 99fc72d254a903a5445c991ac5e1f7ab95d1df6dde684250e145bd908131ebda SHA512 8b53016ae48cae39e9fee030fa18b9cebb72bf72b180be1a0a605a97ab6a0ad62d32317f459728a324f83179ec624885bd3cbe61ac0b5594690cca0c0e74c76e WHIRLPOOL 6718f3e998f0d7174e7088881c74d0e2063e935b5610e076eaf2233ee84f6478c0a1689f5d01de9aeb8f53a97ed73fb4957de16be4adc83045b21c48b93e8646 AUX 2.3.1-shared-lib.patch 525 SHA256 865514044a180aaf707054aafbf78f8b834aedd4cee96f2fbafdff5360dd219a SHA512 e7c5e4a6ed36e4fe74ea30fc5c936a7ff147a25b275cad5713b6f492b042ac64950086430cee0c89baf1b1e084858a40f61b884c88fdd5a39addc3a452f41b83 WHIRLPOOL 5ac8d50805b16eec50b309f3812011ede31564b16d2c782dce4eb006b37accc2c4818134cc562da5fea5c77fa3fdb909bbba707bef1ee0c440b5cce039d2ba94 +AUX 2.5.0-shared-lib.patch 730 SHA256 9ab0d31d034a9980095c07dfc5a403e14ea8e41cbd9eedd238217d63815997cb SHA512 c769431d733bcfcc24c68f3adfca41e3e7e94657936e3f0fe47015feb842465c69fd8f577db7fe4e915b9ed6fd749368b66a09cfe9b083c55b89ac42cac33265 WHIRLPOOL 9c37c2e20fb3c5a0a4248097ae90ffecded604658699677f9fc35ac8b096d5188dda4a5549ee3255bbe2751546c61fdea6ef5133988203e660f070998cb1ed09 +AUX 2.5.0_all_distutils_cxx.patch 14852 SHA256 a920ec04b26cbcead3eea89e2b437be3ca70a5229d3da6ae8a56ea8f1047ff84 SHA512 0b1ec90e1603b0a2af000a43990df0a577ef79700c9707851b82b676531caec9b2f9c9b2c144724e4898dc1d7ea1d5779e932d01a18eaa2d4d9086e2a1b0c7f8 WHIRLPOOL e9648f08f8616fcad2fe2ce1788627adfa1aeb89b3f8b5d2857a73da987b2385ab467b3b3b576e82b02d3beafa4a62b217b7f90b59ed0332f325ebada0337f4e 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.0-src.tar.bz2 15065106 SHA256 8ff1e131d8fefd79032dd81bcf3fde927e152d3acde5105356f6ffc1aad33f81 SHA512 79615ee680d69ff85043f596232f7684407fff27c3f54c8237c1822c43ff63aaf0c8918b6950424a70b75727357b30f0fa88e90df15bd5945905d96f8f2d87b1 WHIRLPOOL 861492b526c5b8271729c51959250f95fc5d4ac6b37108873601a3c09b6cb6f264c764e180f9e913c3ffeebdfaad8a87dc4a3898e717cbea44ff72dff5071461 EBUILD pypy-2.3.1-r2.ebuild 6543 SHA256 2ca2601c1972ed75145adfda371a45c329bf55e9f0165d387758f2d170589139 SHA512 f0308b0e90a78578efead7421d9d69268f5fb13e8f3e7410e562a0b41ec68e6b68d02346a6aa3f9f776d34092fc6c7849099d81134c32a3da5ec823bea9be5d0 WHIRLPOOL 88f3a8c501aa735349869bf7108328481e4b200f06bc1bbdc7285a6458b3010d0142cd8108891002d15fa6a8b430793fe07f733b36aea54489160e4fcd997105 EBUILD pypy-2.4.0.ebuild 6251 SHA256 80d15d914e754f227f32698da7063840869c9c634682a4a5f1876c696fd33475 SHA512 63ece3b05b65a91c28fca011e8f445c3ea1bdcb66720dcbd261288284ae5d3f31ebd4eb6d3325ddae541d4443489c5c705382332d508e8de81b1a644b4c2e2da WHIRLPOOL 3431631a99c28118afd4c97c3c8ff9c5a7b2af9b9651f35ae3c57df2687dc69bd3e6e79712d9b06763238bc64eb12e0aea56e861b2a26b7dac6bebb7ffeab913 -MISC ChangeLog 15238 SHA256 8b0f589541ab48fad9ac286ba46107847146e36f088929ba5dcd303c1d8a1fe4 SHA512 092199d2074617eeb74acb34833c75a83527e31c49622206ed9a15061c71514f2a91b2f6dc75ff8d6e5d1c3fa6e4a3d75f0a2f9e93972ee4e2c3cda8d2a92e5c WHIRLPOOL f90752440195e2b7973a5ed3c9f52283541ca5d178afadf38f67cccd9dfc2930ebd5e81b04e7d6006bfed4413fe65b3cde231adc98c715f4850084a2fcb0f07d -MISC metadata.xml 801 SHA256 7826fa81beb7b614d865d22dc28685b6a337cac5616c5a474b06d7141f33e74e SHA512 e4930c243257594dcaa6f75330f81c8a2ffa074c5d66f90c7f032555b210e8eb9d83f1906d412864a05dd8fb3bc371ecf91e0e6bf4ef75b7ca1144e2e5fb57ab WHIRLPOOL b1d45fc1066f7157eb0787e7dd66965ff7a464f68730f58eaec12aa65e005e5f1b8ece061585015ff12551e9238eb8ebd5b4a5de0d3edbe3f00d28aa6cb5c317 +EBUILD pypy-2.5.0.ebuild 6281 SHA256 84dd357ec12c5d0cc2846b7283fd4357cd998351efaabecdd956234acd79bf8f SHA512 f33ebecac293491dbc14023ebfdbd20a0833ef0a7a5926914af773ac24ff77c29efd24bab877c8522f9d83030f5894984f70508614c272f769e14da4b07bfc1a WHIRLPOOL 1ddd8ecbb80fa36c2927ed6841e861201c6b81707259395c502f0384fd42ec1c6ac8f0ea664fc415211c0ac0c501572ac707a5d0e583017984bc035484ed8af6 +MISC ChangeLog 15541 SHA256 380ec0af00f286005c11a8870d610f06394e7bddf7c89c742bde7a6d574d9797 SHA512 fab354ea20440660bea69c0d237189236bcc9f109903a1a11aec0e714049d1d71bb43eb47c0b7f265a601c6ed00185d3a7e626f7b5d334d1d33395b24b82ec65 WHIRLPOOL 7180bd8917e66f3f84a31eb1db1bbfe0f311180ba57f3ac2e60be25b3cf67a1f9b2a9f289c9c1ee698dc23f16fe54ad5159ba940e21a0fe3fa73fd37a4626ebb +MISC metadata.xml 814 SHA256 c48da602d1fd1b8319490eab43094d7b44f2db5d08d1158e804198feebeede89 SHA512 77b11b4275e1b160bceb050dc0621c9490541c20cfa7327dcdfa6089209f8e0d5e160b6b93c95a406596649d8fdbb9d004d632a6c0df4edde8ac4308a2067653 WHIRLPOOL 9762c2db20f2847ac5c35074ac83a566e3e27dc3d707433184ae3ef82ab2d31c335700e9ba674ffb457848452caedce3e8007d7a88f3e9a87c1a4715bbc216e9 -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 -iQJ8BAEBCABmBQJUyTzbXxSAAAAAAC4AKGlzc3Vlci1mcHJAbm90YXRpb25zLm9w -ZW5wZ3AuZmlmdGhob3JzZW1hbi5uZXQ2REJCMDdDQzRGMERBRDA2RUEwQUZFNDFC -MDdBMUFFQUVGQjQ0NjRFAAoJELB6GurvtEZOr1wP/jC/UlCSMF1h1Uvvffj3QL/M -k+cwogI9DrjOWE8m/eNf+5YetEslgTRrEBpyEBL4TXL+I1O9+PHJvVOXhAjFAaFL -f6TR5oM/be3Vcap+Wy+P4C7l2uxdEbIlhLj0VwE2kmi677HYc3BJEJJ5YOFc+FNZ -3NYfuFxVWW6eiwm5Bi7HZsH43BpR3/8G/4wk299EAHxNlr2o9qiDDuOFFx9mJcBR -QlIxc+3z39MzQq0+aBQScmf5YhWq0/W+PNQ4GtV0cZNKCp5o+swk8QMeRW1soih8 -k/MSfk4uZodtzHY3j3R28Fwypwvir+9czeEoNcRNdRa2+73ekBfmjKvSXgUpi6lK -C9GhkbhRLIK+b6O3y30O1ioDz2QhZhT7r2ha7ymXiOz107DsM2ngWCAFBtIz7KII -+MxmUAQm9pbEBcGK36+mO1zoGJN7AOQJcn8cyo8FtSBHE24tilO8iwpCISR7bF6m -38Cb0I5s5L9biniMV9YP/nD17GN3e5MPfxkIoM4ZbBBU7RD8fou6DsOMcet2BXLg -CBqKVj8OxyoGssFO9YuIa9D/vN03ogvY5d7sHHCHcgM49gSrq5u946fpEddn8N8W -nFXf9/aIj/i1IBXWBsGdHHtY9xrzqVhcRFvEyeY/K+r2gbCUTwJWUzYrwE/yVeOY -S+aNyFg3Fx+lkI38kl2z -=LJt7 +iEYEAREIAAYFAlUOg7UACgkQso7CE7gHKw18wQCfWHjl+9fatHmwMvLNzD/W+LWB +61wAnjLRkg11X02MNHXBFKmaUE+yqdgm +=8SxV -----END PGP SIGNATURE----- diff --git a/dev-python/pypy/files/2.5.0-shared-lib.patch b/dev-python/pypy/files/2.5.0-shared-lib.patch new file mode 100644 index 000000000000..ddd74730f3dd --- /dev/null +++ b/dev-python/pypy/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/files/2.5.0_all_distutils_cxx.patch b/dev-python/pypy/files/2.5.0_all_distutils_cxx.patch new file mode 100644 index 000000000000..aa298d0df646 --- /dev/null +++ b/dev-python/pypy/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/metadata.xml b/dev-python/pypy/metadata.xml index 00d869b32b78..a90c29e4bb20 100644 --- a/dev-python/pypy/metadata.xml +++ b/dev-python/pypy/metadata.xml @@ -7,7 +7,10 @@ Alice Ferrazzi - Build using PyPy with the engine configured towards low memory footprint. This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86, at the cost of lengthened build time. Please note that you will need an extra ~1G of extra RAM or swap since the translation memory (unused at the time) is not freed when the C compiler is spawned. + Build using PyPy with the engine configured towards low memory footprint. \ + This makes it possible to build PyPy using ~3.5G of RAM on amd64 and ~half of that on x86, + at the cost of lengthened build time. Please note that you will need an extra ~1G of extra RAM or \ + swap since the translation memory (unused at the time) is not freed when the C compiler is spawned. Enable sandboxing functionality Use a shadow stack for finding GC roots diff --git a/dev-python/pypy/pypy-2.5.0.ebuild b/dev-python/pypy/pypy-2.5.0.ebuild new file mode 100644 index 000000000000..ec2309e28c7c --- /dev/null +++ b/dev-python/pypy/pypy-2.5.0.ebuild @@ -0,0 +1,224 @@ +# 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 + +DESCRIPTION="A fast, compliant alternative implementation of the Python language" +HOMEPAGE="http://pypy.org/" +SRC_URI="https://bitbucket.org/pypy/pypy/downloads/${P}-src.tar.bz2" + +LICENSE="MIT" +SLOT="0/$(get_version_component_range 1-2 ${PV})" +KEYWORDS="~amd64 ~x86 ~amd64-linux ~x86-linux" +IUSE="bzip2 doc gdbm +jit low-memory ncurses sandbox shadowstack sqlite cpu_flags_x86_sse2 test tk" + +RDEPEND=">=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= ) + gdbm? ( sys-libs/gdbm:0= ) + ncurses? ( sys-libs/ncurses:5= ) + sqlite? ( dev-db/sqlite:3= ) + tk? ( + dev-lang/tk:0= + dev-tcltk/tix:0= + ) + !dev-python/pypy-bin:0" +DEPEND="${RDEPEND} + doc? ( dev-python/sphinx ) + ${PYTHON_DEPS} + test? ( dev-python/pytest )" +PDEPEND="app-admin/python-updater" + +S="${WORKDIR}/${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 +} + +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 +} + +src_prepare() { + epatch "${FILESDIR}/1.9-scripts-location.patch" \ + "${FILESDIR}/1.9-distutils.unixccompiler.UnixCCompiler.runtime_library_dir_option.patch" \ + "${FILESDIR}"/${PV}-shared-lib.patch # 517002 + + pushd lib-python/2.7 > /dev/null || die + epatch "${FILESDIR}"/${PV}_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" + + use doc && emake -C pypy/doc/ html + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" +} + +src_test() { + # (unset) + local -x PYTHONDONTWRITEBYTECODE + + ./pypy-c ./pypy/test_all.py --pypy=./pypy-c lib-python || die +} + +src_install() { + einfo "Installing PyPy ..." + insinto "/usr/$(get_libdir)/pypy" + doins -r include lib_pypy lib-python pypy-c libpypy-c.so + fperms a+x ${INSDESTTREE}/pypy-c ${INSDESTTREE}/libpypy-c.so + pax-mark m "${ED%/}${INSDESTTREE}/pypy-c" "${ED%/}${INSDESTTREE}/libpypy-c.so" + dosym ../$(get_libdir)/pypy/pypy-c /usr/bin/pypy + dodoc README.rst + + if ! use gdbm; then + rm -r "${ED%/}${INSDESTTREE}"/lib_pypy/gdbm.py \ + "${ED%/}${INSDESTTREE}"/lib-python/*2.7/test/test_gdbm.py || die + fi + if ! use sqlite; then + rm -r "${ED%/}${INSDESTTREE}"/lib-python/*2.7/sqlite3 \ + "${ED%/}${INSDESTTREE}"/lib_pypy/_sqlite3.py \ + "${ED%/}${INSDESTTREE}"/lib-python/*2.7/test/test_sqlite.py || die + fi + if ! use tk; then + rm -r "${ED%/}${INSDESTTREE}"/lib-python/*2.7/{idlelib,lib-tk} \ + "${ED%/}${INSDESTTREE}"/lib_pypy/_tkinter \ + "${ED%/}${INSDESTTREE}"/lib-python/*2.7/test/test_{tcl,tk,ttk*}.py || die + fi + + # Install docs + use doc && dohtml -r pypy/doc/_build/html/ + + einfo "Generating caches and byte-compiling ..." + + python_export pypy EPYTHON PYTHON PYTHON_SITEDIR + local PYTHON=${ED%/}${INSDESTTREE}/pypy-c + local -x LD_LIBRARY_PATH="${ED%/}${INSDESTTREE}" + + echo "EPYTHON='${EPYTHON}'" > epython.py + python_domodule epython.py + + # Generate Grammar and PatternGrammar pickles. + "${PYTHON}" -c "import lib2to3.pygram, lib2to3.patcomp; lib2to3.patcomp.PatternCompiler()" \ + || die "Generation of Grammar and PatternGrammar pickles failed" + + # Generate cffi cache + # Please keep in sync with pypy/tool/release/package.py! + "${PYTHON}" -c "import _curses" || die "Failed to import _curses (cffi)" + "${PYTHON}" -c "import syslog" || die "Failed to import syslog (cffi)" + if use gdbm; then + "${PYTHON}" -c "import gdbm" || die "Failed to import gdbm (cffi)" + fi + if use sqlite; then + "${PYTHON}" -c "import _sqlite3" || die "Failed to import _sqlite3 (cffi)" + fi + if use tk; then + "${PYTHON}" -c "import _tkinter" || die "Failed to import _tkinter (cffi)" + fi + + # Cleanup temporary objects + find "${ED%/}${INSDESTTREE}" -name "_cffi_*.[co]" -delete || die + find "${ED%/}${INSDESTTREE}" -type d -empty -delete || die + + # compile the installed modules + python_optimize "${ED%/}${INSDESTTREE}" +} -- 2.26.2