mirror of
https://github.com/justinwoo/easy-dhall-nix.git
synced 2024-11-22 19:19:42 +01:00
feat(build): allow multiple binaries
I gave in because I wanted to use yaml-to-dhall, so this implements copying multiple binaries.
This commit is contained in:
parent
66da4ffe17
commit
f0270205ee
6 changed files with 22 additions and 15 deletions
27
build.nix
27
build.nix
|
@ -1,6 +1,6 @@
|
|||
{ pkgs, release }:
|
||||
|
||||
{ simpleName, binName, attrName }:
|
||||
{ simpleName, binNames, attrName }:
|
||||
|
||||
let
|
||||
release = import ./release.nix;
|
||||
|
@ -23,9 +23,22 @@ pkgs.stdenv.mkDerivation rec {
|
|||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
binPath="$out/bin/${binName}"
|
||||
install -D -m555 -T "${binName}" "$binPath"
|
||||
rm "${binName}"
|
||||
|
||||
${pkgs.lib.concatMapStringsSep "\n" (binName: ''
|
||||
binPath="$out/bin/${binName}"
|
||||
install -D -m555 -T "${binName}" "$binPath"
|
||||
rm "${binName}"
|
||||
|
||||
"$binPath" --bash-completion-script "$binPath" > "${binName}.bash"
|
||||
installShellCompletion --bash "${binName}.bash"
|
||||
rm "${binName}.bash"
|
||||
"$binPath" --zsh-completion-script "$binPath" > "${binName}.zsh"
|
||||
installShellCompletion --zsh "${binName}.zsh"
|
||||
rm "${binName}.zsh"
|
||||
"$binPath" --fish-completion-script "$binPath" > "${binName}.fish"
|
||||
installShellCompletion --fish "${binName}.fish"
|
||||
rm "${binName}.fish"
|
||||
'') binNames}
|
||||
|
||||
# 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
|
||||
|
@ -34,11 +47,5 @@ pkgs.stdenv.mkDerivation rec {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
"$binPath" --bash-completion-script "$binPath" > "${binName}.bash"
|
||||
installShellCompletion --bash "${binName}.bash"
|
||||
"$binPath" --zsh-completion-script "$binPath" > "${binName}.zsh"
|
||||
installShellCompletion --zsh "${binName}.zsh"
|
||||
"$binPath" --fish-completion-script "$binPath" > "${binName}.fish"
|
||||
installShellCompletion --fish "${binName}.fish"
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
import ./build.nix { inherit pkgs; release = import ./release.nix; } {
|
||||
simpleName = "dhall-bash-simple";
|
||||
binName = "dhall-to-bash";
|
||||
binNames = [ "dhall-to-bash" ];
|
||||
attrName = "dhall-bash";
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
import ./build.nix { inherit pkgs; release = import ./release.nix; } {
|
||||
simpleName = "dhall-lsp-simple";
|
||||
binName = "dhall-lsp-server";
|
||||
binNames = [ "dhall-lsp-server" ];
|
||||
attrName = "dhall-lsp-server";
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
import ./build.nix { inherit pkgs; release = import ./release.nix; } {
|
||||
simpleName = "dhall-nix-simple";
|
||||
binName = "dhall-to-nix";
|
||||
binNames = [ "dhall-to-nix" ];
|
||||
attrName = "dhall-nix";
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
import ./build.nix { inherit pkgs; release = import ./release.nix; } {
|
||||
simpleName = "dhall-simple";
|
||||
binName = "dhall";
|
||||
binNames = [ "dhall" ];
|
||||
attrName = "dhall";
|
||||
}
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
|
||||
import ./build.nix { inherit pkgs; release = import ./release.nix; } {
|
||||
simpleName = "dhall-yaml-simple";
|
||||
binName = "dhall-to-yaml-ng";
|
||||
binNames = [ "dhall-to-yaml-ng" "yaml-to-dhall" ];
|
||||
attrName = "dhall-yaml";
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue