2021-01-11 07:54:33 +00:00
|
|
|
{ lib, stdenv, fetchFromGitLab, tetex }:
|
2020-11-04 14:13:06 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "mmixware";
|
2022-01-11 10:01:24 +00:00
|
|
|
version = "unstable-2021-06-18";
|
2020-11-04 14:13:06 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
domain = "gitlab.lrz.de";
|
|
|
|
owner = "mmix";
|
|
|
|
repo = "mmixware";
|
2022-01-11 10:01:24 +00:00
|
|
|
rev = "7c790176d50d13ae2422fa7457ccc4c2d29eba9b";
|
|
|
|
sha256 = "sha256-eSwHiJ5SP/Nennalv4QFTgVnM6oan/DWDZRqtk0o6Z0=";
|
2020-11-04 14:13:06 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile --replace 'rm abstime.h' ""
|
|
|
|
'';
|
|
|
|
|
2022-06-04 16:40:13 +00:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: mmix-config.o:(.bss+0x600): multiple definition of `buffer'; /build/ccDuGrwH.o:(.bss+0x20): first defined here
|
2023-02-19 19:23:32 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = "-fcommon";
|
2022-06-04 16:40:13 +00:00
|
|
|
|
2020-11-04 14:13:06 +00:00
|
|
|
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
|
|
|
|
'';
|
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2020-11-04 14:13:06 +00:00
|
|
|
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;
|
|
|
|
};
|
|
|
|
}
|