2018-10-12 22:21:26 +02:00
|
|
|
{ stdenv, fetchFromGitHub, libelf, which, git, pkgconfig, freeglut
|
|
|
|
, avrbinutils, avrgcc, avrlibc
|
2018-12-11 00:25:35 +01:00
|
|
|
, libGLU_combined
|
|
|
|
, GLUT }:
|
2016-05-24 23:18:03 +02:00
|
|
|
|
|
|
|
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
|
|
|
};
|
|
|
|
|
2018-12-11 00:25:35 +01:00
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"AVR_ROOT=${avrlibc}/avr"
|
|
|
|
"SIMAVR_VERSION=${version}"
|
|
|
|
"AVR=avr-"
|
|
|
|
];
|
2016-05-24 23:18:03 +02:00
|
|
|
|
2018-12-11 00:25:35 +01:00
|
|
|
nativeBuildInputs = [ which pkgconfig avrgcc ];
|
|
|
|
buildInputs = [ libelf freeglut libGLU_combined ]
|
|
|
|
++ stdenv.lib.optional stdenv.isDarwin GLUT;
|
2018-10-12 22:21:26 +02:00
|
|
|
|
2017-05-18 11:39:00 +02:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
|
|
|
|
2018-12-11 00:25:35 +01:00
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "-C tests run_tests";
|
2016-05-24 23:18:03 +02:00
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "A lean and mean Atmel AVR simulator";
|
|
|
|
homepage = https://github.com/buserror/simavr;
|
|
|
|
license = licenses.gpl3;
|
2018-12-11 00:25:35 +01:00
|
|
|
platforms = platforms.unix;
|
2016-05-24 23:18:03 +02:00
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|