summary refs log tree commit diff
path: root/pkgs/tools/security/opencryptoki/default.nix
diff options
context:
space:
mode:
authorRenaud <c0bw3b@users.noreply.github.com>2017-11-12 22:39:37 +0100
committerGitHub <noreply@github.com>2017-11-12 22:39:37 +0100
commitf1ec44ec943ddf49c8510d06f714cdffe8d1deaf (patch)
tree833e869763a8ac3278af14080befd5bf5b74f85b /pkgs/tools/security/opencryptoki/default.nix
parent2d8d35e342f947572e6151673dc6dfdb7a4d5cff (diff)
downloadnixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar.gz
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar.bz2
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar.lz
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar.xz
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.tar.zst
nixpkgs-f1ec44ec943ddf49c8510d06f714cdffe8d1deaf.zip
opencryptoki: 3.2 -> 3.8.1
Diffstat (limited to 'pkgs/tools/security/opencryptoki/default.nix')
-rw-r--r--pkgs/tools/security/opencryptoki/default.nix43
1 files changed, 23 insertions, 20 deletions
diff --git a/pkgs/tools/security/opencryptoki/default.nix b/pkgs/tools/security/opencryptoki/default.nix
index 9ea9c2f4892..f2929f3e22b 100644
--- a/pkgs/tools/security/opencryptoki/default.nix
+++ b/pkgs/tools/security/opencryptoki/default.nix
@@ -1,38 +1,41 @@
-{ stdenv, fetchurl, openssl, trousers, automake, autoconf, libtool, bison, flex }:
+{ stdenv, fetchFromGitHub, openssl, trousers, autoreconfHook, libtool, bison, flex }:
 
 stdenv.mkDerivation rec {
-  version = "3.2";
   name = "opencryptoki-${version}";
+  version = "3.8.1";
 
-  src = fetchurl {
-    url = "mirror://sourceforge/opencryptoki/opencryptoki/v${version}/opencryptoki-v${version}.tgz";
-    sha256 = "06r6zp299vxdspl6k65myzgjv0bihg7kc500v7s4jd3mcrkngd6h";
+  src = fetchFromGitHub {
+    owner = "opencryptoki";
+    repo = "opencryptoki";
+    rev = "v${version}";
+    sha256 = "1m618pjfzw18irmh6i4pfq1gvcxgyfh9ikjn33nrdj55v2l27g31";
   };
 
-  buildInputs = [ automake autoconf libtool openssl trousers bison flex ];
+  nativeBuildInputs = [ autoreconfHook libtool bison flex ];
+  buildInputs = [ openssl trousers ];
 
-  preConfigure = ''
-    substituteInPlace configure.in --replace "chown" "true"
-    substituteInPlace configure.in --replace "chgrp" "true"
-    sh bootstrap.sh --prefix=$out
+  postPatch = ''
+    substituteInPlace configure.ac \
+      --replace "usermod" "true" \
+      --replace "groupadd" "true" \
+      --replace "chmod" "true" \
+      --replace "chgrp" "true"
+    substituteInPlace usr/lib/Makefile.am --replace "DESTDIR" "out"
   '';
 
-  configureFlags = [ "--disable-ccatok" "--disable-icatok" ];
+  configureFlags = [
+    "--prefix=$(out)"
+    "--disable-ccatok"
+    "--disable-icatok"
+  ];
 
-  makeFlags = "DESTDIR=$(out)";
-
-  # work around the build script of opencryptoki
-  postInstall = ''
-    cp -r $out/$out/* $out
-    rm -r $out/nix
-    '';
+  enableParallelBuilding = true;
 
   meta = with stdenv.lib; {
     description = "PKCS#11 implementation for Linux";
-    homepage    = http://opencryptoki.sourceforge.net/;
+    homepage    = https://github.com/opencryptoki/opencryptoki;
     license     = licenses.cpl10;
     maintainers = [ maintainers.tstrobel ];
     platforms   = platforms.unix;
   };
 }
-