unofficial mirror of guix-devel@gnu.org 
 help / color / mirror / code / Atom feed
* [PATCH] gnu: python: Do not use patchelf
@ 2015-03-23  2:51 Mark H Weaver
  2015-03-23  9:16 ` Ludovic Courtès
  0 siblings, 1 reply; 2+ messages in thread
From: Mark H Weaver @ 2015-03-23  2:51 UTC (permalink / raw)
  To: guix-devel

[-- Attachment #1: Type: text/plain, Size: 276 bytes --]

Since we lack a working 'patchelf' on ARM, and since 'patchelf'
currently fails its test suite on MIPS, I hope to eliminate all
unnecessary uses of 'patchelf' in Guix.  This patch is the first step,
which I hope will bring our non-Intel ports back from the dead.

     Mark



[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: [PATCH] gnu: python: Do not use patchelf --]
[-- Type: text/x-patch, Size: 5284 bytes --]

From 488a5b0e64f264dd69e49ba7db586efac4d4a0ef Mon Sep 17 00:00:00 2001
From: Mark H Weaver <mhw@netris.org>
Date: Sun, 22 Mar 2015 22:39:56 -0400
Subject: [PATCH] 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.
---
 gnu/packages/python.scm | 67 ++++++++++++++++---------------------------------
 1 file changed, 22 insertions(+), 45 deletions(-)

diff --git a/gnu/packages/python.scm b/gnu/packages/python.scm
index 2fcdbcc..6b704b3 100644
--- a/gnu/packages/python.scm
+++ b/gnu/packages/python.scm
@@ -33,7 +33,6 @@
   #:use-module (gnu packages)
   #:use-module (gnu packages compression)
   #:use-module (gnu packages databases)
-  #:use-module (gnu packages elf)
   #:use-module (gnu packages fontutils)
   #:use-module (gnu packages gdbm)
   #:use-module (gnu packages gcc)
@@ -134,7 +133,8 @@
               (sqlite (assoc-ref %build-inputs "sqlite"))
               (openssl (assoc-ref %build-inputs "openssl"))
               (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
                "--with-system-ffi"                ; build ctypes
                (string-append "CPPFLAGS="
@@ -151,43 +151,27 @@
                 "-L" sqlite "/lib "
                 "-L" openssl "/lib "
                 "-L" readline "/lib "
-                "-L" zlib "/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))
+                "-L" zlib "/lib "
+                "-Wl,-rpath=" out "/lib")))
 
         #:phases
-        (alist-cons-after
-         'strip 'add-lib-to-runpath
-         (lambda* (#:key outputs #:allow-other-keys)
-           (let* ((out (assoc-ref outputs "out"))
-                  (lib (string-append out "/lib")))
-             ;; Add LIB to the RUNPATH of all the executables.
-             (with-directory-excursion out
-               (for-each (cut augment-rpath <> lib)
-                         (find-files "bin" ".*")))))
+        (alist-cons-before
+         'configure 'patch-lib-shells
+         (lambda _
+           ;; 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"
+                                  "Lib/test/test_subprocess.py"))
+             (("/bin/sh") (which "sh"))))
          (alist-cons-before
-          'configure 'patch-lib-shells
+          'check 'pre-check
           (lambda _
-            ;; 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"
-                                   "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)))))
+            ;; 'Lib/test/test_site.py' needs a valid $HOME
+            (setenv "HOME" (getcwd)))
+          %standard-phases))))
     (inputs
      `(("bzip2" ,bzip2)
        ("gdbm" ,gdbm)
@@ -195,8 +179,7 @@
        ("sqlite" ,sqlite)                         ; for sqlite extension
        ("openssl" ,openssl)
        ("readline" ,readline)
-       ("zlib" ,zlib)
-       ("patchelf" ,patchelf)))                   ; for (guix build rpath)
+       ("zlib" ,zlib)))
     (native-inputs
      `(("pkg-config" ,pkg-config)))
     (native-search-paths
@@ -230,14 +213,8 @@ data types.")
               (sha256
                (base32
                 "1rdncc7g8g6f3lfdg33rli1yffbiq8z283xy4f5ksl1l8i49psdb"))))
-    (arguments
-     (let ((args `(#:modules ((guix build gnu-build-system)
-                              (guix build utils)
-                             (srfi srfi-1)
-                              (srfi srfi-26))
-                   ,@(package-arguments python-2))))
-       (substitute-keyword-arguments args
-         ((#:tests? _) #t))))
+    (arguments (substitute-keyword-arguments (package-arguments python-2)
+                 ((#:tests? _) #t)))
     (native-search-paths
      (list (search-path-specification
             (variable "PYTHONPATH")
-- 
2.2.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] gnu: python: Do not use patchelf
  2015-03-23  2:51 [PATCH] gnu: python: Do not use patchelf Mark H Weaver
@ 2015-03-23  9:16 ` Ludovic Courtès
  0 siblings, 0 replies; 2+ messages in thread
From: Ludovic Courtès @ 2015-03-23  9:16 UTC (permalink / raw)
  To: Mark H Weaver; +Cc: guix-devel

Mark H Weaver <mhw@netris.org> skribis:

> Since we lack a working 'patchelf' on ARM, and since 'patchelf'
> currently fails its test suite on MIPS, I hope to eliminate all
> unnecessary uses of 'patchelf' in Guix.  This patch is the first step,
> which I hope will bring our non-Intel ports back from the dead.

Excellent.

> From 488a5b0e64f264dd69e49ba7db586efac4d4a0ef Mon Sep 17 00:00:00 2001
> From: Mark H Weaver <mhw@netris.org>
> Date: Sun, 22 Mar 2015 22:39:56 -0400
> Subject: [PATCH] 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.

Assuming everything NEEDED is still in RUNPATH, please push.

Thank you for working on it!

Ludo’.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-03-23  9:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-23  2:51 [PATCH] gnu: python: Do not use patchelf Mark H Weaver
2015-03-23  9:16 ` Ludovic Courtès

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).