%global commit 013719105c56e0205e003f7f6ae5c3e1314da6bc # avoid several LTO type mismatch warnings %global _lto_cflags %nil Name: mmix Version: 20221025 Release: 1%{?dist} Summary: MMIX simulators, assembler, and tools License: Knuth URL: https://mmix.cs.hm.edu/ Source0: https://gitlab.lrz.de/mmix/mmixware/-/archive/%{commit}/mmixware-%{commit}.tar.gz Source1: https://mmix.cs.hm.edu/tools/mmixtex/mmixtex.zip # CWEB "patches" to add features Source200: https://gitlab.lrz.de/mmix/util/-/raw/master/mmoimg/mmoimg.ch BuildRequires: gcc BuildRequires: make BuildRequires: texlive-amsfonts BuildRequires: texlive-cm BuildRequires: texlive-cweb BuildRequires: texlive-epsf BuildRequires: texlive-etex BuildRequires: texlive-knuth-lib BuildRequires: texlive-metafont BuildRequires: texlive-mfware %if 0%{?fedora} || 0%{?rhel} >= 9 BuildRequires: texlive-modes %endif BuildRequires: texlive-pdftex BuildRequires: texlive-tex %description MMIX is a computer intended to illustrate machine-level aspects of programming. In the books The Art of Computer Programming, it replaces MIX, the 1960s-style machine that formerly played such a role. MMIX was designed so that its machine language would be simple, elegant, and easy to learn. At the same time it includes all of the complexities needed to achieve high performance in practice, so that MMIX could in principle be built and even perhaps be competitive with some of the fastest general-purpose computers in the marketplace. %prep %setup -q -c -b 0 -a 1 -n mmixware-%{commit} cp %{SOURCE200} . %build # create mmoimg ctangle mmotype.w mmoimg.ch mmoimg.c cweave mmotype.w mmoimg.ch mmoimg.tex make all mmoimg CFLAGS="%{optflags} -fsigned-char" for f in mm*.w; do make ${f%.w}.pdf PDFTEX=pdftex done pdftex mmoimg.tex %check ./mmixal -x -b 250 -l copy.mml copy.mms ./mmix copy copy.mms > copy.out diff -u copy.mms copy.out ./mmixal -x -b 250 -l hello.mml hello.mms ./mmix -Dhello.mmb hello.mmo echo -e '10000\nq' | ./mmmix plain.mmconfig hello.mmb ./mmixal -x -b 250 -l silly.mml silly.mms ./mmix -Dsilly.mmb silly.mmo echo -e '10000\nq' | ./mmmix plain.mmconfig silly.mmb %install mkdir -p $RPM_BUILD_ROOT%{_bindir} install mmix mmixal mmmix mmotype mmoimg $RPM_BUILD_ROOT%{_bindir}/ %files %doc README *.pdf %{_bindir}/mmix %{_bindir}/mmixal %{_bindir}/mmmix %{_bindir}/mmotype %{_bindir}/mmoimg %changelog * Mon Jul 25 2022 Yaakov Selkowitz - 20210618-1 - Initial release