nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ stdenv, fetchFromGitHub, avrgcclibc, libelf, which, git, pkgconfig, freeglut
2, mesa }:
3
4stdenv.mkDerivation rec {
5 name = "simavr-${version}";
6 version = "1.5";
7
8 src = fetchFromGitHub {
9 owner = "buserror";
10 repo = "simavr";
11 rev = "e0d4de41a72520491a4076b3ed87beb997a395c0";
12 sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
13 };
14
15 # ld: cannot find -lsimavr
16 enableParallelBuilding = false;
17
18 buildFlags = "AVR_ROOT=${avrgcclibc}/avr SIMAVR_VERSION=${version}";
19 installFlags = buildFlags + " DESTDIR=$(out)";
20
21 # Hack to avoid TMPDIR in RPATHs.
22 preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
23
24 postFixup = ''
25 target="$out/bin/simavr"
26 patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
27 '';
28
29 buildInputs = [ which git avrgcclibc libelf pkgconfig freeglut mesa ];
30
31 meta = with stdenv.lib; {
32 description = "A lean and mean Atmel AVR simulator";
33 homepage = https://github.com/buserror/simavr;
34 license = licenses.gpl3;
35 platforms = platforms.linux;
36 maintainers = with maintainers; [ goodrone ];
37 };
38
39}
40