summaryrefslogtreecommitdiff
path: root/repo/system/tcl.xibuild
blob: 6c39ed97b592ceaff68905914fba3ea1de8ee5e5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash

DEPS=(zlib)

PKG_VER=8.6.11
SOURCE=https://github.com/tcltk/tcl/archive/refs/tags/core-$( echo $PKG_VER  | sed "s|\.|-|g").tar.gz
DESC="the Tool Command language, a robust general purpose scripting language"


build () {
    SRCDIR=$(pwd)
    cd unix
    ./configure --prefix=/usr --mandir=/usr/share/man $([ "$(uname -m)" = x86_64 ] && echo --enable-64bit)

    make 

    sed -e "s|$SRCDIR/unix|/usr/lib|" \
        -e "s|$SRCDIR|/usr/include|"  \
        -i tclConfig.sh

    sed -e "s|$SRCDIR/unix/pkgs/tdbc1.1.2|/usr/lib/tdbc1.1.2|" \
        -e "s|$SRCDIR/pkgs/tdbc1.1.2/generic|/usr/include|"    \
        -e "s|$SRCDIR/pkgs/tdbc1.1.2/library|/usr/lib/tcl8.6|" \
        -e "s|$SRCDIR/pkgs/tdbc1.1.2|/usr/include|"            \
        -i pkgs/tdbc1.1.2/tdbcConfig.sh

    sed -e "s|$SRCDIR/unix/pkgs/itcl4.2.1|/usr/lib/itcl4.2.1|" \
        -e "s|$SRCDIR/pkgs/itcl4.2.1/generic|/usr/include|"    \
        -e "s|$SRCDIR/pkgs/itcl4.2.1|/usr/include|"            \
        -i pkgs/itcl4.2.1/itclConfig.sh

    unset SRCDIR
}

check () {
    make test
}

package () {
    make DESTDIR=$PKG_DEST install

    chmod -v u+w $PKG_DEST/usr/lib/libtcl$(echo $PKG_DEST | cut -d. -f-2).so

    make DESTDIR=$PKG_DEST install-private-headers

    ln $PKG_DEST/usr/bin/tclsh* $PKG_DEST/usr/bin/tclsh
    cp -f tclsh9 $PKG_DEST/usr/bin/tclsh
    mv $PKG_DEST/usr/share/man/man3/{Thread,Tcl_Thread}.3

}