summary refs log tree commit diff
diff options
context:
space:
mode:
authorTobias Geerinckx-Rice <me@tobias.gr>2017-11-16 20:45:21 +0100
committerTobias Geerinckx-Rice <me@tobias.gr>2017-11-21 02:53:01 +0100
commitffe7eee59cd7e00e76096c5021a770aeb35093b9 (patch)
treea06339f94117d02c84cca6cea3ddbc6ac9bfaa66
parentac1f1aa270cb10b7570a8e0181ab709f082c4032 (diff)
downloadguix-ffe7eee59cd7e00e76096c5021a770aeb35093b9.tar.gz
gnu: protobuf: Add ‘static’ output.
* gnu/packages/protobuf.scm (protobuf)[outputs]: New field.
[arguments]: Add new ‘move-static-libraries’ phase.
-rw-r--r--gnu/packages/protobuf.scm18
1 files changed, 18 insertions, 0 deletions
diff --git a/gnu/packages/protobuf.scm b/gnu/packages/protobuf.scm
index 2e681ca97d..02d58b1448 100644
--- a/gnu/packages/protobuf.scm
+++ b/gnu/packages/protobuf.scm
@@ -46,6 +46,24 @@
                 "0y6cr4l7bwa6zvjv5flzr4cx28shk5h8dz99xw90v8qih954pcrb"))))
     (build-system gnu-build-system)
     (inputs `(("zlib" ,zlib)))
+    (outputs (list "out"
+                   "static"))           ; ~12 MiB of .a files
+    (arguments
+     `(#:phases
+       (modify-phases %standard-phases
+         (add-after 'install 'move-static-libraries
+           (lambda* (#:key outputs #:allow-other-keys)
+             ;; Move static libraries to the "static" output.
+             (let* ((out    (assoc-ref outputs "out"))
+                    (lib    (string-append out "/lib"))
+                    (static (assoc-ref outputs "static"))
+                    (slib   (string-append static "/lib")))
+               (mkdir-p slib)
+               (for-each (lambda (file)
+                           (install-file file slib)
+                           (delete-file file))
+                         (find-files lib "\\.a$"))
+               #t))))))
     (home-page "https://github.com/google/protobuf")
     (synopsis "Data encoding for remote procedure calls (RPCs)")
     (description