2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, libelf, which, pkg-config, freeglut
|
2020-04-24 23:36:52 +00:00
|
|
|
, avrgcc, avrlibc
|
|
|
|
, libGLU, libGL
|
|
|
|
, GLUT }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "simavr";
|
|
|
|
version = "1.5";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "buserror";
|
|
|
|
repo = "simavr";
|
|
|
|
rev = "e0d4de41a72520491a4076b3ed87beb997a395c0";
|
|
|
|
sha256 = "0b2lh6l2niv80dmbm9xkamvnivkbmqw6v97sy29afalrwfxylxla";
|
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"AVR_ROOT=${avrlibc}/avr"
|
|
|
|
"SIMAVR_VERSION=${version}"
|
|
|
|
"AVR=avr-"
|
|
|
|
];
|
|
|
|
|
|
|
|
NIX_CFLAGS_COMPILE = [ "-Wno-error=stringop-truncation" ];
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ which pkg-config avrgcc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
buildInputs = [ libelf freeglut libGLU libGL ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin GLUT;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Hack to avoid TMPDIR in RPATHs.
|
|
|
|
preFixup = ''rm -rf "$(pwd)" && mkdir "$(pwd)" '';
|
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "-C tests run_tests";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A lean and mean Atmel AVR simulator";
|
|
|
|
homepage = "https://github.com/buserror/simavr";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|