From patchwork Sat Oct 22 19:09:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Marius Bakke X-Patchwork-Id: 43820 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 977ED27BBEA; Mon, 24 Oct 2022 00:07:46 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 153D227BBE9 for ; Mon, 24 Oct 2022 00:07:44 +0100 (BST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1omjDF-0006z4-BS for patchwork@mira.cbaines.net; Sun, 23 Oct 2022 18:12:57 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsh-00080e-T1 for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1omJsh-0004cI-L8 for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1omJsh-0003LE-7f for guix-patches@gnu.org; Sat, 22 Oct 2022 15:10:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#58587] [PATCH v2 02/22] gnu: pypy: Move to separate module. Resent-From: Marius Bakke Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 22 Oct 2022 19:10:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58587 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 58587@debbugs.gnu.org Cc: Lars-Dominik Braun Received: via spool by 58587-submit@debbugs.gnu.org id=B58587.166646579312802 (code B ref 58587); Sat, 22 Oct 2022 19:10:03 +0000 Received: (at 58587) by debbugs.gnu.org; 22 Oct 2022 19:09:53 +0000 Received: from localhost ([127.0.0.1]:42354 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsW-0003KO-0i for submit@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:53 -0400 Received: from eggs.gnu.org ([209.51.188.92]:59110) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1omJsU-0003K4-3G for 58587@debbugs.gnu.org; Sat, 22 Oct 2022 15:09:51 -0400 Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsO-0004WK-TQ; Sat, 22 Oct 2022 15:09:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-Version:References:In-Reply-To:Date:Subject:To: From; bh=IAXFTLdI1nDiv7sk1T3Id64Vj6NU2663aGsOdelfs34=; b=CEo9kLLafLK8ChRffsFs jRjJL/wfgWCktJvcZuR/5NsY6QCXJJP929ATmvgd3j6zshijpV/W/umanFz5JC2O0vi2/Zz2F5Ie0 UKq4oUkP8hsdtha/C5BshVzrR9tnfMd7QTAX4qFzAi4DD7zVK99wH1al1W3tvecOgqfl2Ed0Fd/bX i/EKVws0mXVRuiP3Cxt/TPtKlDYLmUr+muwLaLu20A6B+4HSCJH3ONgWAfvoSDJMY+WLHGBC8Y1HQ 3Kl1+J65v1MfKDSy0/GDFxjhaYPJs+KxM4OpwrGhgoniRszzhozydhRea7dnB+564MzpFeY1MvS1Y KaI3DoZIYjZHkg==; Received: from [185.80.180.134] (helo=localhost) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1omJsO-0003ge-By; Sat, 22 Oct 2022 15:09:44 -0400 From: Marius Bakke Date: Sat, 22 Oct 2022 21:09:10 +0200 Message-Id: <20221022190930.13086-2-marius@gnu.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221022190930.13086-1-marius@gnu.org> References: <87eduzu18u.fsf@gnu.org> <20221022190930.13086-1-marius@gnu.org> MIME-Version: 1.0 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches From: Lars-Dominik Braun This removes the need to import (gnu packages python-xyz) in (gnu packages python), avoiding issues with circular imports. * gnu/packages/python.scm (pypy): Move… * gnu/packages/pypy.scm (pypy): …here * gnu/local.mk: Register new file. Co-authored-by: Marius Bakke --- gnu/local.mk | 1 + gnu/packages/pypy.scm | 273 ++++++++++++++++++++++++++++++++++++++++ gnu/packages/python.scm | 170 ------------------------- 3 files changed, 274 insertions(+), 170 deletions(-) create mode 100644 gnu/packages/pypy.scm diff --git a/gnu/local.mk b/gnu/local.mk index 8247180bef..bf598cec8b 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -506,6 +506,7 @@ GNU_SYSTEM_MODULES = \ %D%/packages/pure.scm \ %D%/packages/purescript.scm \ %D%/packages/pv.scm \ + %D%/packages/pypy.scm \ %D%/packages/python.scm \ %D%/packages/python-build.scm \ %D%/packages/python-check.scm \ diff --git a/gnu/packages/pypy.scm b/gnu/packages/pypy.scm new file mode 100644 index 0000000000..002cfd59cd --- /dev/null +++ b/gnu/packages/pypy.scm @@ -0,0 +1,273 @@ +;;; GNU Guix --- Functional package management for GNU +;;; Copyright © 2013 Nikita Karetnikov +;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Courtès +;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge +;;; Copyright © 2014, 2015 Mark H Weaver +;;; Copyright © 2014, 2017, 2019 Eric Bavier +;;; Copyright © 2014, 2015 Federico Beffa +;;; Copyright © 2015 Omar Radwan +;;; Copyright © 2015 Pierre-Antoine Rault +;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus +;;; Copyright © 2015, 2016 Christine Lemmer-Webber +;;; Copyright © 2015 Eric Dvorsak +;;; Copyright © 2015, 2016 David Thompson +;;; Copyright © 2015, 2016, 2017, 2021 Leo Famulari +;;; Copyright © 2015, 2017 Ben Woodcroft +;;; Copyright © 2015, 2016 Erik Edrosa +;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner +;;; Copyright © 2015, 2017 Kyle Meyer +;;; Copyright © 2015, 2016 Chris Marusich +;;; Copyright © 2016 Danny Milosavljevic +;;; Copyright © 2016 Lukas Gradl +;;; Copyright © 2016, 2018 Hartmut Goebel +;;; Copyright © 2016 Daniel Pimentel +;;; Copyright © 2016 Sou Bunnbu +;;; Copyright © 2016, 2017 Troy Sankey +;;; Copyright © 2016, 2017 Nikita +;;; Copyright © 2016 Dylan Jeffers +;;; Copyright © 2016 David Craven +;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke +;;; Copyright © 2016, 2017 Stefan Reichör +;;; Copyright © 2016 Dylan Jeffers +;;; Copyright © 2016, 2017 Alex Vong +;;; Copyright © 2016, 2017, 2018 Arun Isaac +;;; Copyright © 2016–2018, 2021 Tobias Geerinckx-Rice +;;; Copyright © 2016, 2017, 2018, 2021 Julien Lepiller +;;; Copyright © 2016, 2017 Thomas Danckaert +;;; Copyright © 2017 Carlo Zancanaro +;;; Copyright © 2017 Frederick M. Muriithi +;;; Copyright © 2017, 2018 Adriano Peluso +;;; Copyright © 2017 Ben Sturmfels +;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe +;;; Copyright © 2017 José Miguel Sánchez García +;;; Copyright © 2017 Roel Janssen +;;; Copyright © 2017, 2018 Kei Kebreau +;;; Copyright © 2017 Rutger Helling +;;; Copyright © 2017 Muriithi Frederick Muriuki +;;; Copyright © 2017 Brendan Tildesley +;;; Copyright © 2018 Ethan R. Jones +;;; Copyright © 2018 Vijayalakshmi Vedantham +;;; Copyright © 2018 Mathieu Lirzin +;;; Copyright © 2018 Adam Massmann +;;; Copyright © 2016, 2018 Tomáš Čech +;;; Copyright © 2018 Nicolas Goaziou +;;; Copyright © 2018 Oleg Pykhalov +;;; Copyright © 2018 Clément Lassieur +;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer +;;; Copyright © 2018 Luther Thompson +;;; Copyright © 2018 Vagrant Cascadian +;;; Copyright © 2019 Tanguy Le Carrour +;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen +;;; Copyright © 2020, 2021 Greg Hogan +;;; +;;; This file is part of GNU Guix. +;;; +;;; GNU Guix is free software; you can redistribute it and/or modify it +;;; under the terms of the GNU General Public License as published by +;;; the Free Software Foundation; either version 3 of the License, or (at +;;; your option) any later version. +;;; +;;; GNU Guix is distributed in the hope that it will be useful, but +;;; WITHOUT ANY WARRANTY; without even the implied warranty of +;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;;; GNU General Public License for more details. +;;; +;;; You should have received a copy of the GNU General Public License +;;; along with GNU Guix. If not, see . + +(define-module (gnu packages pypy) + #:use-module ((guix licenses) #:prefix license:) + #:use-module (gnu packages) + #:use-module (gnu packages base) + #:use-module (gnu packages bash) + #:use-module (gnu packages certs) + #:use-module (gnu packages check) + #:use-module (gnu packages compression) + #:use-module (gnu packages dbm) + #:use-module (gnu packages hurd) + #:use-module (gnu packages libffi) + #:use-module (gnu packages ncurses) + #:use-module (gnu packages pkg-config) + #:use-module (gnu packages python) + #:use-module (gnu packages python-xyz) + #:use-module (gnu packages readline) + #:use-module (gnu packages shells) + #:use-module (gnu packages sqlite) + #:use-module (gnu packages tcl) + #:use-module (gnu packages tls) + #:use-module (gnu packages xml) + #:use-module (guix gexp) + #:use-module (guix packages) + #:use-module (guix download) + #:use-module (guix utils) + #:use-module (guix build-system gnu) + #:use-module (guix build-system trivial) + #:use-module (srfi srfi-1) + #:use-module (srfi srfi-26)) + +(define-public pypy + (package + (name "pypy") + (version "7.3.5") + (source (origin + (method url-fetch) + (uri (string-append "https://downloads.python.org/pypy/" + "pypy3.7-v" version "-src.tar.bz2")) + (sha256 + (base32 + "18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r")))) + (build-system gnu-build-system) + (arguments + (list + #:tests? #f ;FIXME: 43 out of 364 tests are failing + #:modules '((ice-9 ftw) (ice-9 match) + (guix build utils) (guix build gnu-build-system)) + #:disallowed-references (list nss-certs) + #:phases + #~(modify-phases %standard-phases + (delete 'configure) + (add-after 'unpack 'patch-source + (lambda* (#:key inputs #:allow-other-keys) + (substitute* '("rpython/rlib/clibffi.py") + ;; find_library does not work for libc + (("ctypes\\.util\\.find_library\\('c'\\)") "'libc.so'")) + (substitute* '("lib_pypy/cffi/_pycparser/ply/cpp.py") + ;; Make reproducible (XXX: unused?) + (("time\\.localtime\\(\\)") "time.gmtime(0)")) + (substitute* '("pypy/module/sys/version.py") + ;; Make reproducible + (("t\\.gmtime\\(\\)") "t.gmtime(0)")) + (substitute* '("lib_pypy/_tkinter/tklib_build.py") + ;; Link to versioned libtcl and libtk + (("linklibs = \\['tcl', 'tk'\\]") + "linklibs = ['tcl8.6', 'tk8.6']") + (("incdirs = \\[\\]") + (string-append + "incdirs = ['" + #$(this-package-input "tcl") "/include', '" + #$(this-package-input "tk") "/include']"))) + (substitute* '("lib_pypy/_curses_build.py") + ;; Find curses + (("/usr/local") + #$(this-package-input "ncurses"))) + (substitute* '("lib_pypy/_dbm.py") + ;; Use gdbm compat library, so we don’t need to pull + ;; in bdb. + (("ctypes.util.find_library\\('db'\\)") + (format #f "~s" (search-input-file + inputs "lib/libgdbm_compat.so")))) + (substitute* '("lib_pypy/_sqlite3_build.py") + ;; Always use search paths + (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") + ;; Find sqlite3 + (("/usr/local") (assoc-ref inputs "sqlite")) + (("libname = 'sqlite3'") + (format #f "libname = ~s" + (search-input-file inputs "lib/libsqlite3.so.0")))) + (substitute* '("lib-python/3/subprocess.py") + ;; Fix shell path + (("/bin/sh") + (search-input-file inputs "/bin/sh"))) + (substitute* '("lib-python/3/distutils/unixccompiler.py") + ;; gcc-toolchain does not provide symlink cc -> gcc + (("\"cc\"") "\"gcc\"")))) + (add-after 'unpack 'set-source-file-times-to-1980 + ;; copied from python package, required by zip testcase + (lambda _ + (let ((circa-1980 (* 10 366 24 60 60))) + (ftw "." (lambda (file stat flag) + (utime file circa-1980 circa-1980) + #t))))) + (replace 'build + (lambda _ + (with-directory-excursion "pypy/goal" + ;; Build with jit optimization. + (invoke "python2" + "../../rpython/bin/rpython" + (string-append "--make-jobs=" + (number->string (parallel-job-count))) + "-Ojit" + "targetpypystandalone" + "--allworkingmodules")) + ;; Build c modules and package everything, so tests work. + (with-directory-excursion "pypy/tool/release" + (invoke "python2" "package.py" + "--archive-name" "pypy-dist" + "--builddir" (getcwd))))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (if tests? + (begin + (setenv "HOME" "/tmp") ; test_with_pip tries to + ; access ~/.cache/pip + ;; Run library tests only (no interpreter unit tests). + ;; This is what Gentoo does. + (invoke "python" "pypy/test_all.py" + "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" + "lib-python")) + (format #t "test suite not run~%")))) + (replace 'install + (lambda* (#:key inputs outputs #:allow-other-keys) + (let* ((bin-pypy3 (string-append #$output "/bin/pypy3")) + (shebang-match-python "#!.+/bin/python") + (shebang-pypy3 (string-append "#!" bin-pypy3)) + (dist-dir "pypy/tool/release/pypy-dist")) + (with-directory-excursion dist-dir + ;; Delete test data. + (for-each + (lambda (x) + (delete-file-recursively (string-append + "lib-python/3/" x))) + '("tkinter/test" + "test" + "sqlite3/test" + "lib2to3/tests" + "idlelib/idle_test" + "distutils/tests" + "ctypes/test" + "unittest/test")) + ;; Patch shebang referencing python. + (substitute* '("lib-python/3/cgi.py" + "lib-python/3/encodings/rot_13.py") + ((shebang-match-python) shebang-pypy3)) + (with-fluids ((%default-port-encoding "ISO-8859-1")) + (substitute* '("lib_pypy/_md5.py" + "lib_pypy/_sha1.py") + ((shebang-match-python) shebang-pypy3)))) + (copy-recursively dist-dir #$output))))))) + (native-inputs + (list gzip + nss-certs ; For ssl tests + pkg-config + python-2 + python2-pycparser + tar)) ; Required for package.py + (inputs + (list bzip2 + expat + gdbm + glibc + libffi + ncurses + openssl + sqlite + tcl + tk + xz + zlib)) + (home-page "https://www.pypy.org/") + (synopsis "Python implementation with just-in-time compilation") + (description "PyPy is a faster, alternative implementation of the Python +programming language employing a just-in-time compiler. It supports most +Python code natively, including C extensions.") + (license (list license:expat ; pypy itself; _pytest/ + license:psfl ; python standard library in lib-python/ + license:asl2.0 ; dotviewer/font/ and some of lib-python/ + license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* + license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ + (license:non-copyleft + "http://www.unicode.org/copyright.html"))))) + +(define-public pypy3 + (deprecated-package "pypy3" pypy)) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index e31158dfc0..00c3eb7774 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -81,17 +81,13 @@ (define-module (gnu packages python) #:use-module (gnu packages) #:use-module (gnu packages base) #:use-module (gnu packages bash) - #:use-module (gnu packages certs) #:use-module (gnu packages check) #:use-module (gnu packages compression) #:use-module (gnu packages dbm) #:use-module (gnu packages hurd) #:use-module (gnu packages libffi) - #:use-module (gnu packages ncurses) #:use-module (gnu packages pkg-config) - #:use-module (gnu packages python-xyz) #:use-module (gnu packages readline) - #:use-module (gnu packages shells) #:use-module (gnu packages sqlite) #:use-module (gnu packages tcl) #:use-module (gnu packages tls) @@ -736,169 +732,3 @@ (define-public micropython compatible with normal Python as possible to allow you to transfer code with ease from the desktop to a microcontroller or embedded system.") (license license:expat))) - -(define-public pypy - (package - (name "pypy") - (version "7.3.5") - (source (origin - (method url-fetch) - (uri (string-append "https://downloads.python.org/pypy/" - "pypy3.7-v" version "-src.tar.bz2")) - (sha256 - (base32 - "18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r")))) - (build-system gnu-build-system) - (arguments - (list - #:tests? #f ;FIXME: 43 out of 364 tests are failing - #:modules '((ice-9 ftw) (ice-9 match) - (guix build utils) (guix build gnu-build-system)) - #:disallowed-references (list nss-certs) - #:phases - #~(modify-phases %standard-phases - (delete 'configure) - (add-after 'unpack 'patch-source - (lambda* (#:key inputs #:allow-other-keys) - (substitute* '("rpython/rlib/clibffi.py") - ;; find_library does not work for libc - (("ctypes\\.util\\.find_library\\('c'\\)") "'libc.so'")) - (substitute* '("lib_pypy/cffi/_pycparser/ply/cpp.py") - ;; Make reproducible (XXX: unused?) - (("time\\.localtime\\(\\)") "time.gmtime(0)")) - (substitute* '("pypy/module/sys/version.py") - ;; Make reproducible - (("t\\.gmtime\\(\\)") "t.gmtime(0)")) - (substitute* '("lib_pypy/_tkinter/tklib_build.py") - ;; Link to versioned libtcl and libtk - (("linklibs = \\['tcl', 'tk'\\]") - "linklibs = ['tcl8.6', 'tk8.6']") - (("incdirs = \\[\\]") - (string-append - "incdirs = ['" - #$(this-package-input "tcl") "/include', '" - #$(this-package-input "tk") "/include']"))) - (substitute* '("lib_pypy/_curses_build.py") - ;; Find curses - (("/usr/local") - #$(this-package-input "ncurses"))) - (substitute* '("lib_pypy/_dbm.py") - ;; Use gdbm compat library, so we don’t need to pull - ;; in bdb. - (("ctypes.util.find_library\\('db'\\)") - (format #f "~s" (search-input-file - inputs "lib/libgdbm_compat.so")))) - (substitute* '("lib_pypy/_sqlite3_build.py") - ;; Always use search paths - (("sys\\.platform\\.startswith\\('freebsd'\\)") "True") - ;; Find sqlite3 - (("/usr/local") (assoc-ref inputs "sqlite")) - (("libname = 'sqlite3'") - (format #f "libname = ~s" - (search-input-file inputs "lib/libsqlite3.so.0")))) - (substitute* '("lib-python/3/subprocess.py") - ;; Fix shell path - (("/bin/sh") - (search-input-file inputs "/bin/sh"))) - (substitute* '("lib-python/3/distutils/unixccompiler.py") - ;; gcc-toolchain does not provide symlink cc -> gcc - (("\"cc\"") "\"gcc\"")))) - (add-after 'unpack 'set-source-file-times-to-1980 - ;; copied from python package, required by zip testcase - (lambda _ - (let ((circa-1980 (* 10 366 24 60 60))) - (ftw "." (lambda (file stat flag) - (utime file circa-1980 circa-1980) - #t))))) - (replace 'build - (lambda _ - (with-directory-excursion "pypy/goal" - ;; Build with jit optimization. - (invoke "python2" - "../../rpython/bin/rpython" - (string-append "--make-jobs=" - (number->string (parallel-job-count))) - "-Ojit" - "targetpypystandalone" - "--allworkingmodules")) - ;; Build c modules and package everything, so tests work. - (with-directory-excursion "pypy/tool/release" - (invoke "python2" "package.py" - "--archive-name" "pypy-dist" - "--builddir" (getcwd))))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (if tests? - (begin - (setenv "HOME" "/tmp") ; test_with_pip tries to - ; access ~/.cache/pip - ;; Run library tests only (no interpreter unit tests). - ;; This is what Gentoo does. - (invoke "python" "pypy/test_all.py" - "--pypy=pypy/tool/release/pypy-dist/bin/pypy3" - "lib-python")) - (format #t "test suite not run~%")))) - (replace 'install - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((bin-pypy3 (string-append #$output "/bin/pypy3")) - (shebang-match-python "#!.+/bin/python") - (shebang-pypy3 (string-append "#!" bin-pypy3)) - (dist-dir "pypy/tool/release/pypy-dist")) - (with-directory-excursion dist-dir - ;; Delete test data. - (for-each - (lambda (x) - (delete-file-recursively (string-append - "lib-python/3/" x))) - '("tkinter/test" - "test" - "sqlite3/test" - "lib2to3/tests" - "idlelib/idle_test" - "distutils/tests" - "ctypes/test" - "unittest/test")) - ;; Patch shebang referencing python. - (substitute* '("lib-python/3/cgi.py" - "lib-python/3/encodings/rot_13.py") - ((shebang-match-python) shebang-pypy3)) - (with-fluids ((%default-port-encoding "ISO-8859-1")) - (substitute* '("lib_pypy/_md5.py" - "lib_pypy/_sha1.py") - ((shebang-match-python) shebang-pypy3)))) - (copy-recursively dist-dir #$output))))))) - (native-inputs - (list gzip - nss-certs ; For ssl tests - pkg-config - python-2 - python2-pycparser - tar)) ; Required for package.py - (inputs - (list bzip2 - expat - gdbm - glibc - libffi - ncurses - openssl - sqlite - tcl - tk - xz - zlib)) - (home-page "https://www.pypy.org/") - (synopsis "Python implementation with just-in-time compilation") - (description "PyPy is a faster, alternative implementation of the Python -programming language employing a just-in-time compiler. It supports most -Python code natively, including C extensions.") - (license (list license:expat ; pypy itself; _pytest/ - license:psfl ; python standard library in lib-python/ - license:asl2.0 ; dotviewer/font/ and some of lib-python/ - license:gpl3+ ; ./rpython/rlib/rvmprof/src/shared/libbacktrace/dwarf2.* - license:bsd-3 ; lib_pypy/cffi/_pycparser/ply/ - (license:non-copyleft - "http://www.unicode.org/copyright.html"))))) - -(define-public pypy3 - (deprecated-package "pypy3" pypy))