From e2c555799cc9c6037af7d29ee083dda3560c268d Mon Sep 17 00:00:00 2001 From: Adam Joseph Date: Mon, 5 Jun 2023 18:42:31 -0700 Subject: [PATCH] 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 b0b5ef7286dca098f40f5075175105c3c0dfbe05) to prevent nixpkgs addingn `--disable-shared` to doas' configureFlags. --- pkgs/tools/security/doas/default.nix | 8 +++----- pkgs/tools/security/doas/disable-shared.patch | 13 ------------- 2 files changed, 3 insertions(+), 18 deletions(-) delete mode 100644 pkgs/tools/security/doas/disable-shared.patch diff --git a/pkgs/tools/security/doas/default.nix b/pkgs/tools/security/doas/default.nix index ce360d8234559..ad08cd8056bed 100644 --- a/pkgs/tools/security/doas/default.nix +++ b/pkgs/tools/security/doas/default.nix @@ -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) '' diff --git a/pkgs/tools/security/doas/disable-shared.patch b/pkgs/tools/security/doas/disable-shared.patch deleted file mode 100644 index 2f8869ee69884..0000000000000 --- a/pkgs/tools/security/doas/disable-shared.patch +++ /dev/null @@ -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 ;;