Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, makeSetupHook, fetchFromGitHub, libelf, which, pkg-config, freeglut 2, avrgcc, avrlibc 3, libGLU, libGL 4, GLUT }: 5 6let 7 setupHookDarwin = makeSetupHook { 8 name = "darwin-avr-gcc-hook"; 9 substitutions = { 10 darwinSuffixSalt = stdenv.cc.suffixSalt; 11 avrSuffixSalt = avrgcc.suffixSalt; 12 }; 13 } ./setup-hook-darwin.sh; 14in stdenv.mkDerivation rec { 15 pname = "simavr"; 16 version = "1.7"; 17 18 src = fetchFromGitHub { 19 owner = "buserror"; 20 repo = "simavr"; 21 rev = "v${version}"; 22 sha256 = "0njz03lkw5374x1lxrq08irz4b86lzj2hibx46ssp7zv712pq55q"; 23 }; 24 25 makeFlags = [ 26 "DESTDIR=$(out)" 27 "PREFIX=" 28 "AVR_ROOT=${avrlibc}/avr" 29 "SIMAVR_VERSION=${version}" 30 "AVR=avr-" 31 ]; 32 33 nativeBuildInputs = [ which pkg-config avrgcc ] 34 ++ lib.optional stdenv.isDarwin setupHookDarwin; 35 buildInputs = [ libelf freeglut libGLU libGL ] 36 ++ lib.optional stdenv.isDarwin GLUT; 37 38 # Hack to avoid TMPDIR in RPATHs. 39 preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" ''; 40 41 doCheck = true; 42 checkTarget = "-C tests run_tests"; 43 44 meta = with lib; { 45 description = "A lean and mean Atmel AVR simulator"; 46 homepage = "https://github.com/buserror/simavr"; 47 license = licenses.gpl3; 48 platforms = platforms.unix; 49 maintainers = with maintainers; [ goodrone ]; 50 }; 51 52}