aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/misc/emulators/simh/default.nix
blob: 50e02a8f2403ca591c11ae1919544fc5fb6780c6 (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
{ stdenv
, fetchFromGitHub
, SDL2
, SDL2_ttf
, libpcap
, vde2
, pcre
}:

stdenv.mkDerivation rec {
  pname = "simh";
  version = "3.11-1";

  src = fetchFromGitHub {
    owner = "simh";
    repo = pname;
    rev = "v${version}";
    sha256 = "sha256-65+YfOWpVXPeT64TZcSaWJY+ODQ0q/pwF9jb8xGdpIs=";
  };

  buildInputs = [ SDL2 SDL2_ttf libpcap vde2 pcre ];

  dontConfigure = true;

  makeFlags = [ "GCC=cc" "CC_STD=-std=c99" "LDFLAGS=-lm" ];

  preInstall = ''
    install -d ${placeholder "out"}/bin
    install -d ${placeholder "out"}/share/simh
  '';

  installPhase = ''
    runHook preInstall
    for i in BIN/*; do
      install -D $i ${placeholder "out"}/bin
    done
    for i in VAX/*bin; do
      install -D $i ${placeholder "out"}/share/simh
    done
    runHook postInstall
  '';

  postInstall = ''
    (cd $out/bin; for i in *; do ln -s $i simh-$i; done)
  '';

  meta = with stdenv.lib; {
    homepage = "http://simh.trailing-edge.com/";
    description = "A collection of simulators of historic hardware";
    longDescription = ''
      SimH (History Simulator) is a collection of simulators for historically
      significant or just plain interesting computer hardware and software from
      the past. The goal of the project is to create highly portable system
      simulators and to publish them as freeware on the Internet, with freely
      available copies of significant or representative software.
    '';
    license = with licenses; mit;
    maintainers = with maintainers; [ AndersonTorres ];
    platforms = with platforms; unix;
  };
}
# TODO: install documentation