From 663096a9dc3efce72c84f0c6628dbcea981794ef Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 11 Mar 2024 12:14:52 +0100 Subject: [PATCH] arduino-cli: only generate/install shell completion if we can run the executable --- pkgs/development/embedded/arduino/arduino-cli/default.nix | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix index 95297f04424c..630f72237676 100644 --- a/pkgs/development/embedded/arduino/arduino-cli/default.nix +++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix @@ -53,7 +53,7 @@ let "-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown" ] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ]; - postInstall = '' + postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' export HOME="$(mktemp -d)" for s in {bash,zsh,fish}; do $out/bin/arduino-cli completion $s > completion.$s @@ -85,6 +85,7 @@ if stdenv.isLinux then extraInstallCommands = '' mv $out/bin/$name $out/bin/arduino-cli + '' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) '' cp -r ${pkg.outPath}/share $out/share ''; passthru.pureGoPkg = pkg;