1
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-06-20 00:19:25 +03:00
nixpkgs/pkgs/development/embedded/arduino/arduino-cli/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

56 lines
1.3 KiB
Nix
Raw Normal View History

{ lib, stdenv, buildGoModule, fetchFromGitHub, buildFHSUserEnv }:
2020-08-07 15:17:57 -07:00
let
pkg = buildGoModule rec {
pname = "arduino-cli";
2023-01-17 14:52:31 +01:00
version = "0.29.0";
2020-08-07 15:17:57 -07:00
src = fetchFromGitHub {
owner = "arduino";
repo = pname;
rev = version;
2023-01-17 14:52:31 +01:00
sha256 = "sha256-jew4KLpOOXE9N/h4qFqof8y26DQrvm78E/ARbbwocD4=";
2020-08-07 15:17:57 -07:00
};
subPackages = [ "." ];
2023-01-17 14:52:31 +01:00
vendorSha256 = "sha256-BunonnjzGnpcmGJXxEQXvjJLGvdSXUOK9zAhXoAemHY=";
2020-08-07 15:17:57 -07:00
doCheck = false;
2021-08-26 16:45:51 +10:00
ldflags = [
"-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'" ];
2020-08-07 15:17:57 -07:00
meta = with lib; {
2020-08-07 15:17:57 -07:00
inherit (src.meta) homepage;
description = "Arduino from the command line";
license = licenses.gpl3Only;
maintainers = with maintainers; [ ryantm ];
};
};
in
if stdenv.isLinux then
2020-08-07 15:17:57 -07:00
# buildFHSUserEnv is needed because the arduino-cli downloads compiler
# toolchains from the internet that have their interpreters pointed at
# /lib64/ld-linux-x86-64.so.2
buildFHSUserEnv
{
inherit (pkg) name meta;
runScript = "${pkg.outPath}/bin/arduino-cli";
extraInstallCommands = ''
mv $out/bin/$name $out/bin/arduino-cli
'';
targetPkgs = pkgs: with pkgs; [
zlib
];
}
else
pkg