git.iko.soy/typeable/nixpkgs
on master help sign in
lc3tools: fix errors due to incorrect hardcoded paths
commitf4679d33f83d22febc11dc5df58f4afb2343c4c1 authorDmitry Kudriavtsev <dkudriavtsev@gmail.com> dateMon 30 Nov 2020, 16:52 (6 years ago) parent925b70c
3 files changed+41−2
pkgs/development/tools/lc3tools/0002-lc3os-path.patch+21 pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patch+13 pkgs/development/tools/lc3tools/default.nix+7−2
pkgs/development/tools/lc3tools/0002-lc3os-path.patchnew file+21
@@ -0,0 +1,21 @@
1+diff --git a/lc3sim.c b/lc3sim.c
2+index dac7f7a..736fd7c 100644
3+--- a/lc3sim.c
4++++ b/lc3sim.c
5+@@ -665,14 +665,14 @@ init_machine ()
6+ bzero (lc3_sym_hash, sizeof (lc3_sym_hash));
7+ clear_all_breakpoints ();
8+
9+- if (read_obj_file (INSTALL_DIR "/lc3os.obj", &os_start, &os_end) == -1) {
10++ if (read_obj_file (INSTALL_DIR "/share/lc3tools/lc3os.obj", &os_start, &os_end) == -1) {
11+ if (gui_mode)
12+ puts ("ERR {Failed to read LC-3 OS code.}");
13+ else
14+ puts ("Failed to read LC-3 OS code.");
15+ show_state_if_stop_visible ();
16+ } else {
17+- if (read_sym_file (INSTALL_DIR "/lc3os.sym") == -1) {
18++ if (read_sym_file (INSTALL_DIR "/share/lc3tools/lc3os.sym") == -1) {
19+ if (gui_mode)
20+ puts ("ERR {Failed to read LC-3 OS symbols.}");
21+ else
pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patchnew file+13
@@ -0,0 +1,13 @@
1+diff --git a/Makefile.def b/Makefile.def
2+index 34f7df3..05dc86c 100644
3+--- a/Makefile.def
4++++ b/Makefile.def
5+@@ -155,7 +155,7 @@ dist_lc3sim-tk: lc3sim-tk
6+
7+ lc3sim-tk: lc3sim-tk.def
8+ ${SED} -e 's @@WISH@@ ${WISH} g' \
9+- -e 's*@@LC3_SIM@@*"${INSTALL_DIR}/lc3sim"*g' \
10++ -e 's*@@LC3_SIM@@*"${INSTALL_DIR}/bin/lc3sim"*g' \
11+ -e 's!@@CODE_FONT@@!${CODE_FONT}!g' \
12+ -e 's!@@BUTTON_FONT@@!${BUTTON_FONT}!g' \
13+ -e 's!@@CONSOLE_FONT@@!${CONSOLE_FONT}!g' \
pkgs/development/tools/lc3tools/default.nix+7−2
@@ -13,6 +13,12 @@ stdenv.mkDerivation {
1313 # the original configure looks for things in the FHS path
1414 # I have modified it to take environment vars
1515 ./0001-mangle-configure.patch
16+
17+ # lc3sim looks for the LC3 OS in $out/share/lc3tools instead of $out
18+ ./0002-lc3os-path.patch
19+
20+ # lc3sim-tk looks for lc3sim in $out/bin instead of $out
21+ ./0003-lc3sim-tk-path.patch
1622 ];
1723
1824 nativeBuildInputs = [ unzip ];
@@ -27,10 +33,9 @@ stdenv.mkDerivation {
2733 prefixKey = "--installdir ";
2834
2935 postInstall = ''
30− rm $out/{COPYING,NO_WARRANTY,README}
3136 mkdir -p $out/{bin,share/lc3tools}
3237
33− mv -t $out/share/lc3tools $out/lc3os*
38+ mv -t $out/share/lc3tools $out/{COPYING,NO_WARRANTY,README} $out/lc3os*
3439 mv -t $out/bin $out/lc3*
3540 '';
3641