blob: e3b1e037e0e6780851ea5f245f21568bf3302497 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
{
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
];
};
}
|