summary refs log tree commit diff
path: root/pkgs/development/tools/simavr
diff options
context:
space:
mode:
authorMaximilian Güntner <code@sourcediver.org>2017-09-05 13:54:14 +0200
committerMaximilian Güntner <code@sourcediver.org>2017-09-05 13:54:14 +0200
commitb22718d51cde09dc7c034a65e022159452959efc (patch)
treee53b3723ca77581f7dad1047f91fbece7290c272 /pkgs/development/tools/simavr
parent414f5eff2d3383e153760c9bf30369aabe3d2463 (diff)
downloadnixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar.gz
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar.bz2
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar.lz
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar.xz
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.tar.zst
nixpkgs-b22718d51cde09dc7c034a65e022159452959efc.zip
simavr: fix build for separate avr toolchain
Diffstat (limited to 'pkgs/development/tools/simavr')
-rw-r--r--pkgs/development/tools/simavr/default.nix11
1 files changed, 8 insertions, 3 deletions
diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix
index 5ad2647ea31..c4dd8725a1c 100644
--- a/pkgs/development/tools/simavr/default.nix
+++ b/pkgs/development/tools/simavr/default.nix
@@ -1,4 +1,4 @@
-{ stdenv, fetchFromGitHub, avrgcclibc, libelf, which, git, pkgconfig, freeglut
+{ stdenv, fetchFromGitHub, avrbinutils, avrgcc, avrlibc, libelf, which, git, pkgconfig, freeglut
 , mesa }:
 
 stdenv.mkDerivation rec {
@@ -15,9 +15,14 @@ stdenv.mkDerivation rec {
   # ld: cannot find -lsimavr
   enableParallelBuilding = false;
 
-  buildFlags = "AVR_ROOT=${avrgcclibc}/avr SIMAVR_VERSION=${version}";
+  preConfigure = ''
+    substituteInPlace Makefile.common --replace "-I../simavr/sim/avr -I../../simavr/sim/avr" \
+    "-I${avrlibc}/avr/include -L${avrlibc}/avr/lib/avr5  -B${avrlibc}/avr/lib -I../simavr/sim/avr -I../../simavr/sim/avr"
+  '';
+  buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
   installFlags = buildFlags + " DESTDIR=$(out)";
 
+  
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
 
@@ -26,7 +31,7 @@ stdenv.mkDerivation rec {
     patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
   '';
 
-  buildInputs = [ which git avrgcclibc libelf pkgconfig freeglut mesa ];
+  buildInputs = [ which git avrbinutils avrgcc avrlibc libelf pkgconfig freeglut mesa ];
 
   meta = with stdenv.lib; {
     description = "A lean and mean Atmel AVR simulator";