Merge pull request #227880 from SFrijters/arduino-cli-0.32.2

arduino-cli: 0.31.0 -> 0.32.2, enable (most) unittests

authored by

Doron Behar and committed by
GitHub
68054e5c 73037ab8

+31 -5
+31 -5
pkgs/development/embedded/arduino/arduino-cli/default.nix
··· 1 - { lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles }: 1 + { lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles, go-task }: 2 2 3 3 let 4 4 5 5 pkg = buildGoModule rec { 6 6 pname = "arduino-cli"; 7 - version = "0.31.0"; 7 + version = "0.32.2"; 8 8 9 9 src = fetchFromGitHub { 10 10 owner = "arduino"; 11 11 repo = pname; 12 12 rev = version; 13 - hash = "sha256-y51/5Gu6nTaL+XLP7hLk/gaksIdRahecl5q5jYBWATE="; 13 + hash = "sha256-Em8L2ZYS1rgW46/MP5hs/EBWGcb5GP3EDEzWi072F/I="; 14 14 }; 15 15 16 16 nativeBuildInputs = [ 17 17 installShellFiles 18 18 ]; 19 19 20 + nativeCheckInputs = [ 21 + go-task 22 + ]; 23 + 20 24 subPackages = [ "." ]; 21 25 22 - vendorSha256 = "sha256-JuuGJuSax2tfuQHH/Hqk1JpQE2OboYJKJjzPjIZ1UD8="; 26 + vendorSha256 = "sha256-+5Cj6wdX25fK+Y9czTwRRqCdY+0iarvii9nD3QMDh+c="; 23 27 24 - doCheck = false; 28 + postPatch = let 29 + skipTests = [ 30 + # tries to "go install" 31 + "TestDummyMonitor" 32 + # try to Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2" 33 + "TestDownloadAndChecksums" 34 + "TestParseArgs" 35 + "TestParseReferenceCores" 36 + "TestPlatformSearch" 37 + "TestPlatformSearchSorting" 38 + ]; 39 + in '' 40 + substituteInPlace Taskfile.yml \ 41 + --replace "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'" 42 + ''; 43 + 44 + doCheck = stdenv.isLinux; 45 + 46 + checkPhase = '' 47 + runHook preCheck 48 + task go:test 49 + runHook postCheck 50 + ''; 25 51 26 52 ldflags = [ 27 53 "-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown"