1 | #!/bin/bash
|
---|
2 | #
|
---|
3 | # Tk
|
---|
4 | #
|
---|
5 | # Dependencies: tcl X
|
---|
6 | #
|
---|
7 |
|
---|
8 | cd ${SRC}
|
---|
9 | LOG=tk-blfs.log
|
---|
10 |
|
---|
11 | SELF=`basename ${0}`
|
---|
12 | set_buildenv
|
---|
13 | set_libdirname
|
---|
14 | setup_multiarch
|
---|
15 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
16 | extra_conf="--libdir=/usr/${libdirname}"
|
---|
17 | fi
|
---|
18 |
|
---|
19 | unpack_tarball tk${TK_VER}-src &&
|
---|
20 | cd ${PKGDIR}/unix
|
---|
21 |
|
---|
22 | if [ ! "${libdirname}" = "lib" ]; then
|
---|
23 | # change TK_LIBRARY in Makefile so it is under $(libdir)
|
---|
24 | test -f Makefile.in-ORIG ||
|
---|
25 | cp -p Makefile.in Makefile.in-ORIG
|
---|
26 | sed '/TK_LIBRARY/s@\$(prefix)/lib@$(libdir)@g' \
|
---|
27 | Makefile.in-ORIG > Makefile.in
|
---|
28 | fi
|
---|
29 |
|
---|
30 | max_log_init Tcl ${TK_VER} "blfs (shared)" ${CONFLOGS} ${LOG}
|
---|
31 | CC="${CC-gcc} ${ARCH_CFLAGS}" \
|
---|
32 | CFLAGS="${TGT_CFLAGS}" \
|
---|
33 | ./configure --prefix=/usr --enable-threads ${extra_conf} \
|
---|
34 | --with-tcl=/usr/${libdirname} \
|
---|
35 | >> ${LOGFILE} 2>&1 &&
|
---|
36 | echo " o Configure OK" &&
|
---|
37 |
|
---|
38 | min_log_init ${BUILDLOGS} &&
|
---|
39 | make ${PMFLAGS} LDFLAGS="-s" \
|
---|
40 | >> ${LOGFILE} 2>&1 &&
|
---|
41 | echo " o Build OK" || barf
|
---|
42 |
|
---|
43 | #min_log_init ${TESTLOGS} &&
|
---|
44 | #make test \
|
---|
45 | # >> ${LOGFILE} 2>&1 &&
|
---|
46 | #echo " o Test OK" &&
|
---|
47 |
|
---|
48 | # TODO: get version from tk itself
|
---|
49 | V=`echo ${TK_VER} | cut -d "." -f 1,2`
|
---|
50 |
|
---|
51 | sed -i "s@${SRC}/${PKGDIR}/unix@/usr/${libdirname}@" tkConfig.sh &&
|
---|
52 | sed -i "s@${SRC}/${PKGDIR}@/usr/include/tk${V}@" tkConfig.sh &&
|
---|
53 |
|
---|
54 | min_log_init ${INSTLOGS} &&
|
---|
55 | make install \
|
---|
56 | >> ${LOGFILE} 2>&1 &&
|
---|
57 | echo " o ALL OK" || barf
|
---|
58 |
|
---|
59 | install -d /usr/include/tk${V}/unix &&
|
---|
60 | install -m644 *.h /usr/include/tk${V}/unix/ &&
|
---|
61 | install -d /usr/include/tk${V}/generic &&
|
---|
62 | install -c -m644 ../generic/*.h /usr/include/tk${V}/generic/ &&
|
---|
63 | rm -f /usr/include/tk${V}/generic/{tk,tkDecls,tkPlatDecls}.h &&
|
---|
64 | ln -nsf ../../include/tk${V} /usr/${libdirname}/tk${V}/include &&
|
---|
65 | ln -sf libtk${V}.so /usr/${libdirname}/libtk.so &&
|
---|
66 | ln -sf wish${V} /usr/bin/wish
|
---|
67 |
|
---|