[PATCH] gnu: libarchive: Replace add--L-in-libarchive-pc by configure-flags.

  • Open
  • quality assurance status badge
Details
One participant
  • Nicolas Graves
Owner
unassigned
Submitted by
Nicolas Graves
Severity
normal
N
N
Nicolas Graves wrote on 5 Nov 2023 16:21
(address . guix-patches@gnu.org)(address . ngraves@ngraves.fr)
20231105152129.26938-1-ngraves@ngraves.fr
* gnu/packages/backup.scm (libarchive): Replace add--L-in-libarchive-pc by configure-flags.
[arguments](phases): Remove phase add--L-in-libarchive-pc.
(configuration-flags): Adapt configuration LIBS to avoid propagation.

Change-Id: I85f623043e98b82e46b9afe18c0be53cc7961d4b
---
gnu/packages/backup.scm | 39 +++++++++++----------------------------
1 file changed, 11 insertions(+), 28 deletions(-)

Toggle diff (73 lines)
diff --git a/gnu/packages/backup.scm b/gnu/packages/backup.scm
index 12c4a45b9d..b5e4112c4b 100644
--- a/gnu/packages/backup.scm
+++ b/gnu/packages/backup.scm
@@ -24,6 +24,7 @@
;;; Copyright © 2022 Maxim Cournoyer <maxim.cournoyer@gmail.com>
;;; Copyright © 2022 Feng Shu <tumashu@163.com>
;;; Copyright © 2023 Timo Wilken <guix@twilken.net>
+;;; Copyright © 2023 Nicolas Graves <ngraves@ngraves.fr>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -41,7 +42,6 @@
;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
(define-module (gnu packages backup)
- #:use-module (guix gexp)
#:use-module (guix packages)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix gexp)
@@ -262,7 +262,15 @@ (define-public libarchive
`(,zstd "lib")))
(arguments
(list
- #:configure-flags #~'("--disable-static")
+ ;; Embed absolute references to inputs to avoid propagation.
+ #:configure-flags
+ #~(list "--disable-static"
+ (string-append
+ "LIBS= -L"
+ (string-join
+ (list #$@(map (lambda (in) (this-package-input (car in)))
+ (package-inputs this-package)))
+ "/lib -L")))
#:phases
#~(modify-phases %standard-phases
(add-before 'build 'patch-pwd
@@ -288,32 +296,7 @@ (define-public libarchive
(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
--
2.41.0
?