lol

pkgsStatic.doas: fix build

* Patch configure script to not die on --disable-shared
* Pass -laudit when building statically with PAM support. Upstream buiild
system does not use pkg-config, unfortunately.

authored by

Dmitry Bogatov and committed by helbling.dev 6fd104a8 74f2b890

+20
+7
pkgs/tools/security/doas/default.nix
··· 32 32 # Allow doas to discover binaries in /run/current-system/sw/{s,}bin and 33 33 # /run/wrappers/bin 34 34 ./0001-add-NixOS-specific-dirs-to-safe-PATH.patch 35 + 36 + # Standard environment supports "dontDisableStatic" knob, but has no 37 + # equivalent for "--disable-shared", so I have to patch "configure" 38 + # script instead. 39 + ./disable-shared.patch 35 40 ]; 36 41 37 42 postPatch = '' 38 43 sed -i '/\(chown\|chmod\)/d' GNUmakefile 44 + '' + lib.optionalString (withPAM && stdenv.hostPlatform.isStatic) '' 45 + sed -i 's/-lpam/-lpam -laudit/' configure 39 46 ''; 40 47 41 48 nativeBuildInputs = [ bison ];
+13
pkgs/tools/security/doas/disable-shared.patch
··· 1 + Accept and ignore "--disable-shared" option passed by pkgsStatic.stdenv. 2 + Without this patch, configure phase fails with "unknown option". 3 + 4 + --- a/configure 1970-01-01 00:00:00.000000000 -0500 5 + +++ b/configure 1970-01-01 00:00:00.000000000 -0500 6 + @@ -46,6 +46,7 @@ 7 + opt=${x%%=*} 8 + var=${x#*=} 9 + case "$opt" in 10 + + --disable-shared) : ;; 11 + --prefix) PREFIX=$var ;; 12 + --exec-prefix) EPREFIX=$var ;; 13 + --bindir) BINDIR=$var ;;