1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 ocamlPackages,
6 perl,
7 zlib,
8 db,
9}:
10
11let
12 inherit (ocamlPackages)
13 ocaml
14 findlib
15 cryptokit
16 num
17 ;
18in
19
20stdenv.mkDerivation rec {
21 pname = "sks";
22 version = "unstable-2021-02-04";
23
24 src = fetchFromGitHub {
25 owner = "SKS-Keyserver";
26 repo = "sks-keyserver";
27 rev = "c3ba6d5abb525dcb84745245631c410c11c07ec1";
28 sha256 = "0fql07sc69hv6jy7x5svb19977cdsz0p1j8wv53k045a6v7rw1jw";
29 };
30
31 # pkgs.db provides db_stat, not db$major.$minor_stat
32 patches = [
33 ./adapt-to-nixos.patch
34 ];
35
36 outputs = [
37 "out"
38 "webSamples"
39 ];
40
41 nativeBuildInputs = [
42 ocaml
43 findlib
44 perl
45 ];
46 buildInputs = [
47 zlib
48 db
49 cryptokit
50 num
51 ];
52
53 makeFlags = [
54 "PREFIX=$(out)"
55 "MANDIR=$(out)/share/man"
56 ];
57 preConfigure = ''
58 cp Makefile.local.unused Makefile.local
59 sed -i \
60 -e "s:^LIBDB=.*$:LIBDB=-ldb:g" \
61 Makefile.local
62 '';
63
64 preBuild = "make dep";
65
66 doCheck = true;
67 checkPhase = "./sks unit_test";
68
69 # Copy the web examples for the NixOS module
70 postInstall = "cp -R sampleWeb $webSamples";
71
72 meta = with lib; {
73 description = "Easily deployable & decentralized OpenPGP keyserver";
74 longDescription = ''
75 SKS is an OpenPGP keyserver whose goal is to provide easy to deploy,
76 decentralized, and highly reliable synchronization. That means that a key
77 submitted to one SKS server will quickly be distributed to all key
78 servers, and even wildly out-of-date servers, or servers that experience
79 spotty connectivity, can fully synchronize with rest of the system.
80 '';
81 inherit (src.meta) homepage;
82 license = licenses.gpl2Plus;
83 platforms = platforms.linux;
84 maintainers = [ ];
85 };
86}