2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, asciidoctor
|
|
|
|
, botan2
|
|
|
|
, bzip2
|
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gnupg
|
|
|
|
, gtest
|
|
|
|
, json_c
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
2023-07-15 17:15:38 +00:00
|
|
|
, sexpp
|
2021-06-28 23:13:55 +00:00
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-06-28 23:13:55 +00:00
|
|
|
pname = "rnp";
|
2023-07-15 17:15:38 +00:00
|
|
|
version = "0.17.0";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rnpgp";
|
|
|
|
repo = "rnp";
|
2023-07-15 17:15:38 +00:00
|
|
|
rev = "v${finalAttrs.version}";
|
|
|
|
hash = "sha256-4fB7Sl9+ATrJTRnhbNG5BoW3XLxR7IP167RK96+gxj0=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
buildInputs = [ zlib bzip2 json_c botan2 sexpp ];
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
./unbundle-sexpp.patch
|
|
|
|
./sexp_sexpp_rename.patch
|
|
|
|
];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
|
|
|
|
"-DBUILD_SHARED_LIBS=on"
|
|
|
|
"-DBUILD_TESTING=on"
|
|
|
|
"-DDOWNLOAD_GTEST=off"
|
|
|
|
"-DDOWNLOAD_RUBYRNP=off"
|
|
|
|
];
|
|
|
|
|
|
|
|
nativeBuildInputs = [ asciidoctor cmake gnupg gtest pkg-config python3 ];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
# NOTE: check-only inputs should ideally be moved to nativeCheckInputs, but it
|
2021-06-28 23:13:55 +00:00
|
|
|
# would fail during buildPhase.
|
2023-02-02 18:25:31 +00:00
|
|
|
# nativeCheckInputs = [ gtest python3 ];
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
2023-07-15 17:15:38 +00:00
|
|
|
echo "v${finalAttrs.version}" > version.txt
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
2023-07-15 17:15:38 +00:00
|
|
|
})
|