2024-07-27 06:49:29 +00:00
|
|
|
{ lib, stdenv, makeSetupHook, fetchFromGitHub, libelf, which, pkg-config, libglut
|
2020-04-24 23:36:52 +00:00
|
|
|
, avrgcc, avrlibc
|
|
|
|
, libGLU, libGL
|
|
|
|
, GLUT }:
|
|
|
|
|
2023-02-02 18:25:31 +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 {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "simavr";
|
2021-10-01 09:20:50 +00:00
|
|
|
version = "1.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "buserror";
|
|
|
|
repo = "simavr";
|
2021-10-01 09:20:50 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0njz03lkw5374x1lxrq08irz4b86lzj2hibx46ssp7zv712pq55q";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
makeFlags = [
|
|
|
|
"DESTDIR=$(out)"
|
|
|
|
"PREFIX="
|
|
|
|
"AVR_ROOT=${avrlibc}/avr"
|
|
|
|
"SIMAVR_VERSION=${version}"
|
|
|
|
"AVR=avr-"
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeBuildInputs = [ which pkg-config avrgcc ]
|
|
|
|
++ lib.optional stdenv.isDarwin setupHookDarwin;
|
2024-07-27 06:49:29 +00:00
|
|
|
buildInputs = [ libelf libglut libGLU libGL ]
|
2021-02-05 17:12:51 +00:00
|
|
|
++ lib.optional stdenv.isDarwin GLUT;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-08-22 20:05:09 +00:00
|
|
|
# remove forbidden references to $TMPDIR
|
|
|
|
preFixup = lib.optionalString stdenv.isLinux ''
|
|
|
|
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/*
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
doCheck = true;
|
|
|
|
checkTarget = "-C tests run_tests";
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Lean and mean Atmel AVR simulator";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "simavr";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/buserror/simavr";
|
|
|
|
license = licenses.gpl3;
|
|
|
|
platforms = platforms.unix;
|
|
|
|
maintainers = with maintainers; [ goodrone ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|