From: Josselin Poiret via Guix-patches via <guix-patches@gnu.org>
To: 68656@debbugs.gnu.org
Cc: Josselin Poiret <dev@jpoiret.xyz>
Subject: [bug#68656] [PATCH core-updates 7/7] gnu: cryptsetup-static: Fix static build.
Date: Mon, 22 Jan 2024 14:36:23 +0100 [thread overview]
Message-ID: <3b0266f455e3789bc3eb9eaa5f9e26551312852c.1705762361.git.dev@jpoiret.xyz> (raw)
In-Reply-To: <cover.1705762361.git.dev@jpoiret.xyz>
From: Josselin Poiret <dev@jpoiret.xyz>
* gnu/packages/cryptsetup.scm (cryptsetup-static): Pass static variants of
dependencies. Also work around wrong pkg-config paths of util-linux for the
static output.
Change-Id: I025f241b02ee0ea80227ef7d31789571e635ef2c
---
gnu/packages/cryptsetup.scm | 86 +++++++++++++++++++------------------
1 file changed, 45 insertions(+), 41 deletions(-)
diff --git a/gnu/packages/cryptsetup.scm b/gnu/packages/cryptsetup.scm
index 8e2bdb6d9e..8ff649bccc 100644
--- a/gnu/packages/cryptsetup.scm
+++ b/gnu/packages/cryptsetup.scm
@@ -23,6 +23,7 @@ (define-module (gnu packages cryptsetup)
#:use-module (guix packages)
#:use-module (guix download)
#:use-module (guix build-system gnu)
+ #:use-module (guix gexp)
#:use-module (guix utils)
#:use-module (gnu packages)
#:use-module (gnu packages gnupg)
@@ -116,56 +117,59 @@ (define-public cryptsetup-static
(inherit cryptsetup)
(name "cryptsetup-static")
(arguments
- '(#:configure-flags '("--disable-shared"
- "--enable-static-cryptsetup"
-
- "--disable-veritysetup"
- "--disable-cryptsetup-reencrypt"
- "--disable-integritysetup"
-
- ;; The default is OpenSSL which provides better PBKDF performance.
- "--with-crypto_backend=gcrypt"
-
- "--disable-blkid"
- ;; 'libdevmapper.a' pulls in libpthread, libudev and libm.
- "LIBS=-ludev -pthread -lm")
-
- #:allowed-references () ;this should be self-contained
-
- #:modules ((ice-9 ftw)
- (ice-9 match)
- (guix build utils)
- (guix build gnu-build-system))
+ (substitute-keyword-arguments (package-arguments cryptsetup)
+ ((#:configure-flags flags ''())
+ `(cons* "--disable-shared"
+ "--enable-static-cryptsetup"
- #:phases (modify-phases %standard-phases
- (add-after 'install 'remove-cruft
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Remove everything except the 'cryptsetup' command.
- (let ((out (assoc-ref outputs "out")))
- (with-directory-excursion out
- (let ((dirs (scandir "."
- (match-lambda
- ((or "." "..") #f)
- (_ #t)))))
- (for-each delete-file-recursively
- (delete "sbin" dirs))
- (for-each (lambda (file)
- (rename-file (string-append file
- ".static")
- file)
- (remove-store-references file))
- '("sbin/cryptsetup"))
- #t))))))))
+ "--disable-veritysetup"
+ "--disable-integritysetup"
+ ;; Bypass broken pkg-config paths for the static output of
+ ;; util-linux. Only blkid is located through pkg-config, not
+ ;; uuid.
+ (format #f "BLKID_CFLAGS=-I~a"
+ (search-input-directory %build-inputs "include/blkid"))
+ (format #f "BLKID_LIBS=-L~a -lblkid"
+ (dirname (search-input-file %build-inputs "lib/libblkid.a")))
+ ,flags))
+ ((#:allowed-references refs '())
+ '())
+ ((#:modules modules '())
+ '((ice-9 ftw)
+ (ice-9 match)
+ (guix build utils)
+ (guix build gnu-build-system)))
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (add-after 'install 'remove-cruft
+ (lambda* (#:key outputs #:allow-other-keys)
+ ;; Remove everything except the 'cryptsetup' command.
+ (let ((out (assoc-ref outputs "out")))
+ (with-directory-excursion out
+ (let ((dirs (scandir "."
+ (match-lambda
+ ((or "." "..") #f)
+ (_ #t)))))
+ (for-each delete-file-recursively
+ (delete "sbin" dirs))
+ (for-each (lambda (file)
+ (rename-file (string-append file
+ ".static")
+ file)
+ (remove-store-references file))
+ '("sbin/cryptsetup"))
+ #t)))))))))
(inputs
(let ((libgcrypt-static
(package
(inherit (static-library libgcrypt))
(propagated-inputs
`(("libgpg-error-host" ,(static-library libgpg-error)))))))
- `(("json-c" ,json-c-0.13)
+ `(("argon2" ,(static-library argon2))
+ ("json-c" ,(static-library json-c-0.13))
("libgcrypt" ,libgcrypt-static)
("lvm2" ,lvm2-static)
("util-linux" ,util-linux "static")
("util-linux" ,util-linux "lib")
- ("popt" ,popt))))
+ ("popt" ,(static-library popt)))))
(synopsis "Hard disk encryption tool (statically linked)")))
--
2.41.0
next prev parent reply other threads:[~2024-01-22 15:26 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-22 13:33 [bug#68656] [PATCH core-updates 0/7] Cryptsetup woes Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 1/7] gnu: cryptsetup: Update to 2.6.1 Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 2/7] gnu: Add libdevmapper-propagated-inputs Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 3/7] gnu: Add libcryptsetup-propagated-inputs Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 4/7] gnu: volume-key: Add required transitive dependencies Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 5/7] gnu: libblockdev: Add libcryptsetup propagated inputs Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` [bug#68656] [PATCH core-updates 6/7] gnu: lvm2-static: Properly handle eudev dependency in pkg-config Josselin Poiret via Guix-patches via
2024-01-22 13:36 ` Josselin Poiret via Guix-patches via [this message]
2024-01-24 16:42 ` [bug#68656] [PATCH core-updates 0/7] Cryptsetup woes Maxim Cournoyer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3b0266f455e3789bc3eb9eaa5f9e26551312852c.1705762361.git.dev@jpoiret.xyz \
--to=guix-patches@gnu.org \
--cc=68656@debbugs.gnu.org \
--cc=dev@jpoiret.xyz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).