Skip to content

Commit 2be516b

Browse files
authored
Merge pull request #4140 from NTULINUX/system-tclpath
Drop the need for exporting TCLLIBPATH, use system path [v2]
2 parents 59c5a73 + 5277e32 commit 2be516b

7 files changed

Lines changed: 21 additions & 12 deletions

File tree

debian/control.top.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Build-Depends:
4242
python3-dev,
4343
python3-tk,
4444
python3-xlib,
45+
tcl,
4546
tcl@TCLTK_VERSION@-dev,
4647
tclx,
4748
tk@TCLTK_VERSION@-dev,

debian/linuxcnc.install.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ usr/bin/xyzbc-trt-gui
113113
usr/lib/lib*.so.*
114114
usr/lib/linuxcnc
115115
usr/lib/python3
116-
usr/lib/tcltk
116+
usr/share/tcltk
117117

118118
usr/share/axis
119119
usr/share/glade

debian/rules.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ override_dh_compress:
145145
override_dh_fixperms:
146146
dh_fixperms -X/linuxcnc_module_helper -X/rtapi_app
147147
# In case that only the indep packages are built
148-
if [ -x "$(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl" ]; then \
149-
chmod -x $(DESTDIR)/usr/lib/tcltk/linuxcnc/linuxcnc.tcl; \
148+
if [ -x "$(DESTDIR)/usr/share/tcltk/linuxcnc/linuxcnc.tcl" ]; then \
149+
chmod -x $(DESTDIR)/usr/share/tcltk/linuxcnc/linuxcnc.tcl; \
150150
fi
151151
# override_dh_python3: # not executed, so we attach it to fixperms
152152
DEB_HOST_ARCH=`dpkg-architecture -qDEB_HOST_ARCH` dh_python3

lib/python/nf.py.in

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ def find_prefix(f):
105105
return find_prefix(os.path.dirname(f))
106106

107107
PREFIX = "@prefix@"
108+
EMC2_TCL_DIR = "@EMC2_TCL_DIR@"
108109
SHARE = os.path.join(PREFIX, "share", "axis")
109110
tcl_libdir = os.path.join(SHARE, "tcl")
110111

lib/python/rs274/options.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818

1919
import nf, os
2020

21-
# lib/tcltk/emc2 for installed emc
22-
# tcl for run-in-place emc
23-
for candidate in 'lib/tcltk/linuxcnc', 'tcl':
24-
LINUXCNC_TCL = os.path.join(nf.PREFIX, candidate, 'linuxcnc.tcl')
25-
if os.path.exists(LINUXCNC_TCL): break
21+
# system Tcl path for installed emc
22+
# tcl for run-in-place emc
23+
rip = os.path.join(nf.PREFIX, 'tcl', 'linuxcnc.tcl')
24+
LINUXCNC_TCL = rip if os.path.exists(rip) else os.path.join(nf.EMC2_TCL_DIR, 'linuxcnc.tcl')
2625

2726
options = '''
2827
. configure -bg #d9d9d9

src/Makefile.inc.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ LANGUAGES = @LANGUAGES@
6666
docsdir = ${prefix}/share/doc/linuxcnc
6767
sampleconfsdir = ${prefix}/share/doc/linuxcnc/examples/sample-configs
6868
ncfilesdir = ${prefix}/share/linuxcnc/ncfiles
69-
tcldir = ${prefix}/lib/tcltk/linuxcnc
69+
tcldir = @EMC2_TCL_DIR@
7070

7171

7272
# /Standard configure directories

src/configure.ac

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,15 @@ AC_DEFINE_UNQUOTED([EMC2_DEFAULT_TOOLTABLE], "$DEFAULT_TOOLTABLE", [Default nml
690690
# we decide based on RIP or install where stuff goes #
691691
##############################################################################
692692

693+
AC_ARG_WITH([tcl-dir],
694+
[AS_HELP_STRING([--with-tcl-dir=DIR],
695+
[directory for LinuxCNC Tcl scripts (default: auto-detected from tcl_pkgPath)])],
696+
[EMC2_TCL_DIR="$withval"],
697+
[TCL_GET_DIR=$(echo [['set d [lindex [lsearch -all -inline -glob $tcl_pkgPath /usr/share/*] 0]; if {$d eq ""} {set d [lindex [lsearch -all -inline -glob $tcl_pkgPath /usr/lib*] 0]}; puts $d']] | tclsh 2>/dev/null)
698+
AS_IF([test -z "$TCL_GET_DIR"],
699+
[AC_MSG_ERROR([could not determine Tcl package dir from tcl_pkgPath])])
700+
EMC2_TCL_DIR="$TCL_GET_DIR/linuxcnc"])
701+
693702
fe () {
694703
# Fully expand argument. Example:
695704
# ${datadir} -> ${datarootdir} -> ${prefix}/share -> /usr/local
@@ -726,9 +735,8 @@ else
726735
EMC2_SCRIPT=$EMC2_BIN_DIR/linuxcnc
727736
EMC2_SUFFIX=""
728737
EMC2_ICON=linuxcncicon
729-
EMC2_TCL_DIR=${prefix}/lib/tcltk/linuxcnc
730-
EMC2_TCL_LIB_DIR=${prefix}/lib/tcltk/linuxcnc
731-
EMC2_LANG_DIR=${prefix}/lib/tcltk/linuxcnc/msgs
738+
EMC2_TCL_LIB_DIR="${EMC2_TCL_DIR}"
739+
EMC2_LANG_DIR="${EMC2_TCL_DIR}/msgs"
732740
EMC2_PO_DIR=${prefix}/share/locale
733741
EMC2_HELP_DIR=${prefix}/share/doc/linuxcnc
734742
case $MODULE_DIR in

0 commit comments

Comments
 (0)