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.
This commit is contained in:
Profpatsch 2020-11-30 23:46:04 +01:00
parent 635d2ed992
commit 646a850fc1

View file

@ -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 didnt 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