From b24d1cfc85cba1024d7396f3ad625c5fc3cf926b Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Mon, 2 Sep 2013 21:48:50 +0200 Subject: gnu: python: Revert 77c7f8f4 and make Python 3 the default. * gnu/packages/python.scm (python-3): Rename this to... * gnu/packages/python.scm (python): ...this, rename this to... * gnu/packages/python.scm (python-2): ...this. --- gnu/packages/python.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 493068adde..0a3977aabb 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -31,7 +31,7 @@ #:use-module (guix build-system gnu) #:use-module (guix build-system python)) -(define-public python +(define-public python-2 (package (name "python") (version "2.7.5") @@ -151,8 +151,8 @@ packages; exception-based error handling; and very high level dynamic data types.") (license psfl))) -(define-public python-3 - (package (inherit python) +(define-public python + (package (inherit python-2) (version "3.3.2") (source (origin -- cgit v1.2.3 From 898238b9f5199aaebffa508f62a2a00854370048 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 3 Sep 2013 21:27:40 +0200 Subject: gnu: python: Add package python-wrapper. * gnu/packages/python.scm (python-wrapper): New variable. --- gnu/packages/python.scm | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 0a3977aabb..33082a6d94 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -29,7 +29,8 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix build-system gnu) - #:use-module (guix build-system python)) + #:use-module (guix build-system python) + #:use-module (guix build-system trivial)) (define-public python-2 (package @@ -167,6 +168,31 @@ data types.") (variable "PYTHONPATH") (directories '("lib/python3.3/site-packages"))))))) +(define-public python-wrapper + (package (inherit python) + (name "python-wrapper") + (source #f) + (build-system trivial-build-system) + (inputs `(("python" ,python))) + (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))) + `("python3", "pydoc3", "idle3") + `("python", "pydoc", "idle")))))) + (description (string-append (package-description python) + "\n\nThis wrapper package provides symbolic links to the python binaries + without version suffix.")))) + + (define-public pytz (package (name "pytz") -- cgit v1.2.3 From ee3e314bb7ba376c7e8c95c3da1f64ba07d57847 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 3 Sep 2013 22:18:39 +0200 Subject: gnu: python: Replace input python by python-wrapper. * gnu/packages/{gdb.scm (gdb), cryptsetup.scm (cryptsetup), ghostscript.scm (ghostscript), glib.scm (glib), gnupg.scm (pius), gtk.scm (cairo, harfbuzz), libevent.scm (libevent), netpbm.scm (netpbm), oggvorbis.scm (libkate), qemu.scm (qemu), samba.scm (samba), texlive.scm (rubber, texlive), version-control.scm (subversion), xml.scm (libxml2, libxslt), xorg.scm (libxcb, mesa, xcb-proto, xorg-server), yasm.scm (yasm), zip.scm (zziplib)}: Replace input python by python-wrapper. --- gnu/packages/cryptsetup.scm | 2 +- gnu/packages/gdb.scm | 2 +- gnu/packages/ghostscript.scm | 2 +- gnu/packages/glib.scm | 2 +- gnu/packages/gnupg.scm | 2 +- gnu/packages/gtk.scm | 4 ++-- gnu/packages/libevent.scm | 2 +- gnu/packages/netpbm.scm | 2 +- gnu/packages/oggvorbis.scm | 2 +- gnu/packages/qemu.scm | 2 +- gnu/packages/samba.scm | 2 +- gnu/packages/texlive.scm | 4 ++-- gnu/packages/version-control.scm | 2 +- gnu/packages/xml.scm | 4 ++-- gnu/packages/xorg.scm | 8 ++++---- gnu/packages/yasm.scm | 2 +- gnu/packages/zip.scm | 2 +- 17 files changed, 23 insertions(+), 23 deletions(-) diff --git a/gnu/packages/cryptsetup.scm b/gnu/packages/cryptsetup.scm index c746e28721..8645e9e04a 100644 --- a/gnu/packages/cryptsetup.scm +++ b/gnu/packages/cryptsetup.scm @@ -45,7 +45,7 @@ `(("libgcrypt" ,libgcrypt) ("lvm2" ,lvm2) ("popt" ,popt) - ("python" ,python) + ("python" ,python-wrapper) ("util-linux" ,util-linux))) (synopsis "hard disk encryption tool") (description diff --git a/gnu/packages/gdb.scm b/gnu/packages/gdb.scm index 4cf6b90cc3..5190283895 100644 --- a/gnu/packages/gdb.scm +++ b/gnu/packages/gdb.scm @@ -53,7 +53,7 @@ ("gmp" ,gmp) ("readline" ,readline) ("ncurses" ,ncurses) - ("python" ,python) + ("python" ,python-wrapper) ("texinfo" ,texinfo) ("dejagnu" ,dejagnu))) (home-page "http://www.gnu.org/software/gdb/") diff --git a/gnu/packages/ghostscript.scm b/gnu/packages/ghostscript.scm index dd6c576cdf..7df1f6c17e 100644 --- a/gnu/packages/ghostscript.scm +++ b/gnu/packages/ghostscript.scm @@ -136,7 +136,7 @@ printing, and psresize, for adjusting page sizes.") ("libtiff" ,libtiff) ("perl" ,perl) ("pkg-config" ,pkg-config) ; needed to find libtiff - ("python" ,python) + ("python" ,python-wrapper) ("tcl" ,tcl) ("zlib" ,zlib))) (arguments diff --git a/gnu/packages/glib.scm b/gnu/packages/glib.scm index 63751bb510..72479f21e7 100644 --- a/gnu/packages/glib.scm +++ b/gnu/packages/glib.scm @@ -92,7 +92,7 @@ shared NFS home directories.") ("gettext" ,guix:gettext) ("libffi" ,libffi) ("pkg-config" ,pkg-config) - ("python" ,python) + ("python" ,python-wrapper) ("zlib" ,zlib) ("perl" ,perl) ; needed by GIO tests ("dbus" ,dbus) ; for GDBus tests diff --git a/gnu/packages/gnupg.scm b/gnu/packages/gnupg.scm index 604ebc2941..7c0f50900a 100644 --- a/gnu/packages/gnupg.scm +++ b/gnu/packages/gnupg.scm @@ -191,7 +191,7 @@ S/MIME.") "1g1jly3wl4ks6h8ydkygyl2c4i7v3z91rg42005m6vm70y1d8b3d")))) (build-system gnu-build-system) (inputs `(("perl" ,perl) - ("python" ,python) + ("python" ,python-wrapper) ("gpg" ,gnupg))) (arguments `(#:tests? #f diff --git a/gnu/packages/gtk.scm b/gnu/packages/gtk.scm index 742cbf172e..e72f7c5acc 100644 --- a/gnu/packages/gtk.scm +++ b/gnu/packages/gtk.scm @@ -83,7 +83,7 @@ tools have full access to view and control running applications.") ("libspectre" ,libspectre) ("pkg-config" ,pkg-config) ("poppler" ,poppler) - ("python" ,python) + ("python" ,python-wrapper) ("xextproto" ,xextproto) ("zlib" ,zlib))) (arguments @@ -123,7 +123,7 @@ affine transformation (scale, rotation, shear, etc.)") `(("cairo" ,cairo) ("icu4c" ,icu4c) ("pkg-config" ,pkg-config) - ("python" ,python))) + ("python" ,python-wrapper))) (synopsis "opentype text shaping engine") (description "HarfBuzz is an OpenType text shaping engine.") diff --git a/gnu/packages/libevent.scm b/gnu/packages/libevent.scm index ccca427fc4..8f2d5dad46 100644 --- a/gnu/packages/libevent.scm +++ b/gnu/packages/libevent.scm @@ -44,7 +44,7 @@ ;; Dependencies used for the tests and for `event_rpcgen.py'. ("which" ,which) - ("python" ,python))) + ("python" ,python-wrapper))) (arguments '(#:patches (list (assoc-ref %build-inputs "patch/dns-tests")))) (home-page "http://libevent.org/") diff --git a/gnu/packages/netpbm.scm b/gnu/packages/netpbm.scm index d2213b8f0d..c8d3603701 100644 --- a/gnu/packages/netpbm.scm +++ b/gnu/packages/netpbm.scm @@ -57,7 +57,7 @@ ("libxml2" ,libxml2) ("perl" ,perl) ("pkg-config" ,pkg-config) - ("python" ,python) + ("python" ,python-wrapper) ("zlib" ,zlib))) (arguments `(#:phases diff --git a/gnu/packages/oggvorbis.scm b/gnu/packages/oggvorbis.scm index 2aa606ca22..589828be0a 100644 --- a/gnu/packages/oggvorbis.scm +++ b/gnu/packages/oggvorbis.scm @@ -191,7 +191,7 @@ meaning that audio is compressed in FLAC without any loss in quality.") ("libogg" ,libogg) ("libpng" ,libpng) ("pkg-config" ,pkg-config) - ("python" ,python) + ("python" ,python-wrapper) ("zlib" ,zlib))) (synopsis "kate, a karaoke and text codec for embedding in ogg") (description diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index 9c9355c4d6..2ca34ad9c7 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm @@ -94,7 +94,7 @@ `(;; ("mesa" ,mesa) ;; ("libaio" ,libaio) ("glib" ,glib) - ("python" ,python) + ("python" ,python-wrapper) ("ncurses" ,ncurses) ("libpng" ,libpng) ("libjpeg" ,libjpeg-8) diff --git a/gnu/packages/samba.scm b/gnu/packages/samba.scm index b016442908..e0199bce90 100644 --- a/gnu/packages/samba.scm +++ b/gnu/packages/samba.scm @@ -150,7 +150,7 @@ anywhere.") ("patchelf" ,patchelf))) ; for (guix build rpath) (native-inputs ; for the test suite `(("perl" ,perl) - ("python" ,python))) + ("python" ,python-wrapper))) (home-page "http://www.samba.org/") (synopsis "The standard Windows interoperability suite of programs for GNU and Unix") diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index a0d57444e3..0240def785 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -81,7 +81,7 @@ ("pkg-config" ,pkg-config) ;; FIXME: Add interpreters fontforge and ruby, ;; once they are available. - ("python" ,python) + ("python" ,python-wrapper) ("tcsh" ,tcsh) ("teckit" ,teckit) ("t1lib" ,t1lib) @@ -202,7 +202,7 @@ world.") (build-system gnu-build-system) (arguments '(#:tests? #f)) ; no `check' target (inputs `(("texinfo" ,texinfo) - ("python" ,python) + ("python" ,python-wrapper) ("which" ,which))) (home-page "https://launchpad.net/rubber") (synopsis "Rubber, a wrapper for LaTeX and friends") diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 14404f0bfe..ed64b460db 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -126,7 +126,7 @@ everything from small to very large projects with speed and efficiency.") `(("apr" ,apr) ("apr-util" ,apr-util) ("perl" ,perl) - ("python" ,python) + ("python" ,python-wrapper) ("sqlite" ,sqlite) ("zlib" ,zlib))) (home-page "http://subversion.apache.org/") diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 2f9d64b81a..5b031ac512 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -66,7 +66,7 @@ things the parser might find in the XML document (like start tags).") (home-page "http://www.xmlsoft.org/") (synopsis "libxml2, a C parser for XML") (inputs `(("perl" ,perl) - ("python" ,python) + ("python" ,python-wrapper) ("zlib" ,zlib))) (arguments `(#:phases @@ -102,7 +102,7 @@ things the parser might find in the XML document (like start tags).") (synopsis "libxslt, a C library for applying XSLT stylesheets to XML documents") (inputs `(("libgcrypt" ,libgcrypt) ("libxml2" ,libxml2) - ("python" ,python) + ("python" ,python-wrapper) ("zlib" ,zlib))) (description "Libxslt is an XSLT C library developed for the GNOME project. It is diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index 5f07401e98..bc9e05fdb5 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -1857,7 +1857,7 @@ tracking.") "0ds4qg6slidrzyz6q9ckq0a19hn6blzpnvciy4brh741gn49jpdd")))) (build-system gnu-build-system) (inputs - `(("pkg-config" ,pkg-config) ("python" ,python))) + `(("pkg-config" ,pkg-config) ("python" ,python-wrapper))) (home-page "http://www.x.org/wiki/") (synopsis "xorg implementation of the X Window System") (description "X.org provides an implementation of the X Window System") @@ -4169,7 +4169,7 @@ tracking.") ("libxml2" ,libxml2) ("makedepend" ,makedepend) ("pkg-config" ,pkg-config) - ("python" ,python))) + ("python" ,python-wrapper))) (arguments `(#:configure-flags `("--with-gallium-drivers=r600,svga,swrast") ; drop r300 from the default list as it requires llvm @@ -4215,7 +4215,7 @@ emulation to complete hardware acceleration for modern GPUs.") `(("xcb-proto" ,xcb-proto) ("libxslt" ,libxslt) ("pkg-config" ,pkg-config) - ("python" ,python))) + ("python" ,python-wrapper))) (home-page "http://www.x.org/wiki/") (synopsis "xorg implementation of the X Window System") (description "X.org provides an implementation of the X Window System") @@ -4270,7 +4270,7 @@ emulation to complete hardware acceleration for modern GPUs.") ("mesa" ,mesa) ("openssl" ,openssl) ("pkg-config" ,pkg-config) - ("python" ,python) + ("python" ,python-wrapper) ("recordproto" ,recordproto) ("resourceproto" ,resourceproto) ("scrnsaverproto" ,scrnsaverproto) diff --git a/gnu/packages/yasm.scm b/gnu/packages/yasm.scm index 51cd3ed0a5..a990d08174 100644 --- a/gnu/packages/yasm.scm +++ b/gnu/packages/yasm.scm @@ -40,7 +40,7 @@ "0cfg7ji3ia2in628w42wrfvw2ixmmm4rghwmv2k202mraysgm3vn")))) (build-system gnu-build-system) (inputs - `(("python" ,python) + `(("python" ,python-wrapper) ("xmlto" ,xmlto))) (home-page "http://yasm.tortall.net/") (synopsis "Rewrite of the NASM assembler") diff --git a/gnu/packages/zip.scm b/gnu/packages/zip.scm index 934acdc316..c419b08e9f 100644 --- a/gnu/packages/zip.scm +++ b/gnu/packages/zip.scm @@ -120,7 +120,7 @@ UnZip recreates the stored directory structure by default.") (build-system gnu-build-system) (inputs `(("perl" ,perl) ; for the documentation ("pkg-config" ,pkg-config) - ("python" ,python) ; for the documentation + ("python" ,python-wrapper) ; for the documentation ("zip" ,zip) ; to create test files ("zlib" ,zlib))) (arguments -- cgit v1.2.3 From 3df47231e6c632aadcd7b103bb5b399a8d29772d Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 18:04:15 +0200 Subject: guix: python: Switch to python-wrapper as the default version for the python build system (switches to Python 3) and compute python-version instead of passing it as a parameter. * guix/build-system/python.scm (default-python): Switch to python-wrapper. * guix/build-system/python.scm (python-build): Drop parameter #:python-version. * guix/build/python-build-system.scm (wrap): Compute python version from input. --- guix/build-system/python.scm | 6 ++---- guix/build/python-build-system.scm | 4 +++- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index b60adb182f..7ac93b296b 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -39,13 +39,11 @@ "Return the default Python package." ;; Lazily resolve the binding to avoid a circular dependency. (let ((python (resolve-interface '(gnu packages python)))) - (module-ref python 'python))) + (module-ref python 'python-wrapper))) (define* (python-build store name source inputs #:key (python (default-python)) - (python-version - (string-take (package-version (default-python)) 3)) (tests? #t) (configure-flags ''()) (phases '(@ (guix build python-build-system) @@ -62,6 +60,7 @@ (guix build utils)))) "Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE provides a 'setup.py' file as its build system." + (define python-search-paths (append (package-native-search-paths python) (standard-search-paths))) @@ -78,7 +77,6 @@ provides a 'setup.py' file as its build system." #:test-target "test" #:tests? ,tests? #:outputs %outputs - #:python-version ,python-version #:search-paths ',(map search-path-specification->sexp (append python-search-paths search-paths)) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 84299798b0..04c223bb85 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -53,7 +53,7 @@ (zero? (apply system* "python" args))) (error "no setup.py found"))) -(define* (wrap #:key outputs python-version #:allow-other-keys) +(define* (wrap #:key inputs outputs #:allow-other-keys) (define (list-of-files dir) (map (cut string-append dir "/" <>) (or (scandir dir (lambda (f) @@ -69,6 +69,8 @@ outputs)) (let* ((out (assoc-ref outputs "out")) + (python (assoc-ref inputs "python")) + (python-version (string-take (string-take-right python 5) 3)) (var `("PYTHONPATH" prefix ,(cons (string-append out "/lib/python" python-version "/site-packages") -- cgit v1.2.3 From 1611eccd106fa14e0161b7c562f3a09931ed97e1 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 18:35:49 +0200 Subject: gnu: bazaar: Switch back to Python 2. * gnu/packages/version-control.scm (bazaar): Switch back to Python 2. --- gnu/packages/version-control.scm | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index ed64b460db..1b0e1bd6e0 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -58,7 +58,9 @@ ;; require Zsh. `(("gettext" ,guix:gettext))) (arguments - `(#:tests? #f)) ; no test target + `(#:tests? #f ; no test target + #:python ,python-2)) ; Python 3 apparently not yet supported, see + ; https://answers.launchpad.net/bzr/+question/229048 (home-page "https://gnu.org/software/bazaar") (synopsis "Decentralized revision control system") (description -- cgit v1.2.3 From 91da9ab009d11fac66814c14a202ec7c43de590e Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 18:40:54 +0200 Subject: gnu: zziplib: Switch back to Python 2. * gnu/packages/zip.scm (zziplib): Switch back to Python 2. --- gnu/packages/zip.scm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gnu/packages/zip.scm b/gnu/packages/zip.scm index c419b08e9f..f505d053c6 100644 --- a/gnu/packages/zip.scm +++ b/gnu/packages/zip.scm @@ -120,7 +120,8 @@ UnZip recreates the stored directory structure by default.") (build-system gnu-build-system) (inputs `(("perl" ,perl) ; for the documentation ("pkg-config" ,pkg-config) - ("python" ,python-wrapper) ; for the documentation + ("python" ,python-2) ; for the documentation; Python 3 not supported, + ; http://forums.gentoo.org/viewtopic-t-863161-start-0.html ("zip" ,zip) ; to create test files ("zlib" ,zlib))) (arguments -- cgit v1.2.3 From f82cfaac716f2ffc15f56338b98b99d42fb0ef86 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 18:54:53 +0200 Subject: gnu: libxml2: Switch back to Python 2. * gnu/packages/xml.scm (libxml2): Switch back to Python 2. --- gnu/packages/xml.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 5b031ac512..28c99b1f8c 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -66,7 +66,7 @@ things the parser might find in the XML document (like start tags).") (home-page "http://www.xmlsoft.org/") (synopsis "libxml2, a C parser for XML") (inputs `(("perl" ,perl) - ("python" ,python-wrapper) + ("python" ,python-2) ; incompatible with Python 3 (print syntax) ("zlib" ,zlib))) (arguments `(#:phases -- cgit v1.2.3 From 98e4829c4bda0b0a3bffad6ac6da8307f58ea5f9 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 19:03:14 +0200 Subject: gnu: mesa: Switch back to Python 2. * gnu/packages/xorg.scm (mesa): Switch back to Python 2. --- gnu/packages/xorg.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/xorg.scm b/gnu/packages/xorg.scm index bc9e05fdb5..b7ce8ad8aa 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -4169,7 +4169,7 @@ tracking.") ("libxml2" ,libxml2) ("makedepend" ,makedepend) ("pkg-config" ,pkg-config) - ("python" ,python-wrapper))) + ("python" ,python-2))) ; incompatible with Python 3 (print syntax) (arguments `(#:configure-flags `("--with-gallium-drivers=r600,svga,swrast") ; drop r300 from the default list as it requires llvm -- cgit v1.2.3 From 9bee5d6c18de87493ed4596de8410bbb66360343 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 19:06:51 +0200 Subject: gnu: rubber: Switch back to Python 2. * gnu/packages/texlive.scm (rubber): Switch back to Python 2. --- gnu/packages/texlive.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index 0240def785..223d8e9e4d 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -202,7 +202,7 @@ world.") (build-system gnu-build-system) (arguments '(#:tests? #f)) ; no `check' target (inputs `(("texinfo" ,texinfo) - ("python" ,python-wrapper) + ("python" ,python-2) ; incompatible with Python 3 (print syntax) ("which" ,which))) (home-page "https://launchpad.net/rubber") (synopsis "Rubber, a wrapper for LaTeX and friends") -- cgit v1.2.3 From 78fed0648fe5e1db0ee302fc548755422c80359b Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 19:09:39 +0200 Subject: gnu: texlive: Switch back to Python 2. * gnu/packages/texlive.scm (texlive): Switch back to Python 2. --- gnu/packages/texlive.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/texlive.scm b/gnu/packages/texlive.scm index 223d8e9e4d..7c6f82b9c9 100644 --- a/gnu/packages/texlive.scm +++ b/gnu/packages/texlive.scm @@ -81,7 +81,7 @@ ("pkg-config" ,pkg-config) ;; FIXME: Add interpreters fontforge and ruby, ;; once they are available. - ("python" ,python-wrapper) + ("python" ,python-2) ; incompatible with Python 3 (print syntax) ("tcsh" ,tcsh) ("teckit" ,teckit) ("t1lib" ,t1lib) -- cgit v1.2.3 From 66ed0c314646c66d5f9ec586a8e5a1d079a927b0 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 19:13:41 +0200 Subject: gnu: qemu: Switch back to Python 2. * gnu/packages/qemu.scm (qemu): Switch back to Python 2. --- gnu/packages/qemu.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/qemu.scm b/gnu/packages/qemu.scm index 2ca34ad9c7..6330fabcf9 100644 --- a/gnu/packages/qemu.scm +++ b/gnu/packages/qemu.scm @@ -94,7 +94,7 @@ `(;; ("mesa" ,mesa) ;; ("libaio" ,libaio) ("glib" ,glib) - ("python" ,python-wrapper) + ("python" ,python-2) ; incompatible with Python 3 according to error message ("ncurses" ,ncurses) ("libpng" ,libpng) ("libjpeg" ,libjpeg-8) -- cgit v1.2.3 From aa9e22efa38a88c2370591a3656b23f52d3bab64 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 19:17:19 +0200 Subject: gnu: subversion: Switch back to Python 2. * gnu/packages/version-control.scm (subversion): Switch back to Python 2. --- gnu/packages/version-control.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 1b0e1bd6e0..0ed6ce297a 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -128,7 +128,7 @@ everything from small to very large projects with speed and efficiency.") `(("apr" ,apr) ("apr-util" ,apr-util) ("perl" ,perl) - ("python" ,python-wrapper) + ("python" ,python-2) ; incompatible with Python 3 (print syntax) ("sqlite" ,sqlite) ("zlib" ,zlib))) (home-page "http://subversion.apache.org/") -- cgit v1.2.3 From 89114f39e4be7ac655fbdd7f00a5f985c8f4ce6b Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 4 Sep 2013 22:12:33 +0200 Subject: gnu: python: Implement the python naming scheme for pytz and babel. * gnu/packages/python.scm (pytz): Rename this ... * gnu/packages/python.scm (python-pytz): ... to this * gnu/packages/python.scm (python2-pytz): New variable, input python-2. * gnu/packages/python.scm (babel): Rename this ... * gnu/packages/python.scm (python-babel): ... to this * gnu/packages/python.scm (python2-babel): New variable, input python-2. --- gnu/packages/python.scm | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 33082a6d94..a4007d963b 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -193,9 +193,9 @@ data types.") without version suffix.")))) -(define-public pytz +(define-public python-pytz (package - (name "pytz") + (name "python-pytz") (version "2013b") (source (origin @@ -213,9 +213,14 @@ data types.") using Python 2.4 or higher and provides access to the Olson timezone database.") (license x11))) -(define-public babel +(define-public python2-pytz + (package (inherit python-pytz) + (name "python2-pytz") + (arguments `(#:python ,python-2)))) + +(define-public python-babel (package - (name "babel") + (name "python-babel") (version "0.9.6") (source (origin @@ -227,7 +232,7 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") "03vmr54jq5vf3qw6kpdv7cdk7x7i2jhzyf1mawv2gk8zrxg0hfja")))) (build-system python-build-system) (inputs - `(("pytz" ,pytz))) + `(("python-pytz" ,python-pytz))) (home-page "http://babel.edgewall.org/") (synopsis "Tools for internationalizing Python applications") @@ -238,3 +243,10 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") access to various locale display names, localized number and date formatting, etc. ") (license bsd-3))) + +(define-public python2-babel + (package (inherit python-babel) + (name "python2-babel") + (inputs + `(("python2-pytz" ,python2-pytz))) + (arguments `(#:python ,python-2)))) -- cgit v1.2.3 From d1f30e9943bf59fa0eefe40bb9aea64df2e7a594 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 5 Sep 2013 18:13:23 +0200 Subject: gnu: git: Switch back to Python 2. * gnu/packages/version-control.scm (git): Switch back to Python 2. --- gnu/packages/version-control.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gnu/packages/version-control.scm b/gnu/packages/version-control.scm index 0ed6ce297a..42b5d5fe99 100644 --- a/gnu/packages/version-control.scm +++ b/gnu/packages/version-control.scm @@ -88,7 +88,7 @@ from a command line or use a GUI application.") ("gettext" ,guix:gettext) ("openssl" ,openssl) ("perl" ,perl) - ("python" ,python) ; CAVEAT: incompatible with python-3 according to INSTALL + ("python" ,python-2) ; CAVEAT: incompatible with python-3 according to INSTALL ("zlib" ,zlib))) (arguments `(#:make-flags `("V=1") ; more verbose compilation -- cgit v1.2.3 From 7b96bf82daf25699ce6b4f4cb2ced1e5318b576f Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 5 Sep 2013 18:43:18 +0200 Subject: gnu: python: Honour #:tests? and #:test-target in build system. * guix/build/python-build-system.scm (check): Use named parameters tests? and test-target (default now: "test" instead of "check"). --- guix/build/python-build-system.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 04c223bb85..27818526fa 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; ;;; This file is part of GNU Guix. @@ -45,13 +46,15 @@ (zero? (apply system* "python" args))) (error "no setup.py found")))) -(define* (check #:key outputs #:allow-other-keys) +(define* (check #:key outputs tests? test-target #:allow-other-keys) "Run the test suite of a given Python package." - (if (file-exists? "setup.py") - (let ((args `("setup.py" "check"))) - (format #t "running 'python' with arguments ~s~%" args) - (zero? (apply system* "python" args))) - (error "no setup.py found"))) + (if tests? + (if (file-exists? "setup.py") + (let ((args `("setup.py" ,test-target))) + (format #t "running 'python' with arguments ~s~%" args) + (zero? (apply system* "python" args))) + (error "no setup.py found")) + #t)) (define* (wrap #:key inputs outputs #:allow-other-keys) (define (list-of-files dir) -- cgit v1.2.3 From 8498b8cfac1ef63f706b0094289a3e300c8846c0 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 5 Sep 2013 18:55:27 +0200 Subject: gnu: python: Disable tests in pytz and babel. * gnu/packages/python.scm (python-pytz, python-babel): Disable tests. --- gnu/packages/python.scm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index a4007d963b..4baef78e7b 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -206,6 +206,7 @@ data types.") (base32 "19giwgfcrg0nr1gdv49qnmf2jb2ilkcfc7qyqvfpz4dp0p64ksv5")))) (build-system python-build-system) + (arguments `(#:tests? #f)) ; no test target (home-page "https://launchpad.net/pytz") (synopsis "The Python timezone library.") (description @@ -233,6 +234,7 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") (build-system python-build-system) (inputs `(("python-pytz" ,python-pytz))) + (arguments `(#:tests? #f)) ; no test target (home-page "http://babel.edgewall.org/") (synopsis "Tools for internationalizing Python applications") -- cgit v1.2.3 From 49b90a7539f69c2ac6a86697f3b9c631a3ceca15 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 5 Sep 2013 19:07:28 +0200 Subject: gnu: python: Disable tests in python2-pytz and python2-babel. * gnu/packages/python.scm (python2-pytz, python2-babel): Disable tests. --- gnu/packages/python.scm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 4baef78e7b..ce89281e26 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -217,7 +217,7 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") (define-public python2-pytz (package (inherit python-pytz) (name "python2-pytz") - (arguments `(#:python ,python-2)))) + (arguments (append (package-arguments python-pytz) `(#:python ,python-2))))) (define-public python-babel (package @@ -251,4 +251,4 @@ etc. ") (name "python2-babel") (inputs `(("python2-pytz" ,python2-pytz))) - (arguments `(#:python ,python-2)))) + (arguments (append (package-arguments python-babel) `(#:python ,python-2))))) -- cgit v1.2.3 From b191f88ee34576a6908b9b5e94cb7664e88c7e79 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 5 Sep 2013 20:25:08 +0200 Subject: guix: python: Add build phase and factor out calls to setup.py. * guix/build/python-build-system.scm (call-setuppy): New procedure. * guix/build/python-build-system.scm (build): New procedure. * guix/build/python-build-system.scm (check, install): Use call-setuppy. * guix/build/python-build-system.scm (%standard-phases): Add call to build. --- guix/build/python-build-system.scm | 49 ++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 21 deletions(-) diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index 27818526fa..f213a97f01 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -35,27 +35,33 @@ ;; ;; Code: -(define* (install #:key outputs (configure-flags '()) - #:allow-other-keys) - "Install a given Python package." - (let ((out (assoc-ref outputs "out"))) - (if (file-exists? "setup.py") - (let ((args `("setup.py" "install" ,(string-append "--prefix=" out) - ,@configure-flags))) - (format #t "running 'python' with arguments ~s~%" args) - (zero? (apply system* "python" args))) - (error "no setup.py found")))) -(define* (check #:key outputs tests? test-target #:allow-other-keys) +(define (call-setuppy command params) + (if (file-exists? "setup.py") + (begin + (format #t "running \"python setup.py\" with command ~s and parameters ~s~%" + command params) + (zero? (apply system* "python" "setup.py" command params))) + (error "no setup.py found"))) + +(define* (build #:rest empty) + "Build a given Python package." + (call-setuppy "build" '())) + +(define* (check #:key tests? test-target #:allow-other-keys) "Run the test suite of a given Python package." (if tests? - (if (file-exists? "setup.py") - (let ((args `("setup.py" ,test-target))) - (format #t "running 'python' with arguments ~s~%" args) - (zero? (apply system* "python" args))) - (error "no setup.py found")) + (call-setuppy test-target '()) #t)) +(define* (install #:key outputs (configure-flags '()) + #:allow-other-keys) + "Install a given Python package." + (let* ((out (assoc-ref outputs "out")) + (params (append (list (string-append "--prefix=" out)) + configure-flags))) + (call-setuppy "install" params))) + (define* (wrap #:key inputs outputs #:allow-other-keys) (define (list-of-files dir) (map (cut string-append dir "/" <>) @@ -92,11 +98,12 @@ 'install 'wrap wrap (alist-replace - 'check check - (alist-replace 'install install - (alist-delete 'configure - (alist-delete 'build - gnu:%standard-phases)))))) + 'build build + (alist-replace + 'check check + (alist-replace 'install install + (alist-delete 'configure + gnu:%standard-phases)))))) (define* (python-build #:key inputs (phases %standard-phases) #:allow-other-keys #:rest args) -- cgit v1.2.3 From 11bb85a10d4a84dab7fdfaaaf7012b743ce7a09f Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Sun, 8 Sep 2013 16:57:37 +0200 Subject: guix: python: Add package-with-python2, a procedure rewriting a package to compile with Python 2 instead of the default Python 3. * guix/build-system/python.scm (default-python2, package-with-explicit-python, package-with-python2): New procedures. * guix/build-system/python.scm (python2-pytz, python2-babel): Use package-with-python2. --- gnu/packages/python.scm | 11 +++------ guix/build-system/python.scm | 54 +++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 56 insertions(+), 9 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index ce89281e26..3ff4da2149 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -28,6 +28,7 @@ #:use-module (gnu packages patchelf) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix utils) #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (guix build-system trivial)) @@ -215,9 +216,7 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") (license x11))) (define-public python2-pytz - (package (inherit python-pytz) - (name "python2-pytz") - (arguments (append (package-arguments python-pytz) `(#:python ,python-2))))) + (package-with-python2 python-pytz)) (define-public python-babel (package @@ -247,8 +246,4 @@ etc. ") (license bsd-3))) (define-public python2-babel - (package (inherit python-babel) - (name "python2-babel") - (inputs - `(("python2-pytz" ,python2-pytz))) - (arguments (append (package-arguments python-babel) `(#:python ,python-2))))) + (package-with-python2 python-babel)) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index 7ac93b296b..d120cc9cc3 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2013 Ludovic Courtès +;;; Copyright © 2013 Andreas Enge ;;; Copyright © 2013 Nikita Karetnikov ;;; ;;; This file is part of GNU Guix. @@ -25,7 +26,9 @@ #:use-module (guix build-system) #:use-module (guix build-system gnu) #:use-module (ice-9 match) - #:export (python-build + #:use-module (srfi srfi-26) + #:export (package-with-python2 + python-build python-build-system)) ;; Commentary: @@ -41,6 +44,55 @@ (let ((python (resolve-interface '(gnu packages python)))) (module-ref python 'python-wrapper))) +(define (default-python2) + "Return the default Python 2 package." + (let ((python (resolve-interface '(gnu packages python)))) + (module-ref python 'python-2))) + +(define (package-with-explicit-python p python old-prefix new-prefix) + "Create a package with the same fields as P, which is assumed to use +PYTHON-BUILD-SYSTEM, such that it is compiled with PYTHON instead. The +inputs are changed recursively accordingly. If the name of P starts with +OLD-PREFIX, this is replaced by NEW-PREFIX; otherwise, NEW-PREFIX is +prepended to the name." + (let* ((build-system (package-build-system p)) + (rewrite-if-package + (lambda (content) + ;; CONTENT may be a string (e.g., for patches), in which case it + ;; is returned, or a package, which is rewritten with the new + ;; PYTHON and NEW-PREFIX. + (if (package? content) + (package-with-explicit-python content python + old-prefix new-prefix) + content))) + (rewrite + (match-lambda + ((name content . rest) + (append (list name (rewrite-if-package content)) rest))))) + (package (inherit p) + (name + (let ((name (package-name p))) + (if (eq? build-system python-build-system) + (string-append new-prefix + (if (string-prefix? old-prefix name) + (substring name (string-length old-prefix)) + name)) + name))) + (arguments + (let ((arguments (package-arguments p))) + (if (eq? build-system python-build-system) + (if (member #:python arguments) + (substitute-keyword-arguments arguments ((#:python p) python)) + (append arguments `(#:python ,python))) + arguments))) + (inputs + (map rewrite (package-inputs p))) + (native-inputs + (map rewrite (package-native-inputs p)))))) + +(define package-with-python2 + (cut package-with-explicit-python <> (default-python2) "python-" "python2-")) + (define* (python-build store name source inputs #:key (python (default-python)) -- cgit v1.2.3 From 1d1f939798d2649bbabc962e37f90efe5805e202 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 10 Sep 2013 11:42:07 +0200 Subject: guix: python: Add parameter #:phases to build system. * guix/build-system/python.scm (python-build): Use parameter #:phases. --- guix/build-system/python.scm | 1 + 1 file changed, 1 insertion(+) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index d120cc9cc3..d018ee70f3 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -128,6 +128,7 @@ provides a 'setup.py' file as its build system." #:system ,system #:test-target "test" #:tests? ,tests? + #:phases ,phases #:outputs %outputs #:search-paths ',(map search-path-specification->sexp (append python-search-paths -- cgit v1.2.3 From e1a264f6fac2f517a2192e07eaae1db600eb8b1d Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 10 Sep 2013 20:32:50 +0200 Subject: guix: python: Do not import %standard-phases from gnu-build-system. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * guix/build-system/python.scm (python-build): Drop module gnu-build-system. Thanks to Ludovic Courtès . --- guix/build-system/python.scm | 1 - 1 file changed, 1 deletion(-) diff --git a/guix/build-system/python.scm b/guix/build-system/python.scm index d018ee70f3..03e587ba01 100644 --- a/guix/build-system/python.scm +++ b/guix/build-system/python.scm @@ -108,7 +108,6 @@ prepended to the name." (guix build gnu-build-system) (guix build utils))) (modules '((guix build python-build-system) - (guix build gnu-build-system) (guix build utils)))) "Build SOURCE using PYTHON, and with INPUTS. This assumes that SOURCE provides a 'setup.py' file as its build system." -- cgit v1.2.3 From 73adf220370e12b8788d47ea22ee1975cb9bc752 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Tue, 10 Sep 2013 21:08:12 +0200 Subject: gnu: Add python-setuptools, python2-setuptools. * gnu/packages/python.scm (python-setuptools, python2-setuptools): New variables. --- gnu/packages/python.scm | 50 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 3ff4da2149..8f65852630 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -247,3 +247,53 @@ etc. ") (define-public python2-babel (package-with-python2 python-babel)) + +(define-public python-setuptools + (package + (name "python-setuptools") + (version "1.1.4") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/s/setuptools/setuptools-" + version ".tar.gz")) + (sha256 + (base32 + "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf")))) + (build-system python-build-system) + (arguments + `(#:tests? #f + ;;FIXME: test_sdist_with_utf8_encoded_filename fails in + ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py" + ;; line 354 + ;; The tests pass with Python 2.7.5. + #:phases + (alist-replace + 'install + (lambda* (#:key outputs #:allow-other-keys #:rest args) + (let* ((install (assoc-ref %standard-phases 'install)) + (out (assoc-ref outputs "out")) + (python (assoc-ref %build-inputs "python")) + (python-version (string-take (string-take-right python 5) 3)) + (path (string-append out "/lib/python" python-version + "/site-packages/"))) + (mkdir-p path) + (setenv "PYTHONPATH" path) + (apply install args))) + %standard-phases))) + (home-page "https://pypi.python.org/pypi/setuptools") + (synopsis + "Library designed to facilitate packaging Python projects") + (description + "Setuptools is a fully-featured, stable library designed to facilitate +packaging Python projects, where packaging includes: +Python package and module definitions, +distribution package metadata, +test hooks, +project installation, +platform-specific details, +Python 3 support.") + (license psfl))) + +(define-public python2-setuptools + (package-with-python2 python-setuptools)) -- cgit v1.2.3 From 824af8cadc1b4f1ac7a859f3d18cbe69b195a844 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 11 Sep 2013 15:47:34 +0200 Subject: guix: python: Create module installation path and add it to PYTHONPATH during the installation phase. * guix/build/python-build-system.scm (get-python-version): New procedure. * guix/build/python-build-system.scm (install): Create and add path. * gnu/packages/python.scm (python-setuptools): Drop path creation code. --- gnu/packages/python.scm | 16 +--------------- guix/build/python-build-system.scm | 23 +++++++++++++++++++---- 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 8f65852630..55d23e45e8 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -262,25 +262,11 @@ etc. ") "0hl9sa5xr9bi2ifq51wy1bawsjv5nzvpbac7m9z1ciz778874csf")))) (build-system python-build-system) (arguments - `(#:tests? #f + `(#:tests? #f)) ;;FIXME: test_sdist_with_utf8_encoded_filename fails in ;; /tmp/nix-build-python2-setuptools-1.1.4.drv-0/setuptools-1.1.4/setuptools/tests/test_sdist.py" ;; line 354 ;; The tests pass with Python 2.7.5. - #:phases - (alist-replace - 'install - (lambda* (#:key outputs #:allow-other-keys #:rest args) - (let* ((install (assoc-ref %standard-phases 'install)) - (out (assoc-ref outputs "out")) - (python (assoc-ref %build-inputs "python")) - (python-version (string-take (string-take-right python 5) 3)) - (path (string-append out "/lib/python" python-version - "/site-packages/"))) - (mkdir-p path) - (setenv "PYTHONPATH" path) - (apply install args))) - %standard-phases))) (home-page "https://pypi.python.org/pypi/setuptools") (synopsis "Library designed to facilitate packaging Python projects") diff --git a/guix/build/python-build-system.scm b/guix/build/python-build-system.scm index f213a97f01..0bb8c4d49d 100644 --- a/guix/build/python-build-system.scm +++ b/guix/build/python-build-system.scm @@ -54,12 +54,27 @@ (call-setuppy test-target '()) #t)) -(define* (install #:key outputs (configure-flags '()) +(define (get-python-version python) + (string-take (string-take-right python 5) 3)) + +(define* (install #:key outputs inputs (configure-flags '()) #:allow-other-keys) "Install a given Python package." (let* ((out (assoc-ref outputs "out")) (params (append (list (string-append "--prefix=" out)) - configure-flags))) + configure-flags)) + (python-version (get-python-version (assoc-ref inputs "python"))) + (old-path (getenv "PYTHONPATH")) + (add-path (string-append out "/lib/python" python-version + "/site-packages/"))) + ;; create the module installation directory and add it to PYTHONPATH + ;; to make setuptools happy + (mkdir-p add-path) + (setenv "PYTHONPATH" + (string-append (if old-path + (string-append old-path ":") + "") + add-path)) (call-setuppy "install" params))) (define* (wrap #:key inputs outputs #:allow-other-keys) @@ -79,10 +94,10 @@ (let* ((out (assoc-ref outputs "out")) (python (assoc-ref inputs "python")) - (python-version (string-take (string-take-right python 5) 3)) (var `("PYTHONPATH" prefix ,(cons (string-append out "/lib/python" - python-version "/site-packages") + (get-python-version python) + "/site-packages") (search-path-as-string->list (or (getenv "PYTHONPATH") "")))))) (for-each (lambda (dir) -- cgit v1.2.3 From fc50e9c69425c74b4367feb46b83cc28aeb178c2 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 11 Sep 2013 15:51:13 +0200 Subject: gnu: Add python-dateutil, python2-dateutil. * gnu/packages/python.scm (python-dateutil, python2-dateutil): New variables. --- gnu/packages/python.scm | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 55d23e45e8..b50a893e1d 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -218,6 +218,7 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") (define-public python2-pytz (package-with-python2 python-pytz)) + (define-public python-babel (package (name "python-babel") @@ -248,6 +249,7 @@ etc. ") (define-public python2-babel (package-with-python2 python-babel)) + (define-public python-setuptools (package (name "python-setuptools") @@ -283,3 +285,30 @@ Python 3 support.") (define-public python2-setuptools (package-with-python2 python-setuptools)) + + +(define-public python-dateutil + (package + (name "python-dateutil") + (version "1.5") ; last version for python < 3 + (source + (origin + (method url-fetch) + (uri (string-append "http://labix.org/download/python-dateutil/python-dateutil-" + version ".tar.gz")) + (sha256 + (base32 + "0fqfglhy5khbvsipr3x7m6bcaqljh8xl5cw33vbfxy7qhmywm2n0")))) + (build-system python-build-system) + (inputs + `(("python-setuptools" ,python-setuptools))) + (home-page "http://labix.org/python-dateutil") + (synopsis + "Extensions to the standard datetime module, available in Python 2.3+") + (description + "The dateutil module provides powerful extensions to the standard +datetime module, available in Python 2.3+.") + (license psfl))) + +(define-public python2-dateutil + (package-with-python2 python-dateutil)) -- cgit v1.2.3 From e1804763d00a2aa03e696a73dc3675a15acd47de Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Wed, 11 Sep 2013 22:56:52 +0200 Subject: gnu: Update python-babel, python2-babel to 1.3. * gnu/packages/python.scm (python-babel, python2-babel): Update to 1.3. --- gnu/packages/python.scm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index b50a893e1d..9b9a445f38 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -222,20 +222,21 @@ using Python 2.4 or higher and provides access to the Olson timezone database.") (define-public python-babel (package (name "python-babel") - (version "0.9.6") + (version "1.3") (source (origin (method url-fetch) - (uri (string-append "http://ftp.edgewall.com/pub/babel/Babel-" + (uri (string-append "https://pypi.python.org/packages/source/B/Babel/Babel-" version ".tar.gz")) (sha256 (base32 - "03vmr54jq5vf3qw6kpdv7cdk7x7i2jhzyf1mawv2gk8zrxg0hfja")))) + "0bnin777lc53nxd1hp3apq410jj5wx92n08h7h4izpl4f4sx00lz")))) (build-system python-build-system) (inputs - `(("python-pytz" ,python-pytz))) + `(("python-pytz" ,python-pytz) + ("python-setuptools" ,python-setuptools))) (arguments `(#:tests? #f)) ; no test target - (home-page "http://babel.edgewall.org/") + (home-page "http://babel.pocoo.org/") (synopsis "Tools for internationalizing Python applications") (description -- cgit v1.2.3 From 1d08c01fcf31ae7ac61f4595b151355b7a197e47 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Thu, 12 Sep 2013 15:31:45 +0200 Subject: gnu: Add python2-sqlite. * gnu/packages/python.scm (python2-sqlite): New variable. --- gnu/packages/python.scm | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 9b9a445f38..dcfe784e57 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -20,12 +20,15 @@ (define-module (gnu packages python) #:use-module ((guix licenses) #:select (bsd-3 psfl x11)) + #:use-module ((guix licenses) #:select (zlib) + #:renamer (symbol-prefix-proc 'license)) #:use-module (gnu packages) #:use-module (gnu packages compression) #:use-module (gnu packages gdbm) #:use-module (gnu packages readline) #:use-module (gnu packages openssl) #:use-module (gnu packages patchelf) + #:use-module (gnu packages sqlite) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix utils) @@ -313,3 +316,31 @@ datetime module, available in Python 2.3+.") (define-public python2-dateutil (package-with-python2 python-dateutil)) + + +(define-public python2-pysqlite + (package + (name "python2-pysqlite") + (version "2.6.3") + (source + (origin + (method url-fetch) + (uri (string-append "http://pysqlite.googlecode.com/files/pysqlite-" + version ".tar.gz")) + (sha256 + (base32 + "0nsqqfp072rgqbls100rdvbzkjkin7li3kprhfxlfqvzf608hlqd")))) + (build-system python-build-system) + (inputs + `(("sqlite" ,sqlite))) + (arguments + `(#:python ,python-2 ; incompatible with Python 3 + #:tests? #f)) ; no test target + (home-page "http://labix.org/python-dateutil") + (synopsis + "SQLite bindings for Python.") + (description + "Pysqlite provides SQLite bindings for Python that comply to the +Database API 2.0T.") + (license zlib))) + -- cgit v1.2.3 From 2875caf5b52340ea16965b1d8f76342cc07bf8b5 Mon Sep 17 00:00:00 2001 From: Andreas Enge Date: Fri, 13 Sep 2013 14:25:53 +0200 Subject: gnu: Add python2-mechanize. * gnu/packages/python.scm (python2-mechanize): New variable. --- gnu/packages/python.scm | 37 ++++++++++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index dcfe784e57..be33bf6570 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -19,7 +19,7 @@ ;;; along with GNU Guix. If not, see . (define-module (gnu packages python) - #:use-module ((guix licenses) #:select (bsd-3 psfl x11)) + #:use-module ((guix licenses) #:select (bsd-3 bsd-style psfl x11)) #:use-module ((guix licenses) #:select (zlib) #:renamer (symbol-prefix-proc 'license)) #:use-module (gnu packages) @@ -344,3 +344,38 @@ datetime module, available in Python 2.3+.") Database API 2.0T.") (license zlib))) + +(define-public python2-mechanize + (package + (name "python2-mechanize") + (version "0.2.5") + (source + (origin + (method url-fetch) + (uri (string-append "https://pypi.python.org/packages/source/m/mechanize/mechanize-" + version ".tar.gz")) + (sha256 + (base32 + "0rj7r166i1dyrq0ihm5rijfmvhs8a04im28lv05c0c3v206v4rrf")))) + (build-system python-build-system) + (inputs + `(("python2-setuptools" ,python2-setuptools))) + (arguments + `(#:python ,python-2 ; apparently incompatible with Python 3 + #:tests? #f)) + ;; test fails with message + ;; AttributeError: 'module' object has no attribute 'test_pullparser' + ;; (python-3.3.2) or + ;; AttributeError: 'module' object has no attribute 'test_urllib2_localnet' + ;; (python-2.7.5). + ;; The source code is from March 2011 and probably not up-to-date + ;; with respect to python unit tests. + (home-page "http://wwwsearch.sourceforge.net/mechanize/") + (synopsis + "Stateful programmatic web browsing in Python") + (description + "Mechanize implements stateful programmatic web browsing in Python, +after Andy Lester’s Perl module WWW::Mechanize.") + (license (bsd-style "file://COPYING" + "See COPYING in the distribution.")))) + -- cgit v1.2.3