Patchwork [3/3] gnu: lvm2: Make sure compiled objects are stripped.

login
register
mail settings
Submitter Leo Famulari
Date Oct. 3, 2016, 7:42 p.m.
Message ID <d64d05a1252381766b8eeb1f160a2df36b6b74c6.1475523667.git.leo@famulari.name>
Download mbox | patch
Permalink /patch/16220/
State New
Headers show

Comments

Leo Famulari - Oct. 3, 2016, 7:42 p.m.
* gnu/packages/linux.scm (lvm2)[arguments]: Add 'make-objects-writeable' phase.
---
 gnu/packages/linux.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)
Ludovic Courtès - Oct. 6, 2016, 8:34 p.m.
Leo Famulari <leo@famulari.name> skribis:

> * gnu/packages/linux.scm (lvm2)[arguments]: Add 'make-objects-writeable' phase.

OK, thanks!

Ludo’.

Patch

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index d977be1..91c7a8a 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -1667,7 +1667,17 @@  time.")
 
              ;; Replace /bin/sh with the right file name.
              (patch-makefile-SHELL "make.tmpl")
-             #t)))
+             #t))
+         (add-before 'strip 'make-objects-writable
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Make compiled objects writable so they can be stripped.
+             (let ((out (assoc-ref outputs "out")))
+               (for-each (lambda (file)
+                           (chmod file #o755))
+                         (append
+                           (find-files (string-append out "/lib"))
+                           (find-files (string-append out "/sbin"))))
+               #t))))
 
        #:configure-flags (list (string-append "--sysconfdir="
                                               (assoc-ref %outputs "out")