arduino-cli: reformat according to nixpkgs RFC166
This commit is contained in:
parent
7df8684583
commit
38bc5fa17e
@ -1,4 +1,12 @@
|
|||||||
{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSEnv, installShellFiles, go-task }:
|
{
|
||||||
|
lib,
|
||||||
|
stdenv,
|
||||||
|
buildGoModule,
|
||||||
|
fetchFromGitHub,
|
||||||
|
buildFHSEnv,
|
||||||
|
installShellFiles,
|
||||||
|
go-task,
|
||||||
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
@ -13,33 +21,31 @@ let
|
|||||||
hash = "sha256-/2GtWiks/d8sTJ6slX2nQtFpGkqm4PSfgDd0uVG+qN8=";
|
hash = "sha256-/2GtWiks/d8sTJ6slX2nQtFpGkqm4PSfgDd0uVG+qN8=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [ installShellFiles ];
|
||||||
installShellFiles
|
|
||||||
];
|
|
||||||
|
|
||||||
nativeCheckInputs = [
|
nativeCheckInputs = [ go-task ];
|
||||||
go-task
|
|
||||||
];
|
|
||||||
|
|
||||||
subPackages = [ "." ];
|
subPackages = [ "." ];
|
||||||
|
|
||||||
vendorHash = "sha256-OkilZMDTueHfn6T5Af8e+CVersSPDMcAUUB2o1ny6nc=";
|
vendorHash = "sha256-OkilZMDTueHfn6T5Af8e+CVersSPDMcAUUB2o1ny6nc=";
|
||||||
|
|
||||||
postPatch = let
|
postPatch =
|
||||||
skipTests = [
|
let
|
||||||
# tries to "go install"
|
skipTests = [
|
||||||
"TestDummyMonitor"
|
# tries to "go install"
|
||||||
# try to Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2"
|
"TestDummyMonitor"
|
||||||
"TestDownloadAndChecksums"
|
# try to Get "https://downloads.arduino.cc/libraries/library_index.tar.bz2"
|
||||||
"TestParseArgs"
|
"TestDownloadAndChecksums"
|
||||||
"TestParseReferenceCores"
|
"TestParseArgs"
|
||||||
"TestPlatformSearch"
|
"TestParseReferenceCores"
|
||||||
"TestPlatformSearchSorting"
|
"TestPlatformSearch"
|
||||||
];
|
"TestPlatformSearchSorting"
|
||||||
in ''
|
];
|
||||||
substituteInPlace Taskfile.yml \
|
in
|
||||||
--replace-fail "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'"
|
''
|
||||||
'';
|
substituteInPlace Taskfile.yml \
|
||||||
|
--replace-fail "go test" "go test -p $NIX_BUILD_CORES -skip '(${lib.concatStringsSep "|" skipTests})'"
|
||||||
|
'';
|
||||||
|
|
||||||
doCheck = stdenv.isLinux;
|
doCheck = stdenv.isLinux;
|
||||||
|
|
||||||
@ -50,7 +56,10 @@ let
|
|||||||
'';
|
'';
|
||||||
|
|
||||||
ldflags = [
|
ldflags = [
|
||||||
"-s" "-w" "-X github.com/arduino/arduino-cli/version.versionString=${version}" "-X github.com/arduino/arduino-cli/version.commit=unknown"
|
"-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'" ];
|
] ++ lib.optionals stdenv.isLinux [ "-extldflags '-static'" ];
|
||||||
|
|
||||||
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
postInstall = lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
@ -67,33 +76,38 @@ let
|
|||||||
description = "Arduino from the command line";
|
description = "Arduino from the command line";
|
||||||
mainProgram = "arduino-cli";
|
mainProgram = "arduino-cli";
|
||||||
changelog = "https://github.com/arduino/arduino-cli/releases/tag/${version}";
|
changelog = "https://github.com/arduino/arduino-cli/releases/tag/${version}";
|
||||||
license = [ licenses.gpl3Only licenses.asl20 ];
|
license = [
|
||||||
maintainers = with maintainers; [ ryantm sfrijters ];
|
licenses.gpl3Only
|
||||||
|
licenses.asl20
|
||||||
|
];
|
||||||
|
maintainers = with maintainers; [
|
||||||
|
ryantm
|
||||||
|
sfrijters
|
||||||
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
if stdenv.isLinux then
|
if stdenv.isLinux then
|
||||||
# buildFHSEnv is needed because the arduino-cli downloads compiler
|
# buildFHSEnv is needed because the arduino-cli downloads compiler
|
||||||
# toolchains from the internet that have their interpreters pointed at
|
# toolchains from the internet that have their interpreters pointed at
|
||||||
# /lib64/ld-linux-x86-64.so.2
|
# /lib64/ld-linux-x86-64.so.2
|
||||||
buildFHSEnv
|
buildFHSEnv {
|
||||||
{
|
|
||||||
inherit (pkg) name meta;
|
inherit (pkg) name meta;
|
||||||
|
|
||||||
runScript = "${pkg.outPath}/bin/arduino-cli";
|
runScript = "${pkg.outPath}/bin/arduino-cli";
|
||||||
|
|
||||||
extraInstallCommands = ''
|
extraInstallCommands =
|
||||||
mv $out/bin/$name $out/bin/arduino-cli
|
''
|
||||||
'' + lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
mv $out/bin/$name $out/bin/arduino-cli
|
||||||
cp -r ${pkg.outPath}/share $out/share
|
''
|
||||||
'';
|
+ lib.optionalString (stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
|
||||||
|
cp -r ${pkg.outPath}/share $out/share
|
||||||
|
'';
|
||||||
passthru.pureGoPkg = pkg;
|
passthru.pureGoPkg = pkg;
|
||||||
|
|
||||||
targetPkgs = pkgs: with pkgs; [
|
targetPkgs = pkgs: with pkgs; [ zlib ];
|
||||||
zlib
|
|
||||||
];
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
pkg
|
pkg
|
||||||
|
Loading…
Reference in New Issue
Block a user