summaryrefslogtreecommitdiffstats
path: root/pkgs/tools/security/tpm2-tss-engine/default.nix
blob: 192d9709ee703f3a45d634eaec64e7e9422c9346 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
{ stdenv
, fetchFromGitHub
, lib
, pkg-config
, autoreconfHook
, autoconf
, autoconf-archive
, automake
, libtool
, makeWrapper
, curl
, openssl
, tpm2-tss
, pandoc
, doxygen
}:

stdenv.mkDerivation rec {
  pname = "tpm2-tss-engine";
  version = "1.1.0";

  src = fetchFromGitHub {
    owner = "tpm2-software";
    repo = pname;
    rev = "v${version}";
    sha256 = "1pwc38izkk50s73xzcca1l5h265lmh4hcgpfq8lmbv5grq2qdal8";
  };

  nativeBuildInputs = [
    pkg-config
    makeWrapper
    autoreconfHook
    autoconf
    autoconf-archive
    automake
    libtool
    pandoc
    doxygen
  ];

  buildInputs = [
    curl openssl tpm2-tss
  ];

  preFixup = let
    ldLibraryPath = lib.makeLibraryPath ([
      tpm2-tss
    ]);
  in ''
    for bin in $out/bin/*; do
      wrapProgram $bin \
        --suffix LD_LIBRARY_PATH : "${ldLibraryPath}"
    done
  '';

  meta = with lib; {
    description = "OpenSSL Engine for TPM2 devices";
    homepage = "tpm2-software.github.io";
    license = licenses.bsd3;
    platforms = platforms.linux;
    maintainers = with maintainers; [ matthiasbeyer ];
  };
}