Files
nixpkgs/pkgs/development/tools/simavr/default.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

79 lines
1.5 KiB
Nix

{
lib,
stdenv,
makeSetupHook,
fetchFromGitHub,
libelf,
which,
pkg-config,
libglut,
avrgcc,
avrlibc,
libGLU,
libGL,
}:
let
setupHookDarwin = makeSetupHook {
name = "darwin-avr-gcc-hook";
substitutions = {
darwinSuffixSalt = stdenv.cc.suffixSalt;
avrSuffixSalt = avrgcc.suffixSalt;
};
} ./setup-hook-darwin.sh;
in
stdenv.mkDerivation rec {
pname = "simavr";
version = "1.7";
src = fetchFromGitHub {
owner = "buserror";
repo = "simavr";
rev = "v${version}";
sha256 = "0njz03lkw5374x1lxrq08irz4b86lzj2hibx46ssp7zv712pq55q";
};
makeFlags = [
"DESTDIR=$(out)"
"PREFIX="
"AVR_ROOT=${avrlibc}/avr"
"SIMAVR_VERSION=${version}"
"AVR=avr-"
];
nativeBuildInputs = [
which
pkg-config
avrgcc
]
++ lib.optional stdenv.hostPlatform.isDarwin setupHookDarwin;
buildInputs = [
libelf
libglut
libGLU
libGL
];
# remove forbidden references to $TMPDIR
preFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf --shrink-rpath --allowed-rpath-prefixes "$NIX_STORE" "$out"/bin/*
'';
doCheck = true;
checkTarget = "-C tests run_tests";
meta = {
description = "Lean and mean Atmel AVR simulator";
mainProgram = "simavr";
homepage = "https://github.com/buserror/simavr";
license = lib.licenses.gpl3;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [
goodrone
patryk27
];
};
}