From afd3d9316ce3c48cd7f7dbae64be0f8bcb756ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Sat, 3 Oct 2015 20:12:59 +0200 Subject: Use "normalized codesets" everywhere. In other words, change "xx_YY.UTF-8" to "xx_YY.utf8". * guix/profiles.scm (ca-certificate-bundle): Use "en_US.utf8" instead of "en_US.UTF-8". * guix/packages.scm (patch-and-repack): Likewise. * guix/build/gnu-build-system.scm (install-locale): Likewise. * guix/build-system/gnu.scm (gnu-build, gnu-cross-build): Likewise. * gnu/packages/python.scm (python-ipython): Likewise. * gnu/packages/gawk.scm (gawk): Likewise. * build-aux/hydra/demo-os.scm: Likewise. * gnu/packages/guile.scm (guile-ncurses)[arguments]: Remove 'change-locale' phase. --- gnu/packages/python.scm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 708ba29d24..fd1a2d3601 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -3665,7 +3665,7 @@ cluster without needing to write any wrapper code yourself.") (man1 (string-append data "/man/man1")) (info (string-append data "/info")) (examples (string-append doc "/examples"))) - (setenv "LANG" "en_US.UTF-8") + (setenv "LANG" "en_US.utf8") (with-directory-excursion "docs" ;; FIXME: html and pdf fail to build ;; (system* "make" "html") -- cgit v1.2.3 From 14f8dae6b1e42cfd37678d64c137932b91656a41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 7 Oct 2015 11:30:41 +0200 Subject: gnu: python: Do not retain references to build tools. * gnu/packages/python.scm (python-2)[arguments]: Add 'do-not-record-configure-flags' and 'do-not-record-configure-flags-in-makefile' phases. --- gnu/packages/python.scm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index fd1a2d3601..05c1f504ef 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -174,6 +174,24 @@ "Lib/test/test_subprocess.py")) (("/bin/sh") (which "sh"))) #t)) + (add-before + 'install 'do-not-record-configure-flags + (lambda _ + ;; Remove configure flags from '_sysconfigdata.py' so we don't + ;; end up keeping references to the build tools. + (substitute* (find-files "." "sysconfigdata\\.py$") + (("'CONFIG_ARGS':.*") + "'CONFIG_ARGS': \"\",\n")) + #t)) + (add-after + 'install 'do-not-record-configure-flags-in-makefile + (lambda* (#:key outputs #:allow-other-keys) + ;; Likewise. + (let ((out (assoc-ref outputs "out"))) + (substitute* (find-files out "^Makefile$") + (("^CONFIG_ARGS[[:blank:]]*=.*$") + "CONFIG_ARGS =\n")) + #t))) (add-before 'check 'pre-check (lambda _ -- cgit v1.2.3 From 0d56e3e1bc7269c403c72ba265cec44d4757d1a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 7 Oct 2015 11:51:14 +0200 Subject: gnu: python-wrapper: Improve synopsis and description. * gnu/packages/python.scm (python-wrapper): Add 'synopsis' field; provide literal 'description' value. --- gnu/packages/python.scm | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 05c1f504ef..08f5bca2c7 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -280,9 +280,12 @@ data types.") (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.")))) + (synopsis "Wrapper for the Python 3 commands") + (description + "This package provides wrappers for the commands of Python@tie{}3.x such +that they can be invoked under their usual name---e.g., @command{python} +instead of @command{python3}."))) + (define-public python-psutil (package -- cgit v1.2.3 From 95288fcc6cfa184b500caa95062bf3194d255880 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 7 Oct 2015 21:27:36 +0200 Subject: gnu: python: Add "minimal" variants. * gnu/packages/python.scm (python2-minimal, python-minimal): New variables. (wrap-python3): New procedure. (python-wrapper): Use it. (python-minimal-wrapper): New variable. * gnu/packages/xml.scm (libxslt)[native-inputs]: Use PYTHON-MINIMAL-WRAPPER instead of PYTHON-WRAPPER. * gnu/packages/xorg.scm (xcb-proto, libxcb, xorg-server): Likewise. --- gnu/packages/python.scm | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 08f5bca2c7..bb4b385026 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -260,9 +260,46 @@ data types.") (version-major+minor version) "/site-packages")))))))) -(define-public python-wrapper +;; Minimal variants of Python, mostly used to break the cycle between Tk and +;; Python (Tk -> libxcb -> Python.) + +(define-public python2-minimal + (package (inherit python-2) + (name "python-minimal") + (arguments + (substitute-keyword-arguments (package-arguments python-2) + ((#:configure-flags _) + `(list "--enable-shared" + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib"))))) + (inputs '()))) ;none of the optional dependencies + +(define-public python-minimal + (package (inherit python) + (name "python-minimal") + (arguments + (substitute-keyword-arguments (package-arguments python) + ((#:configure-flags _) + `(let ((openssl (assoc-ref %build-inputs "openssl")) + (zlib (assoc-ref %build-inputs "zlib")) + (out (assoc-ref %outputs "out"))) + (list "--enable-shared" + (string-append "CPPFLAGS=" + "-I" openssl "/include " + "-I" zlib "/include ") + (string-append "LDFLAGS=" + "-L" openssl "/lib " + "-L" zlib "/lib " + "-Wl,-rpath=" out "/lib")))))) + + ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib; + ;; zlib is required by 'zipimport', used by pip. + (inputs `(("openssl" ,openssl) + ("zlib" ,zlib))))) + +(define* (wrap-python3 python #:optional (name "python-wrapper")) (package (inherit python) - (name "python-wrapper") + (name name) (source #f) (build-system trivial-build-system) (propagated-inputs `(("python" ,python))) @@ -286,6 +323,8 @@ data types.") that they can be invoked under their usual name---e.g., @command{python} instead of @command{python3}."))) +(define-public python-wrapper (wrap-python3 python)) +(define-public python-minimal-wrapper (wrap-python3 python-minimal)) (define-public python-psutil (package -- cgit v1.2.3 From afa181fff435b4e549092c2639e8165069082755 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 7 Oct 2015 21:31:45 +0200 Subject: gnu: python: Build the tkinter module. Fixes . Reported by Federico Beffa . * gnu/packages/python.scm (python-2)[arguments]: Pass --with-tcltk-includes and --with-tcltk-libs. [inputs]: Add TCL and TK. --- gnu/packages/python.scm | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index bb4b385026..b512e77bbf 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -65,6 +65,7 @@ #:use-module (gnu packages xml) #:use-module (gnu packages xorg) #:use-module (gnu packages zip) + #:use-module (gnu packages tcl) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) @@ -138,9 +139,20 @@ (openssl (assoc-ref %build-inputs "openssl")) (readline (assoc-ref %build-inputs "readline")) (zlib (assoc-ref %build-inputs "zlib")) + (tk (assoc-ref %build-inputs "tk")) + (tcl (assoc-ref %build-inputs "tcl")) (out (assoc-ref %outputs "out"))) (list "--enable-shared" ; allow embedding "--with-system-ffi" ; build ctypes + + ;; configure/setup.py doesn't use pkg-config to find Tcl/Tk. + (string-append "--with-tcltk-includes=-I" tk "/include -I" + tcl "/include") + (string-append "--with-tcltk-libs=-L" tk "/lib -ltk" "" + ,(version-prefix (package-version tk) 2) + " -L" tcl "/lib -ltcl" + ,(version-prefix (package-version tcl) 2)) + (string-append "CPPFLAGS=" "-I" bz2 "/include " "-I" gdbm "/include " @@ -217,7 +229,9 @@ ("sqlite" ,sqlite) ; for sqlite extension ("openssl" ,openssl) ("readline" ,readline) - ("zlib" ,zlib))) + ("zlib" ,zlib) + ("tcl" ,tcl) + ("tk" ,tk))) ; for tkinter (native-inputs `(("pkg-config" ,pkg-config))) (native-search-paths @@ -225,8 +239,7 @@ (variable "PYTHONPATH") (files '("lib/python2.7/site-packages"))))) (home-page "http://python.org") - (synopsis - "High-level, dynamically-typed programming language") + (synopsis "High-level, dynamically-typed programming language") (description "Python is a remarkably powerful dynamic programming language that is used in a wide variety of application domains. Some of its key -- cgit v1.2.3 From 6a20289d5a38520fd79e80c256a0315c96a46347 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 8 Oct 2015 00:05:34 +0200 Subject: gnu: python: Simplify list of configure flags. * gnu/packages/patches/python-2.7-search-paths.patch, gnu/packages/patches/python-3-search-paths.patch: New files. * gnu-system.am (dist_patch_DATA): Add them. * gnu/packages/python.scm (python-2)[source]: Use first patch. [arguments]: Remove now unneeded CPPFLAGS and LDFLAGS. (python)[source]: Use second patch. (python-minimal)[arguments]: Remove CPPFLAGS and LDFLAGS. --- gnu/packages/python.scm | 66 +++++++++++-------------------------------------- 1 file changed, 14 insertions(+), 52 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index b512e77bbf..5dea76f0bc 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -86,7 +86,8 @@ version "/Python-" version ".tar.xz")) (sha256 (base32 - "1h7zbrf9pkj29hlm18b10548ch9757f75m64l47sy75rh43p7lqw")))) + "1h7zbrf9pkj29hlm18b10548ch9757f75m64l47sy75rh43p7lqw")) + (patches (list (search-patch "python-2.7-search-paths.patch"))))) (build-system gnu-build-system) (arguments `(#:tests? #f @@ -132,43 +133,10 @@ ;; such file or directory #:test-target "test" #:configure-flags - (let ((bz2 (assoc-ref %build-inputs "bzip2")) - (gdbm (assoc-ref %build-inputs "gdbm")) - (libffi (assoc-ref %build-inputs "libffi")) - (sqlite (assoc-ref %build-inputs "sqlite")) - (openssl (assoc-ref %build-inputs "openssl")) - (readline (assoc-ref %build-inputs "readline")) - (zlib (assoc-ref %build-inputs "zlib")) - (tk (assoc-ref %build-inputs "tk")) - (tcl (assoc-ref %build-inputs "tcl")) - (out (assoc-ref %outputs "out"))) - (list "--enable-shared" ; allow embedding - "--with-system-ffi" ; build ctypes - - ;; configure/setup.py doesn't use pkg-config to find Tcl/Tk. - (string-append "--with-tcltk-includes=-I" tk "/include -I" - tcl "/include") - (string-append "--with-tcltk-libs=-L" tk "/lib -ltk" "" - ,(version-prefix (package-version tk) 2) - " -L" tcl "/lib -ltcl" - ,(version-prefix (package-version tcl) 2)) - - (string-append "CPPFLAGS=" - "-I" bz2 "/include " - "-I" gdbm "/include " - "-I" sqlite "/include " - "-I" openssl "/include " - "-I" readline "/include " - "-I" zlib "/include") - (string-append "LDFLAGS=" - "-L" bz2 "/lib " - "-L" gdbm "/lib " - "-L" libffi "/lib " - "-L" sqlite "/lib " - "-L" openssl "/lib " - "-L" readline "/lib " - "-L" zlib "/lib " - "-Wl,-rpath=" out "/lib"))) + (list "--enable-shared" ;allow embedding + "--with-system-ffi" ;build ctypes + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib")) #:modules ((ice-9 ftw) ,@%gnu-build-system-modules) @@ -257,9 +225,11 @@ data types.") (method url-fetch) (uri (string-append "https://www.python.org/ftp/python/" version "/Python-" version ".tar.xz")) - (patches (list (search-patch "python-fix-tests.patch") - ;; XXX Try removing this patch for python > 3.4.3 - (search-patch "python-disable-ssl-test.patch"))) + (patches (map search-patch + '("python-fix-tests.patch" + ;; XXX Try removing this patch for python > 3.4.3 + "python-disable-ssl-test.patch" + "python-3-search-paths.patch"))) (patch-flags '("-p0")) (sha256 (base32 @@ -293,17 +263,9 @@ data types.") (arguments (substitute-keyword-arguments (package-arguments python) ((#:configure-flags _) - `(let ((openssl (assoc-ref %build-inputs "openssl")) - (zlib (assoc-ref %build-inputs "zlib")) - (out (assoc-ref %outputs "out"))) - (list "--enable-shared" - (string-append "CPPFLAGS=" - "-I" openssl "/include " - "-I" zlib "/include ") - (string-append "LDFLAGS=" - "-L" openssl "/lib " - "-L" zlib "/lib " - "-Wl,-rpath=" out "/lib")))))) + `(list "--enable-shared" + (string-append "LDFLAGS=-Wl,-rpath=" + (assoc-ref %outputs "out") "/lib"))))) ;; OpenSSL is a mandatory dependency of Python 3.x, for urllib; ;; zlib is required by 'zipimport', used by pip. -- cgit v1.2.3 From 9765b3aeac88ae9c9ffc38ed6d1f8dcbd9abca7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Thu, 8 Oct 2015 17:58:06 +0200 Subject: Revert "gnu: python: Do not retain references to build tools." This reverts commit 14f8dae6b1e42cfd37678d64c137932b91656a41, which was unintentionally pushed (it does not work with Python 3.) --- gnu/packages/python.scm | 18 ------------------ 1 file changed, 18 deletions(-) (limited to 'gnu/packages/python.scm') diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm index 166e8d4944..ee9173b570 100644 --- a/gnu/packages/python.scm +++ b/gnu/packages/python.scm @@ -155,24 +155,6 @@ "Lib/test/test_subprocess.py")) (("/bin/sh") (which "sh"))) #t)) - (add-before - 'install 'do-not-record-configure-flags - (lambda _ - ;; Remove configure flags from '_sysconfigdata.py' so we don't - ;; end up keeping references to the build tools. - (substitute* (find-files "." "sysconfigdata\\.py$") - (("'CONFIG_ARGS':.*") - "'CONFIG_ARGS': \"\",\n")) - #t)) - (add-after - 'install 'do-not-record-configure-flags-in-makefile - (lambda* (#:key outputs #:allow-other-keys) - ;; Likewise. - (let ((out (assoc-ref outputs "out"))) - (substitute* (find-files out "^Makefile$") - (("^CONFIG_ARGS[[:blank:]]*=.*$") - "CONFIG_ARGS =\n")) - #t))) (add-before 'check 'pre-check (lambda _ -- cgit v1.2.3