summary refs log tree commit diff
path: root/pkgs/development/tools/simavr
diff options
context:
space:
mode:
authorMatthew Bauer <mjbauer95@gmail.com>2018-12-10 17:25:35 -0600
committerMatthew Bauer <mjbauer95@gmail.com>2018-12-11 14:40:48 -0600
commit79e886a61b6c239230d17339be54474b46768765 (patch)
tree29ea2e723ff41612f239bf1d419e70b25d41aaac /pkgs/development/tools/simavr
parentef966c1952c3373cb9cbb19859a72564a7b59b99 (diff)
downloadnixpkgs-79e886a61b6c239230d17339be54474b46768765.tar
nixpkgs-79e886a61b6c239230d17339be54474b46768765.tar.gz
nixpkgs-79e886a61b6c239230d17339be54474b46768765.tar.bz2
nixpkgs-79e886a61b6c239230d17339be54474b46768765.tar.lz
nixpkgs-79e886a61b6c239230d17339be54474b46768765.tar.xz
nixpkgs-79e886a61b6c239230d17339be54474b46768765.tar.zst
nixpkgs-79e886a61b6c239230d17339be54474b46768765.zip
simavr: work on macOS
Diffstat (limited to 'pkgs/development/tools/simavr')
-rw-r--r--pkgs/development/tools/simavr/default.nix29
1 files changed, 15 insertions, 14 deletions
diff --git a/pkgs/development/tools/simavr/default.nix b/pkgs/development/tools/simavr/default.nix
index e28aad40ef4..f2bbbef7189 100644
--- a/pkgs/development/tools/simavr/default.nix
+++ b/pkgs/development/tools/simavr/default.nix
@@ -1,6 +1,7 @@
 { stdenv, fetchFromGitHub, libelf, which, git, pkgconfig, freeglut
 , avrbinutils, avrgcc, avrlibc
-, libGLU_combined }:
+, libGLU_combined
+, GLUT }:
 
 stdenv.mkDerivation rec {
   name = "simavr-${version}";
@@ -13,29 +14,29 @@ stdenv.mkDerivation rec {
     sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
   };
 
-  # ld: cannot find -lsimavr
-  enableParallelBuilding = false;
-
-  buildFlags = "AVR_ROOT=${avrlibc}/avr SIMAVR_VERSION=${version}";
-  installFlags = buildFlags + " DESTDIR=$(out)";
+  makeFlags = [
+    "DESTDIR=$(out)"
+    "PREFIX="
+    "AVR_ROOT=${avrlibc}/avr"
+    "SIMAVR_VERSION=${version}"
+    "AVR=avr-"
+  ];
 
+  nativeBuildInputs = [ which pkgconfig avrgcc ];
+  buildInputs = [ libelf freeglut libGLU_combined ]
+    ++ stdenv.lib.optional stdenv.isDarwin GLUT;
 
   # Hack to avoid TMPDIR in RPATHs.
   preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
 
-  postFixup = ''
-    target="$out/bin/simavr"
-    patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
-  '';
-
-  nativeBuildInputs = [ which git pkgconfig avrgcc avrbinutils ];
-  buildInputs = [ libelf freeglut libGLU_combined ];
+  doCheck = true;
+  checkTarget = "-C tests run_tests";
 
   meta = with stdenv.lib; {
     description = "A lean and mean Atmel AVR simulator";
     homepage    = https://github.com/buserror/simavr;
     license     = licenses.gpl3;
-    platforms   = platforms.linux;
+    platforms   = platforms.unix;
     maintainers = with maintainers; [ goodrone ];
   };