aboutsummaryrefslogtreecommitdiff
path: root/infra/libkookie/nixpkgs/pkgs/development/tools/mmixware/default.nix
blob: 0b0d394b4e1e921d14d01aa384e8a71602e5efbc (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
{ stdenv, fetchFromGitLab, tetex }:

stdenv.mkDerivation {
  pname = "mmixware";
  version = "unstable-2019-02-19";

  src = fetchFromGitLab {
    domain = "gitlab.lrz.de";
    owner = "mmix";
    repo = "mmixware";
    rev = "a330d68aafcfe739ecaaece888a669b8e7d9bcb8";
    sha256 = "0bq0d19vqhfbpk4mcqzmd0hygbkhapl1mzlfkcr6afx0fhlhi087";
  };

  hardeningDisable = [ "format" ];

  postPatch = ''
    substituteInPlace Makefile --replace 'rm abstime.h' ""
  '';

  nativeBuildInputs = [ tetex ];
  enableParallelBuilding = true;

  makeFlags = [ "all" "doc" "CFLAGS=-O2" ];

  installPhase = ''
    runHook preInstall
    mkdir -p $out/share/doc
    cp *.ps $out/share/doc
    install -Dm755 mmixal -t $out/bin
    install -Dm755 mmix -t $out/bin
    install -Dm755 mmotype -t $out/bin
    install -Dm755 mmmix -t $out/bin
    runHook postInstall
  '';

  meta = with stdenv.lib; {
    description  = "MMIX simulator and assembler";
    homepage     = "https://www-cs-faculty.stanford.edu/~knuth/mmix-news.html";
    maintainers  = with maintainers; [ siraben ];
    platforms    = platforms.unix;
    license      = licenses.publicDomain;
  };
}