1{ lib
2, stdenv
3, asciidoctor
4, botan2
5, bzip2
6, cmake
7, fetchFromGitHub
8, gnupg
9, gtest
10, json_c
11, pkg-config
12, python3
13, zlib
14}:
15
16stdenv.mkDerivation rec {
17 pname = "rnp";
18 version = "0.15.2";
19
20 src = fetchFromGitHub {
21 owner = "rnpgp";
22 repo = "rnp";
23 rev = "v${version}";
24 sha256 = "1jph69nsz245fbv04nalh1qmhniyh88sacsf3nxv1vxm190314i9";
25 };
26
27 patches = [ ./cmake_nogit.patch ];
28
29 buildInputs = [ zlib bzip2 json_c botan2 ];
30
31 cmakeFlags = [
32 "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
33 "-DBUILD_SHARED_LIBS=on"
34 "-DBUILD_TESTING=on"
35 "-DDOWNLOAD_GTEST=off"
36 "-DDOWNLOAD_RUBYRNP=off"
37 ];
38
39 nativeBuildInputs = [ asciidoctor cmake gnupg gtest pkg-config python3 ];
40
41 # NOTE: check-only inputs should ideally be moved to checkInputs, but it
42 # would fail during buildPhase.
43 # checkInputs = [ gtest python3 ];
44
45 outputs = [ "out" "lib" "dev" ];
46
47 preConfigure = ''
48 echo "v${version}" > version.txt
49 '';
50
51 meta = with lib; {
52 homepage = "https://github.com/rnpgp/rnp";
53 description = "High performance C++ OpenPGP library, fully compliant to RFC 4880";
54 license = licenses.bsd2;
55 platforms = platforms.all;
56 maintainers = with maintainers; [ ribose-jeffreylau ];
57 };
58}