summaryrefslogtreecommitdiffstats
path: root/default.nix
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:32:49 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 03:32:49 +0000
commit8053187731ae8e3eb368d8360989cf5fd6eed9f7 (patch)
tree32bada84ff5d7460cdf3934fcbdbe770d6afe4cd /default.nix
parentInitial commit. (diff)
downloadrnp-8053187731ae8e3eb368d8360989cf5fd6eed9f7.tar.xz
rnp-8053187731ae8e3eb368d8360989cf5fd6eed9f7.zip
Adding upstream version 0.17.0.upstream/0.17.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r--default.nix44
1 files changed, 44 insertions, 0 deletions
diff --git a/default.nix b/default.nix
new file mode 100644
index 0000000..1ab6b1f
--- /dev/null
+++ b/default.nix
@@ -0,0 +1,44 @@
+{ pkgs ? import <nixpkgs> { }
+, lib ? pkgs.lib
+, stdenv ? pkgs.stdenv
+}:
+
+stdenv.mkDerivation rec {
+ pname = "rnp";
+ version = "unstable";
+
+ src = ./.;
+
+ buildInputs = with pkgs; [ zlib bzip2 json_c botan2 ];
+
+ cmakeFlags = [
+ "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}"
+ "-DBUILD_SHARED_LIBS=on"
+ "-DBUILD_TESTING=on"
+ "-DDOWNLOAD_GTEST=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 ];
+ };
+} \ No newline at end of file