Skip to content

[WIP] Drop the need for exporting TCLLIBPATH, use system path [v2]#4140

Draft
NTULINUX wants to merge 2 commits into
LinuxCNC:masterfrom
NTULINUX:system-tclpath
Draft

[WIP] Drop the need for exporting TCLLIBPATH, use system path [v2]#4140
NTULINUX wants to merge 2 commits into
LinuxCNC:masterfrom
NTULINUX:system-tclpath

Conversation

@NTULINUX
Copy link
Copy Markdown
Contributor

@NTULINUX NTULINUX commented Jun 8, 2026

I don't know how to restore my last PR properly with the fixed tree so making a new one.

This avoids hard-coding LinuxCNC to use a path outside of the system's default Tcl search path, making it no longer required to specify TCLLIBPATH on Gentoo and Fedora. Logging in and out in order to update the environmental variables so the icons/menu entries work is also no longer needed.

@NTULINUX NTULINUX marked this pull request as draft June 8, 2026 12:10
@NTULINUX
Copy link
Copy Markdown
Contributor Author

NTULINUX commented Jun 8, 2026

@BsAtHome do you have any recommendations on fixing linuxcnc.install.in so it uses EMC2_TCL_DIR instead of hard-coding it to usr/lib/tcltk? I can add it to configure.ac but I don't think that's right.

What about something like:

diff --git a/debian/configure b/debian/configure
index 096b3f4a5e..f715227ec8 100755
--- a/debian/configure
+++ b/debian/configure
@@ -152,6 +152,8 @@ KERNEL_DEPENDS_BUILD=libudev-dev
 KERNEL_HEADERS=
 KERNEL_VERSION=uspace
 MODUTILS_DEPENDS=
+TCL_GET_DIR=$(echo 'puts [tcl::pkgconfig get scriptdir,runtime]' | tclsh)
+EMC2_TCL_DIR="${TCL_GET_DIR}/linuxcnc"
 if false; then
 MAIN_PACKAGE_NAME=linuxcnc
 OTHER_MAIN_PACKAGE_NAME=linuxcnc-uspace
@@ -177,6 +179,7 @@ sed \
     -e "s#@KERNEL_HEADERS@#$KERNEL_HEADERS#g" \
     -e "s#@KERNEL_VERSION@#$KERNEL_VERSION#g" \
     -e "s#@LIBREADLINE_DEV@#$LIBREADLINE_DEV#g" \
+    -e "s#@EMC2_TCL_DIR@#$EMC2_TCL_DIR#g" \
     -e "s#@MAIN_PACKAGE_NAME@#$MAIN_PACKAGE_NAME#g" \
     -e "s#@MODULE_EXT@#$MODULE_EXT#g" \
     -e "s#@MODULE_PATH@#$MODULE_PATH#g" \

There's also this hard-code too in rules.in:

	if [ -x  "$(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl" ]; then \
		chmod -x $(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl; \
	fi

Trying something...

@NTULINUX NTULINUX marked this pull request as ready for review June 8, 2026 14:03
@NTULINUX
Copy link
Copy Markdown
Contributor Author

NTULINUX commented Jun 8, 2026

Uh oh.. build failed:

debian/configure: line 155: tclsh: command not found

Adding tcl to .github/scripts/install-deps.sh doesn't work..

@NTULINUX NTULINUX marked this pull request as draft June 8, 2026 14:19
NTULINUX added 2 commits June 8, 2026 09:24
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Signed-off-by: Alec Ari <neotheuser@ymail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant