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