about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/jitterentropy
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/jitterentropy')
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/default.nix37
-rw-r--r--nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch13
2 files changed, 50 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
new file mode 100644
index 000000000000..6492077eee41
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/default.nix
@@ -0,0 +1,37 @@
+{ stdenv, fetchFromGitHub }:
+stdenv.mkDerivation rec {
+  pname = "jitterentropy";
+  version = "2.2.0";
+
+  src = fetchFromGitHub {
+    owner = "smuellerDD";
+    repo = "jitterentropy-library";
+    rev = "v${version}";
+    sha256 = "0n2l1fxr7bynnarpwdjifb2fvlsq8w5wmfh31yk5nrc756cjlgyw";
+  };
+  patches = [
+    # Can be removed when upgrading beyond 2.2.0
+    ./reproducible-manpages.patch
+  ];
+
+  enableParallelBuilding = true;
+
+  preInstall = ''
+    mkdir -p $out/include
+    substituteInPlace Makefile \
+      --replace "install -m 0755 -s" \
+                'install -m 0755 -s --strip-program $(STRIP)'
+  '';
+
+  installFlags = [
+    "PREFIX=$(out)"
+  ];
+
+  meta = {
+    description = "Provides a noise source using the CPU execution timing jitter";
+    homepage = https://github.com/smuellerDD/jitterentropy-library;
+    license = with stdenv.lib.licenses; [ gpl2 bsd3 ];
+    platforms = stdenv.lib.platforms.linux;
+    maintainers = with stdenv.lib.maintainers; [ johnazoidberg ];
+  };
+}
diff --git a/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch b/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch
new file mode 100644
index 000000000000..68de5a8ae781
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/jitterentropy/reproducible-manpages.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 4ff069b..3b8714a 100644
+--- a/Makefile
++++ b/Makefile
+@@ -58,7 +58,7 @@ cppcheck:
+ install:
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/share/man/man3
+ 	install -m 644 doc/$(NAME).3 $(DESTDIR)$(PREFIX)/share/man/man3/
+-	gzip -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
++	gzip -n -9 $(DESTDIR)$(PREFIX)/share/man/man3/$(NAME).3
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(LIBDIR)
+ 	install -m 0755 -s lib$(NAME).so.$(LIBVERSION) $(DESTDIR)$(PREFIX)/$(LIBDIR)/
+ 	install -d -m 0755 $(DESTDIR)$(PREFIX)/$(INCDIR)