2024-12-10 20:26:33 +01:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildFHSEnv,
|
|
|
|
arduino-core-unwrapped,
|
|
|
|
withGui ? false,
|
|
|
|
withTeensyduino ? false,
|
|
|
|
}:
|
2021-12-06 17:06:39 +01:00
|
|
|
let
|
|
|
|
arduino-unwrapped = arduino-core-unwrapped.override { inherit withGui withTeensyduino; };
|
|
|
|
in
|
2023-04-11 12:52:27 +02:00
|
|
|
buildFHSEnv {
|
2024-11-24 16:24:56 +01:00
|
|
|
pname = "arduino";
|
|
|
|
inherit (arduino-core-unwrapped) version;
|
2021-12-06 17:06:39 +01:00
|
|
|
|
|
|
|
targetPkgs =
|
2024-12-10 20:26:33 +01:00
|
|
|
pkgs:
|
|
|
|
(with pkgs; [
|
2021-12-06 17:06:39 +01:00
|
|
|
ncurses
|
|
|
|
arduino-unwrapped
|
|
|
|
zlib
|
2024-12-10 20:26:33 +01:00
|
|
|
(python3.withPackages (
|
|
|
|
p: with p; [
|
|
|
|
pyserial
|
|
|
|
]
|
|
|
|
))
|
2021-12-06 17:06:39 +01:00
|
|
|
]);
|
|
|
|
|
|
|
|
extraInstallCommands = ''
|
|
|
|
${lib.optionalString withGui ''
|
|
|
|
# desktop file
|
|
|
|
mkdir -p $out/share/applications
|
|
|
|
cp ${arduino-core-unwrapped.src}/build/linux/dist/desktop.template $out/share/applications/arduino.desktop
|
|
|
|
substituteInPlace $out/share/applications/arduino.desktop \
|
|
|
|
--replace '<BINARY_LOCATION>' "$out/bin/arduino" \
|
|
|
|
--replace '<ICON_NAME>' "$out/share/arduino/icons/128x128/apps/arduino.png"
|
|
|
|
# icon file
|
|
|
|
mkdir -p $out/share/arduino
|
|
|
|
cp -r ${arduino-core-unwrapped.src}/build/shared/icons $out/share/arduino
|
|
|
|
''}
|
|
|
|
'';
|
|
|
|
|
|
|
|
runScript = "arduino";
|
|
|
|
|
|
|
|
meta = arduino-core-unwrapped.meta;
|
|
|
|
}
|