git.iko.soy/typeable/nixpkgs
on master help sign in
arduino: 1.0.6 -> 1.6.6
commit6ff886e539fb2b2017ad3866f068db9368a038d5 authorKjetil Orbekk <kjetil.orbekk@gmail.com> dateSun 8 May 2016, 00:14 (11 years ago) parent135fe56
1 file changed+17−11
pkgs/development/arduino/arduino-core/default.nix+17−11
pkgs/development/arduino/arduino-core/default.nix+17−11
@@ -1,45 +1,51 @@
11{ stdenv, fetchFromGitHub, jdk, jre, ant, coreutils, gnugrep, file, libusb
2−, withGui ? false, gtk2 ? null
3−}:
2+, unzip, zlib, readline, ncurses, withGui ? false, gtk2 ? null }:
43
54assert withGui -> gtk2 != null;
65
76stdenv.mkDerivation rec {
87
9− version = "1.0.6";
8+ version = "1.6.6";
109 name = "arduino${stdenv.lib.optionalString (withGui == false) "-core"}-${version}";
1110
1211 src = fetchFromGitHub {
1312 owner = "arduino";
1413 repo = "Arduino";
1514 rev = "${version}";
16− sha256 = "0nr5b719qi03rcmx6swbhccv6kihxz3b8b6y46bc2j348rja5332";
15+ sha256 = "1gm3sjjs149r2d82ynx25qlg31bbird1zr4x01qi4ybk3gp0268v";
1716 };
1817
19− buildInputs = [ jdk ant file ];
18+ buildInputs = [ jdk ant file unzip ];
2019
2120 buildPhase = ''
22− cd ./core && ant
21+ cd ./arduino-core && ant
2322 cd ../build && ant
2423 cd ..
2524 '';
2625
26+ libPath = stdenv.lib.makeLibraryPath (builtins.filter (l: l != null) [
27+ gtk2 stdenv.cc.cc zlib readline libusb ncurses]) + ":$out/lib";
28+
2729 installPhase = ''
2830 mkdir -p $out/share/arduino
2931 cp -r ./build/linux/work/* "$out/share/arduino/"
3032 echo ${version} > $out/share/arduino/lib/version.txt
3133
34+ # Hack around lack of libtinfo in NixOS
35+ mkdir -p $out/lib
36+ ln -s ${ncurses.out}/lib/libncursesw.so.5 $out/lib/libtinfo.so.5
37+
3238 ${stdenv.lib.optionalString withGui ''
3339 mkdir -p "$out/bin"
34− sed -i -e "s|^java|${jdk}/bin/java|" "$out/share/arduino/arduino"
35− sed -i -e "s|^LD_LIBRARY_PATH=|LD_LIBRARY_PATH=${gtk2}/lib:|" "$out/share/arduino/arduino"
40+ sed -i -e "s|^JAVA=.*|JAVA=${jdk}/bin/java|" "$out/share/arduino/arduino"
41+ sed -i -e "s|^LD_LIBRARY_PATH=|LD_LIBRARY_PATH=${libPath}:|" "$out/share/arduino/arduino"
3642 ln -sr "$out/share/arduino/arduino" "$out/bin/arduino"
3743 ''}
3844
3945 # Fixup "/lib64/ld-linux-x86-64.so.2" like references in ELF executables.
4046 echo "running patchelf on prebuilt binaries:"
4147 find "$out" | while read filepath; do
42− if file "$filepath" | grep -q "ELF.*executable"; then
48+ if file "$filepath" | grep -q "ELF.*executable.*dynamic"; then
4349 # skip target firmware files
4450 if echo "$filepath" | grep -q "\.elf$"; then
4551 continue
@@ -50,8 +56,8 @@ stdenv.mkDerivation rec {
5056 fi
5157 done
5258
53− patchelf --set-rpath ${stdenv.lib.makeLibraryPath [ libusb ]} \
54− "$out/share/arduino/hardware/tools/avrdude"
59+ patchelf --set-rpath ${libPath} \
60+ "$out/share/arduino/hardware/tools/avr/bin/avrdude_bin"
5561 '';
5662
5763 meta = with stdenv.lib; {