From ae13cc9790d198065644eda8363f3e84a81f8932 Mon Sep 17 00:00:00 2001 From: Robert Hensing Date: Thu, 10 Dec 2020 20:45:08 +0100 Subject: [PATCH] haskell.lib.generateOptparseApplicativeCompletion: support separate bin --- pkgs/development/haskell-modules/lib.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/development/haskell-modules/lib.nix b/pkgs/development/haskell-modules/lib.nix index 6bcc563164e..964c179fb65 100644 --- a/pkgs/development/haskell-modules/lib.nix +++ b/pkgs/development/haskell-modules/lib.nix @@ -414,13 +414,13 @@ rec { */ generateOptparseApplicativeCompletion = exeName: pkg: overrideCabal pkg (drv: { postInstall = (drv.postInstall or "") + '' - bashCompDir="$out/share/bash-completion/completions" - zshCompDir="$out/share/zsh/vendor-completions" - fishCompDir="$out/share/fish/vendor_completions.d" + bashCompDir="''${!outputBin}/share/bash-completion/completions" + zshCompDir="''${!outputBin}/share/zsh/vendor-completions" + fishCompDir="''${!outputBin}/share/fish/vendor_completions.d" mkdir -p "$bashCompDir" "$zshCompDir" "$fishCompDir" - "$out/bin/${exeName}" --bash-completion-script "$out/bin/${exeName}" >"$bashCompDir/${exeName}" - "$out/bin/${exeName}" --zsh-completion-script "$out/bin/${exeName}" >"$zshCompDir/_${exeName}" - "$out/bin/${exeName}" --fish-completion-script "$out/bin/${exeName}" >"$fishCompDir/${exeName}.fish" + "''${!outputBin}/bin/${exeName}" --bash-completion-script "''${!outputBin}/bin/${exeName}" >"$bashCompDir/${exeName}" + "''${!outputBin}/bin/${exeName}" --zsh-completion-script "''${!outputBin}/bin/${exeName}" >"$zshCompDir/_${exeName}" + "''${!outputBin}/bin/${exeName}" --fish-completion-script "''${!outputBin}/bin/${exeName}" >"$fishCompDir/${exeName}.fish" # Sanity check grep -F ${exeName} <$bashCompDir/${exeName} >/dev/null || {