2021-02-24 11:02:23 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, asciidoctor
|
|
|
|
, botan2
|
|
|
|
, bzip2
|
|
|
|
, cmake
|
|
|
|
, fetchFromGitHub
|
|
|
|
, gnupg
|
|
|
|
, gtest
|
|
|
|
, json_c
|
|
|
|
, pkg-config
|
|
|
|
, python3
|
|
|
|
, zlib
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "rnp";
|
2022-09-22 18:28:47 +00:00
|
|
|
version = "0.16.2";
|
2021-02-24 11:02:23 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "rnpgp";
|
|
|
|
repo = "rnp";
|
|
|
|
rev = "v${version}";
|
2022-09-22 18:28:47 +00:00
|
|
|
sha256 = "sha256-KHItrpuKXaLGF1mcpju/RJFnm2yPZyYq4eIoRGqf5Y8=";
|
2021-02-24 11:02:23 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
buildInputs = [ zlib bzip2 json_c botan2 ];
|
|
|
|
|
|
|
|
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-01-21 12:00:00 +00:00
|
|
|
# NOTE: check-only inputs should ideally be moved to nativeCheckInputs, but it
|
2021-02-24 11:02:23 +00:00
|
|
|
# would fail during buildPhase.
|
2023-01-21 12:00:00 +00:00
|
|
|
# nativeCheckInputs = [ gtest python3 ];
|
2021-02-24 11:02:23 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "lib" "dev" ];
|
|
|
|
|
|
|
|
preConfigure = ''
|
|
|
|
echo "v${version}" > version.txt
|
|
|
|
'';
|
|
|
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|