nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 SDL2,
6 SDL2_ttf,
7 libpcap,
8 vde2,
9 pcre,
10}:
11
12stdenv.mkDerivation rec {
13 pname = "simh";
14 version = "3.11-1";
15
16 src = fetchFromGitHub {
17 owner = "simh";
18 repo = "simh";
19 rev = "v${version}";
20 sha256 = "sha256-65+YfOWpVXPeT64TZcSaWJY+ODQ0q/pwF9jb8xGdpIs=";
21 };
22
23 buildInputs = [
24 SDL2
25 SDL2_ttf
26 libpcap
27 vde2
28 pcre
29 ];
30
31 dontConfigure = true;
32
33 # Workaround to build against upstream gcc-10 and clang-11.
34 # Can be removed when next release contains
35 # https://github.com/simh/simh/issues/794
36 env.NIX_CFLAGS_COMPILE = toString [ "-fcommon" ];
37
38 makeFlags = [
39 "GCC=${stdenv.cc.targetPrefix}cc"
40 "CC_STD=-std=c99"
41 "LDFLAGS=-lm"
42 ];
43
44 preInstall = ''
45 install -d ${placeholder "out"}/bin
46 install -d ${placeholder "out"}/share/simh
47 '';
48
49 installPhase = ''
50 runHook preInstall
51 for i in BIN/*; do
52 install -D $i ${placeholder "out"}/bin
53 done
54 for i in VAX/*bin; do
55 install -D $i ${placeholder "out"}/share/simh
56 done
57 runHook postInstall
58 '';
59
60 postInstall = ''
61 (cd $out/bin; for i in *; do ln -s $i simh-$i; done)
62 '';
63
64 meta = {
65 homepage = "http://simh.trailing-edge.com/";
66 description = "Collection of simulators of historic hardware";
67 longDescription = ''
68 SimH (History Simulator) is a collection of simulators for historically
69 significant or just plain interesting computer hardware and software from
70 the past. The goal of the project is to create highly portable system
71 simulators and to publish them as freeware on the Internet, with freely
72 available copies of significant or representative software.
73 '';
74 license = with lib.licenses; mit;
75 maintainers = [ ];
76 platforms = with lib.platforms; unix;
77 };
78}
79# TODO: install documentation