doas: drop patch, use dontAddStaticConfigureFlags instead

The configure script that comes with doas does not understand
`--disable-shared`, which nixpkgs sometimes adds to
`configureFlags`.

Previously, doas included a patch that would cause its configure
script to ignore this flag instead of rejecting it.  This commit
drops that patch and instead uses
`dontAddStaticConfigureFlags=false` (introduced in
b0b5ef7286) to prevent nixpkgs addingn
`--disable-shared` to doas' configureFlags.
This commit is contained in:
Adam Joseph 2023-06-05 18:42:31 -07:00 committed by Cole Helbling
parent 92777e645e
commit e2c555799c
2 changed files with 3 additions and 18 deletions

View File

@ -32,13 +32,11 @@ stdenv.mkDerivation rec {
# Allow doas to discover binaries in /run/current-system/sw/{s,}bin and
# /run/wrappers/bin
./0001-add-NixOS-specific-dirs-to-safe-PATH.patch
# Standard environment supports "dontDisableStatic" knob, but has no
# equivalent for "--disable-shared", so I have to patch "configure"
# script instead.
./disable-shared.patch
];
# ./configure script does not understand `--disable-shared`
dontAddStaticConfigureFlags = true;
postPatch = ''
sed -i '/\(chown\|chmod\)/d' GNUmakefile
'' + lib.optionalString (withPAM && stdenv.hostPlatform.isStatic) ''

View File

@ -1,13 +0,0 @@
Accept and ignore "--disable-shared" option passed by pkgsStatic.stdenv.
Without this patch, configure phase fails with "unknown option".
--- a/configure 1970-01-01 00:00:00.000000000 -0500
+++ b/configure 1970-01-01 00:00:00.000000000 -0500
@@ -46,6 +46,7 @@
opt=${x%%=*}
var=${x#*=}
case "$opt" in
+ --disable-shared) : ;;
--prefix) PREFIX=$var ;;
--exec-prefix) EPREFIX=$var ;;
--bindir) BINDIR=$var ;;