2021-01-19 06:50:56 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libelf, which, pkg-config, freeglut
|
2019-06-16 20:59:06 +01:00
|
|
|
, avrgcc, avrlibc
|
2019-11-10 16:44:34 +00:00
|
|
|
, libGLU, libGL
|
2018-12-10 23:25:35 +00:00
|
|
|
, GLUT }:
|
2016-05-24 22:18:03 +01:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "simavr";
|
2017-03-01 17:01:40 +00:00
|
|
|
version = "1.5";
|
2016-05-24 22:18:03 +01:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "buserror";
|
|
|
|
repo = "simavr";
|
2017-03-01 17:01:40 +00:00
|
|
|
rev = "e0d4de41a72520491a4076b3ed87beb997a395c0";
|
|
|
|
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
|
2016-05-24 22:18:03 +01:00
|
|
|
};
|
|
|
|
|
2018-12-10 23:25:35 +00:00
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"AVR_ROOT=${avrlibc}/avr"
|
|
|
|
"SIMAVR_VERSION=${version}"
|
|
|
|
"AVR=avr-"
|
|
|
|
];
|
2016-05-24 22:18:03 +01:00
|
|
|
|
2019-11-03 13:14:32 +00:00
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
|
|
|
|
|
2021-01-19 06:50:56 +00:00
|
|
|
nativeBuildInputs = [ which pkg-config avrgcc ];
|
2019-11-10 16:44:34 +00:00
|
|
|
buildInputs = [ libelf freeglut libGLU libGL ]
|
2021-01-23 12:26:19 +00:00
|
|
|
++ lib.optional stdenv.isDarwin GLUT;
|
2018-10-12 21:21:26 +01:00
|
|
|
|
2017-05-18 10:39:00 +01:00
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
|
|
|
|
2018-12-10 23:25:35 +00:00
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "-C tests run_tests";
|
2016-05-24 22:18:03 +01:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-05-24 22:18:03 +01:00
|
|
|
description = "A lean and mean Atmel AVR simulator";
|
2020-04-01 02:11:51 +01:00
|
|
|
homepage = "https://github.com/buserror/simavr";
|
2016-05-24 22:18:03 +01:00
|
|
|
license = licenses.gpl3;
|
2018-12-10 23:25:35 +00:00
|
|
|
platforms = platforms.unix;
|
2016-05-24 22:18:03 +01:00
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|