1{ lib
2, stdenv
3, fetchFromGitHub
4, autoreconfHook
5, bison
6, flex
7, openldap
8, openssl
9, trousers
10}:
11
12stdenv.mkDerivation rec {
13 pname = "opencryptoki";
14 version = "3.20.0";
15
16 src = fetchFromGitHub {
17 owner = "opencryptoki";
18 repo = "opencryptoki";
19 rev = "v${version}";
20 hash = "sha256-Z11CDw9ykmJ7MI7I0H4Y/i+8/I+hRgC2frklYPP1di0=";
21 };
22
23 nativeBuildInputs = [
24 autoreconfHook
25 bison
26 flex
27 ];
28
29 buildInputs = [
30 openldap
31 openssl
32 trousers
33 ];
34
35 postPatch = ''
36 substituteInPlace configure.ac \
37 --replace "usermod" "true" \
38 --replace "groupadd" "true" \
39 --replace "chmod" "true" \
40 --replace "chgrp" "true"
41 '';
42
43 configureFlags = [
44 "--prefix="
45 "--disable-ccatok"
46 "--disable-icatok"
47 ];
48
49 enableParallelBuilding = true;
50
51 installFlags = [
52 "DESTDIR=${placeholder "out"}"
53 ];
54
55 meta = with lib; {
56 changelog = "https://github.com/opencryptoki/opencryptoki/blob/${src.rev}/ChangeLog";
57 description = "PKCS#11 implementation for Linux";
58 homepage = "https://github.com/opencryptoki/opencryptoki";
59 license = licenses.cpl10;
60 maintainers = [ ];
61 platforms = platforms.unix;
62 };
63}