···
···
static ? stdenv.hostPlatform.isStatic, # generates static libraries *only*
# useful, but have to disable tests for now, as /dev/tpmrm0 is not accessible
19
-
# only allow BSI approved algorithms, FFI and SHAKE for XMSS
20
-
with_bsi_policy ? false,
21
-
# only allow NIST approved algorithms
22
-
with_fips140_policy ? false,
25
-
assert (!with_bsi_policy && !with_fips140_policy) || (with_bsi_policy != with_fips140_policy);
23
+
assert lib.assertOneOf "policy" policy [
24
+
# no explicit policy is given. The defaults by the library are used
26
+
# only allow BSI approved algorithms, FFI and SHAKE for XMSS
28
+
# only allow NIST approved algorithms in FIPS 140
30
+
# only allow "modern" algorithms
···
67
-
++ lib.optionals (stdenv.hostPlatform.isLinux && with_tpm2) [
74
+
++ lib.optionals (stdenv.hostPlatform.isLinux && withTpm2) [
++ lib.optionals (lib.versionAtLeast version "3.6.0") [
73
-
++ lib.optionals (lib.versionAtLeast version "3.7.0" && with_esdm) [
80
+
++ lib.optionals (lib.versionAtLeast version "3.7.0" && withEsdm) [
78
-
lib.optionals finalAttrs.finalPackage.doCheck [ "tests" ]
86
+
++ lib.optionals finalAttrs.finalPackage.doCheck [ "tests" ]
++ lib.optionals static [ "static" ]
80
-
++ lib.optionals (!static) [
88
+
++ lib.optionals (!static) [ "shared" ];
···
++ lib.optionals stdenv.cc.isClang [
101
-
++ lib.optionals (stdenv.hostPlatform.isLinux && with_tpm2) [
106
+
++ lib.optionals (stdenv.hostPlatform.isLinux && withTpm2) [
++ lib.optionals (lib.versionAtLeast version "3.6.0") [
"--enable-modules=jitter_rng"
107
-
++ lib.optionals (lib.versionAtLeast version "3.7.0" && with_esdm) [
112
+
++ lib.optionals (lib.versionAtLeast version "3.7.0" && withEsdm) [
"--enable-modules=esdm_rng"
110
-
++ lib.optionals (lib.versionAtLeast version "3.8.0" && with_bsi_policy) [
111
-
"--module-policy=bsi"
115
+
++ lib.optionals (lib.versionAtLeast version "3.8.0" && policy != null) [
116
+
"--module-policy=${policy}"
118
+
++ lib.optionals (lib.versionAtLeast version "3.8.0" && policy == "bsi") [
115
-
++ lib.optionals (lib.versionAtLeast version "3.8.0" && with_fips140_policy) [
116
-
"--module-policy=fips140"
···
ln -s botan-*.pc botan.pc || true
142
+
passthru.tests = lib.optionalAttrs (lib.versionAtLeast version "3") {
143
+
static = pkgsStatic.botan3;
description = "Cryptographic algorithms library";
···
maintainers = with maintainers; [
platforms = platforms.unix;