2022-08-12 12:06:08 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-09-22 12:36:57 +00:00
|
|
|
, fetchurl
|
2022-08-12 12:06:08 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
|
|
|
, pkg-config
|
|
|
|
, asciidoc
|
|
|
|
, makeWrapper
|
|
|
|
, jansson
|
|
|
|
, jose
|
|
|
|
, cryptsetup
|
|
|
|
, curl
|
|
|
|
, libpwquality
|
|
|
|
, luksmeta
|
|
|
|
, coreutils
|
|
|
|
, tpm2-tools
|
|
|
|
, gnugrep
|
|
|
|
, gnused
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "clevis";
|
2021-05-03 20:48:10 +00:00
|
|
|
version = "18";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "latchset";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2021-05-03 20:48:10 +00:00
|
|
|
sha256 = "sha256-m1UhyjD5ydSgCTBu6sECLlxFx0rnQxFnBA7frbdUqU8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-22 12:36:57 +00:00
|
|
|
patches = [
|
|
|
|
# sss: use BN_set_word(x, 0) instead of BN_zero(), fixes build issue with different versions of openssl
|
|
|
|
(fetchurl {
|
|
|
|
url = "https://github.com/latchset/clevis/commit/ee1dfedb9baca107e66a0fec76693c9d479dcfd9.patch";
|
|
|
|
sha256 = "sha256-GeklrWWlAMALDLdnn6+0Bi0l+bXrIbYkgIyI94WEybM=";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2021-05-03 20:48:10 +00:00
|
|
|
postPatch = ''
|
|
|
|
for f in $(find src/ -type f); do
|
|
|
|
grep -q "/bin/cat" "$f" && substituteInPlace "$f" \
|
|
|
|
--replace '/bin/cat' '${coreutils}/bin/cat' || true
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
# We wrap the main clevis binary entrypoint but not the sub-binaries.
|
|
|
|
wrapProgram $out/bin/clevis \
|
2022-08-12 12:06:08 +00:00
|
|
|
--prefix PATH ':' "${lib.makeBinPath [tpm2-tools jose cryptsetup libpwquality luksmeta gnugrep gnused coreutils]}:${placeholder "out"}/bin"
|
2021-05-03 20:48:10 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ meson ninja pkg-config asciidoc makeWrapper ];
|
|
|
|
buildInputs = [ jansson jose cryptsetup curl libpwquality luksmeta tpm2-tools ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "man" ];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
description = "Automated Encryption Framework";
|
|
|
|
homepage = "https://github.com/latchset/clevis";
|
2022-08-12 12:06:08 +00:00
|
|
|
maintainers = with lib.maintainers; [ ];
|
2020-04-24 23:36:52 +00:00
|
|
|
license = lib.licenses.gpl3Plus;
|
|
|
|
};
|
|
|
|
}
|