2013-01-15 03:29:28 +01:00
|
|
|
|
;;; GNU Guix --- Functional package management for GNU
|
|
|
|
|
;;; Copyright © 2013 Nikita Karetnikov <nikita@karetnikov.org>
|
2021-07-16 17:20:09 +02:00
|
|
|
|
;;; Copyright © 2013, 2014, 2015, 2016, 2017, 2018, 2021 Ludovic Courtès <ludo@gnu.org>
|
2016-04-06 20:49:40 +02:00
|
|
|
|
;;; Copyright © 2013, 2014, 2015, 2016 Andreas Enge <andreas@enge.fr>
|
2015-02-03 06:31:03 +01:00
|
|
|
|
;;; Copyright © 2014, 2015 Mark H Weaver <mhw@netris.org>
|
2019-01-23 05:00:50 +01:00
|
|
|
|
;;; Copyright © 2014, 2017, 2019 Eric Bavier <bavier@member.fsf.org>
|
2015-01-14 18:04:17 +01:00
|
|
|
|
;;; Copyright © 2014, 2015 Federico Beffa <beffa@fbengineering.ch>
|
2015-02-03 06:31:03 +01:00
|
|
|
|
;;; Copyright © 2015 Omar Radwan <toxemicsquire4@gmail.com>
|
2015-02-04 01:02:20 +01:00
|
|
|
|
;;; Copyright © 2015 Pierre-Antoine Rault <par@rigelk.eu>
|
2019-01-02 16:29:51 +01:00
|
|
|
|
;;; Copyright © 2015, 2016, 2017, 2018, 2019 Ricardo Wurmus <rekado@elephly.net>
|
2021-08-15 20:15:37 +02:00
|
|
|
|
;;; Copyright © 2015, 2016 Christine Lemmer-Webber <cwebber@dustycloud.org>
|
2015-07-25 21:31:05 +02:00
|
|
|
|
;;; Copyright © 2015 Eric Dvorsak <eric@dvorsak.fr>
|
2015-12-07 22:18:35 +01:00
|
|
|
|
;;; Copyright © 2015, 2016 David Thompson <davet@gnu.org>
|
2021-02-19 23:45:05 +01:00
|
|
|
|
;;; Copyright © 2015, 2016, 2017, 2021 Leo Famulari <leo@famulari.name>
|
2017-08-05 04:09:56 +02:00
|
|
|
|
;;; Copyright © 2015, 2017 Ben Woodcroft <donttrustben@gmail.com>
|
2016-01-01 21:28:46 +01:00
|
|
|
|
;;; Copyright © 2015, 2016 Erik Edrosa <erik.edrosa@gmail.com>
|
2020-07-13 14:51:46 +02:00
|
|
|
|
;;; Copyright © 2015, 2016, 2017, 2018, 2019, 2020 Efraim Flashner <efraim@flashner.co.il>
|
2017-10-26 23:02:28 +02:00
|
|
|
|
;;; Copyright © 2015, 2017 Kyle Meyer <kyle@kyleam.com>
|
2016-03-28 04:10:48 +02:00
|
|
|
|
;;; Copyright © 2015, 2016 Chris Marusich <cmmarusich@gmail.com>
|
2016-02-25 22:26:45 +01:00
|
|
|
|
;;; Copyright © 2016 Danny Milosavljevic <dannym+a@scratchpost.org>
|
2016-05-22 01:19:42 +02:00
|
|
|
|
;;; Copyright © 2016 Lukas Gradl <lgradl@openmailbox.org>
|
2017-01-02 17:31:34 +01:00
|
|
|
|
;;; Copyright © 2016, 2018 Hartmut Goebel <h.goebel@crazy-compilers.com>
|
2016-06-16 14:08:24 +02:00
|
|
|
|
;;; Copyright © 2016 Daniel Pimentel <d4n1@d4n1.org>
|
2016-06-23 17:06:52 +02:00
|
|
|
|
;;; Copyright © 2016 Sou Bunnbu <iyzsong@gmail.com>
|
2017-02-20 07:37:35 +01:00
|
|
|
|
;;; Copyright © 2016, 2017 Troy Sankey <sankeytms@gmail.com>
|
mailmap: Update entries for Nikita.
* .mailmap: change email and name for Nikita.
* Makefile.am, doc/guix.texi, etc/completion/fish/guix.fish,
gnu/packages/accessibility.scm, gnu/packages/admin.scm,
gnu/packages/audio.scm, gnu/packages/autotools.scm, gnu/packages/cdrom.scm,
gnu/packages/check.scm, gnu/packages/cinnamon.scm,
gnu/packages/compression.scm, gnu/packages/crypto.scm,
gnu/packages/databases.scm, gnu/packages/django.scm, gnu/packages/dns.scm,
gnu/packages/elixir.scm, gnu/packages/emacs-xyz.scm, gnu/packages/emacs.scm,
gnu/packages/enlightenment.scm, gnu/packages/erlang.scm,
gnu/packages/fonts.scm, gnu/packages/fontutils.scm, gnu/packages/forth.scm,
gnu/packages/fvwm.scm, gnu/packages/games.scm, gnu/packages/gl.scm,
gnu/packages/gnome.scm, gnu/packages/gnunet.scm, gnu/packages/gnupg.scm,
gnu/packages/gtk.scm, gnu/packages/guile-wm.scm, gnu/packages/guile-xyz.scm,
gnu/packages/haskell-apps.scm, gnu/packages/haskell-check.scm,
gnu/packages/haskell-crypto.scm, gnu/packages/haskell-xyz.scm,
gnu/packages/haskell.scm, gnu/packages/image-viewers.scm,
gnu/packages/image.scm, gnu/packages/irc.scm, gnu/packages/language.scm,
gnu/packages/libcanberra.scm, gnu/packages/linux.scm,
gnu/packages/lisp-xyz.scm, gnu/packages/lisp.scm, gnu/packages/lolcode.scm,
gnu/packages/lxde.scm, gnu/packages/lxqt.scm, gnu/packages/mail.scm,
gnu/packages/markup.scm, gnu/packages/mate.scm, gnu/packages/maths.scm,
gnu/packages/mc.scm, gnu/packages/messaging.scm, gnu/packages/music.scm,
gnu/packages/ncurses.scm, gnu/packages/networking.scm,
gnu/packages/nickle.scm, gnu/packages/openbox.scm, gnu/packages/pdf.scm,
gnu/packages/perl-check.scm, gnu/packages/perl.scm,
gnu/packages/python-compression.scm, gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm, gnu/packages/python-xyz.scm,
gnu/packages/python.scm, gnu/packages/qt.scm, gnu/packages/ruby.scm,
gnu/packages/rust.scm, gnu/packages/scheme.scm,
gnu/packages/serialization.scm, gnu/packages/shells.scm,
gnu/packages/ssh.scm, gnu/packages/suckless.scm, gnu/packages/tbb.scm,
gnu/packages/telephony.scm, gnu/packages/text-editors.scm,
gnu/packages/textutils.scm, gnu/packages/time.scm, gnu/packages/tls.scm,
gnu/packages/tor.scm, gnu/packages/version-control.scm,
gnu/packages/video.scm, gnu/packages/vim.scm, gnu/packages/web.scm,
gnu/packages/wm.scm, gnu/packages/xdisorg.scm, gnu/packages/xfce.scm,
gnu/packages/xml.scm, gnu/packages/xorg.scm, gnu/services/certbot.scm,
gnu/services/desktop.scm, gnu/services/version-control.scm,
gnu/services/web.scm, guix/import/hackage.scm, guix/licenses.scm: Likewise.
Signed-off-by: Efraim Flashner <efraim@flashner.co.il>
2020-05-11 13:05:45 +02:00
|
|
|
|
;;; Copyright © 2016, 2017 Nikita <nikita@n0.is>
|
2016-08-13 22:22:49 +02:00
|
|
|
|
;;; Copyright © 2016 Dylan Jeffers <sapientech@sapientech@openmailbox.org>
|
2016-08-05 19:21:17 +02:00
|
|
|
|
;;; Copyright © 2016 David Craven <david@craven.ch>
|
2021-07-21 23:54:10 +02:00
|
|
|
|
;;; Copyright © 2016, 2017, 2018, 2019, 2020, 2021 Marius Bakke <marius@gnu.org>
|
2017-05-25 21:24:52 +02:00
|
|
|
|
;;; Copyright © 2016, 2017 Stefan Reichör <stefan@xsteve.at>
|
2017-11-08 15:49:53 +01:00
|
|
|
|
;;; Copyright © 2016, 2017 Alex Vong <alexvong1995@gmail.com>
|
2018-03-27 17:29:03 +02:00
|
|
|
|
;;; Copyright © 2016, 2017, 2018 Arun Isaac <arunisaac@systemreboot.net>
|
2022-05-29 02:00:02 +02:00
|
|
|
|
;;; Copyright © 2016–2018, 2021, 2022 Tobias Geerinckx-Rice <me@tobias.gr>
|
2021-03-17 13:33:22 +01:00
|
|
|
|
;;; Copyright © 2016, 2017, 2018, 2021 Julien Lepiller <julien@lepiller.eu>
|
2017-02-21 13:33:20 +01:00
|
|
|
|
;;; Copyright © 2016, 2017 Thomas Danckaert <post@thomasdanckaert.be>
|
2017-01-22 05:46:08 +01:00
|
|
|
|
;;; Copyright © 2017 Carlo Zancanaro <carlo@zancanaro.id.au>
|
2017-02-09 18:48:32 +01:00
|
|
|
|
;;; Copyright © 2017 Frederick M. Muriithi <fredmanglis@gmail.com>
|
2018-01-22 18:55:12 +01:00
|
|
|
|
;;; Copyright © 2017, 2018 Adriano Peluso <catonano@gmail.com>
|
2017-04-18 18:16:18 +02:00
|
|
|
|
;;; Copyright © 2017 Ben Sturmfels <ben@sturm.com.au>
|
2019-03-06 16:39:00 +01:00
|
|
|
|
;;; Copyright © 2017, 2018, 2019 Mathieu Othacehe <m.othacehe@gmail.com>
|
2017-05-23 17:53:11 +02:00
|
|
|
|
;;; Copyright © 2017 José Miguel Sánchez García <jmi2k@openmailbox.org>
|
2017-06-21 10:36:07 +02:00
|
|
|
|
;;; Copyright © 2017 Roel Janssen <roel@gnu.org>
|
2018-01-15 02:13:13 +01:00
|
|
|
|
;;; Copyright © 2017, 2018 Kei Kebreau <kkebreau@posteo.net>
|
2017-06-23 05:43:09 +02:00
|
|
|
|
;;; Copyright © 2017 Rutger Helling <rhelling@mykolab.com>
|
2019-05-03 18:42:32 +02:00
|
|
|
|
;;; Copyright © 2017 Brendan Tildesley <mail@brendan.scot>
|
2018-02-05 23:55:34 +01:00
|
|
|
|
;;; Copyright © 2018 Ethan R. Jones <ethanrjones97@gmail.com
|
2018-01-21 19:37:57 +01:00
|
|
|
|
;;; Copyright © 2018 Fis Trivial <ybbs.daans@hotmail.com>
|
2018-03-19 17:50:25 +01:00
|
|
|
|
;;; Copyright © 2018 Vijayalakshmi Vedantham <vijimay12@gmail.com>
|
2018-03-31 23:19:12 +02:00
|
|
|
|
;;; Copyright © 2018 Mathieu Lirzin <mthl@gnu.org>
|
2018-04-04 08:09:28 +02:00
|
|
|
|
;;; Copyright © 2018 Adam Massmann <massmannak@gmail.com>
|
2018-04-16 11:04:19 +02:00
|
|
|
|
;;; Copyright © 2016, 2018 Tomáš Čech <sleep_walker@gnu.org>
|
2018-04-22 23:59:57 +02:00
|
|
|
|
;;; Copyright © 2018 Nicolas Goaziou <mail@nicolasgoaziou.fr>
|
2018-04-28 17:24:31 +02:00
|
|
|
|
;;; Copyright © 2018 Oleg Pykhalov <go.wigust@gmail.com>
|
2018-06-14 01:13:02 +02:00
|
|
|
|
;;; Copyright © 2018 Clément Lassieur <clement@lassieur.org>
|
2021-01-13 04:26:17 +01:00
|
|
|
|
;;; Copyright © 2018, 2019, 2020, 2021 Maxim Cournoyer <maxim.cournoyer@gmail.com>
|
2018-10-21 23:45:52 +02:00
|
|
|
|
;;; Copyright © 2018 Luther Thompson <lutheroto@gmail.com>
|
2018-12-15 23:23:41 +01:00
|
|
|
|
;;; Copyright © 2018 Vagrant Cascadian <vagrant@debian.org>
|
2019-11-19 09:50:51 +01:00
|
|
|
|
;;; Copyright © 2019 Tanguy Le Carrour <tanguy@bioneland.org>
|
2020-04-13 07:47:38 +02:00
|
|
|
|
;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
|
2021-03-05 23:56:40 +01:00
|
|
|
|
;;; Copyright © 2020, 2021 Greg Hogan <code@greghogan.com>
|
2022-07-25 22:05:10 +02:00
|
|
|
|
;;; Copyright © 2022 Philip McGrath <philip@philipmcgrath.com>
|
2018-04-04 08:09:28 +02:00
|
|
|
|
;;;
|
2013-01-15 03:29:28 +01:00
|
|
|
|
;;; 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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2013-01-18 01:06:24 +01:00
|
|
|
|
(define-module (gnu packages python)
|
2016-08-05 19:21:17 +02:00
|
|
|
|
#:use-module ((guix licenses) #:prefix license:)
|
2013-04-06 00:28:39 +02:00
|
|
|
|
#:use-module (gnu packages)
|
2019-07-09 20:59:58 +02:00
|
|
|
|
#:use-module (gnu packages base)
|
2016-10-16 04:44:29 +02:00
|
|
|
|
#:use-module (gnu packages bash)
|
2020-05-22 16:02:26 +02:00
|
|
|
|
#:use-module (gnu packages certs)
|
|
|
|
|
#:use-module (gnu packages check)
|
2013-01-18 01:06:24 +01:00
|
|
|
|
#:use-module (gnu packages compression)
|
gnu: Move dbm databases to new module.
* gnu/packages/databases.scm (gdbm, bdb, bdb-5.3): Move from here...
* gnu/packages/dbm.scm: ...to this new module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/audio.scm,
gnu/packages/avahi.scm,
gnu/packages/backup.scm,
gnu/packages/cobol.scm,
gnu/packages/cyrus-sasl.scm,
gnu/packages/databases.scm,
gnu/packages/finance.scm,
gnu/packages/game-development.scm,
gnu/packages/gnome.scm,
gnu/packages/guile.scm,
gnu/packages/ibus.scm,
gnu/packages/kerberos.scm,
gnu/packages/linux.scm,
gnu/packages/mail.scm,
gnu/packages/man.scm,
gnu/packages/nvi.scm,
gnu/packages/openldap.scm,
gnu/packages/package-management.scm,
gnu/packages/php.scm,
gnu/packages/pulseaudio.scm,
gnu/packages/python.scm,
gnu/packages/rdf.scm,
gnu/packages/ruby.scm,
gnu/packages/sawfish.scm: Update module references.
2019-01-16 14:48:47 +01:00
|
|
|
|
#:use-module (gnu packages dbm)
|
2020-04-13 07:47:38 +02:00
|
|
|
|
#:use-module (gnu packages hurd)
|
2014-02-01 01:39:04 +01:00
|
|
|
|
#:use-module (gnu packages libffi)
|
2020-05-22 16:02:26 +02:00
|
|
|
|
#:use-module (gnu packages ncurses)
|
2014-02-01 01:39:04 +01:00
|
|
|
|
#:use-module (gnu packages pkg-config)
|
2020-05-22 16:02:26 +02:00
|
|
|
|
#:use-module (gnu packages python-xyz)
|
2015-02-13 21:02:47 +01:00
|
|
|
|
#:use-module (gnu packages readline)
|
2020-05-22 16:02:26 +02:00
|
|
|
|
#:use-module (gnu packages shells)
|
gnu: Move sqlite to separate module.
* gnu/packages/databases.scm (sqlite, sqlite-3.26.0, sqlite-with-fts5,
sqlite-with-column-metadata): Move variables from here...
* gnu/packages/sqlite.scm: ...to this new module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/apl.scm,
gnu/packages/bittorrent.scm,
gnu/packages/calendar.scm,
gnu/packages/code.scm,
gnu/packages/crypto.scm,
gnu/packages/databases.scm,
gnu/packages/dc.scm,
gnu/packages/disk.scm,
gnu/packages/ebook.scm,
gnu/packages/education.scm,
gnu/packages/emacs.scm,
gnu/packages/emulators.scm,
gnu/packages/file-systems.scm,
gnu/packages/freedesktop.scm,
gnu/packages/ftp.scm,
gnu/packages/games.scm,
gnu/packages/geo.scm,
gnu/packages/gnome.scm,
gnu/packages/gnunet.scm,
gnu/packages/gnupg.scm,
gnu/packages/gnuzilla.scm,
gnu/packages/gps.scm,
gnu/packages/guile.scm,
gnu/packages/ibus.scm,
gnu/packages/kerberos.scm,
gnu/packages/kodi.scm,
gnu/packages/lisp.scm,
gnu/packages/mail.scm,
gnu/packages/messaging.scm,
gnu/packages/mpd.scm,
gnu/packages/music.scm,
gnu/packages/networking.scm,
gnu/packages/nfs.scm,
gnu/packages/ocaml.scm,
gnu/packages/package-management.scm,
gnu/packages/pdf.scm,
gnu/packages/photo.scm,
gnu/packages/php.scm,
gnu/packages/python.scm,
gnu/packages/qt.scm,
gnu/packages/ruby.scm,
gnu/packages/scheme.scm,
gnu/packages/sync.scm,
gnu/packages/syndication.scm,
gnu/packages/version-control.scm,
gnu/packages/video.scm,
gnu/packages/web-browsers.scm,
gnu/packages/webkit.scm: Adjust module references.
2019-01-15 21:47:05 +01:00
|
|
|
|
#:use-module (gnu packages sqlite)
|
2015-10-07 21:31:45 +02:00
|
|
|
|
#:use-module (gnu packages tcl)
|
gnu: Separate Python core packages from the rest.
* gnu/packages/python.scm: Move hundreds of package definitions from here...
* gnu/packages/python-xyz.scm: ...to this new module.
* gnu/local.mk (GNU_SYSTEM_MODULES): Add it.
* gnu/packages/ada.scm,
gnu/packages/admin.scm,
gnu/packages/android.scm,
gnu/packages/audio.scm,
gnu/packages/backup.scm,
gnu/packages/benchmark.scm,
gnu/packages/bioinformatics.scm,
gnu/packages/bittorrent.scm,
gnu/packages/calendar.scm,
gnu/packages/check.scm,
gnu/packages/chemistry.scm,
gnu/packages/cluster.scm,
gnu/packages/compression.scm,
gnu/packages/connman.scm,
gnu/packages/crypto.scm,
gnu/packages/cups.scm,
gnu/packages/databases.scm,
gnu/packages/dav.scm,
gnu/packages/direct-connect.scm,
gnu/packages/disk.scm,
gnu/packages/django.scm,
gnu/packages/dlang.scm,
gnu/packages/docker.scm,
gnu/packages/ebook.scm,
gnu/packages/elf.scm,
gnu/packages/emacs.scm,
gnu/packages/emulators.scm,
gnu/packages/engineering.scm,
gnu/packages/enlightenment.scm,
gnu/packages/finance.scm,
gnu/packages/fltk.scm,
gnu/packages/fontutils.scm,
gnu/packages/freedesktop.scm,
gnu/packages/game-development.scm,
gnu/packages/games.scm,
gnu/packages/geo.scm,
gnu/packages/gl.scm,
gnu/packages/glib.scm,
gnu/packages/gnome.scm,
gnu/packages/gnupg.scm,
gnu/packages/gnuzilla.scm,
gnu/packages/graph.scm,
gnu/packages/graphics.scm,
gnu/packages/graphviz.scm,
gnu/packages/gtk.scm,
gnu/packages/ham-radio.scm,
gnu/packages/image-processing.scm,
gnu/packages/image-viewers.scm,
gnu/packages/image.scm,
gnu/packages/irc.scm,
gnu/packages/jrnl.scm,
gnu/packages/julia.scm,
gnu/packages/kde-frameworks.scm,
gnu/packages/key-mon.scm,
gnu/packages/libffi.scm,
gnu/packages/libreoffice.scm,
gnu/packages/libusb.scm,
gnu/packages/lirc.scm,
gnu/packages/logging.scm,
gnu/packages/machine-learning.scm,
gnu/packages/mail.scm,
gnu/packages/mate.scm,
gnu/packages/maths.scm,
gnu/packages/medical.scm,
gnu/packages/messaging.scm,
gnu/packages/monitoring.scm,
gnu/packages/mp3.scm,
gnu/packages/mpd.scm,
gnu/packages/music.scm,
gnu/packages/networking.scm,
gnu/packages/nutrition.scm,
gnu/packages/openldap.scm,
gnu/packages/openstack.scm,
gnu/packages/package-management.scm,
gnu/packages/password-utils.scm,
gnu/packages/patchutils.scm,
gnu/packages/pdf.scm,
gnu/packages/photo.scm,
gnu/packages/polkit.scm,
gnu/packages/protobuf.scm,
gnu/packages/python-crypto.scm,
gnu/packages/python-web.scm,
gnu/packages/qt.scm,
gnu/packages/rdf.scm,
gnu/packages/ruby.scm,
gnu/packages/search.scm,
gnu/packages/selinux.scm,
gnu/packages/serialization.scm,
gnu/packages/shells.scm,
gnu/packages/simulation.scm,
gnu/packages/ssh.scm,
gnu/packages/statistics.scm,
gnu/packages/storage.scm,
gnu/packages/sync.scm,
gnu/packages/terminals.scm,
gnu/packages/textutils.scm,
gnu/packages/time.scm,
gnu/packages/tls.scm,
gnu/packages/tor.scm,
gnu/packages/tryton.scm,
gnu/packages/version-control.scm,
gnu/packages/video.scm,
gnu/packages/virtualization.scm,
gnu/packages/vpn.scm,
gnu/packages/web-browsers.scm,
gnu/packages/web.scm,
gnu/packages/wicd.scm,
gnu/packages/xdisorg.scm,
gnu/packages/xorg.scm: Update module references.
2019-01-15 14:21:30 +01:00
|
|
|
|
#:use-module (gnu packages tls)
|
2019-03-23 15:31:09 +01:00
|
|
|
|
#:use-module (gnu packages xml)
|
2021-01-22 05:26:01 +01:00
|
|
|
|
#:use-module (guix gexp)
|
2013-01-15 03:29:28 +01:00
|
|
|
|
#:use-module (guix packages)
|
|
|
|
|
#:use-module (guix download)
|
2013-09-08 16:57:37 +02:00
|
|
|
|
#:use-module (guix utils)
|
2013-05-23 03:49:02 +02:00
|
|
|
|
#:use-module (guix build-system gnu)
|
2020-04-01 12:58:32 +02:00
|
|
|
|
#:use-module (guix build-system trivial)
|
|
|
|
|
#:use-module (srfi srfi-1)
|
2021-01-22 05:26:01 +01:00
|
|
|
|
#:use-module (srfi srfi-26)
|
|
|
|
|
|
|
|
|
|
#:export (customize-site
|
|
|
|
|
guix-pythonpath-search-path))
|
|
|
|
|
|
|
|
|
|
(define* (customize-site version)
|
|
|
|
|
"Generate a install-sitecustomize.py phase, using VERSION."
|
2021-07-14 13:12:56 +02:00
|
|
|
|
`(lambda* (#:key native-inputs inputs outputs #:allow-other-keys)
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(let* ((out (assoc-ref outputs "out"))
|
|
|
|
|
(site-packages (string-append
|
|
|
|
|
out "/lib/python"
|
|
|
|
|
,(version-major+minor version)
|
|
|
|
|
"/site-packages"))
|
2021-07-14 13:12:56 +02:00
|
|
|
|
(sitecustomize.py (assoc-ref (or native-inputs inputs)
|
|
|
|
|
"sitecustomize.py"))
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(dest (string-append site-packages "/sitecustomize.py")))
|
|
|
|
|
(mkdir-p site-packages)
|
|
|
|
|
(copy-file sitecustomize.py dest)
|
|
|
|
|
;; Set the correct permissions on the installed file, else the byte
|
|
|
|
|
;; compilation phase fails with a permission denied error.
|
|
|
|
|
(chmod dest #o644))))
|
|
|
|
|
|
|
|
|
|
(define (guix-pythonpath-search-path version)
|
|
|
|
|
"Generate a GUIX_PYTHONPATH search path specification, using VERSION."
|
|
|
|
|
(search-path-specification (variable "GUIX_PYTHONPATH")
|
|
|
|
|
(files (list (string-append
|
|
|
|
|
"lib/python"
|
|
|
|
|
(version-major+minor version)
|
|
|
|
|
"/site-packages")))))
|
2013-01-15 03:29:28 +01:00
|
|
|
|
|
2016-05-15 11:51:54 +02:00
|
|
|
|
(define-public python-2.7
|
2013-01-15 03:29:28 +01:00
|
|
|
|
(package
|
2018-03-16 21:58:08 +01:00
|
|
|
|
(name "python2")
|
2020-10-21 03:31:42 +02:00
|
|
|
|
(version "2.7.18")
|
2013-01-15 03:29:28 +01:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (string-append "https://www.python.org/ftp/python/"
|
|
|
|
|
version "/Python-" version ".tar.xz"))
|
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2020-10-21 03:31:42 +02:00
|
|
|
|
"0hzgxl94hnflis0d6m4szjx0b52gah7wpmcg5g00q7am6xwhwb5n"))
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(patches (search-patches "python-2.7-search-paths.patch"
|
|
|
|
|
"python-2-deterministic-build-info.patch"
|
|
|
|
|
"python-2.7-site-prefixes.patch"
|
|
|
|
|
"python-2.7-source-date-epoch.patch"
|
|
|
|
|
"python-2.7-adjust-tests.patch"
|
2021-05-09 21:29:46 +02:00
|
|
|
|
"python-cross-compile.patch"
|
2021-06-03 22:10:09 +02:00
|
|
|
|
"python-2.7-CVE-2021-3177.patch"
|
|
|
|
|
"python-2.7-no-static-lib.patch"))
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(modules '((guix build utils)))
|
|
|
|
|
(snippet
|
|
|
|
|
'(begin
|
|
|
|
|
;; Ensure the bundled copies of these libraries are not used.
|
|
|
|
|
(for-each delete-file-recursively
|
|
|
|
|
'("Modules/_ctypes/libffi" "Modules/expat" "Modules/zlib"))
|
2019-03-23 15:31:09 +01:00
|
|
|
|
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(substitute* "Modules/Setup.dist"
|
|
|
|
|
;; Link Expat instead of embedding the bundled one.
|
|
|
|
|
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
|
2019-03-23 15:31:09 +01:00
|
|
|
|
|
2020-10-21 03:25:20 +02:00
|
|
|
|
;; Suboptimal to delete failing tests here, but if we delete them in
|
|
|
|
|
;; the arguments then we need to make sure to strip out that phase
|
|
|
|
|
;; when it gets inherited by python and python-minimal.
|
|
|
|
|
(for-each delete-file
|
|
|
|
|
'("Lib/test/test_compileall.py"
|
|
|
|
|
"Lib/test/test_ctypes.py" ; fails on mips64el
|
|
|
|
|
"Lib/test/test_distutils.py"
|
|
|
|
|
"Lib/test/test_import.py"
|
|
|
|
|
"Lib/test/test_shutil.py"
|
|
|
|
|
"Lib/test/test_socket.py"
|
2021-07-15 13:34:24 +02:00
|
|
|
|
"Lib/test/test_subprocess.py"))))))
|
2015-11-15 22:27:45 +01:00
|
|
|
|
(outputs '("out"
|
2021-06-03 22:14:14 +02:00
|
|
|
|
"tk" ;tkinter; adds 50 MiB to the closure
|
|
|
|
|
"idle")) ;programming environment; weighs 5MB
|
2013-01-15 03:29:28 +01:00
|
|
|
|
(build-system gnu-build-system)
|
2013-04-06 00:28:39 +02:00
|
|
|
|
(arguments
|
2018-07-23 17:08:30 +02:00
|
|
|
|
`(#:test-target "test"
|
2013-04-06 00:28:39 +02:00
|
|
|
|
#:configure-flags
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(list "--enable-shared" ;allow embedding
|
|
|
|
|
"--with-system-expat" ;for XML support
|
|
|
|
|
"--with-system-ffi" ;build ctypes
|
|
|
|
|
"--with-ensurepip=install" ;install pip and setuptools
|
2021-03-18 23:41:40 +01:00
|
|
|
|
"--with-computed-gotos" ;main interpreter loop optimization
|
2017-01-23 00:31:59 +01:00
|
|
|
|
"--enable-unicode=ucs4"
|
2021-07-22 00:08:52 +02:00
|
|
|
|
|
|
|
|
|
;; FIXME: These flags makes Python significantly faster, but
|
|
|
|
|
;; leads to non-reproducible binaries.
|
|
|
|
|
;; "--with-lto" ;increase size by 20MB, but 15% speedup
|
|
|
|
|
;; "--enable-optimizations"
|
2019-07-07 16:51:26 +02:00
|
|
|
|
|
|
|
|
|
;; Prevent the installed _sysconfigdata.py from retaining a reference
|
|
|
|
|
;; to coreutils.
|
|
|
|
|
"INSTALL=install -c"
|
|
|
|
|
"MKDIR_P=mkdir -p"
|
|
|
|
|
|
2019-03-06 16:39:00 +01:00
|
|
|
|
;; Disable runtime check failing if cross-compiling, see:
|
|
|
|
|
;; https://lists.yoctoproject.org/pipermail/poky/2013-June/008997.html
|
|
|
|
|
,@(if (%current-target-system)
|
|
|
|
|
'("ac_cv_buggy_getaddrinfo=no"
|
|
|
|
|
"ac_cv_file__dev_ptmx=no"
|
|
|
|
|
"ac_cv_file__dev_ptc=no")
|
|
|
|
|
'())
|
2021-03-18 23:41:40 +01:00
|
|
|
|
;; -fno-semantic-interposition reinstates some optimizations by gcc
|
|
|
|
|
;; leading to around 15% speedup. This is the default starting from
|
|
|
|
|
;; python 3.10.
|
|
|
|
|
"CFLAGS=-fno-semantic-interposition"
|
2015-10-08 00:05:34 +02:00
|
|
|
|
(string-append "LDFLAGS=-Wl,-rpath="
|
2021-03-18 23:41:40 +01:00
|
|
|
|
(assoc-ref %outputs "out") "/lib"
|
|
|
|
|
" -fno-semantic-interposition"))
|
2018-11-02 03:18:41 +01:00
|
|
|
|
;; With no -j argument tests use all available cpus, so provide one.
|
|
|
|
|
#:make-flags
|
2019-04-18 05:39:39 +02:00
|
|
|
|
(list (string-append
|
|
|
|
|
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
|
|
|
|
;; Exclude the following tests as they fail
|
|
|
|
|
;; non-deterministically with "error: [Errno 104] Connection
|
|
|
|
|
;; reset by peer." Python 3 seems unaffected. A potential fix,
|
|
|
|
|
;; yet to be backported to Python 2, is available at:
|
|
|
|
|
;; https://github.com/python/cpython/commit/529525fb5a8fd9b96ab4021311a598c77588b918.
|
|
|
|
|
" --exclude test_urllib2_localnet test_httplib"))
|
2013-05-08 01:50:21 +02:00
|
|
|
|
|
2020-10-21 03:25:20 +02:00
|
|
|
|
#:modules ((ice-9 ftw) (ice-9 match)
|
|
|
|
|
(guix build utils) (guix build gnu-build-system))
|
|
|
|
|
#:phases
|
|
|
|
|
(modify-phases %standard-phases
|
|
|
|
|
(add-before
|
|
|
|
|
'configure 'patch-lib-shells
|
2015-07-15 19:31:51 +02:00
|
|
|
|
(lambda _
|
2019-06-29 17:31:07 +02:00
|
|
|
|
;; This variable is used in setup.py to enable cross compilation
|
|
|
|
|
;; specific switches. As it is not set properly by configure
|
|
|
|
|
;; script, set it manually.
|
|
|
|
|
,@(if (%current-target-system)
|
|
|
|
|
'((setenv "_PYTHON_HOST_PLATFORM" ""))
|
|
|
|
|
'())
|
2015-07-15 19:31:51 +02:00
|
|
|
|
;; Filter for existing files, since some may not exist in all
|
|
|
|
|
;; versions of python that are built with this recipe.
|
|
|
|
|
(substitute* (filter file-exists?
|
|
|
|
|
'("Lib/subprocess.py"
|
|
|
|
|
"Lib/popen2.py"
|
|
|
|
|
"Lib/distutils/tests/test_spawn.py"
|
2017-07-30 18:13:33 +02:00
|
|
|
|
"Lib/test/support/__init__.py"
|
2015-07-15 19:31:51 +02:00
|
|
|
|
"Lib/test/test_subprocess.py"))
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(("/bin/sh") (which "sh")))))
|
2020-10-21 03:25:20 +02:00
|
|
|
|
,@(if (hurd-system?)
|
|
|
|
|
`((add-before 'build 'patch-regen-for-hurd
|
|
|
|
|
(lambda* (#:key inputs #:allow-other-keys)
|
|
|
|
|
(let ((libc (assoc-ref inputs "libc")))
|
|
|
|
|
(substitute* "Lib/plat-generic/regen"
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(("/usr/include/") (string-append libc "/include/")))))))
|
2020-10-21 03:25:20 +02:00
|
|
|
|
'())
|
|
|
|
|
(add-before 'configure 'do-not-record-configure-flags
|
|
|
|
|
(lambda* (#:key configure-flags #:allow-other-keys)
|
|
|
|
|
;; Remove configure flags from the installed '_sysconfigdata.py'
|
|
|
|
|
;; and 'Makefile' so we don't end up keeping references to the
|
|
|
|
|
;; build tools.
|
|
|
|
|
;;
|
|
|
|
|
;; Preserve at least '--with-system-ffi' since otherwise the
|
|
|
|
|
;; thing tries to build libffi, fails, and we end up with a
|
|
|
|
|
;; Python that lacks ctypes.
|
|
|
|
|
(substitute* "configure"
|
|
|
|
|
(("^CONFIG_ARGS=.*$")
|
|
|
|
|
(format #f "CONFIG_ARGS='~a'\n"
|
|
|
|
|
(if (member "--with-system-ffi" configure-flags)
|
|
|
|
|
"--with-system-ffi"
|
2021-07-15 13:34:24 +02:00
|
|
|
|
""))))))
|
2020-10-21 03:32:05 +02:00
|
|
|
|
(add-before 'check 'pre-check
|
2015-07-15 19:31:51 +02:00
|
|
|
|
(lambda _
|
|
|
|
|
;; 'Lib/test/test_site.py' needs a valid $HOME
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(setenv "HOME" (getcwd))))
|
2020-10-21 03:32:05 +02:00
|
|
|
|
(add-after 'unpack 'set-source-file-times-to-1980
|
2015-07-15 19:31:51 +02:00
|
|
|
|
;; XXX One of the tests uses a ZIP library to pack up some of the
|
|
|
|
|
;; source tree, and fails with "ZIP does not support timestamps
|
|
|
|
|
;; before 1980". Work around this by setting the file times in the
|
|
|
|
|
;; source tree to sometime in early 1980.
|
|
|
|
|
(lambda _
|
|
|
|
|
(let ((circa-1980 (* 10 366 24 60 60)))
|
|
|
|
|
(ftw "." (lambda (file stat flag)
|
|
|
|
|
(utime file circa-1980 circa-1980)
|
2021-07-15 13:34:24 +02:00
|
|
|
|
#t)))))
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(add-after 'install 'remove-tests
|
|
|
|
|
;; Remove 25 MiB of unneeded unit tests. Keep test_support.*
|
|
|
|
|
;; because these files are used by some libraries out there.
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
(match (scandir (string-append out "/lib")
|
|
|
|
|
(lambda (name)
|
|
|
|
|
(string-prefix? "python" name)))
|
|
|
|
|
((pythonX.Y)
|
|
|
|
|
(let ((testdir (string-append out "/lib/" pythonX.Y
|
|
|
|
|
"/test")))
|
|
|
|
|
(with-directory-excursion testdir
|
|
|
|
|
(for-each delete-file-recursively
|
|
|
|
|
(scandir testdir
|
|
|
|
|
(match-lambda
|
|
|
|
|
((or "." "..") #f)
|
|
|
|
|
("support" #f)
|
|
|
|
|
(file
|
|
|
|
|
(not
|
|
|
|
|
(string-prefix? "test_support."
|
|
|
|
|
file))))))
|
2021-03-17 13:33:22 +01:00
|
|
|
|
(call-with-output-file "__init__.py" (const #t))))
|
|
|
|
|
(let ((libdir (string-append out "/lib/" pythonX.Y)))
|
|
|
|
|
(for-each
|
|
|
|
|
(lambda (directory)
|
|
|
|
|
(let ((dir (string-append libdir "/" directory)))
|
|
|
|
|
(when (file-exists? dir)
|
|
|
|
|
(delete-file-recursively dir))))
|
|
|
|
|
'("email/test" "ctypes/test" "unittest/test" "tkinter/test"
|
2021-08-20 18:29:23 +02:00
|
|
|
|
"sqlite3/test" "bsddb/test" "lib-tk/test" "json/tests"
|
|
|
|
|
"distutils/tests"))))))))
|
2021-07-22 00:33:31 +02:00
|
|
|
|
(add-after 'remove-tests 'move-tk-inter
|
2020-10-21 03:25:20 +02:00
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
;; When Tkinter support is built move it to a separate output so
|
|
|
|
|
;; that the main output doesn't contain a reference to Tcl/Tk.
|
|
|
|
|
(let ((out (assoc-ref outputs "out"))
|
|
|
|
|
(tk (assoc-ref outputs "tk")))
|
|
|
|
|
(when tk
|
|
|
|
|
(match (find-files out "tkinter.*\\.so")
|
|
|
|
|
((tkinter.so)
|
|
|
|
|
;; The .so is in OUT/lib/pythonX.Y/lib-dynload, but we
|
|
|
|
|
;; want it under TK/lib/pythonX.Y/site-packages.
|
|
|
|
|
(let* ((len (string-length out))
|
|
|
|
|
(target (string-append
|
|
|
|
|
tk "/"
|
|
|
|
|
(string-drop
|
|
|
|
|
(dirname (dirname tkinter.so))
|
|
|
|
|
len)
|
|
|
|
|
"/site-packages")))
|
|
|
|
|
(install-file tkinter.so target)
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(delete-file tkinter.so))))))))
|
2021-07-22 00:33:31 +02:00
|
|
|
|
(add-after 'move-tk-inter 'move-idle
|
2021-06-03 22:14:14 +02:00
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
;; when idle is built, move it to a separate output to save some
|
|
|
|
|
;; space (5MB)
|
|
|
|
|
(let ((out (assoc-ref outputs "out"))
|
|
|
|
|
(idle (assoc-ref outputs "idle")))
|
|
|
|
|
(when idle
|
|
|
|
|
(for-each
|
|
|
|
|
(lambda (file)
|
|
|
|
|
(let ((target (string-append idle "/bin/" (basename file))))
|
|
|
|
|
(install-file file (dirname target))
|
|
|
|
|
(delete-file file)))
|
|
|
|
|
(find-files (string-append out "/bin") "^idle"))
|
|
|
|
|
(match (find-files out "^idlelib$" #:directories? #t)
|
|
|
|
|
((idlelib)
|
|
|
|
|
(let* ((len (string-length out))
|
|
|
|
|
(target (string-append idle "/"
|
|
|
|
|
(string-drop idlelib len)
|
|
|
|
|
"/site-packages")))
|
|
|
|
|
(mkdir-p (dirname target))
|
|
|
|
|
(rename-file idlelib target))))))))
|
2021-07-22 00:33:31 +02:00
|
|
|
|
(add-after 'move-idle 'rebuild-bytecode
|
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
|
|
|
|
;; Disable hash randomization to ensure the generated .pycs
|
|
|
|
|
;; are reproducible.
|
|
|
|
|
(setenv "PYTHONHASHSEED" "0")
|
|
|
|
|
(for-each
|
|
|
|
|
(lambda (output)
|
|
|
|
|
(for-each (lambda (opt)
|
|
|
|
|
(format #t "Compiling with optimization level: ~a\n"
|
|
|
|
|
(if (null? opt) "none" (car opt)))
|
|
|
|
|
(apply invoke
|
|
|
|
|
`(,,(if (%current-target-system)
|
|
|
|
|
"python2"
|
|
|
|
|
'(string-append out "/bin/python"))
|
|
|
|
|
,@opt
|
|
|
|
|
"-m" "compileall"
|
|
|
|
|
"-f" ; force rebuild
|
|
|
|
|
;; Don't build lib2to3, because it contains
|
|
|
|
|
;; Python 3 code.
|
|
|
|
|
"-x" "lib2to3/.*"
|
|
|
|
|
,output)))
|
|
|
|
|
;; Python 2 has a single file extension (.pyo) for the
|
|
|
|
|
;; chosen level of optimization, so it doesn't make
|
|
|
|
|
;; sense to byte compile with more than one level.
|
|
|
|
|
(list '() '("-OO"))))
|
|
|
|
|
(map cdr outputs)))))
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(add-after 'install 'install-sitecustomize.py
|
|
|
|
|
,(customize-site version)))))
|
2013-01-15 03:29:28 +01:00
|
|
|
|
(inputs
|
2021-12-13 17:18:24 +01:00
|
|
|
|
(list bzip2
|
|
|
|
|
expat
|
|
|
|
|
gdbm
|
|
|
|
|
libffi ; for ctypes
|
|
|
|
|
sqlite ; for sqlite extension
|
2022-08-30 18:40:03 +02:00
|
|
|
|
openssl-1.1
|
2021-12-13 17:18:24 +01:00
|
|
|
|
readline
|
|
|
|
|
zlib
|
|
|
|
|
tcl
|
|
|
|
|
tk)) ; for tkinter
|
2014-02-01 01:39:04 +01:00
|
|
|
|
(native-inputs
|
2019-03-06 16:39:00 +01:00
|
|
|
|
`(("pkg-config" ,pkg-config)
|
2021-01-22 05:26:01 +01:00
|
|
|
|
("sitecustomize.py" ,(local-file (search-auxiliary-file
|
|
|
|
|
"python/sitecustomize.py")))
|
2019-03-06 16:39:00 +01:00
|
|
|
|
;; When cross-compiling, a native version of Python itself is needed.
|
|
|
|
|
,@(if (%current-target-system)
|
2019-06-29 17:31:07 +02:00
|
|
|
|
`(("python2" ,this-package)
|
2019-03-06 16:39:00 +01:00
|
|
|
|
("which" ,which))
|
|
|
|
|
'())))
|
2013-03-30 22:50:45 +01:00
|
|
|
|
(native-search-paths
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(list (guix-pythonpath-search-path version)))
|
2016-08-20 12:22:29 +02:00
|
|
|
|
(home-page "https://www.python.org")
|
2015-10-07 21:31:45 +02:00
|
|
|
|
(synopsis "High-level, dynamically-typed programming language")
|
2013-01-15 03:29:28 +01:00
|
|
|
|
(description
|
|
|
|
|
"Python is a remarkably powerful dynamic programming language that
|
|
|
|
|
is used in a wide variety of application domains. Some of its key
|
|
|
|
|
distinguishing features include: clear, readable syntax; strong
|
|
|
|
|
introspection capabilities; intuitive object orientation; natural
|
|
|
|
|
expression of procedural code; full modularity, supporting hierarchical
|
|
|
|
|
packages; exception-based error handling; and very high level dynamic
|
|
|
|
|
data types.")
|
2019-06-18 20:01:54 +02:00
|
|
|
|
(properties '((cpe-name . "python")))
|
2016-08-05 19:21:17 +02:00
|
|
|
|
(license license:psfl)))
|
2013-05-23 03:49:02 +02:00
|
|
|
|
|
2016-05-15 11:51:54 +02:00
|
|
|
|
;; Current 2.x version.
|
|
|
|
|
(define-public python-2 python-2.7)
|
|
|
|
|
|
2021-01-13 04:26:17 +01:00
|
|
|
|
(define-public python-3.9
|
2020-10-22 04:12:48 +02:00
|
|
|
|
(package
|
|
|
|
|
(inherit python-2)
|
2018-03-17 10:13:47 +01:00
|
|
|
|
(name "python")
|
2021-12-17 21:01:53 +01:00
|
|
|
|
(version "3.9.9")
|
2014-04-07 22:50:48 +02:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (string-append "https://www.python.org/ftp/python/"
|
|
|
|
|
version "/Python-" version ".tar.xz"))
|
2020-04-02 17:11:17 +02:00
|
|
|
|
(patches (search-patches
|
2020-10-22 04:27:30 +02:00
|
|
|
|
"python-3-arm-alignment.patch"
|
2020-04-02 17:11:17 +02:00
|
|
|
|
"python-3-deterministic-build-info.patch"
|
2021-01-13 04:26:17 +01:00
|
|
|
|
"python-3-fix-tests.patch"
|
|
|
|
|
"python-3-hurd-configure.patch"
|
2021-06-03 22:10:09 +02:00
|
|
|
|
"python-3-search-paths.patch"
|
|
|
|
|
"python-3-no-static-lib.patch"))
|
2014-04-07 22:50:48 +02:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-12-17 21:01:53 +01:00
|
|
|
|
"09vd7g71i11iz5ydqghwc8kaxr0vgji94hhwwnj77h3kll28r0h6"))
|
2019-03-23 15:31:09 +01:00
|
|
|
|
(modules '((guix build utils)))
|
2017-02-21 19:12:12 +01:00
|
|
|
|
(snippet
|
2017-06-13 09:24:57 +02:00
|
|
|
|
'(begin
|
2019-03-23 15:31:09 +01:00
|
|
|
|
;; Delete the bundled copy of libexpat.
|
|
|
|
|
(delete-file-recursively "Modules/expat")
|
2020-01-14 19:52:58 +01:00
|
|
|
|
(substitute* "Modules/Setup"
|
2019-03-23 15:31:09 +01:00
|
|
|
|
;; Link Expat instead of embedding the bundled one.
|
|
|
|
|
(("^#pyexpat.*") "pyexpat pyexpat.c -lexpat\n"))
|
2021-03-17 13:33:22 +01:00
|
|
|
|
;; Delete windows binaries
|
|
|
|
|
(for-each delete-file
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(find-files "Lib/distutils/command" "\\.exe$"))))))
|
2018-03-04 20:32:28 +01:00
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments python-2)
|
2019-04-18 05:39:39 +02:00
|
|
|
|
((#:make-flags _)
|
2019-05-04 05:46:29 +02:00
|
|
|
|
`(list (string-append
|
|
|
|
|
(format #f "TESTOPTS=-j~d" (parallel-job-count))
|
2021-01-13 04:26:17 +01:00
|
|
|
|
;; test_mmap fails on low-memory systems
|
|
|
|
|
" --exclude test_mmap test_socket"
|
2020-10-07 23:01:26 +02:00
|
|
|
|
,@(if (hurd-target?)
|
|
|
|
|
'(" test_posix" ;multiple errors
|
|
|
|
|
" test_time"
|
|
|
|
|
" test_pty"
|
|
|
|
|
" test_shutil"
|
|
|
|
|
" test_tempfile" ;chflags: invalid argument:
|
|
|
|
|
; tbv14c9t/dir0/dir0/dir0/test0.txt
|
|
|
|
|
" test_asyncio" ;runs over 10min
|
|
|
|
|
" test_os" ;stty: 'standard input':
|
|
|
|
|
; Inappropriate ioctl for device
|
|
|
|
|
" test_openpty" ;No such file or directory
|
|
|
|
|
" test_selectors" ;assertEqual(NUM_FDS // 2, len(fds))
|
|
|
|
|
; 32752 != 4
|
|
|
|
|
" test_compileall" ;multiple errors
|
|
|
|
|
" test_poll" ;list index out of range
|
|
|
|
|
" test_subprocess" ;runs over 10min
|
|
|
|
|
" test_asyncore" ;multiple errors
|
|
|
|
|
" test_threadsignals"
|
|
|
|
|
" test_eintr" ;Process return code is -14
|
|
|
|
|
" test_io" ;multiple errors
|
|
|
|
|
" test_logging"
|
|
|
|
|
" test_signal"
|
|
|
|
|
" test_threading" ;runs over 10min
|
|
|
|
|
" test_flags" ;ERROR
|
|
|
|
|
" test_bidirectional_pty"
|
|
|
|
|
" test_create_unix_connection"
|
|
|
|
|
" test_unix_sock_client_ops"
|
|
|
|
|
" test_open_unix_connection"
|
|
|
|
|
" test_open_unix_connection_error"
|
|
|
|
|
" test_read_pty_output"
|
|
|
|
|
" test_write_pty")
|
|
|
|
|
'()))))
|
2018-03-04 20:32:28 +01:00
|
|
|
|
((#:phases phases)
|
2020-10-22 04:12:48 +02:00
|
|
|
|
`(modify-phases ,phases
|
|
|
|
|
,@(if (hurd-system?)
|
|
|
|
|
`((delete 'patch-regen-for-hurd)) ;regen was removed after 3.5.9
|
|
|
|
|
'())
|
2021-03-17 13:33:22 +01:00
|
|
|
|
(add-after 'unpack 'remove-windows-binaries
|
|
|
|
|
(lambda _
|
|
|
|
|
;; Delete .exe from embedded .whl (zip) files
|
|
|
|
|
(for-each
|
|
|
|
|
(lambda (whl)
|
2021-07-21 23:54:10 +02:00
|
|
|
|
(let ((dir "whl-content")
|
|
|
|
|
(circa-1980 (* 10 366 24 60 60)))
|
2021-03-17 13:33:22 +01:00
|
|
|
|
(mkdir-p dir)
|
|
|
|
|
(with-directory-excursion dir
|
|
|
|
|
(let ((whl (string-append "../" whl)))
|
|
|
|
|
(invoke "unzip" whl)
|
|
|
|
|
(for-each delete-file
|
|
|
|
|
(find-files "." "\\.exe$"))
|
|
|
|
|
(delete-file whl)
|
2021-07-21 23:54:10 +02:00
|
|
|
|
;; Reset timestamps to prevent them from ending
|
|
|
|
|
;; up in the Zip archive.
|
|
|
|
|
(ftw "." (lambda (file stat flag)
|
|
|
|
|
(utime file circa-1980 circa-1980)
|
|
|
|
|
#t))
|
2021-03-17 13:33:22 +01:00
|
|
|
|
(apply invoke "zip" "-X" whl
|
2021-07-21 23:54:10 +02:00
|
|
|
|
(find-files "." #:directories? #t))))
|
2021-03-17 13:33:22 +01:00
|
|
|
|
(delete-file-recursively dir)))
|
|
|
|
|
(find-files "Lib/ensurepip" "\\.whl$"))))
|
2020-10-22 04:12:48 +02:00
|
|
|
|
(add-before 'check 'set-TZDIR
|
|
|
|
|
(lambda* (#:key inputs native-inputs #:allow-other-keys)
|
|
|
|
|
;; test_email requires the Olson time zone database.
|
|
|
|
|
(setenv "TZDIR"
|
|
|
|
|
(string-append (assoc-ref
|
|
|
|
|
(or native-inputs inputs) "tzdata")
|
2021-01-22 05:26:01 +01:00
|
|
|
|
"/share/zoneinfo"))))
|
2019-02-08 10:24:11 +01:00
|
|
|
|
(replace 'rebuild-bytecode
|
2018-03-04 20:32:28 +01:00
|
|
|
|
(lambda* (#:key outputs #:allow-other-keys)
|
|
|
|
|
(let ((out (assoc-ref outputs "out")))
|
2018-07-23 20:53:50 +02:00
|
|
|
|
;; Disable hash randomization to ensure the generated .pycs
|
|
|
|
|
;; are reproducible.
|
|
|
|
|
(setenv "PYTHONHASHSEED" "0")
|
2021-07-22 00:05:45 +02:00
|
|
|
|
|
2021-07-22 00:33:31 +02:00
|
|
|
|
(for-each (lambda (output)
|
|
|
|
|
;; XXX: Delete existing pycs generated by the build
|
|
|
|
|
;; system beforehand because the -f argument does
|
|
|
|
|
;; not necessarily overwrite all files, leading to
|
|
|
|
|
;; indeterministic results.
|
|
|
|
|
(for-each (lambda (pyc)
|
|
|
|
|
(delete-file pyc))
|
|
|
|
|
(find-files output "\\.pyc$"))
|
2021-07-22 00:05:45 +02:00
|
|
|
|
|
2021-07-22 00:33:31 +02:00
|
|
|
|
(apply invoke
|
|
|
|
|
`(,,(if (%current-target-system)
|
|
|
|
|
"python3"
|
|
|
|
|
'(string-append out
|
|
|
|
|
"/bin/python3"))
|
|
|
|
|
"-m" "compileall"
|
|
|
|
|
"-o" "0" "-o" "1" "-o" "2"
|
|
|
|
|
"-f" ; force rebuild
|
|
|
|
|
"--invalidation-mode=unchecked-hash"
|
|
|
|
|
;; Don't build lib2to3, because it's
|
|
|
|
|
;; Python 2 code.
|
|
|
|
|
"-x" "lib2to3/.*"
|
|
|
|
|
,output)))
|
|
|
|
|
(map cdr outputs)))))
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(replace 'install-sitecustomize.py
|
|
|
|
|
,(customize-site version))))))
|
2022-08-30 18:40:03 +02:00
|
|
|
|
(inputs
|
|
|
|
|
(modify-inputs (package-inputs python-2.7)
|
|
|
|
|
(replace "openssl" openssl)))
|
2019-07-09 20:59:58 +02:00
|
|
|
|
(native-inputs
|
|
|
|
|
`(("tzdata" ,tzdata-for-tests)
|
2021-03-17 13:33:22 +01:00
|
|
|
|
("unzip" ,unzip)
|
|
|
|
|
("zip" ,(@ (gnu packages compression) zip))
|
2019-06-29 17:31:07 +02:00
|
|
|
|
,@(if (%current-target-system)
|
|
|
|
|
`(("python3" ,this-package))
|
|
|
|
|
'())
|
2019-07-09 20:59:58 +02:00
|
|
|
|
,@(package-native-inputs python-2)))
|
2013-08-31 18:43:17 +02:00
|
|
|
|
(native-search-paths
|
2021-01-22 05:26:01 +01:00
|
|
|
|
(list (guix-pythonpath-search-path version)
|
2021-01-15 06:07:46 +01:00
|
|
|
|
;; Used to locate tzdata by the zoneinfo module introduced in
|
|
|
|
|
;; Python 3.9.
|
|
|
|
|
(search-path-specification
|
|
|
|
|
(variable "PYTHONTZPATH")
|
|
|
|
|
(files (list "share/zoneinfo")))))))
|
2013-08-31 14:52:24 +02:00
|
|
|
|
|
2016-05-15 11:51:54 +02:00
|
|
|
|
;; Current 3.x version.
|
2021-01-13 04:26:17 +01:00
|
|
|
|
(define-public python-3 python-3.9)
|
2016-05-15 11:51:54 +02:00
|
|
|
|
|
|
|
|
|
;; Current major version.
|
|
|
|
|
(define-public python python-3)
|
|
|
|
|
|
2015-10-07 21:27:36 +02:00
|
|
|
|
;; Minimal variants of Python, mostly used to break the cycle between Tk and
|
|
|
|
|
;; Python (Tk -> libxcb -> Python.)
|
|
|
|
|
|
|
|
|
|
(define-public python2-minimal
|
2018-10-06 18:50:47 +02:00
|
|
|
|
(package/inherit python-2
|
2018-03-16 21:58:31 +01:00
|
|
|
|
(name "python2-minimal")
|
2015-11-15 22:27:45 +01:00
|
|
|
|
(outputs '("out"))
|
2017-03-19 22:10:12 +01:00
|
|
|
|
|
|
|
|
|
;; Keep zlib, which is used by 'pip' (via the 'zipimport' module), which
|
|
|
|
|
;; is invoked upon 'make install'. 'pip' also expects 'ctypes' and thus
|
2019-03-23 15:31:09 +01:00
|
|
|
|
;; libffi. Expat is needed for XML support which is expected by a lot
|
|
|
|
|
;; of libraries out there.
|
|
|
|
|
(inputs `(("expat" ,expat)
|
|
|
|
|
("libffi" ,libffi)
|
2017-03-19 22:10:12 +01:00
|
|
|
|
("zlib" ,zlib)))))
|
2015-10-07 21:27:36 +02:00
|
|
|
|
|
|
|
|
|
(define-public python-minimal
|
2018-10-06 16:47:05 +02:00
|
|
|
|
(package/inherit python
|
2015-10-07 21:27:36 +02:00
|
|
|
|
(name "python-minimal")
|
2015-11-15 22:27:45 +01:00
|
|
|
|
(outputs '("out"))
|
2015-10-07 21:27:36 +02:00
|
|
|
|
|
2016-06-20 21:05:20 +02:00
|
|
|
|
;; Build fails due to missing ctypes without libffi.
|
2015-10-07 21:27:36 +02:00
|
|
|
|
;; OpenSSL is a mandatory dependency of Python 3.x, for urllib;
|
2019-03-23 15:31:09 +01:00
|
|
|
|
;; zlib is required by 'zipimport', used by pip. Expat is needed
|
|
|
|
|
;; for XML support, which is generally expected to be available.
|
|
|
|
|
(inputs `(("expat" ,expat)
|
|
|
|
|
("libffi" ,libffi)
|
2016-06-20 21:05:20 +02:00
|
|
|
|
("openssl" ,openssl)
|
2015-10-07 21:27:36 +02:00
|
|
|
|
("zlib" ,zlib)))))
|
|
|
|
|
|
2018-03-29 13:39:40 +02:00
|
|
|
|
(define-public python-debug
|
2018-10-06 16:47:05 +02:00
|
|
|
|
(package/inherit python
|
2018-03-29 13:39:40 +02:00
|
|
|
|
(name "python-debug")
|
|
|
|
|
(outputs '("out" "debug"))
|
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
|
(arguments
|
|
|
|
|
(substitute-keyword-arguments (package-arguments python)
|
|
|
|
|
((#:configure-flags flags '())
|
|
|
|
|
`(cons "--with-pydebug" ,flags))))
|
|
|
|
|
(synopsis
|
2022-06-27 00:09:38 +02:00
|
|
|
|
"Python with the debug hooks enabled")
|
2018-03-29 13:39:40 +02:00
|
|
|
|
(description
|
|
|
|
|
"This variant of Python provides an interpreter built with
|
|
|
|
|
@code{--with-pydebug} to help develop and debug extensions. See
|
|
|
|
|
@url{https://pythonextensionpatterns.readthedocs.io/en/latest/debugging/debug.html},
|
|
|
|
|
for more information.")))
|
|
|
|
|
|
2015-12-22 22:24:41 +01:00
|
|
|
|
(define* (wrap-python3 python
|
|
|
|
|
#:optional
|
|
|
|
|
(name (string-append (package-name python) "-wrapper")))
|
2018-10-06 16:47:05 +02:00
|
|
|
|
(package/inherit python
|
2015-10-07 21:27:36 +02:00
|
|
|
|
(name name)
|
2013-09-03 21:27:40 +02:00
|
|
|
|
(source #f)
|
|
|
|
|
(build-system trivial-build-system)
|
2015-11-15 22:27:45 +01:00
|
|
|
|
(outputs '("out"))
|
2016-10-16 04:44:29 +02:00
|
|
|
|
(inputs `(("bash" ,bash)))
|
2014-11-02 12:47:32 +01:00
|
|
|
|
(propagated-inputs `(("python" ,python)))
|
2013-09-03 21:27:40 +02:00
|
|
|
|
(arguments
|
|
|
|
|
`(#:modules ((guix build utils))
|
|
|
|
|
#:builder
|
|
|
|
|
(begin
|
|
|
|
|
(use-modules (guix build utils))
|
|
|
|
|
(let ((bin (string-append (assoc-ref %outputs "out") "/bin"))
|
|
|
|
|
(python (string-append (assoc-ref %build-inputs "python") "/bin/")))
|
|
|
|
|
(mkdir-p bin)
|
|
|
|
|
(for-each
|
|
|
|
|
(lambda (old new)
|
|
|
|
|
(symlink (string-append python old)
|
|
|
|
|
(string-append bin "/" new)))
|
2021-06-03 22:14:14 +02:00
|
|
|
|
`("python3" ,"pydoc3" ,"pip3")
|
|
|
|
|
`("python" ,"pydoc" ,"pip"))
|
2016-10-16 04:44:29 +02:00
|
|
|
|
;; python-config outputs search paths based upon its location,
|
|
|
|
|
;; use a bash wrapper to avoid changing its outputs.
|
|
|
|
|
(let ((bash (string-append (assoc-ref %build-inputs "bash")
|
|
|
|
|
"/bin/bash"))
|
|
|
|
|
(old (string-append python "python3-config"))
|
|
|
|
|
(new (string-append bin "/python-config")))
|
|
|
|
|
(with-output-to-file new
|
|
|
|
|
(lambda ()
|
|
|
|
|
(format #t "#!~a~%" bash)
|
|
|
|
|
(format #t "exec \"~a\" \"$@\"~%" old)
|
2021-07-15 13:34:24 +02:00
|
|
|
|
(chmod new #o755))))))))
|
2015-10-07 11:51:14 +02:00
|
|
|
|
(synopsis "Wrapper for the Python 3 commands")
|
|
|
|
|
(description
|
|
|
|
|
"This package provides wrappers for the commands of Python@tie{}3.x such
|
2022-07-25 22:05:10 +02:00
|
|
|
|
that they can also be invoked under their usual names---e.g., @command{python}
|
2020-09-14 10:27:32 +02:00
|
|
|
|
instead of @command{python3} or @command{pip} instead of @command{pip3}.
|
2022-07-25 22:05:10 +02:00
|
|
|
|
|
2020-09-14 10:27:32 +02:00
|
|
|
|
To function properly, this package should not be installed together with the
|
2022-07-25 22:05:10 +02:00
|
|
|
|
@code{python} package: this package uses the @code{python} package as a
|
|
|
|
|
propagated input, so installing this package already makes both the versioned
|
|
|
|
|
and the unversioned commands available.")))
|
2015-10-07 11:51:14 +02:00
|
|
|
|
|
2015-10-07 21:27:36 +02:00
|
|
|
|
(define-public python-wrapper (wrap-python3 python))
|
|
|
|
|
(define-public python-minimal-wrapper (wrap-python3 python-minimal))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
|
|
|
|
|
(define-public micropython
|
|
|
|
|
(package
|
|
|
|
|
(name "micropython")
|
2022-05-29 02:00:02 +02:00
|
|
|
|
(version "1.18")
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(source
|
|
|
|
|
(origin
|
|
|
|
|
(method url-fetch)
|
|
|
|
|
(uri (string-append "https://github.com/micropython/micropython/"
|
|
|
|
|
"releases/download/v" version
|
2021-03-12 23:54:57 +01:00
|
|
|
|
"/micropython-" version ".tar.xz"))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(sha256
|
2022-05-29 02:00:02 +02:00
|
|
|
|
(base32 "1d1yza02pwq3kh8531ryq9sjk7zjqh786nnw397cccfk5ss73z4n"))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(modules '((guix build utils)))
|
|
|
|
|
(snippet
|
|
|
|
|
'(begin
|
|
|
|
|
(delete-file-recursively "ports/cc3200/FreeRTOS")
|
|
|
|
|
(with-directory-excursion "lib"
|
|
|
|
|
;; TODO: Unbundle axtls and berkley-db-1.xx
|
|
|
|
|
(for-each delete-file-recursively
|
2022-05-29 02:00:02 +02:00
|
|
|
|
'("libffi" "lwip" "stm32lib" "nrfx")))))))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(build-system gnu-build-system)
|
|
|
|
|
(arguments
|
2022-05-29 02:00:00 +02:00
|
|
|
|
(list #:phases
|
|
|
|
|
#~(modify-phases %standard-phases
|
|
|
|
|
(add-before 'build 'build-mpy-cross
|
|
|
|
|
(lambda* (#:key make-flags #:allow-other-keys)
|
|
|
|
|
(with-directory-excursion "mpy-cross"
|
|
|
|
|
(apply invoke "make" make-flags))))
|
|
|
|
|
(add-after 'build-mpy-cross 'prepare-build
|
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "ports/unix")
|
|
|
|
|
;; see: https://github.com/micropython/micropython/pull/4246
|
|
|
|
|
(substitute* "Makefile"
|
|
|
|
|
(("-Os") "-Os -ffp-contract=off"))))
|
2022-05-29 02:00:00 +02:00
|
|
|
|
(add-before 'install-license-files 'chdir-back
|
2022-05-29 02:00:00 +02:00
|
|
|
|
;; We don't build in the root directory so the file isn't found.
|
2022-05-29 02:00:00 +02:00
|
|
|
|
(lambda _
|
|
|
|
|
(chdir "../..")))
|
2022-05-29 02:00:00 +02:00
|
|
|
|
(delete 'configure)) ; no configure
|
|
|
|
|
#:make-flags
|
|
|
|
|
#~(list (string-append "PREFIX=" #$output)
|
|
|
|
|
"V=1")
|
|
|
|
|
#:test-target "test"))
|
2022-05-29 02:00:01 +02:00
|
|
|
|
(native-inputs (list pkg-config python-wrapper))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(inputs
|
2021-12-13 17:18:24 +01:00
|
|
|
|
(list libffi))
|
2019-02-19 10:20:02 +01:00
|
|
|
|
(home-page "https://micropython.org/")
|
|
|
|
|
(synopsis "Python implementation for microcontrollers and constrained systems")
|
|
|
|
|
(description "MicroPython is a lean and efficient implementation of the
|
|
|
|
|
Python 3 programming language that includes a small subset of the Python
|
|
|
|
|
standard library and is optimised to run on microcontrollers and in constrained
|
|
|
|
|
environments. MicroPython is packed full of advanced features such as an
|
|
|
|
|
interactive prompt, arbitrary precision integers, closures, list comprehension,
|
|
|
|
|
generators, exception handling and more. Still it is compact enough to fit and
|
|
|
|
|
run within just 256k of code space and 16k of RAM. MicroPython aims to be as
|
|
|
|
|
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)))
|
2020-05-22 16:02:26 +02:00
|
|
|
|
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(define-public pypy
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(package
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(name "pypy")
|
2021-08-04 20:54:09 +02:00
|
|
|
|
(version "7.3.5")
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(source (origin
|
|
|
|
|
(method url-fetch)
|
2021-08-04 20:54:09 +02:00
|
|
|
|
(uri (string-append "https://downloads.python.org/pypy/"
|
|
|
|
|
"pypy3.7-v" version "-src.tar.bz2"))
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(sha256
|
|
|
|
|
(base32
|
2021-08-04 20:54:09 +02:00
|
|
|
|
"18lrdmpcczlbk3cfarkgwqdmilrybz56i1dafk8dkjlyk90gw86r"))))
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(build-system gnu-build-system)
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(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))))
|
2022-09-07 20:34:57 +02:00
|
|
|
|
(copy-recursively dist-dir #$output)))))))
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(native-inputs
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(list gzip
|
|
|
|
|
nss-certs ; For ssl tests
|
|
|
|
|
pkg-config
|
|
|
|
|
python-2
|
|
|
|
|
python2-pycparser
|
|
|
|
|
tar)) ; Required for package.py
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(inputs
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(list bzip2
|
|
|
|
|
expat
|
|
|
|
|
gdbm
|
|
|
|
|
glibc
|
|
|
|
|
libffi
|
2021-12-13 17:18:24 +01:00
|
|
|
|
ncurses
|
|
|
|
|
openssl
|
|
|
|
|
sqlite
|
|
|
|
|
tcl
|
|
|
|
|
tk
|
2022-05-06 05:41:25 +02:00
|
|
|
|
xz
|
|
|
|
|
zlib))
|
2020-05-22 16:02:26 +02:00
|
|
|
|
(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.")
|
2020-11-15 10:54:26 +01:00
|
|
|
|
(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/
|
2020-05-22 16:02:26 +02:00
|
|
|
|
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")))))
|
|
|
|
|
|
2022-05-06 05:41:25 +02:00
|
|
|
|
(define-public pypy3
|
|
|
|
|
(deprecated-package "pypy3" pypy))
|