arduino: error on wrong architecture

This commit is contained in:
Matthew Bauer 2020-06-09 10:38:39 -05:00
parent f2e9046de5
commit a528cc1bca

View File

@ -53,10 +53,10 @@ let
xorg.libXxf86vm xorg.libXxf86vm
zlib zlib
]; ];
teensy_architecture = teensy_architecture = if stdenv.hostPlatform.isx86_32 then "linux32"
lib.optionalString (stdenv.hostPlatform.system == "x86_64-linux") "linux64" else if stdenv.hostPlatform.isx86_64 then "linux64"
+ lib.optionalString (stdenv.hostPlatform.system == "i686-linux") "linux32" else if stdenv.hostPlatform.isAarch32 then "linuxarm"
+ lib.optionalString (stdenv.hostPlatform.system == "arm-linux") "linuxarm"; else throw "${stdenv.hostPlatform.system} is not supported in teensy";
flavor = (if withTeensyduino then "teensyduino" else "arduino") flavor = (if withTeensyduino then "teensyduino" else "arduino")
+ stdenv.lib.optionalString (!withGui) "-core"; + stdenv.lib.optionalString (!withGui) "-core";
@ -75,24 +75,21 @@ stdenv.mkDerivation rec {
teensyduino_version = "147"; teensyduino_version = "147";
teensyduino_src = fetchurl { teensyduino_src = fetchurl {
url = "https://www.pjrc.com/teensy/td_${teensyduino_version}/TeensyduinoInstall.${teensy_architecture}"; url = "https://www.pjrc.com/teensy/td_${teensyduino_version}/TeensyduinoInstall.${teensy_architecture}";
sha256 = sha256 = {
lib.optionalString (teensy_architecture == "linux64") linux64 = "09ysanip5d2f5axzd81z2l74ayng60zqhjxmxs7xa5098fff46il";
"09ysanip5d2f5axzd81z2l74ayng60zqhjxmxs7xa5098fff46il" linux32 = "1zw3cfv2p62dwg8838vh0gd1934b18cyx7c13azvwmrpj601l0xx";
+ lib.optionalString (teensy_architecture == "linux32") linuxarm = "12421z26ksx84aldw1pq0cakh8jhs33mwafgvfij0zfgn9x0i877";
"1zw3cfv2p62dwg8838vh0gd1934b18cyx7c13azvwmrpj601l0xx" }.${teensy_architecture} or (throw "No arduino binaries for ${teensy_architecture}");
+ lib.optionalString (teensy_architecture == "linuxarm") };
"12421z26ksx84aldw1pq0cakh8jhs33mwafgvfij0zfgn9x0i877";
};
# Used because teensyduino requires jars be a specific size # Used because teensyduino requires jars be a specific size
arduino_dist_src = fetchurl { arduino_dist_src = fetchurl {
url = "http://downloads.arduino.cc/arduino-${version}-${teensy_architecture}.tar.xz"; url = "http://downloads.arduino.cc/arduino-${version}-${teensy_architecture}.tar.xz";
sha256 = sha256 =
lib.optionalString (teensy_architecture == "linux64") {
"1lv4in9j0r8s0cis4zdvbk2637vlj12w69wdxgcxcrwvkcdahkpa" linux64 = "1lv4in9j0r8s0cis4zdvbk2637vlj12w69wdxgcxcrwvkcdahkpa";
+ lib.optionalString (teensy_architecture == "linux32") linux32 = "0zla3a6gd9prclgrbbgsmhf8ds8zb221m65x21pvz0y1cwsdvjpm";
"0zla3a6gd9prclgrbbgsmhf8ds8zb221m65x21pvz0y1cwsdvjpm" linuxarm = "1w5m49wfd68zazli0lf3w4zykab8n7mzp3wnbjqfpx2vip80bqnz";
+ lib.optionalString (teensy_architecture == "linuxarm") }.${teensy_architecture} or (throw "No arduino binaries for ${teensy_architecture}");
"1w5m49wfd68zazli0lf3w4zykab8n7mzp3wnbjqfpx2vip80bqnz";
}; };