guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/09: gnu: zstd: Move libraries to separate outputs.


From: guix-commits
Subject: 06/09: gnu: zstd: Move libraries to separate outputs.
Date: Mon, 22 Jul 2019 10:25:18 -0400 (EDT)

mbakke pushed a commit to branch master
in repository guix.

commit ec0de9d8bcc46bb6911b1f9ea135a354bac65b1a
Author: Marius Bakke <address@hidden>
Date:   Mon Jul 22 14:53:12 2019 +0200

    gnu: zstd: Move libraries to separate outputs.
    
    * gnu/packages/compression.scm (zstd)[outputs]: New field.
    [arguments]: Add phase 'adjust-libary-locations'.  Pass LIBDIR and 
INCLUDEDIR
    in <#:make-flags>.
    * gnu/packages/backup.scm (borg)[inputs]: Change ZSTD to ZSTD:LIB.
    * gnu/packages/sync.scm (casync)[inputs]: Likewise.
    * gnu/packages/tor.scm (tor)[inputs]: Likewise.
    * gnu/packages/linux.scm (btrfs-progs)[inputs]: Likewise.  Add ZSTD:STATIC.
---
 gnu/packages/backup.scm      |  2 +-
 gnu/packages/compression.scm | 32 ++++++++++++++++++++++++++++++--
 gnu/packages/linux.scm       |  3 ++-
 gnu/packages/sync.scm        |  2 +-
 gnu/packages/tor.scm         |  2 +-
 5 files changed, 35 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 6f319cc..47a6a9b 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -627,7 +627,7 @@ detection, and lossless compression.")
        ;; transitional package for now:
        ;; <https://bugs.gnu.org/30662>
        ("python-msgpack" ,python-msgpack-transitional)
-       ("zstd" ,zstd)))
+       ("zstd" ,zstd "lib")))
     (synopsis "Deduplicated, encrypted, authenticated and compressed backups")
     (description "Borg is a deduplicating backup program.  Optionally, it
 supports compression and authenticated encryption.  The main goal of Borg is to
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm
index a6a2a04..3c5d355 100644
--- a/gnu/packages/compression.scm
+++ b/gnu/packages/compression.scm
@@ -13,7 +13,7 @@
 ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <address@hidden>
 ;;; Copyright © 2016 David Craven <address@hidden>
 ;;; Copyright © 2016, 2019 Kei Kebreau <address@hidden>
-;;; Copyright © 2016, 2018 Marius Bakke <address@hidden>
+;;; Copyright © 2016, 2018, 2019 Marius Bakke <address@hidden>
 ;;; Copyright © 2017 ng0 <address@hidden>
 ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <address@hidden>
 ;;; Copyright © 2017 Theodoros Foradis <address@hidden>
@@ -1372,13 +1372,41 @@ or junctions, and always follows hard links.")
        (sha256
         (base32 "13nlsqhkn276frxrzjdn7wz0j9zz414lf336885ykyxcvw2a0gr9"))))
     (build-system gnu-build-system)
+    (outputs '("out"                    ;1.1MiB executables and documentation
+               "lib"                    ;1MiB shared library and headers
+               "static"))               ;1MiB static library
     (arguments
      `(#:phases
        (modify-phases %standard-phases
-         (delete 'configure))           ; no configure script
+         (delete 'configure)            ;no configure script
+         (add-after 'install 'adjust-library-locations
+           (lambda* (#:key outputs #:allow-other-keys)
+             (let* ((out (assoc-ref outputs "out"))
+                    (lib (assoc-ref outputs "lib"))
+                    (static (assoc-ref outputs "static"))
+                    (shared-libs (string-append lib "/lib"))
+                    (static-libs (string-append static "/lib")))
+               ;; Move the static library to its own output to save ~1MiB.
+               (mkdir-p static-libs)
+               (for-each (lambda (ar)
+                           (link ar (string-append static-libs "/"
+                                                   (basename ar)))
+                           (delete-file ar))
+                         (find-files shared-libs "\\.a$"))
+
+               ;; While here, remove prefix= from the pkg-config file because 
it
+               ;; is unused, and because it contains a needless reference to 
$out.
+               ;; XXX: It would be great if #:disallow-references worked 
between
+               ;; outputs.
+               (substitute* (string-append shared-libs "/pkgconfig/libzstd.pc")
+                 (("^prefix=.*") ""))
+
+               #t))))
        #:make-flags
        (list "CC=gcc"
              (string-append "PREFIX=" (assoc-ref %outputs "out"))
+             (string-append "LIBDIR=" (assoc-ref %outputs "lib") "/lib")
+             (string-append "INCLUDEDIR=" (assoc-ref %outputs "lib") 
"/include")
              ;; Skip auto-detection of, and creating a dependency on, the build
              ;; environment's ‘xz’ for what amounts to a dubious feature 
anyway.
              "HAVE_LZMA=0"
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 7d3800c..5288328 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -3862,7 +3862,8 @@ and copy/paste text in the console and in xterm.")
               ("lzo" ,lzo)
               ("zlib" ,zlib)
               ("zlib:static" ,zlib "static")
-              ("zstd" ,zstd)))
+              ("zstd" ,zstd "lib")
+              ("zstd:static" ,zstd "static")))
     (native-inputs `(("pkg-config" ,pkg-config)
                      ("asciidoc" ,asciidoc)
                      ("python" ,python)
diff --git a/gnu/packages/sync.scm b/gnu/packages/sync.scm
index faff25d..1c80b79 100644
--- a/gnu/packages/sync.scm
+++ b/gnu/packages/sync.scm
@@ -227,7 +227,7 @@ and does not hamper local file system performance.")
        ("rsync" ,rsync)))                         ;for tests
     (inputs
      `(("xz" ,xz)                                 ;for liblzma
-       ("zstd" ,zstd)
+       ("zstd" ,zstd "lib")
        ("curl" ,curl)
        ("acl" ,acl)
        ("libselinux" ,libselinux)
diff --git a/gnu/packages/tor.scm b/gnu/packages/tor.scm
index 25bd520..8b5e803 100644
--- a/gnu/packages/tor.scm
+++ b/gnu/packages/tor.scm
@@ -67,7 +67,7 @@
        ("libevent" ,libevent)
        ("libseccomp" ,libseccomp)
        ("xz" ,xz)
-       ("zstd" ,zstd)))
+       ("zstd" ,zstd "lib")))
     (home-page "https://www.torproject.org/";)
     (synopsis "Anonymous network router to improve privacy on the Internet")
     (description



reply via email to

[Prev in Thread] Current Thread [Next in Thread]