diff options
| author | Lars-Dominik Braun <lars@6xq.net> | 2020-11-15 10:54:26 +0100 |
|---|---|---|
| committer | Maxim Cournoyer <maxim.cournoyer@gmail.com> | 2021-08-05 10:29:59 -0400 |
| commit | 7e05fda6e8dd72b63009181072a282ad15c25c4f (patch) | |
| tree | 7ed9d38d06269fe40b9d4f9e47a8f79562403883 /gnu/packages/python.scm | |
| parent | 49432f6534c900e90017726f08cb37397662a9b8 (diff) | |
gnu: pypy3: Use gdbm compat library and other small fixes.
* gnu/packages/python.scm (pypy3)[inputs]: Remove bash-minimal.
[phases]: Remove trailing #t.
{patch-source}: Use gdbm compat library. Fix shell with the implicit Bash
input.
{build}: Use the '--allworkingmodules' argument.
{install}: Refactor for clarity.
[license]: Re-indent comments.
Modified-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Signed-off-by: Maxim Cournoyer <maxim.cournoyer@gmail.com>
Diffstat (limited to 'gnu/packages/python.scm')
| -rw-r--r-- | gnu/packages/python.scm | 82 |
1 files changed, 43 insertions, 39 deletions
diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 5cc02d5ba34..4ff3200cc95 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm | |||
| @@ -745,7 +745,6 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 745 | ("tcl" ,tcl) | 745 | ("tcl" ,tcl) |
| 746 | ("tk" ,tk) | 746 | ("tk" ,tk) |
| 747 | ("glibc" ,glibc) | 747 | ("glibc" ,glibc) |
| 748 | ("bash-minimal" ,bash-minimal) ; Used as /bin/sh | ||
| 749 | ("xz" ,xz))) ; liblzma | 748 | ("xz" ,xz))) ; liblzma |
| 750 | (arguments | 749 | (arguments |
| 751 | `(#:tests? #f ;FIXME: 43 out of 364 tests are failing | 750 | `(#:tests? #f ;FIXME: 43 out of 364 tests are failing |
| @@ -777,6 +776,12 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 777 | (substitute* '("lib_pypy/_curses_build.py") | 776 | (substitute* '("lib_pypy/_curses_build.py") |
| 778 | ;; Find curses | 777 | ;; Find curses |
| 779 | (("/usr/local") (assoc-ref inputs "ncurses"))) | 778 | (("/usr/local") (assoc-ref inputs "ncurses"))) |
| 779 | (substitute* '("lib_pypy/_dbm.py") | ||
| 780 | ;; Use gdbm compat library, so we don’t need to pull | ||
| 781 | ;; in bdb. | ||
| 782 | (("ctypes.util.find_library\\('db'\\)") | ||
| 783 | (format #f "'~a/lib/libgdbm_compat.so'" | ||
| 784 | (assoc-ref inputs "gdbm")))) | ||
| 780 | (substitute* '("lib_pypy/_sqlite3_build.py") | 785 | (substitute* '("lib_pypy/_sqlite3_build.py") |
| 781 | ;; Always use search paths | 786 | ;; Always use search paths |
| 782 | (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") | 787 | (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") |
| @@ -788,12 +793,10 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 788 | "/lib/libsqlite3.so.0'"))) | 793 | "/lib/libsqlite3.so.0'"))) |
| 789 | (substitute* '("lib-python/3/subprocess.py") | 794 | (substitute* '("lib-python/3/subprocess.py") |
| 790 | ;; Fix shell path | 795 | ;; Fix shell path |
| 791 | (("/bin/sh") | 796 | (("/bin/sh") (which "sh"))) |
| 792 | (string-append (assoc-ref inputs "bash-minimal") "/bin/sh"))) | ||
| 793 | (substitute* '("lib-python/3/distutils/unixccompiler.py") | 797 | (substitute* '("lib-python/3/distutils/unixccompiler.py") |
| 794 | ;; gcc-toolchain does not provide symlink cc -> gcc | 798 | ;; gcc-toolchain does not provide symlink cc -> gcc |
| 795 | (("\"cc\"") "\"gcc\"")) | 799 | (("\"cc\"") "\"gcc\"")))) |
| 796 | #t)) | ||
| 797 | (add-after | 800 | (add-after |
| 798 | 'unpack 'set-source-file-times-to-1980 | 801 | 'unpack 'set-source-file-times-to-1980 |
| 799 | ;; copied from python package, required by zip testcase | 802 | ;; copied from python package, required by zip testcase |
| @@ -801,8 +804,7 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 801 | (let ((circa-1980 (* 10 366 24 60 60))) | 804 | (let ((circa-1980 (* 10 366 24 60 60))) |
| 802 | (ftw "." (lambda (file stat flag) | 805 | (ftw "." (lambda (file stat flag) |
| 803 | (utime file circa-1980 circa-1980) | 806 | (utime file circa-1980 circa-1980) |
| 804 | #t)) | 807 | #t))))) |
| 805 | #t))) | ||
| 806 | (replace 'build | 808 | (replace 'build |
| 807 | (lambda* (#:key inputs #:allow-other-keys) | 809 | (lambda* (#:key inputs #:allow-other-keys) |
| 808 | (with-directory-excursion "pypy/goal" | 810 | (with-directory-excursion "pypy/goal" |
| @@ -812,7 +814,8 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 812 | (string-append "--make-jobs=" | 814 | (string-append "--make-jobs=" |
| 813 | (number->string (parallel-job-count))) | 815 | (number->string (parallel-job-count))) |
| 814 | "-Ojit" | 816 | "-Ojit" |
| 815 | "targetpypystandalone")) | 817 | "targetpypystandalone" |
| 818 | "--allworkingmodules")) | ||
| 816 | ;; Build c modules and package everything, so tests work. | 819 | ;; Build c modules and package everything, so tests work. |
| 817 | (with-directory-excursion "pypy/tool/release" | 820 | (with-directory-excursion "pypy/tool/release" |
| 818 | (unsetenv "PYTHONPATH") ; Do not use the system’s python libs: | 821 | (unsetenv "PYTHONPATH") ; Do not use the system’s python libs: |
| @@ -834,44 +837,45 @@ ease from the desktop to a microcontroller or embedded system.") | |||
| 834 | "pypy/test_all.py" | 837 | "pypy/test_all.py" |
| 835 | "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" | 838 | "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" |
| 836 | "lib-python")) | 839 | "lib-python")) |
| 837 | (format #t "test suite not run~%")) | 840 | (format #t "test suite not run~%")))) |
| 838 | #t)) | ||
| 839 | (replace 'install | 841 | (replace 'install |
| 840 | (lambda* (#:key inputs outputs #:allow-other-keys) | 842 | (lambda* (#:key inputs outputs #:allow-other-keys) |
| 841 | (with-directory-excursion "pypy/tool/release" | 843 | (let* ((out (assoc-ref outputs "out")) |
| 842 | ;; Delete test data. | 844 | (bin-pypy3 (string-append out "/bin/pypy3")) |
| 843 | (for-each | 845 | (shebang-match-python "#!.+/bin/python") |
| 844 | (lambda (x) | 846 | (shebang-pypy3 (string-append "#!" bin-pypy3)) |
| 845 | (delete-file-recursively (string-append | 847 | (dist-dir "pypy/tool/release/pypy-dist")) |
| 846 | "pypy-dist/lib-python/3/" x))) | 848 | (with-directory-excursion dist-dir |
| 847 | '("tkinter/test" | 849 | ;; Delete test data. |
| 848 | "test" | 850 | (for-each |
| 849 | "sqlite3/test" | 851 | (lambda (x) |
| 850 | "lib2to3/tests" | 852 | (delete-file-recursively (string-append |
| 851 | "idlelib/idle_test" | 853 | "lib-python/3/" x))) |
| 852 | "distutils/tests" | 854 | '("tkinter/test" |
| 853 | "ctypes/test" | 855 | "test" |
| 854 | "unittest/test")) | 856 | "sqlite3/test" |
| 855 | ;; Patch shebang referencing python2 | 857 | "lib2to3/tests" |
| 856 | (substitute* '("pypy-dist/lib-python/3/cgi.py" | 858 | "idlelib/idle_test" |
| 857 | "pypy-dist/lib-python/3/encodings/rot_13.py") | 859 | "distutils/tests" |
| 858 | (("#!.+/bin/python") | 860 | "ctypes/test" |
| 859 | (string-append "#!" (assoc-ref outputs "out") "/bin/pypy3"))) | 861 | "unittest/test")) |
| 860 | (with-fluids ((%default-port-encoding "ISO-8859-1")) | 862 | ;; Patch shebang referencing python2 |
| 861 | (substitute* '("pypy-dist/lib_pypy/_md5.py" | 863 | (substitute* '("lib-python/3/cgi.py" |
| 862 | "pypy-dist/lib_pypy/_sha1.py") | 864 | "lib-python/3/encodings/rot_13.py") |
| 863 | (("#!.+/bin/python") | 865 | ((shebang-match-python) shebang-pypy3)) |
| 864 | (string-append "#!" (assoc-ref outputs "out") "/bin/pypy3")))) | 866 | (with-fluids ((%default-port-encoding "ISO-8859-1")) |
| 865 | (copy-recursively "pypy-dist" (assoc-ref outputs "out"))) | 867 | (substitute* '("lib_pypy/_md5.py" |
| 866 | #t))))) | 868 | "lib_pypy/_sha1.py") |
| 869 | ((shebang-match-python) shebang-pypy3)))) | ||
| 870 | (copy-recursively dist-dir out))))))) | ||
| 867 | (home-page "https://www.pypy.org/") | 871 | (home-page "https://www.pypy.org/") |
| 868 | (synopsis "Python implementation with just-in-time compilation") | 872 | (synopsis "Python implementation with just-in-time compilation") |
| 869 | (description "PyPy is a faster, alternative implementation of the Python | 873 | (description "PyPy is a faster, alternative implementation of the Python |
| 870 | programming language employing a just-in-time compiler. It supports most | 874 | programming language employing a just-in-time compiler. It supports most |
| 871 | Python code natively, including C extensions.") | 875 | Python code natively, including C extensions.") |
| 872 | (license (list license:expat ; pypy itself; _pytest/ | 876 | (license (list license:expat ; pypy itself; _pytest/ |
| 873 | license:psfl ; python standard library in lib-python/ | 877 | license:psfl ; python standard library in lib-python/ |
| 874 | license:asl2.0 ; dotviewer/font/ and some of lib-python/ | 878 | license:asl2.0 ; dotviewer/font/ and some of lib-python/ |
| 875 | license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* | 879 | license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* |
| 876 | license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ | 880 | license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ |
| 877 | (license:non-copyleft | 881 | (license:non-copyleft |
