diff options
author | Bjørn Forsman <bjorn.forsman@gmail.com> | 2016-05-11 21:01:29 +0200 |
---|---|---|
committer | Bjørn Forsman <bjorn.forsman@gmail.com> | 2016-05-11 21:11:28 +0200 |
commit | 2d7e4de12ed1e3588ec63517f9647021b893947a (patch) | |
tree | 4508472e418bbd1dc7ba0a75dfed20e4f31245f9 /pkgs/development/arduino | |
parent | 7a8ea6138e662ae55f040e4d6149a9ba3b2f27d5 (diff) |
Revert "arduino: 1.0.6 -> 1.6.6"
This reverts commit 6ff886e539fb2b2017ad3866f068db9368a038d5 because it
doesn't work when chroot builds are enabled (nix.useChroot = true):
$ nix-build -A arduino
these derivations will be built:
/nix/store/xjv1j3mww4jx1vccfc0p1inlcrlgx2if-arduino-1.6.6.drv
building path(s) ‘/nix/store/58sdiphd4pm3811gir0b8j718pgq8zvk-arduino-1.6.6’
...
untar-unzip-download:
[get] Getting: http://downloads.arduino.cc/reference-1.6.6-3.zip
[get] To: /tmp/nix-build-arduino-1.6.6.drv-0/Arduino-1.6.6-src/build/shared/reference-1.6.6-3.zip
[get] Error getting http://downloads.arduino.cc/reference-1.6.6-3.zip to /tmp/nix-build-arduino-1.6.6.drv-0/Arduino-1.6.6-src/build/shared/reference-1.6.6-3.zip
untar-unzip-checksum:
[echo] Testing checksum of "shared/reference-1.6.6-3.zip"
[checksum] Could not find file /tmp/nix-build-arduino-1.6.6.drv-0/Arduino-1.6.6-src/build/shared/reference-1.6.6-3.zip to generate checksum for.
BUILD FAILED
Reasoning: without a revert, the build farm cannot produce binaries and
users that build from source, without chroot, cannot trust that they get
a working result (non-deterministic build, depending on how pure the
arduino builder is).
Diffstat (limited to 'pkgs/development/arduino')
-rw-r--r-- | pkgs/development/arduino/arduino-core/default.nix | 28 |
1 files changed, 11 insertions, 17 deletions
diff --git a/pkgs/development/arduino/arduino-core/default.nix b/pkgs/development/arduino/arduino-core/default.nix index 8059879dc479..37947c804b8b 100644 --- a/pkgs/development/arduino/arduino-core/default.nix +++ b/pkgs/development/arduino/arduino-core/default.nix @@ -1,51 +1,45 @@ { stdenv, fetchFromGitHub, jdk, jre, ant, coreutils, gnugrep, file, libusb -, unzip, zlib, readline, ncurses, withGui ? false, gtk2 ? null }: +, withGui ? false, gtk2 ? null +}: assert withGui -> gtk2 != null; stdenv.mkDerivation rec { - version = "1.6.6"; + version = "1.0.6"; name = "arduino${stdenv.lib.optionalString (withGui == false) "-core"}-${version}"; src = fetchFromGitHub { owner = "arduino"; repo = "Arduino"; rev = "${version}"; - sha256 = "1gm3sjjs149r2d82ynx25qlg31bbird1zr4x01qi4ybk3gp0268v"; + sha256 = "0nr5b719qi03rcmx6swbhccv6kihxz3b8b6y46bc2j348rja5332"; }; - buildInputs = [ jdk ant file unzip ]; + buildInputs = [ jdk ant file ]; buildPhase = '' - cd ./arduino-core && ant + cd ./core && ant cd ../build && ant cd .. ''; - libPath = stdenv.lib.makeLibraryPath (builtins.filter (l: l != null) [ - gtk2 stdenv.cc.cc zlib readline libusb ncurses]) + ":$out/lib"; - installPhase = '' mkdir -p $out/share/arduino cp -r ./build/linux/work/* "$out/share/arduino/" echo ${version} > $out/share/arduino/lib/version.txt - # Hack around lack of libtinfo in NixOS - mkdir -p $out/lib - ln -s ${ncurses.out}/lib/libncursesw.so.5 $out/lib/libtinfo.so.5 - ${stdenv.lib.optionalString withGui '' mkdir -p "$out/bin" - sed -i -e "s|^JAVA=.*|JAVA=${jdk}/bin/java|" "$out/share/arduino/arduino" - sed -i -e "s|^LD_LIBRARY_PATH=|LD_LIBRARY_PATH=${libPath}:|" "$out/share/arduino/arduino" + sed -i -e "s|^java|${jdk}/bin/java|" "$out/share/arduino/arduino" + sed -i -e "s|^LD_LIBRARY_PATH=|LD_LIBRARY_PATH=${gtk2}/lib:|" "$out/share/arduino/arduino" ln -sr "$out/share/arduino/arduino" "$out/bin/arduino" ''} # Fixup "/lib64/ld-linux-x86-64.so.2" like references in ELF executables. echo "running patchelf on prebuilt binaries:" find "$out" | while read filepath; do - if file "$filepath" | grep -q "ELF.*executable.*dynamic"; then + if file "$filepath" | grep -q "ELF.*executable"; then # skip target firmware files if echo "$filepath" | grep -q "\.elf$"; then continue @@ -56,8 +50,8 @@ stdenv.mkDerivation rec { fi done - patchelf --set-rpath ${libPath} \ - "$out/share/arduino/hardware/tools/avr/bin/avrdude_bin" + patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ libusb ]} \ + "$out/share/arduino/hardware/tools/avrdude" ''; meta = with stdenv.lib; { |