From: =?utf-8?q?St=C3=A9phane_Glondu?= <steph@glondu.net>
Date: Mon, 14 Nov 2022 08:24:28 +0100
Subject: Fix paths in labltk script

Bug-Debian: https://bugs.debian.org/1023867
---
 lib/Makefile | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/Makefile b/lib/Makefile
index d4a1f65..0f4d0b5 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -48,6 +48,9 @@ TOPLEVELSTART=topstart.cmo
 
 TOPDEPS = $(TOPLEVELLIBS) $(TOPLEVELSTART)
 
+OCAML_STDLIB_DIR = $(shell ocamlc -where)
+INSTALLDIR_RUNTIME = $(OCAML_STDLIB_DIR)/$(LIBNAME)
+
 $(LIBNAME).cma: $(SUPPORT) ../Widgets.src
 	$(MAKE) superclean
 	cd ../labltk; $(MAKE)
@@ -74,7 +77,7 @@ $(LIBNAME)top$(EXE) : $(LIBNAME).cma ../support/lib$(LIBNAME).$(A)
 $(LIBNAME): Makefile
 	@echo Generate $@
 	@echo "#!/bin/sh" > $@
-	@echo 'exec $(INSTALLDIR)/$(LIBNAME)top$(EXE) -I $(INSTALLDIR) "$$@"' >> $@
+	@echo 'exec $(INSTALLDIR_RUNTIME)/$(LIBNAME)top$(EXE) -I $(INSTALLDIR_RUNTIME) "$$@"' >> $@
 
 install-script: $(LIBNAME)
 	cp $(LIBNAME) $(INSTALLBINDIR)
