1 { lib, stdenv, fetchFromGitLab, tetex }:
5 version = "unstable-2021-06-18";
7 src = fetchFromGitLab {
8 domain = "gitlab.lrz.de";
11 rev = "7c790176d50d13ae2422fa7457ccc4c2d29eba9b";
12 sha256 = "sha256-eSwHiJ5SP/Nennalv4QFTgVnM6oan/DWDZRqtk0o6Z0=";
15 hardeningDisable = [ "format" ];
18 substituteInPlace Makefile --replace 'rm abstime.h' ""
21 # Workaround build failure on -fno-common toolchains:
22 # ld: mmix-config.o:(.bss+0x600): multiple definition of `buffer'; /build/ccDuGrwH.o:(.bss+0x20): first defined here
23 env.NIX_CFLAGS_COMPILE = "-fcommon";
25 nativeBuildInputs = [ tetex ];
26 enableParallelBuilding = true;
28 makeFlags = [ "all" "doc" "CFLAGS=-O2" ];
32 mkdir -p $out/share/doc
33 cp *.ps $out/share/doc
34 install -Dm755 mmixal -t $out/bin
35 install -Dm755 mmix -t $out/bin
36 install -Dm755 mmotype -t $out/bin
37 install -Dm755 mmmix -t $out/bin
42 description = "MMIX simulator and assembler";
43 homepage = "https://www-cs-faculty.stanford.edu/~knuth/mmix-news.html";
44 maintainers = with maintainers; [ siraben ];
45 platforms = platforms.unix;
46 license = licenses.publicDomain;