Change pypy2 spec to pypy3

This commit is contained in:
Miro Hrončok 2015-04-25 00:48:59 +02:00
parent e76c4a2968
commit 26c3863db6
5 changed files with 49 additions and 77 deletions

15
.gitignore vendored
View File

@ -1,14 +1 @@
/pypy-1.4.1-src.tar.bz2 /pypy3-2.4.0-src.tar.bz2
/pypy-1.5-src.tar.bz2
/release-1.6.tar.bz2
/release-1.7.tar.bz2
/release-1.8.tar.bz2
/release-1.9.tar.bz2
/release-2.0-beta-1.tar.bz2
/release-2.0.2.tar.bz2
/release-2.1.0.tar.bz2
/pypy-2.2-src.tar.bz2
/pypy-2.2.1-src.tar.bz2
/pypy-2.3-src.tar.bz2
/release-2.3.1.tar.bz2
/pypy-2.4.0-src.tar.bz2

View File

@ -1,5 +0,0 @@
%__pypy /usr/bin/pypy
%pypy_sitelib %(%{__pypy} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%pypy_sitearch %(%{__pypy} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%pypy_version %(%{__pypy} -c "import sys; sys.stdout.write(sys.version[:3])")
%pypydir %{_builddir}/pypy-%{name}-%{version}-%{release}

5
macros.pypy3 Normal file
View File

@ -0,0 +1,5 @@
%__pypy3 /usr/bin/pypy3
%pypy3_sitelib %(%{__pypy3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
%pypy3_sitearch %(%{__pypy3} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")
%pypy3_version %(%{__pypy3} -c "import sys; sys.stdout.write(sys.version[:3])")
%pypy3dir %{_builddir}/pypy3-%{name}-%{version}-%{release}

View File

@ -1,7 +1,7 @@
Name: pypy Name: pypy3
Version: 2.4.0 Version: 2.4.0
Release: 1%{?dist} Release: 1%{?dist}
Summary: Python implementation with a Just-In-Time compiler Summary: Python 3 implementation with a Just-In-Time compiler
Group: Development/Languages Group: Development/Languages
# LGPL and another free license we'd need to ask spot about are present in some # LGPL and another free license we'd need to ask spot about are present in some
@ -117,8 +117,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
# Easy way to turn off the selftests: # Easy way to turn off the selftests:
%global run_selftests 1 %global run_selftests 1
%global pypyprefix %{_libdir}/pypy-%{version} %global pypyprefix %{_libdir}/pypy3-%{version}
%global pylibver 2.7 %global pylibver 3
# We refer to this subdir of the source tree in a few places during the build: # We refer to this subdir of the source tree in a few places during the build:
%global goal_dir pypy/goal %global goal_dir pypy/goal
@ -130,11 +130,11 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
%(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g')
# Source and patches: # Source and patches:
Source0: https://bitbucket.org/pypy/pypy/downloads/pypy-2.4.0-src.tar.bz2 Source0: https://bitbucket.org/pypy/pypy/downloads/pypy3-2.4.0-src.tar.bz2
# Supply various useful RPM macros for building python modules against pypy: # Supply various useful RPM macros for building python modules against pypy:
# __pypy, pypy_sitelib, pypy_sitearch # __pypy, pypy_sitelib, pypy_sitearch
Source2: macros.pypy Source2: macros.pypy3
# By default, if built at a tty, the translation process renders a Mandelbrot # By default, if built at a tty, the translation process renders a Mandelbrot
# set to indicate progress. # set to indicate progress.
@ -164,19 +164,15 @@ Patch2: 007-remove-startup-message.patch
%global use_self_when_building 0 %global use_self_when_building 0
%if 0%{use_self_when_building} %if 0%{use_self_when_building}
# pypy3 can only be build with pypy2
BuildRequires: pypy BuildRequires: pypy
%global bootstrap_python_interp pypy %global bootstrap_python_interp pypy
%else %else
# Python 2.6 or later is needed, so on RHEL5 (2.4) we need to use the alternate
# python26 rpm: # pypy3 can only be build with python2
%if 0%{?rhel} == 5
BuildRequires: python26-devel
%global bootstrap_python_interp python26
%else
BuildRequires: python-devel BuildRequires: python-devel
%global bootstrap_python_interp python %global bootstrap_python_interp python
%endif
%endif %endif
@ -218,10 +214,10 @@ BuildRequires: emacs
# Metadata for the core package (the JIT build): # Metadata for the core package (the JIT build):
Requires: pypy-libs = %{version}-%{release} Requires: pypy3-libs = %{version}-%{release}
%description %description
PyPy's implementation of Python, featuring a Just-In-Time compiler on some CPU PyPy's implementation of Python 3, featuring a Just-In-Time compiler on some CPU
architectures, and various optimized implementations of the standard types architectures, and various optimized implementations of the standard types
(strings, dictionaries, etc) (strings, dictionaries, etc)
@ -235,7 +231,7 @@ CPU architecture.
%package libs %package libs
Group: Development/Languages Group: Development/Languages
Summary: Run-time libraries used by PyPy implementations of Python Summary: Run-time libraries used by PyPy implementations of Python 3
# We supply an emacs mode for the JIT viewer. # We supply an emacs mode for the JIT viewer.
# (This doesn't bring in all of emacs, just the directory structure) # (This doesn't bring in all of emacs, just the directory structure)
@ -244,39 +240,29 @@ Requires: emacs-filesystem >= %{_emacs_version}
%endif %endif
%description libs %description libs
Libraries required by the various PyPy implementations of Python. Libraries required by the various PyPy implementations of Python 3.
%package devel %package devel
Group: Development/Languages Group: Development/Languages
Summary: Development tools for working with PyPy Summary: Development tools for working with PyPy3
Requires: pypy = %{version}-%{release} Requires: pypy3 = %{version}-%{release}
%description devel %description devel
Header files for building C extension modules against PyPy Header files for building C extension modules against PyPy3
%if 0%{with_stackless} %if 0%{with_stackless}
%package stackless %package stackless
Group: Development/Languages Group: Development/Languages
Summary: Stackless Python interpreter built using PyPy Summary: Stackless Python interpreter built using PyPy3
Requires: pypy-libs = %{version}-%{release} Requires: pypy3-libs = %{version}-%{release}
%description stackless %description stackless
Build of PyPy with support for micro-threads for massive concurrency Build of PyPy3 with support for micro-threads for massive concurrency
%endif %endif
%if 0%{with_stackless}
%package stackless
Group: Development/Languages
Summary: Stackless Python interpreter built using PyPy
Requires: pypy-libs = %{version}-%{release}
%description stackless
Build of PyPy with support for micro-threads for massive concurrency
%endif
%prep %prep
%setup -q -n pypy-2.4.0-src %setup -q -n pypy3-2.4.0-src
%patch0 -p1 -b .suppress-mandelbrot-set-during-tty-build %patch0 -p1 -b .suppress-mandelbrot-set-during-tty-build
%patch1 -p1 %patch1 -p1
%patch2 -p1 %patch2 -p1
@ -295,8 +281,6 @@ for f in rpython/translator/goal/bpnn.py ; do
chmod a-x $f chmod a-x $f
done done
rm -rf lib-python/3
%build %build
@ -421,7 +405,7 @@ BuildPyPy() {
} }
BuildPyPy \ BuildPyPy \
pypy \ pypy3 \
%if 0%{with_jit} %if 0%{with_jit}
"-Ojit" \ "-Ojit" \
%else %else
@ -431,7 +415,7 @@ BuildPyPy \
%if 0%{with_stackless} %if 0%{with_stackless}
BuildPyPy \ BuildPyPy \
pypy-stackless \ pypy3-stackless \
"--stackless" "--stackless"
%endif %endif
@ -479,10 +463,10 @@ InstallPyPy() {
mkdir -p %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
mkdir -p %{buildroot}/%{pypyprefix} mkdir -p %{buildroot}/%{pypyprefix}
InstallPyPy pypy InstallPyPy pypy3
%if 0%{with_stackless} %if 0%{with_stackless}
InstallPyPy pypy-stackless InstallPyPy pypy3-stackless
%endif %endif
@ -585,16 +569,16 @@ mkdir -p %{buildroot}/%{pypyprefix}/site-packages
# Note that some of the test files deliberately contain syntax errors, so # Note that some of the test files deliberately contain syntax errors, so
# we pass 0 for the second argument ("errors_terminate"): # we pass 0 for the second argument ("errors_terminate"):
/usr/lib/rpm/brp-python-bytecompile \ /usr/lib/rpm/brp-python-bytecompile \
%{buildroot}/%{_bindir}/pypy \ %{buildroot}/%{_bindir}/pypy3 \
0 0
%{buildroot}/%{pypyprefix}/pypy -c 'import _tkinter' %{buildroot}/%{pypyprefix}/pypy3 -c 'import _tkinter'
%{buildroot}/%{pypyprefix}/pypy -c 'import Tkinter' %{buildroot}/%{pypyprefix}/pypy3 -c 'import tkinter'
%{buildroot}/%{pypyprefix}/pypy -c 'import _sqlite3' %{buildroot}/%{pypyprefix}/pypy3 -c 'import _sqlite3'
%{buildroot}/%{pypyprefix}/pypy -c 'import _curses' %{buildroot}/%{pypyprefix}/pypy3 -c 'import _curses'
%{buildroot}/%{pypyprefix}/pypy -c 'import curses' %{buildroot}/%{pypyprefix}/pypy3 -c 'import curses'
%{buildroot}/%{pypyprefix}/pypy -c 'import syslog' %{buildroot}/%{pypyprefix}/pypy3 -c 'import syslog'
%{buildroot}/%{pypyprefix}/pypy -c 'from _sqlite3 import *' %{buildroot}/%{pypyprefix}/pypy3 -c 'from _sqlite3 import *'
# Header files for C extension modules. # Header files for C extension modules.
# Upstream's packaging process (pypy/tool/release/package.py) # Upstream's packaging process (pypy/tool/release/package.py)
@ -658,7 +642,8 @@ find \
# Install the JIT trace mode for Emacs: # Install the JIT trace mode for Emacs:
%if %{with_emacs} %if %{with_emacs}
mkdir -p %{buildroot}/%{_emacs_sitelispdir} mkdir -p %{buildroot}/%{_emacs_sitelispdir}
cp -a rpython/jit/tool/pypytrace-mode.el* %{buildroot}/%{_emacs_sitelispdir} cp -a rpython/jit/tool/pypytrace-mode.el %{buildroot}/%{_emacs_sitelispdir}/pypy3trace-mode.el
cp -a rpython/jit/tool/pypytrace-mode.elc %{buildroot}/%{_emacs_sitelispdir}/pypy3trace-mode.elc
%endif %endif
# Install macros for rpm: # Install macros for rpm:
@ -694,7 +679,7 @@ CheckPyPy() {
# Use regrtest to explicitly list all tests: # Use regrtest to explicitly list all tests:
( ./$ExeName -c \ ( ./$ExeName -c \
"from test.regrtest import findtests; print '\n'.join(findtests())" "from test.regrtest import findtests; print('\n'.join(findtests()))"
) > testnames.txt ) > testnames.txt
# Skip some tests: # Skip some tests:
@ -784,10 +769,10 @@ CheckPyPy() {
#pypy/goal/pypy pypy/test_all.py --resultlog=pypyjit_new.log #pypy/goal/pypy pypy/test_all.py --resultlog=pypyjit_new.log
%if %{run_selftests} %if %{run_selftests}
CheckPyPy pypy CheckPyPy pypy3
%if 0%{with_stackless} %if 0%{with_stackless}
CheckPyPy pypy-stackless CheckPyPy pypy3-stackless
%endif %endif
%endif # run_selftests %endif # run_selftests
@ -809,21 +794,21 @@ rm -rf $RPM_BUILD_ROOT
%{pypyprefix}/lib_pypy/ %{pypyprefix}/lib_pypy/
%{pypyprefix}/site-packages/ %{pypyprefix}/site-packages/
%if %{with_emacs} %if %{with_emacs}
%{_emacs_sitelispdir}/pypytrace-mode.el %{_emacs_sitelispdir}/pypy3trace-mode.el
%{_emacs_sitelispdir}/pypytrace-mode.elc %{_emacs_sitelispdir}/pypy3trace-mode.elc
%endif %endif
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
%doc LICENSE README.rst %doc LICENSE README.rst
%{_bindir}/pypy %{_bindir}/pypy3
%{pypyprefix}/pypy %{pypyprefix}/pypy3
%files devel %files devel
%defattr(-,root,root,-) %defattr(-,root,root,-)
%dir %{pypy_include_dir} %dir %{pypy_include_dir}
%{pypy_include_dir}/*.h %{pypy_include_dir}/*.h
%config(noreplace) %{_rpmconfigdir}/macros.d/macros.pypy %config(noreplace) %{_rpmconfigdir}/macros.d/macros.pypy3
%if 0%{with_stackless} %if 0%{with_stackless}
%files stackless %files stackless

View File

@ -1 +1 @@
6a25a212e7c5121f1f3988c118d05695 pypy-2.4.0-src.tar.bz2 96ba72916114d16904e12562b5d84e51 pypy3-2.4.0-src.tar.bz2