FS#3602 - Arch tcl/tk packages include invalid src directory reference

Attached to Project: Arch Linux
Opened by Tom Killian (tomk) - Friday, 09 December 2005, 16:53 GMT
Last edited by Andreas Radke (AndyRTR) - Sunday, 11 November 2007, 22:49 GMT
Task Type Bug Report
Category Packages: Extra
Status Closed
Assigned To Andreas Radke (AndyRTR)
Architecture All
Severity Low
Priority Normal
Reported Version 0.7 Wombat
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

I tried to build tix (http://tix.sourceforge.net) against tcl/tk 8.4.11, as installed by the current Arch packages. tix is a standard TEA extension. When I ran ./configure --prefix=/usr, the output included the following:

checking for Tcl private include files... Using srcdir found in tclConfig.sh: /home/dorphell/Arch.CVS/arch/build/devel/tcl/src/tcl8.4.11
checking for Tk private include files... Using srcdir found in tkConfig.sh: /home/dorphell/Arch.CVS/arch/build/devel/tk/src/tk8.4.11

The subsequent make failed with the following error:

In file included from ./generic/tixClass.c:29:
./generic/tixPort.h:37:25: error: tclPort.h: No such file or directory
./generic/tixClass.c: In function 'Tix_ClassCmd':
./generic/tixClass.c:228: warning: implicit declaration of function 'strcmp'
./generic/tixClass.c:238: warning: implicit declaration of function 'strstr'
./generic/tixClass.c:238: warning: incompatible implicit declaration of built-in function 'strstr'
./generic/tixClass.c:277: warning: implicit declaration of function 'strlen'
./generic/tixClass.c:277: warning: incompatible implicit declaration of built-in function 'strlen'
./generic/tixClass.c: In function 'Tix_CreateInstanceCmd':
./generic/tixClass.c:763: warning: incompatible implicit declaration of built-in function 'strstr'
./generic/tixClass.c: In function 'Tix_InstanceCmd':
./generic/tixClass.c:861: warning: incompatible implicit declaration of built-in function 'strlen'
./generic/tixClass.c:889: warning: implicit declaration of function 'strncmp'
make: *** [tixClass.o] Error 1

tclPort.h is in /usr/include/tcl/, but is not found.

I built tcl and tk locally, and tclConfig.sh/tkConfig.sh now refer to my build direcory instead of Dorphell's. I can build tix against these local versions. However, it seems to me that the best fix would be to edit tclConfig.sh/tkConfig.sh to refer to /usr/include instead of the build directory. I'm going to try to work that out.
This task depends upon

Closed by  Andreas Radke (AndyRTR)
Sunday, 11 November 2007, 22:49 GMT
Reason for closing:  Fixed
Comment by Loui Chang (louipc) - Saturday, 07 April 2007, 02:16 GMT
Yeah it would be really great if there could be a sweet solution to this. Obviously my build directory isn't in /home/tobias/...

From /usr/lib/tclConfig.sh:
TCL_BUILD_LIB_SPEC='-L/home/tobias/Install/Arch/arch-cvs/arch/build/devel/tcl/sr
c/tcl8.4.14/unix -ltcl8.4${TCL_DBGX}'

When I built itcl it did the same thing it made an itclConfig.sh with my build directory.
Is it just me or is this a really stupid behaviour?
This is itcl. http://incrtcl.sourceforge.net/itcl/
Comment by Andrew Fyfe (space-m0nkey) - Saturday, 07 April 2007, 22:24 GMT
2 patches attached for the PKGBUILD files to fix this problem.
Comment by Tom Killian (tomk) - Sunday, 15 April 2007, 18:25 GMT
That's a step in the right direction, but still needs a bit of work. With this fix, the *Config.sh files have

TCL_SRC_DIR=/usr/lib/tcl8.4.14

which is not only a non-existent path, but also not a source directory, because of course we don't install the source. I'm not familiar enough with tcl/tk to judge how much this matters, but it doesn't feel right. :)

I'll have a closer look at the *Config.sh.in files that are used to create these files during the build, and if anyone as other ideas, please post them here.
Comment by Loui Chang (louipc) - Tuesday, 17 July 2007, 02:33 GMT
What do you think if the relevant src directory referenced in tclConfig.sh was installed in /usr/share/tcl or something?
Comment by Loui Chang (louipc) - Tuesday, 17 July 2007, 06:43 GMT
What do you think if the relevant src directory referenced in tclConfig.sh was installed in /usr/share/tcl or something?
Comment by Allan McRae (Allan) - Saturday, 22 September 2007, 10:12 GMT
There a four lines in both /usr/lib/{tcl,tk}Config.sh that need changed. Add these lines to the end of the relevant PKGBUILDs.

tcl:
sed -i \
-e "s,^TCL_BUILD_LIB_SPEC='-L.*/unix,TCL_BUILD_LIB_SPEC='-L/usr/lib," \
-e "s,^TCL_SRC_DIR='.*',TCL_SRC_DIR='/usr/include'," \
-e "s,^TCL_BUILD_STUB_LIB_SPEC='-L.*/unix,TCL_BUILD_STUB_LIB_SPEC='-L/usr/lib," \
-e "s,^TCL_BUILD_STUB_LIB_PATH='.*/unix,TCL_BUILD_STUB_LIB_PATH='/usr/lib," \
${startdir}/pkg/usr/lib/tclConfig.sh

tk:
sed -i \
-e "s,^\(TK_BUILD_LIB_SPEC='-L\).*/unix,\1/usr/lib," \
-e "s,^\(TK_SRC_DIR='\).*',\1/usr/include'," \
-e "s,^\(TK_BUILD_STUB_LIB_SPEC='-L\).*/unix,\1/usr/lib," \
-e "s,^\(TK_BUILD_STUB_LIB_PATH='\).*/unix,\1/usr/lib," \
${startdir}/pkg/usr/lib/tkConfig.sh

This not very consistent sed expression style was bought to you with the help of the gentoo ebuilds.
Comment by Andrew Fyfe (space-m0nkey) - Saturday, 22 September 2007, 16:36 GMT
or simply use the patches that I've already posted above

TCL:
sed -i \
"s#$startdir/src/tcl$pkgver/unix#/usr/lib" \
$startdir/pkg/usr/lib/tclConfig.sh

TK:
sed -i \
"s#$startdir/src/tk$pkgver/unix#/usr/lib" \
$startdir/pkg/usr/lib/tkConfig.sh
Comment by Allan McRae (Allan) - Saturday, 22 September 2007, 17:00 GMT
Not quite because one needs to point to /usr/include not /usr/lib, which is actually the cause of initial bug report.
Comment by Andrew Fyfe (space-m0nkey) - Saturday, 22 September 2007, 18:29 GMT
Oops my bad for some reason I got it stuck in my head that the missing headers were in usr/lib/tcl*

The sed should be

sed -i.bak \
-e "/SRC/ s#$startdir/src/tcl$pkgver#/usr/include#" \
-e "/LIB/ s#$startdir/src/tcl$pkgver/unix#/usr/lib#" \
$startdir/pkg/usr/lib/tclConfig.sh
Comment by Andreas Radke (AndyRTR) - Tuesday, 09 October 2007, 21:21 GMT
can you please summarize if the problem still exists with latest update and what it wrong?
Comment by Allan McRae (Allan) - Tuesday, 09 October 2007, 23:58 GMT
grep "abs" /usr/lib/t{cl,k}Config.sh

shows the path used to buld tcl/tk - /var/abs/extra/devel/... Problem still exists. I have tested my solution above which fixes it. Andrew's simpler sed statement above should do the same thing but I haven't tested.

Loading...