lc3tools: fix build on macOS

This commit is contained in:
Rahul Butani 2022-06-06 01:16:33 -05:00
parent 9c7fe48d8d
commit 94d6466021
No known key found for this signature in database
GPG Key ID: 1C7CE491479FA273
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,22 @@
diff --git a/configure b/configure
index dfc1b3e..55577af 100755
--- a/configure
+++ b/configure
@@ -18,7 +18,7 @@ esac
# Some binaries that we'll need, and the places that we might find them.
IFS=:
-binlist="uname:flex:gcc:wish:rm:cp:mkdir:chmod:sed"
+binlist="uname:flex:cc:wish:rm:cp:mkdir:chmod:sed"
pathlist=$PATH
libpathlist=$LIBS
incpathlist=$INCLUDES
@@ -109,7 +109,7 @@ fi
# Splice it all in to Makefile.def to create the Makefile.
rm -f Makefile
-sed -e "s __GCC__ $gcc g" -e "s __FLEX__ $flex g" -e "s __EXE__ $EXE g" \
+sed -e "s __GCC__ $cc g" -e "s __FLEX__ $flex g" -e "s __EXE__ $EXE g" \
-e "s*__OS_SIM_LIBS__*$OS_SIM_LIBS*g" -e "s __RM__ $rm g" \
-e "s __CP__ $cp g" -e "s __MKDIR__ $mkdir g" -e "s __CHMOD__ $chmod g" \
-e "s __USE_READLINE__ $USE_READLINE g" -e "s*__RLLPATH__*$RLLPATH*g" \

View File

@ -19,6 +19,9 @@ stdenv.mkDerivation {
# lc3sim-tk looks for lc3sim in $out/bin instead of $out
./0003-lc3sim-tk-path.patch
# use `cc` instead of `gcc`; on macOS the latter is not present
./0004-configure-use-cc.patch
];
nativeBuildInputs = [ unzip ];
@ -40,8 +43,15 @@ stdenv.mkDerivation {
'';
meta = with lib; {
longDescription = ''
The LC-3 tools package contains the lc3as assembler, the lc3sim simulator,
and lc3sim-tk, a Tcl/Tk-based GUI frontend to the simulator.
'';
description = "Toolchain and emulator for the LC-3 architecture";
homepage = "https://highered.mheducation.com/sites/0072467509/student_view0/lc-3_simulator.html";
license = licenses.gpl2;
maintainers = with maintainers; [ anna328p ];
mainProgram = "lc3sim-tk";
platforms = with lib.platforms; unix ++ windows;
};
}