From 028a4bdd6d3a13d0dc61de32868130d953dab366 Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 11 Mar 2024 12:14:14 +0100 Subject: [PATCH 1/4] arduino-cli: 0.35.2 -> 0.35.3 --- pkgs/development/embedded/arduino/arduino-cli/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix index fcc4c84e7cba..95297f04424c 100644 --- a/pkgs/development/embedded/arduino/arduino-cli/default.nix +++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix @@ -4,13 +4,13 @@ let pkg = buildGoModule rec { pname = "arduino-cli"; - version = "0.35.2"; + version = "0.35.3"; src = fetchFromGitHub { owner = "arduino"; repo = pname; rev = "v${version}"; - hash = "sha256-ctgDuWbNLMyQrxnarTbCtGXM5G+bPeS4Xa7eTbkFo0k="; + hash = "sha256-brWWoIOQhU/isd48VCx6tczAJnamBuOa6e/xezuHN7E="; }; nativeBuildInputs = [ From 663096a9dc3efce72c84f0c6628dbcea981794ef Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 11 Mar 2024 12:14:52 +0100 Subject: [PATCH 2/4] 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; From 20fa19a8b4a4032d49a821192f132fbdd575628c Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 11 Mar 2024 12:26:26 +0100 Subject: [PATCH 3/4] arduino-cli: avoid creating temp files for completions We still need to set HOME or we get Error: invalid path creating config dir: /homeless-shelter/.arduino15 error: mkdir /homeless-shelter: permission denied --- pkgs/development/embedded/arduino/arduino-cli/default.nix | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix index 630f72237676..f1cba0cd975f 100644 --- a/pkgs/development/embedded/arduino/arduino-cli/default.nix +++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix @@ -55,10 +55,10 @@ let 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 - installShellCompletion --cmd arduino-cli --$s completion.$s - done + installShellCompletion --cmd arduino-cli \ + --bash <($out/bin/arduino-cli completion bash) \ + --zsh <($out/bin/arduino-cli completion zsh) \ + --fish <($out/bin/arduino-cli completion fish) unset HOME ''; From 59959d0ae7f6172eb986d3882f4ffd41b95c392a Mon Sep 17 00:00:00 2001 From: Stefan Frijters Date: Mon, 11 Mar 2024 12:27:15 +0100 Subject: [PATCH 4/4] arduino-cli: fix deprecation warning for substituteInPlace --replace --- pkgs/development/embedded/arduino/arduino-cli/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/embedded/arduino/arduino-cli/default.nix b/pkgs/development/embedded/arduino/arduino-cli/default.nix index f1cba0cd975f..2f0ce3e133ed 100644 --- a/pkgs/development/embedded/arduino/arduino-cli/default.nix +++ b/pkgs/development/embedded/arduino/arduino-cli/default.nix @@ -38,7 +38,7 @@ let ]; in '' substituteInPlace Taskfile.yml \ - --replace "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'" + --replace-fail "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'" ''; doCheck = stdenv.isLinux;