2023-01-01 18:09:45 +00:00
|
|
|
{ lib, stdenv, makeSetupHook, fetchFromGitHub, libelf, which, pkg-config, freeglut
|
2019-06-16 19:59:06 +00: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 21:18:03 +00:00
|
|
|
|
2023-01-01 18:09:45 +00:00
|
|
|
let
|
|
|
|
setupHookDarwin = makeSetupHook {
|
|
|
|
name = "darwin-avr-gcc-hook";
|
|
|
|
substitutions = {
|
|
|
|
darwinSuffixSalt = stdenv.cc.suffixSalt;
|
|
|
|
avrSuffixSalt = avrgcc.suffixSalt;
|
|
|
|
};
|
|
|
|
} ./setup-hook-darwin.sh;
|
|
|
|
in stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "simavr";
|
2021-09-27 13:12:28 +00:00
|
|
|
version = "1.7";
|
2016-05-24 21:18:03 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "buserror";
|
|
|
|
repo = "simavr";
|
2021-09-27 13:12:28 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0njz03lkw5374x1lxrq08irz4b86lzj2hibx46ssp7zv712pq55q";
|
2016-05-24 21:18:03 +00: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 21:18:03 +00:00
|
|
|
|
2023-01-01 18:09:45 +00:00
|
|
|
nativeBuildInputs = [ which pkg-config avrgcc ]
|
|
|
|
++ lib.optional stdenv.isDarwin setupHookDarwin;
|
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 20:21:26 +00:00
|
|
|
|
2017-05-18 09:39:00 +00: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 21:18:03 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2016-05-24 21:18:03 +00:00
|
|
|
description = "A lean and mean Atmel AVR simulator";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://github.com/buserror/simavr";
|
2016-05-24 21:18:03 +00:00
|
|
|
license = licenses.gpl3;
|
2018-12-10 23:25:35 +00:00
|
|
|
platforms = platforms.unix;
|
2016-05-24 21:18:03 +00:00
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|