# If you do not have X11 installed, configure will see that.
# Or you can pass --without-x to configure.
# ...but generic/tk.h is including X11/Xlib.h so...
# Get the source
cd
test -f installed/tk8.6.13-src.tar.gz && mv installed/tk8.6.13-src.tar.gz .
test ! -f tk8.6.13-src.tar.gz &&
wget http://prdownloads.sourceforge.net/tcl/tk8.6.13-src.tar.gz
# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "tk?.*.*" -exec rm -r {} \;
tar xzvf ~/tk8.6.13-src.tar.gz
cd tk8.6.13
test $UID = 0 && chown -R root:root .
cd unix
# If you want to build a threaded Tk add --enable-threads to the configure
# lines below (default)
# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --libdir=/usr/lib64 --mandir=/usr/man \
--enable-man-symlinks --enable-64bit
# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --mandir=/usr/man --enable-man-symlinks
# Build it
make
# Test the build
make test
# Become root to install it
su
# Remove the Slackware package, if there is one
test -x /sbin/removepkg && /sbin/removepkg tk
# Install it
make install
# Create symlinks
( cd /usr/bin
rm -f wish
ln -s wish8.6 wish )
( cd /usr/lib
rm -f libtk.so
test -f libtk8.6.so && ln -s libtk8.6.so libtk.so )
test -d /usr/lib64 &&
( cd /usr/lib64
rm -f libtk.so
test -f libtk8.6.so && ln -s libtk8.6.so libtk.so )
# Update /etc/ld.so.cache
ldconfig
# Become yourself again
exit
# Save the source for later
cd
mkdir -p -m 0700 installed
rm -f installed/tk*-src.tar.*
mv tk8.6.13-src.tar.gz installed/
# If you ever want to uninstall Tk, this should do it:
cd ~/src/tk*.*.*
su
VER=`grep TCL_VERSION /usr/lib*/tkConfig.sh | awk -F"'" '{ print $2 }'`
test -d /usr/lib/tk${VER} && rm -r /usr/lib/tk${VER}/
rm -f /usr/bin/wish${VER} /usr/lib64/libtk${VER}.so \
/usr/lib64/libtkstub${VER}.a /usr/lib64/tkConfig.sh \
/usr/lib64/pkgconfig/tk.pc
for file in doc/*.n; do rm -f /usr/man/mann/$(basename "$file"); done
unset VER
ldconfig
exit
find ~/src -maxdepth 1 -type d -name "tk?.*.*" -exec rm -r {} \;
rm -f ~/installed/tk?.*-src.tar.*