summaryrefslogtreecommitdiff
path: root/extra/tcl/PKGBUILD
blob: cd032548968391546e1376ffc82e7414763899fa (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
# $Id: PKGBUILD 170721 2012-11-10 04:48:01Z allan $
# Maintainer: Allan McRae <allan@archlinux.org>
# Committer: Judd Vinet <jvinet@zeroflux.org>

pkgname=tcl
pkgver=8.5.13
pkgrel=1
pkgdesc="The Tcl scripting language"
arch=('i686' 'x86_64' 'mips64el')
url="http://tcl.sourceforge.net/"
license=('custom')
source=(http://downloads.sourceforge.net/sourceforge/tcl/tcl${pkgver}-src.tar.gz)
md5sums=('fa3a9bf9b2d6ed2431f1baa46f4058b8')

build() {
  cd ${srcdir}/tcl${pkgver}/unix
  
  if [ "$CARCH" = "x86_64" ]; then
    ./configure --prefix=/usr --mandir=/usr/share/man --enable-threads --enable-64bit
  else
    ./configure --prefix=/usr --mandir=/usr/share/man --enable-threads --disable-64bit
  fi
  
  make
}

check() {
  cd ${srcdir}/tcl${pkgver}/unix
  make test
}

package()
{
  cd ${srcdir}/tcl${pkgver}/unix
  
  make INSTALL_ROOT=${pkgdir} install install-private-headers
  ln -sf tclsh8.5 ${pkgdir}/usr/bin/tclsh
  
  # install license
  install -Dm644 ../license.terms ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE

  # remove buildroot traces
  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," \
    -e "s,^TCL_LIB_FILE='libtcl8.5..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl8.5\$\{TCL_DBGX\}.so\"," \
    -e "s,^TCL_CC_SEARCH_FLAGS='\(.*\)',TCL_CC_SEARCH_FLAGS='\1:/usr/lib'," \
    -e "s,^TCL_LD_SEARCH_FLAGS='\(.*\)',TCL_LD_SEARCH_FLAGS='\1:/usr/lib'," \
    ${pkgdir}/usr/lib/tclConfig.sh
}