From f4679d33f83d22febc11dc5df58f4afb2343c4c1 Mon Sep 17 00:00:00 2001 From: Dmitry Kudriavtsev Date: Mon, 30 Nov 2020 16:52:35 -0800 Subject: lc3tools: fix errors due to incorrect hardcoded paths --- .../tools/lc3tools/0002-lc3os-path.patch | 21 +++++++++++++++++++++ .../tools/lc3tools/0003-lc3sim-tk-path.patch | 13 +++++++++++++ pkgs/development/tools/lc3tools/default.nix | 9 +++++++-- 3 files changed, 41 insertions(+), 2 deletions(-) create mode 100644 pkgs/development/tools/lc3tools/0002-lc3os-path.patch create mode 100644 pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patch (limited to 'pkgs') diff --git a/pkgs/development/tools/lc3tools/0002-lc3os-path.patch b/pkgs/development/tools/lc3tools/0002-lc3os-path.patch new file mode 100644 index 000000000000..413c95e12f64 --- /dev/null +++ b/pkgs/development/tools/lc3tools/0002-lc3os-path.patch @@ -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 diff --git a/pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patch b/pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patch new file mode 100644 index 000000000000..38bc9daaf59c --- /dev/null +++ b/pkgs/development/tools/lc3tools/0003-lc3sim-tk-path.patch @@ -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' \ diff --git a/pkgs/development/tools/lc3tools/default.nix b/pkgs/development/tools/lc3tools/default.nix index 25b476f68c06..122271c34a4d 100644 --- a/pkgs/development/tools/lc3tools/default.nix +++ b/pkgs/development/tools/lc3tools/default.nix @@ -13,6 +13,12 @@ stdenv.mkDerivation { # 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 ]; nativeBuildInputs = [ unzip ]; @@ -27,10 +33,9 @@ stdenv.mkDerivation { prefixKey = "--installdir "; postInstall = '' - rm $out/{COPYING,NO_WARRANTY,README} mkdir -p $out/{bin,share/lc3tools} - mv -t $out/share/lc3tools $out/lc3os* + mv -t $out/share/lc3tools $out/{COPYING,NO_WARRANTY,README} $out/lc3os* mv -t $out/bin $out/lc3* ''; -- cgit v1.2.3