2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, lvm2, json_c
|
|
|
|
, openssl, libuuid, pkg-config, popt }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2020-08-20 17:08:02 +00:00
|
|
|
pname = "cryptsetup";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "2.4.3";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "dev" "man" ];
|
2022-02-10 20:34:41 +00:00
|
|
|
separateDebugInfo = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-09-26 12:46:18 +00:00
|
|
|
url = "mirror://kernel/linux/utils/cryptsetup/v2.4/${pname}-${version}.tar.xz";
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "sha256-/A35RRiBciZOxb8dC9oIJk+tyKP4VtR+upHzH+NUtQc=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
# Disable 4 test cases that fail in a sandbox
|
|
|
|
patches = [ ./disable-failing-tests.patch ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
|
|
|
|
# O_DIRECT is filesystem dependent and fails in a sandbox (on tmpfs)
|
|
|
|
# and on several filesystem types (btrfs, zfs) without sandboxing.
|
|
|
|
# Remove it, see discussion in #46151
|
|
|
|
substituteInPlace tests/unit-utils-io.c --replace "| O_DIRECT" ""
|
|
|
|
'';
|
|
|
|
|
2022-01-26 04:04:25 +00:00
|
|
|
NIX_LDFLAGS = lib.optionalString (stdenv.cc.isGNU && !stdenv.hostPlatform.isStatic) "-lgcc_s";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-cryptsetup-reencrypt"
|
|
|
|
"--with-crypto_backend=openssl"
|
2021-09-26 12:46:18 +00:00
|
|
|
"--disable-ssh-token"
|
2022-01-26 04:04:25 +00:00
|
|
|
] ++ lib.optionals stdenv.hostPlatform.isStatic [
|
|
|
|
"--enable-static-cryptsetup"
|
2020-08-20 17:08:02 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ pkg-config ];
|
2020-08-20 17:08:02 +00:00
|
|
|
buildInputs = [ lvm2 json_c openssl libuuid popt ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://gitlab.com/cryptsetup/cryptsetup/";
|
|
|
|
description = "LUKS for dm-crypt";
|
2021-02-05 17:12:51 +00:00
|
|
|
license = lib.licenses.gpl2;
|
|
|
|
maintainers = with lib.maintainers; [ ];
|
|
|
|
platforms = with lib.platforms; linux;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|