From patchwork Mon Jan 22 13:36:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josselin Poiret X-Patchwork-Id: 59318 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 1A9EA27BBE9; Mon, 22 Jan 2024 15:26:51 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 23A2127BBE2 for ; Mon, 22 Jan 2024 15:26:50 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rRwBY-0007O7-UR; Mon, 22 Jan 2024 10:26:04 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rRwBU-0007MX-C3 for guix-patches@gnu.org; Mon, 22 Jan 2024 10:26:01 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rRwBU-0005gx-2g for guix-patches@gnu.org; Mon, 22 Jan 2024 10:26:00 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rRwBY-00072Y-4R for guix-patches@gnu.org; Mon, 22 Jan 2024 10:26:04 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68656] [PATCH core-updates 7/7] gnu: cryptsetup-static: Fix static build. Resent-From: Josselin Poiret Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 22 Jan 2024 15:26:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68656 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68656@debbugs.gnu.org Cc: Josselin Poiret Received: via spool by 68656-submit@debbugs.gnu.org id=B68656.170593715827005 (code B ref 68656); Mon, 22 Jan 2024 15:26:04 +0000 Received: (at 68656) by debbugs.gnu.org; 22 Jan 2024 15:25:58 +0000 Received: from localhost ([127.0.0.1]:41558 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRwBS-00071V-A7 for submit@debbugs.gnu.org; Mon, 22 Jan 2024 10:25:58 -0500 Received: from jpoiret.xyz ([206.189.101.64]:44922) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rRwBE-00070a-Ad for 68656@debbugs.gnu.org; Mon, 22 Jan 2024 10:25:45 -0500 Received: from authenticated-user (jpoiret.xyz [206.189.101.64]) by jpoiret.xyz (Postfix) with ESMTPA id 6A8A918530C; Mon, 22 Jan 2024 15:25:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=jpoiret.xyz; s=dkim; t=1705937139; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=D74yMCDyqxCfn6p6u5xQiGcWxflit1CxmD1ZYghBdPQ=; b=Ke455/FaBV1Vpr+ZwGG35OaUaYh6eZaBL2Pm2eOOzMWzx0YDT8FopkrdYC3E6fPQQ4N6Jj +nHqHqnuDpx/9kosNym2x2sQE5G89hemlzmNYJYkCDfOSBP+JGcsY5hI72YWpLurUrJ8vE 8tW5WwI7Cnk8dQhFZJ8IYGGW8I26aaj0Y5Q7ZVzpCBJ+QVxJvLjruzFi5tlzvN48QCSFSJ 95sgEXRjJFpZlKz4gGa6ZnPxe31pmmLLrnr0ut34DMaOlUpcEpNJgi37IruPUHuZfCidqe pm9rkXwEBupfJpY2AhejiPggJTKaqZnWvBc9iaT3g1xEQkTcjDjXnuZxg9myjA== Date: Mon, 22 Jan 2024 14:36:23 +0100 Message-ID: <3b0266f455e3789bc3eb9eaa5f9e26551312852c.1705762361.git.dev@jpoiret.xyz> In-Reply-To: References: MIME-Version: 1.0 X-Spamd-Bar: / Authentication-Results: jpoiret.xyz; auth=pass smtp.auth=jpoiret@jpoiret.xyz smtp.mailfrom=dev@jpoiret.xyz X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Josselin Poiret X-ACL-Warn: , Josselin Poiret via Guix-patches X-Patchwork-Original-From: Josselin Poiret via Guix-patches via From: Josselin Poiret Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches From: Josselin Poiret * 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)")))