From 94d64660218a109c4b6ac8985271434689292131 Mon Sep 17 00:00:00 2001 From: Rahul Butani Date: Mon, 6 Jun 2022 01:16:33 -0500 Subject: [PATCH] lc3tools: fix build on macOS --- .../lc3tools/0004-configure-use-cc.patch | 22 +++++++++++++++++++ pkgs/development/tools/lc3tools/default.nix | 10 +++++++++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/tools/lc3tools/0004-configure-use-cc.patch diff --git a/pkgs/development/tools/lc3tools/0004-configure-use-cc.patch b/pkgs/development/tools/lc3tools/0004-configure-use-cc.patch new file mode 100644 index 00000000000..caaec220000 --- /dev/null +++ b/pkgs/development/tools/lc3tools/0004-configure-use-cc.patch @@ -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" \ diff --git a/pkgs/development/tools/lc3tools/default.nix b/pkgs/development/tools/lc3tools/default.nix index 3e7f81bb4e7..c6120a227a9 100644 --- a/pkgs/development/tools/lc3tools/default.nix +++ b/pkgs/development/tools/lc3tools/default.nix @@ -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; }; }