build-system/gnu: Make the strip behavior of `static-package' configurable.
authorLudovic Courtès <ludo@gnu.org>
Wed, 13 Feb 2013 23:14:29 +0000 (00:14 +0100)
committerLudovic Courtès <ludo@gnu.org>
Thu, 14 Feb 2013 00:12:24 +0000 (01:12 +0100)
* guix/build-system/gnu.scm (static-package): Add #:strip-all? keyword
  parameter.

guix/build-system/gnu.scm

index 82f5bb8..5be4782 100644 (file)
@@ -111,20 +111,24 @@ flags for VARIABLE, the associated value is augmented."
   "A version of P linked with `-static-gcc'."
   (package-with-extra-configure-variable p "LDFLAGS" "-static-libgcc"))
 
-(define* (static-package p #:optional (loc (current-source-location)))
-  "Return a statically-linked version of package P."
+(define* (static-package p #:optional (loc (current-source-location))
+                         #:key (strip-all? #t))
+  "Return a statically-linked version of package P.  If STRIP-ALL? is true,
+use `--strip-all' as the arguments to `strip'."
   (let ((args (package-arguments p)))
     (package (inherit p)
       (location (source-properties->location loc))
       (arguments
        (let ((a (default-keyword-arguments args
                   '(#:configure-flags '()
-                    #:strip-flags #f))))
+                    #:strip-flags '("--strip-debug")))))
          (substitute-keyword-arguments a
            ((#:configure-flags flags)
             `(cons* "--disable-shared" "LDFLAGS=-static" ,flags))
-           ((#:strip-flags _)
-            ''("--strip-all"))))))))
+           ((#:strip-flags flags)
+            (if strip-all?
+                ''("--strip-all")
+                flags))))))))
 
 \f
 (define %store