1 { lib, stdenv, makeSetupHook, fetchFromGitHub, libelf, which, pkg-config, freeglut
7 setupHookDarwin = makeSetupHook {
8 name = "darwin-avr-gcc-hook";
10 darwinSuffixSalt = stdenv.cc.suffixSalt;
11 avrSuffixSalt = avrgcc.suffixSalt;
13 } ./setup-hook-darwin.sh;
14 in stdenv.mkDerivation rec {
18 src = fetchFromGitHub {
22 sha256 = "0njz03lkw5374x1lxrq08irz4b86lzj2hibx46ssp7zv712pq55q";
28 "AVR_ROOT=${avrlibc}/avr"
29 "SIMAVR_VERSION=${version}"
33 nativeBuildInputs = [ which pkg-config avrgcc ]
34 ++ lib.optional stdenv.isDarwin setupHookDarwin;
35 buildInputs = [ libelf freeglut libGLU libGL ]
36 ++ lib.optional stdenv.isDarwin GLUT;
38 # remove forbidden references to $TMPDIR
39 preFixup = lib.optionalString stdenv.isLinux ''
40 patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/*
44 checkTarget = "-C tests run_tests";
47 description = "A lean and mean Atmel AVR simulator";
48 mainProgram = "simavr";
49 homepage = "https://github.com/buserror/simavr";
50 license = licenses.gpl3;
51 platforms = platforms.unix;
52 maintainers = with maintainers; [ goodrone ];