python3Packages.orjson: Disable failing tests on 32 bit
[NixPkgs.git] / pkgs / development / libraries / p11-kit / default.nix
blob1f2646a03638d38fdd71e23354f6b06a1c8551f0
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , autoreconfHook
5 , docbook-xsl-nons
6 , gtk-doc
7 , installShellFiles
8 , libxslt # for xsltproc
9 , pkg-config
10 , which
11 , libffi
12 , libiconv
13 , libintl
14 , libtasn1
17 stdenv.mkDerivation rec {
18   pname = "p11-kit";
19   version = "0.24.1";
21   src = fetchFromGitHub {
22     owner = "p11-glue";
23     repo = pname;
24     rev = version;
25     hash = "sha256-1QIMEGBZsqLYU3v5ZswD5K9VcIGLBovJlC10lBHhH7c=";
26   };
28   outputs = [ "out" "bin" "dev"];
30   # For cross platform builds of p11-kit, libtasn1 in nativeBuildInputs
31   # provides the asn1Parser binary on the hostPlatform needed for building.
32   # at the same time, libtasn1 in buildInputs provides the libasn1 library
33   # to link against for the target platform.
34   # Hence, libtasn1 is required in both native and build inputs.
35   nativeBuildInputs = [
36     autoreconfHook
37     docbook-xsl-nons
38     gtk-doc
39     installShellFiles
40     libtasn1
41     libxslt.bin
42     pkg-config
43     which
44   ];
46   buildInputs = [
47     libffi
48     libiconv
49     libintl
50     libtasn1
51   ];
53   autoreconfPhase = ''
54     NOCONFIGURE=1 ./autogen.sh
55   '';
57   configureFlags = [
58     "--enable-doc"
59     "--sysconfdir=/etc"
60     "--localstatedir=/var"
61     "--with-trust-paths=${lib.concatStringsSep ":" [
62       "/etc/ssl/trust-source"                  # p11-kit trust source
63       "/etc/ssl/certs/ca-certificates.crt"     # NixOS + Debian/Ubuntu/Arch/Gentoo...
64       "/etc/pki/tls/certs/ca-bundle.crt"       # Fedora/CentOS
65       "/var/lib/ca-certificates/ca-bundle.pem" # openSUSE
66       "/etc/ssl/cert.pem"                      # Darwin/macOS
67     ]}"
68   ];
70   enableParallelBuilding = true;
72   # Tests run in fakeroot for non-root users
73   preCheck = ''
74     if [ "$(id -u)" != "0" ]; then
75       export FAKED_MODE=1
76     fi
77   '';
79   doCheck = !stdenv.isDarwin;
81   installFlags = [
82     "exampledir=${placeholder "out"}/etc/pkcs11"
83   ];
85   postInstall = ''
86     installShellCompletion --bash bash-completion/{p11-kit,trust}
87   '';
89   meta = with lib; {
90     description = "Library for loading and sharing PKCS#11 modules";
91     longDescription = ''
92       Provides a way to load and enumerate PKCS#11 modules.
93       Provides a standard configuration setup for installing
94       PKCS#11 modules in such a way that they're discoverable.
95     '';
96     homepage = "https://p11-glue.github.io/p11-glue/p11-kit.html";
97     changelog = [
98       "https://github.com/p11-glue/p11-kit/raw/${version}/NEWS"
99       "https://github.com/p11-glue/p11-kit/releases/tag/${version}"
100     ];
101     platforms = platforms.all;
102     license = licenses.bsd3;
103   };