about summary refs log tree commit diff
path: root/pkgs/tools/security/hash-slinger
diff options
context:
space:
mode:
authorFabian Affolter <mail@fabian-affolter.ch>2021-10-22 17:23:48 +0200
committerArtturin <Artturin@artturin.com>2021-11-11 18:55:17 +0200
commit750f9aaac938d50e2c93d57f197cc9968fa9b577 (patch)
tree671e7909a44a404ab1972bce9f13144050cdc28e /pkgs/tools/security/hash-slinger
parent1326545a4e848c532ce8f199aeeb661d051f2f70 (diff)
hash-slinger: 2.7 -> 3.1
Diffstat (limited to 'pkgs/tools/security/hash-slinger')
-rw-r--r--pkgs/tools/security/hash-slinger/default.nix60
1 files changed, 39 insertions, 21 deletions
diff --git a/pkgs/tools/security/hash-slinger/default.nix b/pkgs/tools/security/hash-slinger/default.nix
index ee06c112481b7..e51d93e9d7fa0 100644
--- a/pkgs/tools/security/hash-slinger/default.nix
+++ b/pkgs/tools/security/hash-slinger/default.nix
@@ -1,45 +1,63 @@
-{ lib, stdenv, fetchFromGitHub, python2Packages, unbound, libreswan }:
+{ lib
+, stdenv
+, fetchFromGitHub
+, python3
+, unbound
+, libreswan
+}:
 
-let
-  pythonPackages = python2Packages;
-in stdenv.mkDerivation rec {
-  pname    = "hash-slinger";
-  version = "2.7";
+stdenv.mkDerivation rec {
+  pname = "hash-slinger";
+  version = "3.1";
 
   src = fetchFromGitHub {
     owner = "letoams";
     repo = pname;
     rev = version;
-    sha256 = "05wn744ydclpnpyah6yfjqlfjlasrrhzj48lqmm5a91nyps5yqyn";
+    sha256 = "sha256-mhMUdZt846QjwRIh2m/4EE+93fUcCKc2FFeoFpzKYvk=";
   };
 
-  pythonPath = with pythonPackages; [ dnspython m2crypto ipaddr python-gnupg
-                                      pyunbound ];
+  pythonPath = with python3.pkgs; [
+    dnspython
+    m2crypto
+    python-gnupg
+    pyunbound
+  ];
 
-  buildInputs = [ pythonPackages.wrapPython ];
-  propagatedBuildInputs = [ unbound libreswan ] ++ pythonPath;
-  propagatedUserEnvPkgs = [ unbound libreswan ];
+  buildInputs = [
+    python3.pkgs.wrapPython
+  ];
 
-  patchPhase = ''
+  propagatedBuildInputs = [
+    unbound
+    libreswan
+  ] ++ pythonPath;
+
+  propagatedUserEnvPkgs = [
+    unbound
+    libreswan
+  ];
+
+  postPatch = ''
     substituteInPlace Makefile \
       --replace "$(DESTDIR)/usr" "$out"
     substituteInPlace ipseckey \
       --replace "/usr/sbin/ipsec" "${libreswan}/sbin/ipsec"
     substituteInPlace tlsa \
-      --replace "/var/lib/unbound/root" "${pythonPackages.pyunbound}/etc/pyunbound/root"
+      --replace "/var/lib/unbound/root" "${python3.pkgs.pyunbound}/etc/pyunbound/root"
     patchShebangs *
-    '';
+  '';
 
   installPhase = ''
-    mkdir -p $out/bin $out/man $out/${pythonPackages.python.sitePackages}/
+    mkdir -p $out/bin $out/man $out/lib/${python3.libPrefix}/site-packages
     make install
     wrapPythonPrograms
-   '';
+  '';
 
-   meta = {
+  meta = with lib; {
     description = "Various tools to generate special DNS records";
-    homepage    = "https://github.com/letoams/hash-slinger";
-    license     = lib.licenses.gpl2Plus;
-    maintainers = [ lib.maintainers.leenaars ];
+    homepage = "https://github.com/letoams/hash-slinger";
+    license = licenses.gpl2Plus;
+    maintainers = with maintainers; [ leenaars ];
   };
 }