Merge pull request #214386 from doronbehar/pkg/arduino-cli

arduino-cli: Install shell completion files

authored by

superherointj and committed by
GitHub
491dd41d 5a6b558d

+16 -1
+16 -1
pkgs/development/embedded/arduino/arduino-cli/default.nix
··· 1 - { lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv }: 1 + { lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv, installShellFiles }: 2 2 3 3 let 4 4 ··· 13 13 sha256 = "sha256-jew4KLpOOXE9N/h4qFqof8y26DQrvm78E/ARbbwocD4="; 14 14 }; 15 15 16 + nativeBuildInputs = [ 17 + installShellFiles 18 + ]; 19 + 16 20 subPackages = [ "." ]; 17 21 18 22 vendorSha256 = "sha256-BunonnjzGnpcmGJXxEQXvjJLGvdSXUOK9zAhXoAemHY="; ··· 23 27 "-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown" 24 28 ] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ]; 25 29 30 + postInstall = '' 31 + export HOME="$(mktemp -d)" 32 + for s in {bash,zsh,fish}; do 33 + $out/bin/arduino-cli completion $s > completion.$s 34 + installShellCompletion --cmd arduino-cli --$s completion.$s 35 + done 36 + unset HOME 37 + ''; 38 + 26 39 meta = with lib; { 27 40 inherit (src.meta) homepage; 28 41 description = "Arduino from the command line"; ··· 46 59 47 60 extraInstallCommands = '' 48 61 mv $out/bin/$name $out/bin/arduino-cli 62 + cp -r ${pkg.outPath}/share $out/share 49 63 ''; 64 + passthru.pureGoPkg = pkg; 50 65 51 66 targetPkgs = pkgs: with pkgs; [ 52 67 zlib