From 646a850fc16ae870def4933a2d159291ea82970c Mon Sep 17 00:00:00 2001 From: Profpatsch Date: Mon, 30 Nov 2020 23:46:04 +0100 Subject: [PATCH] fix(macos): allow multiple directories in the tarball Some of the releases (only MacOS, sigh) lately contain more than one directory. With this we should be able to get around that. --- build.nix | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build.nix b/build.nix index 3c765e2..956d438 100644 --- a/build.nix +++ b/build.nix @@ -23,13 +23,15 @@ pkgs.stdenv.mkDerivation rec { passthru.binNames = binNames; + sourceRoot = "."; + installPhase = '' mkdir -p $out/bin ${pkgs.lib.concatMapStringsSep "\n" (binName: '' binPath="$out/bin/${binName}" - install -D -m555 -T "${binName}" "$binPath" - rm "${binName}" + install -D -m555 -T "bin/${binName}" "$binPath" + rm "bin/${binName}" "$binPath" --bash-completion-script "$binPath" > "${binName}.bash" installShellCompletion --bash "${binName}.bash" @@ -42,6 +44,11 @@ pkgs.stdenv.mkDerivation rec { rm "${binName}.fish" '') binNames} + rmdir bin + + # a bit hacky, but sourceRoot unfortunately unpacks to the runtime build dir + rm env-vars .sandbox.sb || true + # check that we didn’t forget any files (maybe a new binary was added) if [ ! -z "$(${pkgs.lr}/bin/lr -1 -t 'depth == 1' .)" ]; then echo "still some files remaining!" >&2