2016-05-24 23:18:03 +02:00
|
|
|
{ stdenv, fetchFromGitHub, avrgcclibc, libelf, which, git, pkgconfig, freeglut
|
|
|
|
, mesa }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
name = "simavr-${version}";
|
2017-03-01 18:01:40 +01:00
|
|
|
version = "1.5";
|
2016-05-24 23:18:03 +02:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "buserror";
|
|
|
|
repo = "simavr";
|
2017-03-01 18:01:40 +01:00
|
|
|
rev = "e0d4de41a72520491a4076b3ed87beb997a395c0";
|
|
|
|
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
|
2016-05-24 23:18:03 +02:00
|
|
|
};
|
|
|
|
|
2017-03-10 00:57:23 +01:00
|
|
|
# ld: cannot find -lsimavr
|
|
|
|
enableParallelBuilding = false;
|
|
|
|
|
2016-05-24 23:18:03 +02:00
|
|
|
buildFlags = "AVR_ROOT=${avrgcclibc}/avr SIMAVR_VERSION=${version}";
|
|
|
|
installFlags = buildFlags + " DESTDIR=$(out)";
|
|
|
|
|
2017-05-18 11:39:00 +02:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
|
|
|
|
2016-05-24 23:18:03 +02:00
|
|
|
postFixup = ''
|
|
|
|
target="$out/bin/simavr"
|
|
|
|
patchelf --set-rpath "$(patchelf --print-rpath "$target"):$out/lib" "$target"
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [ which git avrgcclibc libelf pkgconfig freeglut mesa ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A lean and mean Atmel AVR simulator";
|
|
|
|
homepage = https://github.com/buserror/simavr;
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|