lol
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, sexpp
14, zlib
15}:
16
17stdenv.mkDerivation (finalAttrs: {
18 pname = "rnp";
19 version = "0.17.0";
20
21 src = fetchFromGitHub {
22 owner = "rnpgp";
23 repo = "rnp";
24 rev = "v${finalAttrs.version}";
25 hash = "sha256-4fB7Sl9+ATrJTRnhbNG5BoW3XLxR7IP167RK96+gxj0=";
26 };
27
28 buildInputs = [ zlib bzip2 json_c botan2 sexpp ];
29
30 patches = [
31 ./unbundle-sexpp.patch
32 ./sexp_sexpp_rename.patch
33 ];
34
35 cmakeFlags = [
36 "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
37 "-DBUILD_SHARED_LIBS=on"
38 "-DBUILD_TESTING=on"
39 "-DDOWNLOAD_GTEST=off"
40 "-DDOWNLOAD_RUBYRNP=off"
41 ];
42
43 nativeBuildInputs = [ asciidoctor cmake gnupg gtest pkg-config python3 ];
44
45 # NOTE: check-only inputs should ideally be moved to nativeCheckInputs, but it
46 # would fail during buildPhase.
47 # nativeCheckInputs = [ gtest python3 ];
48
49 outputs = [ "out" "lib" "dev" ];
50
51 preConfigure = ''
52 echo "v${finalAttrs.version}" > version.txt
53 '';
54
55 meta = with lib; {
56 homepage = "https://github.com/rnpgp/rnp";
57 description = "High performance C++ OpenPGP library, fully compliant to RFC 4880";
58 license = licenses.bsd2;
59 platforms = platforms.all;
60 maintainers = with maintainers; [ ribose-jeffreylau ];
61 };
62})