summary refs log tree commit diff
path: root/pkgs/tools/networking/tlspool/default.nix
blob: 01eced9a5664bf6f421336ba35b25fce22bcf667 (plain) (blame)
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
{ lib, stdenv, fetchFromGitHub
, cmake, pkg-config, arpa2cm
, openldap, p11-kit, unbound, libtasn1, db, openssl, quickder, libkrb5, ldns, gnutls-kdh
, softhsm
}:

let
  pname = "tlspool";
  version = "20180227";
in

stdenv.mkDerivation {
  name = "${pname}-${version}";
  src = fetchFromGitHub {
    owner = "arpa2";
    repo = "tlspool";
    rev = "b4459637d71c7602e94d455e23c74f3973b9cf30";
    sha256 = "0x78f2bdsiglwicwn3injm5ysfjlfa0yzdpnc0r3iw4z0n89rj2r";
  };

  nativeBuildInputs = [
    cmake pkg-config arpa2cm
  ];

  buildInputs = [
    openldap p11-kit unbound libtasn1 db openssl quickder libkrb5 ldns gnutls-kdh
  ];

  postPatch = ''
    # CMake is probably confused because the current version isn't 1.2.6, but 1.2-6
    substituteInPlace CMakeLists.txt \
      --replace "Quick-DER 1.2.4" "Quick-DER 1.2"
    substituteInPlace etc/tlspool.conf \
      --replace "dnssec_rootkey ../etc/root.key" "dnssec_rootkey $out/etc/root.key" \
      --replace "pkcs11_path /usr/local/lib/softhsm/libsofthsm2.so" "pkcs11_path ${softhsm}/lib/softhsm/libsofthsm2.so"
  '';

  postInstall = ''
    mkdir -p $out/include/${pname}/pulleyback $out/etc/tlspool
    cp -R $src/etc/* $out/etc/tlspool/
    cp $src/include/tlspool/*.h $out/include/${pname}
    cp $src/pulleyback/*.h $out/include/${pname}/pulleyback/
    cp $src/src/*.h $out/include/${pname}
  '';

  meta = with lib; {
    description = "A supercharged TLS daemon that allows for easy, strong and consistent deployment";
    license = licenses.gpl3;
    homepage = "http://www.tlspool.org";
    maintainers = with maintainers; [ leenaars qknight ];
  };
}