From 9f752f9c47dda593fd5081ef2247a155158316a9 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Sun, 5 Nov 2023 16:21:25 +0100 Subject: gnu: libarchive: Reference libraries absolutely via configure flags. * gnu/packages/backup.scm (libarchive) [#:configure-flags]: Add 'LIBS' flag. [#:phases] {add--L-in-libarchive-pc}: Delete phase. Change-Id: I85f623043e98b82e46b9afe18c0be53cc7961d4b Signed-off-by: Maxim Cournoyer Modified-by: Maxim Cournoyer --- gnu/packages/backup.scm | 48 ++++++++++++++---------------------------------- 1 file changed, 14 insertions(+), 34 deletions(-) diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm index a561c5fc7e3..48fb8de35b6 100644 --- a/gnu/packages/backup.scm +++ b/gnu/packages/backup.scm @@ -24,7 +24,7 @@ ;;; Copyright © 2022, 2025 Maxim Cournoyer ;;; Copyright © 2022 Feng Shu ;;; Copyright © 2023 Timo Wilken -;;; Copyright © 2024 Nicolas Graves +;;; Copyright © 2023-2024 Nicolas Graves ;;; Copyright © 2024 jgart ;;; Copyright © 2025 Kjartan Oli Agustsson ;;; Copyright © 2025 mstenek @@ -54,7 +54,6 @@ #:use-module (guix build-system qt) #:use-module (guix download) #:use-module (guix gexp) - #:use-module (guix gexp) #:use-module (guix git-download) #:use-module (guix packages) #:use-module (guix utils) @@ -109,7 +108,8 @@ #:use-module (gnu packages time) #:use-module (gnu packages tls) #:use-module (gnu packages valgrind) - #:use-module (gnu packages xml)) + #:use-module (gnu packages xml) + #:use-module (ice-9 format)) (define-public duplicity (package @@ -287,12 +287,17 @@ backups (called chunks) to allow easy burning to CD/DVD.") `(,zstd "lib"))) (arguments (list + ;; Embed absolute references to inputs to avoid propagation. #:configure-flags - #~'("--disable-static" - ;; Because of the circular dependency, we cannot use openssl here. - ;; Explicitly disable openssl to avoid unnecessary dependencies in the - ;; pc file. - "--without-openssl") + #~(list "--disable-static" + (format #f "LIBS=~{-L~a/lib~^ ~}" + '#$(map (lambda (x) + (this-package-input (car x))) + (package-inputs this-package))) + ;; Because of the circular dependency, we cannot use openssl here. + ;; Explicitly disable openssl to avoid unnecessary dependencies in the + ;; pc file. + "--without-openssl") #:phases #~(modify-phases %standard-phases (add-before 'build 'patch-commands @@ -327,32 +332,7 @@ backups (called chunks) to allow easy burning to CD/DVD.") (invoke "./bsdcpio_test" "^test_owner_parse") (invoke "./bsdtar_test")) ;; Tests may be disabled if cross-compiling. - (format #t "Test suite not run.~%")))) - (add-after 'install 'add--L-in-libarchive-pc - (lambda* (#:key inputs outputs #:allow-other-keys) - (let* ((out #$output) - (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")) - (zstd (assoc-ref inputs "zstd")) - (bzip2 (assoc-ref inputs "bzip2"))) - ;; Embed absolute references to these inputs to avoid propagation. - (substitute* (list (string-append lib "/pkgconfig/libarchive.pc") - (string-append lib "/libarchive.la")) - (("-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")) - (("-lzstd") - (string-append "-L" zstd "/lib -lzstd")) - (("-lbz2") - (string-append "-L" bzip2 "/lib -lbz2"))))))))) + (format #t "Test suite not run.~%"))))))) (home-page "https://libarchive.org/") (synopsis "Multi-format archive and compression library") (description -- cgit v1.2.3