about summary refs log tree commit diff
path: root/nixpkgs/pkgs/servers/sks/default.nix
blob: 2ace06edc9750c8d316735403e9230567f6ef1f5 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
{ lib, stdenv, fetchFromGitHub, ocamlPackages, perl
, zlib, db
}:

let
  inherit (ocamlPackages)
    ocaml
    findlib
    cryptokit
    num
    ;
in

stdenv.mkDerivation rec {
  pname = "sks";
  version = "unstable-2021-02-04";

  src = fetchFromGitHub {
    owner = "SKS-Keyserver";
    repo = "sks-keyserver";
    rev = "c3ba6d5abb525dcb84745245631c410c11c07ec1";
    sha256 = "0fql07sc69hv6jy7x5svb19977cdsz0p1j8wv53k045a6v7rw1jw";
  };

  # pkgs.db provides db_stat, not db$major.$minor_stat
  patches = [
    ./adapt-to-nixos.patch
  ];

  outputs = [ "out" "webSamples" ];

  nativeBuildInputs = [ ocaml findlib perl ];
  buildInputs = [ zlib db cryptokit num ];

  makeFlags = [ "PREFIX=$(out)" "MANDIR=$(out)/share/man" ];
  preConfigure = ''
    cp Makefile.local.unused Makefile.local
    sed -i \
      -e "s:^LIBDB=.*$:LIBDB=-ldb:g" \
      Makefile.local
  '';

  preBuild = "make dep";

  doCheck = true;
  checkPhase = "./sks unit_test";

  # Copy the web examples for the NixOS module
  postInstall = "cp -R sampleWeb $webSamples";

  meta = with lib; {
    description = "An easily deployable & decentralized OpenPGP keyserver";
    longDescription = ''
      SKS is an OpenPGP keyserver whose goal is to provide easy to deploy,
      decentralized, and highly reliable synchronization. That means that a key
      submitted to one SKS server will quickly be distributed to all key
      servers, and even wildly out-of-date servers, or servers that experience
      spotty connectivity, can fully synchronize with rest of the system.
    '';
    inherit (src.meta) homepage;
    license = licenses.gpl2Plus;
    platforms = platforms.linux;
    maintainers = with maintainers; [ globin ];
  };
}