nixpkgs/pkgs/tools/security/passage/darwin-getopt-path.patch
Paul Haerle f3a2296445
passage: use getopt from nix on darwin (#241293)
* passage: use getopt from nix on darwin

This removes an ugly hack from upstream which hard-codes a bunch of
paths to find gnu-getopt (as opposed to darwins getopt in
/usr/bin/getopt).

This lets nix-built passage fail on systems which don't have one of
those already installed (i.e. from homebrew).

As upstream seemingly doesn't provide a way to override this easily yet,
we do it ourselves.

---------

Co-authored-by: Weijia Wang <9713184+wegank@users.noreply.github.com>
2023-07-04 10:14:55 +03:00

13 lines
473 B
Diff

diff --git a/src/platform/darwin.sh b/src/platform/darwin.sh
index 9a1fda8..4f7ce3d 100644
--- a/src/platform/darwin.sh
+++ b/src/platform/darwin.sh
@@ -39,6 +39,6 @@ qrcode() {
fi
}
-GETOPT="$({ test -x /usr/local/opt/gnu-getopt/bin/getopt && echo /usr/local/opt/gnu-getopt; } || brew --prefix gnu-getopt 2>/dev/null || { command -v port &>/dev/null && echo /opt/local; } || echo /usr/local)/bin/getopt"
+GETOPT="@GETOPT@"
SHRED="srm -f -z"
BASE64="openssl base64"