biglybt: 3.5.0.0 -> 3.6.0.0
[NixPkgs.git] / pkgs / development / embedded / arduino / arduino-core / chrootenv.nix
bloba97fa50aebf2c294ff3acc54e80072d725aa1291
1 { lib, buildFHSEnv, arduino-core-unwrapped, withGui ? false, withTeensyduino ? false }:
2 let
3   arduino-unwrapped = arduino-core-unwrapped.override { inherit withGui withTeensyduino; };
4 in
5 buildFHSEnv {
6   name = "arduino";
8   targetPkgs =
9     pkgs: (with pkgs; [
10       ncurses
11       arduino-unwrapped
12       zlib
13       (python3.withPackages (p: with p; [
14         pyserial
15       ]))
16     ]);
17   multiArch = false;
19   extraInstallCommands = ''
20     ${lib.optionalString withGui ''
21       # desktop file
22       mkdir -p $out/share/applications
23       cp ${arduino-core-unwrapped.src}/build/linux/dist/desktop.template $out/share/applications/arduino.desktop
24       substituteInPlace $out/share/applications/arduino.desktop \
25         --replace '<BINARY_LOCATION>' "$out/bin/arduino" \
26         --replace '<ICON_NAME>' "$out/share/arduino/icons/128x128/apps/arduino.png"
27       # icon file
28       mkdir -p $out/share/arduino
29       cp -r ${arduino-core-unwrapped.src}/build/shared/icons $out/share/arduino
30     ''}
31   '';
33   runScript = "arduino";
35   meta = arduino-core-unwrapped.meta;