# $Id$ PNAME="tcl" PVER="8.6.9" PBUILD="r1" PCAT="dev-lang" DESCRIPTION="The Tcl package contains the Tool Command Language, a robust general-purpose scripting language." HOMEPAGE="http://tcl.sourceforge.net/" DEPEND=">= virtual/glibc >= sys-libs/zlib-1.2.8" SDEPEND=">= virtual/sed" SRCFILE="${PNAME}${PVER}-src.tar.gz" SRCDIR="${BUILDDIR}/${PNAME}${PVER}" sminclude mtools SRC_URI=( sourceforge://${PNAME}/${SRCFILE} mirror://${PNAME}/${SRCFILE} mirror://${PNAME}/${PNAME}-8.5.5-libdir.patch mirror://${PNAME}/${PNAME}-8.6.8-flags.patch mirror://${PNAME}/${PNAME}-8.6.0-autopath.patch ) UP2SEPERATOR="${PNAME}" UP2SUBSTITUTE="-src" UP2DATE="updatecmd -listonly http://www.tcl.tk/software/tcltk/download.html | grep '${PNAME}[0-9]' | highesttarball gz" src_prepare() { munpack ${SRCFILE} || die cd ${SRCDIR} # support variable libdir mpatch ${PNAME}-8.5.5-libdir.patch || die # fix rpath and pic issues mpatch ${PNAME}-8.6.8-flags.patch || die # fix library runtime detection with disabled rpath from the patch above mpatch ${PNAME}-8.6.0-autopath.patch || die # increase value from 500 to 5000 to fix dejagnu issues # see: http://lists.freebsd.org/pipermail/freebsd-tcltk/2013-June/000068.html # at least libffi testsuite needs this fix sed -i 's:#define DUPTRAVERSE_MAX_DEPTH 500:&0:' generic/regc_nfa.c || die cd ${SRCDIR}/unix mautoreconf || die } src_compile() { cd ${SRCDIR}/unix mconfigure || die mmake || die } src_check() { cd ${SRCDIR}/unix make test || die } src_install() { cd ${SRCDIR}/unix local V="$(echo ${PVER} | cut -d "." -f 1,2)" # removes the reference to the build directory # and replace them by saner system wide locations sed -i "s:${SRCDIR}/unix:/usr/$(mlibdir):" tclConfig.sh || die sed -i "s:${SRCDIR}:/usr/include/tcl${V}:" tclConfig.sh || die sed -i "s,^TCL_LIB_FILE='libtcl${V}..TCL_DBGX..so',TCL_LIB_FILE=\"libtcl${V}\$\{TCL_DBGX\}.so\"," tclConfig.sh || die # installs tcl mmake -j1 DESTDIR=${BINDIR} install || die # installs the internal headers into a system-wide location. minstalldir /usr/include/tcl${V}/unix || die minstallfile \*.h /usr/include/tcl${V}/unix/ || die minstalldir /usr/include/tcl${V}/generic || die minstallfile ../generic/\*.h /usr/include/tcl${V}/generic/ || die mdelete /usr/include/tcl${V}/generic/tcl.h || die mdelete /usr/include/tcl${V}/generic/tclDecls.h || die mdelete /usr/include/tcl${V}/generic/tclPlatDecls.h || die # symlink unix private headers to generic (expect needs that) mlink ../unix/tclUnixPort.h /usr/include/tcl${V}/generic || die mlink ../unix/tclUnixThrd.h /usr/include/tcl${V}/generic || die # creates compatibility symbolic links for the libs mlink ../../include/tcl${V} /usr/$(mlibdir)/tcl${V}/include || die mlink libtcl${V}.so /usr/$(mlibdir)/libtcl.so || die mlink tclsh${V} /usr/bin/tclsh || die cd ${SRCDIR} minstalldocs ChangeLog* changes license.terms README || die }