From afd3d9316ce3c48cd7f7dbae64be0f8bcb756ba6 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 1.4.1 From 14f8dae6b1e42cfd37678d64c137932b91656a41 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 1.4.1 From 0d56e3e1bc7269c403c72ba265cec44d4757d1a1 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 1.4.1 From 95288fcc6cfa184b500caa95062bf3194d255880 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 +++++++++++++++++++++++++++++++++++++++++-- gnu/packages/xml.scm | 2 +- gnu/packages/xorg.scm | 6 +++--- 3 files changed, 45 insertions(+), 6 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 diff --git a/gnu/packages/xml.scm b/gnu/packages/xml.scm index 5d65648bfb..d9c92d6d93 100644 --- a/gnu/packages/xml.scm +++ b/gnu/packages/xml.scm @@ -135,7 +135,7 @@ project (but it is usable outside of the Gnome platform).") (synopsis "C library for applying XSLT stylesheets to XML documents") (inputs `(("libgcrypt" ,libgcrypt) ("libxml2" ,libxml2) - ("python" ,python-wrapper) + ("python" ,python-minimal-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 d4ed4b82d0..47dc0e2601 100644 --- a/gnu/packages/xorg.scm +++ b/gnu/packages/xorg.scm @@ -2050,7 +2050,7 @@ legacy X clients.") "0bp3f53l9fy5x3mn1rkj1g81aiyzl90wacwvqdgy831aa3kfxb5l")))) (build-system gnu-build-system) (native-inputs - `(("pkg-config" ,pkg-config) ("python" ,python-wrapper))) + `(("pkg-config" ,pkg-config) ("python" ,python-minimal-wrapper))) (home-page "http://www.x.org/wiki/") (synopsis "XML-XCB protocol descriptions") (description @@ -4804,7 +4804,7 @@ protocol.") ("libxslt" ,libxslt))) (native-inputs `(("pkg-config" ,pkg-config) - ("python" ,python-wrapper))) + ("python" ,python-minimal-wrapper))) (arguments `(#:configure-flags '("--enable-xkb"))) (home-page "http://www.x.org/wiki/") @@ -4889,7 +4889,7 @@ over Xlib, including: ("xtrans" ,xtrans) ("zlib" ,zlib))) (native-inputs - `(("python" ,python-wrapper) + `(("python" ,python-minimal-wrapper) ("pkg-config" ,pkg-config))) (arguments `(#:parallel-tests? #f -- cgit 1.4.1 From afa181fff435b4e549092c2639e8165069082755 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 1.4.1 From 6a20289d5a38520fd79e80c256a0315c96a46347 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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-system.am | 2 + gnu/packages/patches/python-2.7-search-paths.patch | 16 ++++++ gnu/packages/patches/python-3-search-paths.patch | 19 +++++++ gnu/packages/python.scm | 66 +++++----------------- 4 files changed, 51 insertions(+), 52 deletions(-) create mode 100644 gnu/packages/patches/python-2.7-search-paths.patch create mode 100644 gnu/packages/patches/python-3-search-paths.patch (limited to 'gnu/packages/python.scm') diff --git a/gnu-system.am b/gnu-system.am index cdae0ed1b9..b219d73cb7 100644 --- a/gnu-system.am +++ b/gnu-system.am @@ -604,6 +604,8 @@ dist_patch_DATA = \ gnu/packages/patches/pybugz-encode-error.patch \ gnu/packages/patches/pybugz-stty.patch \ gnu/packages/patches/pyqt-configure.patch \ + gnu/packages/patches/python-2.7-search-paths.patch \ + gnu/packages/patches/python-3-search-paths.patch \ gnu/packages/patches/python-disable-ssl-test.patch \ gnu/packages/patches/python-fix-tests.patch \ gnu/packages/patches/python2-rdflib-drop-sparqlwrapper.patch \ diff --git a/gnu/packages/patches/python-2.7-search-paths.patch b/gnu/packages/patches/python-2.7-search-paths.patch new file mode 100644 index 0000000000..6e5339f3a6 --- /dev/null +++ b/gnu/packages/patches/python-2.7-search-paths.patch @@ -0,0 +1,16 @@ +Make sure the build system honors CPATH and LIBRARY_PATH when looking for +headers and libraries. + +--- Python-2.7.10/setup.py 2015-10-07 18:33:18.125153186 +0200 ++++ Python-2.7.10/setup.py 2015-10-07 18:33:47.497347552 +0200 +@@ -526,6 +526,10 @@ class PyBuildExt(build_ext): + inc_dirs += ['/system/include', '/atheos/autolnk/include'] + inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) + ++ # Always honor these variables. ++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) ++ inc_dirs += os.getenv('CPATH', '').split(os.pathsep) ++ + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if host_platform in ['osf1', 'unixware7', 'openunix8']: + lib_dirs += ['/usr/ccs/lib'] diff --git a/gnu/packages/patches/python-3-search-paths.patch b/gnu/packages/patches/python-3-search-paths.patch new file mode 100644 index 0000000000..547feae1b9 --- /dev/null +++ b/gnu/packages/patches/python-3-search-paths.patch @@ -0,0 +1,19 @@ +Make sure the build system honors CPATH and LIBRARY_PATH when looking for +headers and libraries. + +--- setup.py 2015-10-07 23:32:58.891329173 +0200 ++++ setup.py 2015-10-07 23:46:29.653349924 +0200 +@@ -507,11 +507,8 @@ class PyBuildExt(build_ext): + # if a file is found in one of those directories, it can + # be assumed that no additional -I,-L directives are needed. + if not cross_compiling: +- lib_dirs = self.compiler.library_dirs + [ +- '/lib64', '/usr/lib64', +- '/lib', '/usr/lib', +- ] +- inc_dirs = self.compiler.include_dirs + ['/usr/include'] ++ lib_dirs = os.getenv('LIBRARY_PATH', '').split(os.pathsep) ++ inc_dirs = os.getenv('CPATH', '').split(os.pathsep) + else: + lib_dirs = self.compiler.library_dirs[:] + inc_dirs = self.compiler.include_dirs[:] 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 1.4.1 From 9765b3aeac88ae9c9ffc38ed6d1f8dcbd9abca7b Mon Sep 17 00:00:00 2001 From: Ludovic Courtès 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 1.4.1