about summary refs log tree commit diff
path: root/pkgs/by-name/dj
diff options
context:
space:
mode:
authorOliver Richter <oliver.richter@secunet.com>2023-07-27 12:21:24 +0200
committerOliver Richter <oliver.richter@secunet.com>2023-09-14 13:05:29 +0200
commitf83348c6ea6ba1ce649115c9f7cfbd8eff5c5639 (patch)
tree90d1b09c0e39fc28a192d3a828b5c1d675ef1697 /pkgs/by-name/dj
parentef4efd8aff2a7954c109a94030971ac9bdcd3fee (diff)
djent: init at 1.0
Add djent as a package. djent is a reimplementation of ent, which is a tool for entropy estimation.

Signed-off-by: Oliver Richter <richter-oliver@gmx.net>
Diffstat (limited to 'pkgs/by-name/dj')
-rw-r--r--pkgs/by-name/dj/djent/package.nix47
1 files changed, 47 insertions, 0 deletions
diff --git a/pkgs/by-name/dj/djent/package.nix b/pkgs/by-name/dj/djent/package.nix
new file mode 100644
index 0000000000000..3559410fbd292
--- /dev/null
+++ b/pkgs/by-name/dj/djent/package.nix
@@ -0,0 +1,47 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, mpfr
+}:
+
+stdenv.mkDerivation rec {
+  pname = "djent";
+  version = "1.0";
+
+  src = fetchFromGitHub {
+    owner = "dj-on-github";
+    repo = "djent";
+    rev = "${version}";
+    hash = "sha256-inMh7l/6LlrVnIin+L+fj+4Lchk0Xvt09ngVrCuvphE=";
+  };
+
+  buildInputs = [ mpfr ];
+
+  preBuild = ''
+    sed -i s/gcc/${stdenv.cc.targetPrefix}gcc/g Makefile
+  ''
+  + lib.optionalString (!stdenv.hostPlatform.isx86_64) ''
+    sed -i s/-m64//g Makefile
+  '';
+
+  makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
+
+  installPhase = ''
+    runHook preInstall
+    install -D djent $out/bin/djent
+    runHook postInstall
+  '';
+
+  enableParallelBuilding = true;
+
+  meta = {
+    homepage = "http://www.deadhat.com/";
+    description = ''
+      A reimplementation of the Fourmilab/John Walker random number test program
+      ent with several improvements
+    '';
+    license = lib.licenses.gpl2Only;
+    platforms = lib.platforms.all;
+    maintainers = with lib.maintainers; [ orichter thillux ];
+  };
+}