Unverified Commit fc3665f7 authored by WilliButz's avatar WilliButz
Browse files

botan3: fix selection of stdenv variant for static builds



Apparently with the move to by-name broke stdenv selection in such a way
that the resulting library archive from `pkgsStatic.botan3` no longer
was suitable for static linking, resulting in linking errors:

```
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: cannot find -lbz2: No such file
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: have you installed the static ve
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: cannot find -ljitterentropy: No
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: have you installed the static ve
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: cannot find -lz: No such file or
/nix/store/<...>-x86_64-unknown-linux-musl-binutils-2.44/bin/x86_64-unknown-linux-musl-ld: have you installed the static ve
```

Co-authored-by: default avatarMaximilian Bosch <maximilian@mbosch.me>
parent 2e98a05f
Loading
Loading
Loading
Loading
+4 −6
Original line number Diff line number Diff line
{
  lib,
  stdenv,
  buildPackages,
  libcxxStdenv,
  fetchurl,
  pkgsStatic,
  python3,
@@ -9,7 +9,6 @@
  bzip2,
  zlib,
  jitterentropy,
  darwin,
  esdm,
  tpm2-tss,
  static ? stdenv.hostPlatform.isStatic, # generates static libraries *only*
@@ -20,7 +19,7 @@
  # useful, but have to disable tests for now, as /dev/tpmrm0 is not accessible
  withTpm2 ? false,
  policy ? null,
}:
}@args:

assert lib.assertOneOf "policy" policy [
  # no explicit policy is given. The defaults by the library are used
@@ -32,11 +31,10 @@ assert lib.assertOneOf "policy" policy [
  # only allow "modern" algorithms
  "modern"
];

let
  stdenv' = if static then buildPackages.libcxxStdenv else stdenv;
  stdenv = if static then libcxxStdenv else args.stdenv;
in
stdenv'.mkDerivation (finalAttrs: {
stdenv.mkDerivation (finalAttrs: {
  version = "3.9.0";
  pname = "botan";