-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdefault.nix
57 lines (47 loc) · 1.45 KB
/
default.nix
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
{ pkgs ? import <nixpkgs> { }
, lib ? pkgs.lib
, stdenv ? pkgs.stdenv
, fetchgit
}:
let
sexpSource = fetchgit {
name = "sexp";
url = "https://github.com/rnpgp/sexp.git";
rev = "refs/tags/v0.7.0";
sha256 = "MA54sKyHBFB6ZAGQCHFswIeiVn/TgTjGhP1dE+fS+sU=";
};
in
stdenv.mkDerivation rec {
pname = "rnp";
version = "unstable";
src = ./.;
sexp = import sexpSource { inherit pkgs; };
buildInputs = with pkgs; [ zlib bzip2 json_c botan2 sexp ];
cmakeFlags = [
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
"-DBUILD_SHARED_LIBS=on"
"-DBUILD_TESTING=on"
"-DDOWNLOAD_GTEST=off"
"-DDOWNLOAD_SEXP=off"
"-DDOWNLOAD_RUBYRNP=off"
];
nativeBuildInputs = with pkgs; [ asciidoctor cmake gnupg gtest pkg-config python3 ];
# NOTE: check-only inputs should ideally be moved to checkInputs, but it
# would fail during buildPhase.
# checkInputs = [ gtest python3 ];
outputs = [ "out" "lib" "dev" ];
preConfigure = ''
commitEpoch=$(date +%s)
baseVersion=$(cat version.txt)
echo "v$baseVersion-0-g0-dirty+$commitEpoch" > version.txt
# For generating the correct timestamp in cmake
export SOURCE_DATE_EPOCH=$commitEpoch
'';
meta = with lib; {
homepage = "https://github.com/rnpgp/rnp";
description = "High performance C++ OpenPGP library, fully compliant to RFC 4880";
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ ribose-jeffreylau ];
};
}