guix-commits
[Top][All Lists]
Advanced

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

01/05: gnu: libarchive: Add '-L' flags in 'libarchive.pc'.


From: Ludovic Courtès
Subject: 01/05: gnu: libarchive: Add '-L' flags in 'libarchive.pc'.
Date: Thu, 29 Mar 2018 11:58:22 -0400 (EDT)

civodul pushed a commit to branch core-updates
in repository guix.

commit 5294836d6a5eb1a37da1c130c182a06f201640e6
Author: Ludovic Courtès <address@hidden>
Date:   Thu Mar 29 17:37:17 2018 +0200

    gnu: libarchive: Add '-L' flags in 'libarchive.pc'.
    
    * gnu/packages/backup.scm (libarchive)[arguments]: Add
    'add--L-in-libarchive-pc' phase.
---
 gnu/packages/backup.scm | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index d34c14d..408a4a5 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -204,7 +204,6 @@ backups (called chunks) to allow easy burning to CD/DVD.")
         (base32
          "1km0mzfl6in7l5vz9kl09a88ajx562rw93ng9h2jqavrailvsbgd"))))
     (build-system gnu-build-system)
-    ;; TODO: Add -L/path/to/nettle in libarchive.pc.
     (inputs
      `(("zlib" ,zlib)
        ("nettle" ,nettle)
@@ -231,7 +230,29 @@ backups (called chunks) to allow easy burning to CD/DVD.")
              ;; XXX: This glob disables too much.
              (invoke "./libarchive_test" "^test_*_disk*")
              (invoke "./bsdcpio_test" "^test_owner_parse")
-             (invoke "./bsdtar_test"))))
+             (invoke "./bsdtar_test")))
+         (add-after 'install 'add--L-in-libarchive-pc
+           (lambda* (#:key inputs outputs #:allow-other-keys)
+             (let* ((out     (assoc-ref outputs "out"))
+                    (lib     (string-append out "/lib"))
+                    (nettle  (assoc-ref inputs "nettle"))
+                    (libxml2 (assoc-ref inputs "libxml2"))
+                    (xz      (assoc-ref inputs "xz"))
+                    (zlib    (assoc-ref inputs "zlib"))
+                    (bzip2   (assoc-ref inputs "bzip2")))
+               (substitute* (string-append lib "/pkgconfig/libarchive.pc")
+                 (("-lnettle")
+                  (string-append "-L" nettle "/lib -lnettle"))
+                 (("-lxml2")
+                  (string-append "-L" libxml2 "/lib -lxml2"))
+                 (("-llzma")
+                  (string-append "-L" xz "/lib -llzma"))
+                 (("-lz")
+                  (string-append "-L" zlib "/lib -lz"))
+                 (("-lbz2")
+                  (string-append "-L" bzip2 "/lib -lbz2")))
+               #t))))
+
        ;; libarchive/test/test_write_format_gnutar_filenames.c needs to be
        ;; compiled with C99 or C11 or a gnu variant.
        #:configure-flags '("CFLAGS=-O2 -g -std=c99")))



reply via email to

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