Subject: [bug#34366] [PATCH] gnu: cryptsetup: Update to 2.0.6.

From: Rutger Helling <[email-masked]>
Date: Thu, 7 Feb 2019 11:19:02 +0100

Hey Guix,

here's an update for cryptsetup. Note that although it seems to run
fine I haven't been able to test it with an initramfs (yet).
From 3d7e4ac45a20a93dc3e206fc4cb4049ead634d0a Mon Sep 17 00:00:00 2001
From: Rutger Helling <[email-masked]>
Date: Thu, 7 Feb 2019 10:55:53 +0100
Subject: [PATCH] gnu: cryptsetup: Update to 2.0.6.

* gnu/packages/cryptsetup.scm (cryptsetup): Update to 2.0.6.
[inputs]: Add json-c.
[native-inputs]: Add pkg-config.
* gnu/packages/cryptsetup.scm (cryptsetup-static)[arguments]: Add
--disable-blkid configure flag. Strip new cryptsetup-reencrypt and
integritysetup binaries of references too.
[inputs]: Add json-c.
---
 gnu/packages/cryptsetup.scm | 22 ++++++++++++++++------
 1 file changed, 16 insertions(+), 6 deletions(-)

diff --git a/gnu/packages/cryptsetup.scm b/gnu/packages/cryptsetup.scm
index 9df26edc7..4b5498649 100644
--- a/gnu/packages/cryptsetup.scm
+++ b/gnu/packages/cryptsetup.scm
@@ -1,6 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2013 Andreas Enge <[email-masked]>
 ;;; Copyright © 2016 Ludovic Courtès <[email-masked]>
+;;; Copyright © 2019 Rutger Helling <[email-masked]>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -25,14 +26,16 @@
   #:use-module (guix utils)
   #:use-module (gnu packages)
   #:use-module (gnu packages gnupg)
+  #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages popt)
   #:use-module (gnu packages python)
+  #:use-module (gnu packages web)
   #:use-module (gnu packages linux))
 
 (define-public cryptsetup
   (package
    (name "cryptsetup")
-   (version "1.7.5")
+   (version "2.0.6")
    (source (origin
             (method url-fetch)
             (uri (string-append "mirror://kernel.org/linux/utils/cryptsetup/v"
@@ -40,15 +43,17 @@
                                 "/" name "-" version ".tar.xz"))
             (sha256
              (base32
-              "1gail831j826lmpdx2gsc83lp3br6wfnwh3vqwxaa1nn1lfwsc1b"))))
+              "0c1x125s7p4ps13spsqrcsd9dclz01vsrchmypq9msp7y3hgllbw"))))
    (build-system gnu-build-system)
    (inputs
-    `(("libgcrypt" ,libgcrypt)
+    `(("json-c" ,json-c)
+      ("libgcrypt" ,libgcrypt)
       ("lvm2" ,lvm2)
       ("util-linux" ,util-linux)
       ("popt" ,popt)))
    (native-inputs
-    `(("python" ,python-wrapper)))
+    `(("pkg-config" ,pkg-config)
+      ("python" ,python-wrapper)))
    (synopsis "Hard disk encryption tool")
    (description
     "LUKS (Linux Unified Key Setup)/Cryptsetup provides a standard on-disk
@@ -80,6 +85,7 @@ files).  This assumes LIBRARY uses Libtool."
     (arguments
      '(#:configure-flags '("--disable-shared"
                            "--enable-static-cryptsetup"
+                           "--disable-blkid" ;; Enabling results in linking errors.
 
                            ;; 'libdevmapper.a' pulls in libpthread, libudev and libm.
                            "LIBS=-ludev -pthread -lm")
@@ -109,7 +115,10 @@ files).  This assumes LIBRARY uses Libtool."
                                                                     ".static")
                                                      file)
                                         (remove-store-references file))
-                                      '("sbin/cryptsetup" "sbin/veritysetup"))
+                                      '("sbin/cryptsetup"
+                                        "sbin/cryptsetup-reencrypt"
+                                        "sbin/integritysetup"
+                                        "sbin/veritysetup"))
                             #t))))))))
     (inputs
      (let ((libgcrypt-static
@@ -117,7 +126,8 @@ files).  This assumes LIBRARY uses Libtool."
               (inherit (static-library libgcrypt))
               (propagated-inputs
                `(("libgpg-error-host" ,(static-library libgpg-error)))))))
-       `(("libgcrypt" ,libgcrypt-static)
+       `(("json-c" ,json-c)
+         ("libgcrypt" ,libgcrypt-static)
          ("lvm2" ,lvm2-static)
          ("util-linux" ,util-linux "static")
          ("util-linux" ,util-linux)
-- 
2.20.1