#56825 closed defect (fixed)
p5-tcl-tk: Your Tcl installation fails to find Tk package
Reported by: | ryandesign (Ryan Carsten Schmidt) | Owned by: | chrstphrchvz (Christopher Chavez) |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | ports | Version: | |
Keywords: | Cc: | ||
Port: | p5-tcl-tk |
Description
Your Tcl installation (/opt/local/bin/tclsh) fails to find Tk package. One of possible reasons is missing file 'pkgIndex.tcl' in ..../tk8.4/ directory; Please check if you can feed 'package require Tk' to tclsh
Change History (4)
comment:1 follow-up: 3 Changed 6 years ago by chrstphrchvz (Christopher Chavez)
comment:2 Changed 6 years ago by chrstphrchvz (Christopher Chavez)
comment:3 follow-up: 4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Replying to chrstphrchvz:
I don't know what exactly is causing the error. There's a test in Makefile.PL that checks for Tcl/Tk and certain Tk extensions by running tclsh with a script test-for-tk.tcl, but for some reason, Perl never gets any output from tclsh when run from MacPorts, whereas I can run Makefile.PL manually and it will work.
MacPorts runs as the macports
user. This user does not have permission to access the X server, which is apparently what test-for-tk.tcl does by attempting to include the Tk package:
$ sudo -u macports /opt/local/bin/tclsh % package require Tk couldn't connect to display "/private/tmp/com.apple.launchd.CYqUDJ8ts9/org.macports:0" %
comment:4 Changed 6 years ago by chrstphrchvz (Christopher Chavez)
Replying to ryandesign:
MacPorts runs as the
macports
user. This user does not have permission to access the X server, which is apparently what test-for-tk.tcl does by attempting to include the Tk package:
That explains why this test won't work if the tk +x11
variant is active, but if the tk +quartz
variant is used instead, the same sudo -u macports /opt/local/bin/tclsh
command works, so I don't think the fact the macports
user is used explains the whole story. Even sudo -u macports perl -e "print qx(/opt/local/bin/tclsh test-for-tk.tcl)"
seems to work as long as the tk +quartz
variant is active.
I was actually expecting this error, because a similar one occurred when I was making the p5-tcl-ptk port. Somehow I was able to install p5-tcl-tk yesterday without error; now after uninstalling and cleaning, I get this error.
I don't know what exactly is causing the error. There's a test in Makefile.PL that checks for Tcl/Tk and certain Tk extensions by running tclsh with a script test-for-tk.tcl, but for some reason, Perl never gets any output from tclsh when run from MacPorts, whereas I can run Makefile.PL manually and it will work.
The workaround I ended up using for p5-tcl-ptk was removing the test with a patch to Makefile.PL, and instead trusting MacPorts to properly install Tcl/Tk and tklib (cf. https://github.com/macports/macports-ports/pull/2036). I will probably apply the same workaround here if I can't figure out why there's no output from tclsh to Perl when MacPorts runs Makefile.PL.