summary refs log tree commit diff
path: root/pkgs/servers/certificate-transparency/default.nix
blob: a7c2be4e2861580ebdb760d3a9c04a75a7c106f6 (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
{ stdenv, fetchFromGitHub, autoreconfHook, clang, pkgconfig
, glog, gmock, gtest, google-gflags, gperftools, json_c, leveldb
, libevent, libevhtp, openssl, protobuf, sqlite
}:

stdenv.mkDerivation rec {
  name = "certificate-transparency-${version}";

  version = "2016-01-14";
  rev = "250672b5aef3666edbdfc9a75b95a09e7a57ed08";

  src = fetchFromGitHub {
    owner = "google";
    repo  = "certificate-transparency";
    rev   = rev;
    sha256 = "1gn0bqzkf09jvc2aq3da8fwhl65y7q57msqsh6iczvd6fdmrpfdj";
  };

  # need to disable regex support in evhtp or building will fail
  libevhtp_without_regex = stdenv.lib.overrideDerivation libevhtp
    (oldAttrs: {
      cmakeFlags = "-DEVHTP_DISABLE_REGEX:STRING=ON";
    });

  buildInputs = [
    autoreconfHook clang pkgconfig
    glog gmock google-gflags gperftools gtest json_c leveldb
    libevent libevhtp_without_regex openssl protobuf sqlite
  ];

  patches = [
    ./protobuf-include-from-env.patch
  ];

  configureFlags = [
    "CC=clang"
    "CXX=clang++"
    "GMOCK_DIR=${gmock}"
    "GTEST_DIR=${gtest}"
  ];

  # the default Makefile constructs BUILD_VERSION from `git describe`
  # which isn't available in the nix build environment
  makeFlags = "BUILD_VERSION=${version}-${rev}";

  protocFlags = "-I ${protobuf}/include";

  meta = with stdenv.lib; {
    homepage = https://www.certificate-transparency.org/;
    description = "Auditing for TLS certificates.";
    license = licenses.asl20;
    platforms = platforms.unix;
    maintainers = with maintainers; [ philandstuff ];
  };
}