gnu: python: Do not use patchelf.

* gnu/packages/python.scm (python-2): Add rpath for lib directory of output to
  LDFLAGS.  Remove 'patchelf' from inputs.  Remove #:modules and
  #:imported-modules from arguments.  Remove 'add-lib-to-runpath' phase.
  (python): Do not add #:modules to inherited package arguments.
master
Mark H Weaver 2015-03-22 22:39:56 -04:00
parent c7d1d88f6c
commit 1f43445745
1 changed files with 22 additions and 45 deletions

View File

@ -33,7 +33,6 @@
#:use-module (gnu packages) #:use-module (gnu packages)
#:use-module (gnu packages compression) #:use-module (gnu packages compression)
#:use-module (gnu packages databases) #:use-module (gnu packages databases)
#:use-module (gnu packages elf)
#:use-module (gnu packages fontutils) #:use-module (gnu packages fontutils)
#:use-module (gnu packages gdbm) #:use-module (gnu packages gdbm)
#:use-module (gnu packages gcc) #:use-module (gnu packages gcc)
@ -134,7 +133,8 @@
(sqlite (assoc-ref %build-inputs "sqlite")) (sqlite (assoc-ref %build-inputs "sqlite"))
(openssl (assoc-ref %build-inputs "openssl")) (openssl (assoc-ref %build-inputs "openssl"))
(readline (assoc-ref %build-inputs "readline")) (readline (assoc-ref %build-inputs "readline"))
(zlib (assoc-ref %build-inputs "zlib"))) (zlib (assoc-ref %build-inputs "zlib"))
(out (assoc-ref %outputs "out")))
(list "--enable-shared" ; allow embedding (list "--enable-shared" ; allow embedding
"--with-system-ffi" ; build ctypes "--with-system-ffi" ; build ctypes
(string-append "CPPFLAGS=" (string-append "CPPFLAGS="
@ -151,43 +151,27 @@
"-L" sqlite "/lib " "-L" sqlite "/lib "
"-L" openssl "/lib " "-L" openssl "/lib "
"-L" readline "/lib " "-L" readline "/lib "
"-L" zlib "/lib"))) "-L" zlib "/lib "
"-Wl,-rpath=" out "/lib")))
#:modules ((guix build gnu-build-system)
(guix build utils)
(guix build rpath)
(srfi srfi-26))
#:imported-modules ((guix build gnu-build-system)
(guix build utils)
(guix build rpath))
#:phases #:phases
(alist-cons-after (alist-cons-before
'strip 'add-lib-to-runpath 'configure 'patch-lib-shells
(lambda* (#:key outputs #:allow-other-keys) (lambda _
(let* ((out (assoc-ref outputs "out")) ;; Filter for existing files, since some may not exist in all
(lib (string-append out "/lib"))) ;; versions of python that are built with this recipe.
;; Add LIB to the RUNPATH of all the executables. (substitute* (filter file-exists?
(with-directory-excursion out '("Lib/subprocess.py"
(for-each (cut augment-rpath <> lib) "Lib/popen2.py"
(find-files "bin" ".*"))))) "Lib/distutils/tests/test_spawn.py"
"Lib/test/test_subprocess.py"))
(("/bin/sh") (which "sh"))))
(alist-cons-before (alist-cons-before
'configure 'patch-lib-shells 'check 'pre-check
(lambda _ (lambda _
;; Filter for existing files, since some may not exist in all ;; 'Lib/test/test_site.py' needs a valid $HOME
;; versions of python that are built with this recipe. (setenv "HOME" (getcwd)))
(substitute* (filter file-exists? %standard-phases))))
'("Lib/subprocess.py"
"Lib/popen2.py"
"Lib/distutils/tests/test_spawn.py"
"Lib/test/test_subprocess.py"))
(("/bin/sh") (which "sh"))))
(alist-cons-before
'check 'pre-check
(lambda _
;; 'Lib/test/test_site.py' needs a valid $HOME
(setenv "HOME" (getcwd)))
%standard-phases)))))
(inputs (inputs
`(("bzip2" ,bzip2) `(("bzip2" ,bzip2)
("gdbm" ,gdbm) ("gdbm" ,gdbm)
@ -195,8 +179,7 @@
("sqlite" ,sqlite) ; for sqlite extension ("sqlite" ,sqlite) ; for sqlite extension
("openssl" ,openssl) ("openssl" ,openssl)
("readline" ,readline) ("readline" ,readline)
("zlib" ,zlib) ("zlib" ,zlib)))
("patchelf" ,patchelf))) ; for (guix build rpath)
(native-inputs (native-inputs
`(("pkg-config" ,pkg-config))) `(("pkg-config" ,pkg-config)))
(native-search-paths (native-search-paths
@ -230,14 +213,8 @@ data types.")
(sha256 (sha256
(base32 (base32
"1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb")))) "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb"))))
(arguments (arguments (substitute-keyword-arguments (package-arguments python-2)
(let ((args `(#:modules ((guix build gnu-build-system) ((#:tests? _) #t)))
(guix build utils)
(srfi srfi-1)
(srfi srfi-26))
,@(package-arguments python-2))))
(substitute-keyword-arguments args
((#:tests? _) #t))))
(native-search-paths (native-search-paths
(list (search-path-specification (list (search-path-specification
(variable "PYTHONPATH") (variable "PYTHONPATH")