diff options
Diffstat (limited to 'gnu/packages/compression.scm')
-rw-r--r-- | gnu/packages/compression.scm | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/gnu/packages/compression.scm b/gnu/packages/compression.scm index a6a2a04f6f..3c5d355519 100644 --- a/gnu/packages/compression.scm +++ b/gnu/packages/compression.scm @@ -13,7 +13,7 @@ ;;; Copyright © 2016, 2017, 2018, 2019 Tobias Geerinckx-Rice <me@tobias.gr> ;;; Copyright © 2016 David Craven <david@craven.ch> ;;; Copyright © 2016, 2019 Kei Kebreau <kkebreau@posteo.net> -;;; Copyright © 2016, 2018 Marius Bakke <mbakke@fastmail.com> +;;; Copyright © 2016, 2018, 2019 Marius Bakke <mbakke@fastmail.com> ;;; Copyright © 2017 ng0 <ng0@n0.is> ;;; Copyright © 2017 Manolis Fragkiskos Ragkousis <manolis837@gmail.com> ;;; Copyright © 2017 Theodoros Foradis <theodoros@foradis.org> @@ -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" |