push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
diff --git a/configure b/configure
index 46f9af4..dfc1b3e 100755
--- a/configure
+++ b/configure
@@ -17,10 +17,11 @@ esac
# Some binaries that we'll need, and the places that we might find them.
-binlist="uname flex gcc wish rm cp mkdir chmod sed"
-pathlist="/bin /usr/bin /usr/local/bin /sw/bin /usr/x116/bin /usr/X11R6/bin"
-libpathlist="/lib /usr/lib /usr/local/lib"
-incpathlist="/include /usr/include /usr/local/include"
+IFS=:
+binlist="uname:flex:gcc:wish:rm:cp:mkdir:chmod:sed"
+pathlist=$PATH
+libpathlist=$LIBS
+incpathlist=$INCLUDES
# Find the binaries (or die trying).
@@ -55,7 +56,7 @@ case `$uname -s` in
echo "Configuring for Cygwin..."
;;
Linux*) echo "Configuring for Linux..."
- OS_SIM_LIBS="-lcurses"
+ # OS_SIM_LIBS="-lcurses"
;;
SunOS*) echo "Configuring for Solaris..."
OS_SIM_LIBS="-lcurses -lsocket -lnsl"

View File

@@ -0,0 +1,21 @@
diff --git a/lc3sim.c b/lc3sim.c
index dac7f7a..736fd7c 100644
--- a/lc3sim.c
+++ b/lc3sim.c
@@ -665,14 +665,14 @@ init_machine ()
bzero (lc3_sym_hash, sizeof (lc3_sym_hash));
clear_all_breakpoints ();
- if (read_obj_file (INSTALL_DIR "/lc3os.obj", &os_start, &os_end) == -1) {
+ if (read_obj_file (INSTALL_DIR "/share/lc3tools/lc3os.obj", &os_start, &os_end) == -1) {
if (gui_mode)
puts ("ERR {Failed to read LC-3 OS code.}");
else
puts ("Failed to read LC-3 OS code.");
show_state_if_stop_visible ();
} else {
- if (read_sym_file (INSTALL_DIR "/lc3os.sym") == -1) {
+ if (read_sym_file (INSTALL_DIR "/share/lc3tools/lc3os.sym") == -1) {
if (gui_mode)
puts ("ERR {Failed to read LC-3 OS symbols.}");
else

View File

@@ -0,0 +1,13 @@
diff --git a/Makefile.def b/Makefile.def
index 34f7df3..05dc86c 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -155,7 +155,7 @@ dist_lc3sim-tk: lc3sim-tk
lc3sim-tk: lc3sim-tk.def
${SED} -e 's @@WISH@@ ${WISH} g' \
- -e 's*@@LC3_SIM@@*"${INSTALL_DIR}/lc3sim"*g' \
+ -e 's*@@LC3_SIM@@*"${INSTALL_DIR}/bin/lc3sim"*g' \
-e 's!@@CODE_FONT@@!${CODE_FONT}!g' \
-e 's!@@BUTTON_FONT@@!${BUTTON_FONT}!g' \
-e 's!@@CONSOLE_FONT@@!${CONSOLE_FONT}!g' \

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

@@ -0,0 +1,71 @@
{
lib,
stdenv,
fetchurl,
unzip,
flex,
tk,
ncurses,
readline,
}:
stdenv.mkDerivation {
pname = "lc3tools";
version = "0.12";
src = fetchurl {
url = "https://highered.mheducation.com/sites/dl/free/0072467509/104652/lc3tools_v12.zip";
hash = "sha256-PTM0ole8pHiJmUaahjPwcBQY8/hVVgQhADZ4bSABt3I=";
};
patches = [
# the original configure looks for things in the FHS path
# I have modified it to take environment vars
./0001-mangle-configure.patch
# lc3sim looks for the LC3 OS in $out/share/lc3tools instead of $out
./0002-lc3os-path.patch
# 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 ];
buildInputs = [
flex
tk
ncurses
readline
];
# lumetta published this a while ago but handrolled his configure
# jank in the original packaging makes this necessary:
LIBS = "${flex}/lib:${ncurses}/lib:${readline}/lib";
INCLUDES = "${flex}/include:${ncurses}/include:${readline}/include";
# it doesn't take `--prefix`
prefixKey = "--installdir ";
postInstall = ''
mkdir -p $out/{bin,share/lc3tools}
mv -t $out/share/lc3tools $out/{COPYING,NO_WARRANTY,README} $out/lc3os*
mv -t $out/bin $out/lc3*
'';
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;
};
}