From eebb7897ea5e02298d86fc9acef06954e5275af8 Mon Sep 17 00:00:00 2001 From: CapCreeperGR Date: Thu, 4 Jul 2024 17:17:06 +0300 Subject: [PATCH] Initial Commit --- pkg.info | 7 ++++++ source.sh | 72 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+) create mode 100644 pkg.info create mode 100644 source.sh diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..1e98e0b --- /dev/null +++ b/pkg.info @@ -0,0 +1,7 @@ +name: tcl +description: A general-purpose, interpreted, dynamic programming language +version: 8.6.13 +url: http://tcl.sourceforge.net/ +license: TCL +architecture: any +type: source diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..a45cae6 --- /dev/null +++ b/source.sh @@ -0,0 +1,72 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://downloads.sourceforge.net/tcl/tcl${BPM_PKG_VERSION}-src.tar.gz" +DOWNLOAD_DOC="https://downloads.sourceforge.net/tcl/tcl${BPM_PKG_VERSION}-html.tar.gz" +FILENAME="${DOWNLOAD##*/}" +FILENAME_DOC="${DOWNLOAD_DOC##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + wget "$DOWNLOAD_DOC" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" + mkdir -p "$BPM_SOURCE"/Documentation + tar -xvf "$FILENAME_DOC" --strip-components=1 -C "$BPM_SOURCE"/Documentation +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + SRCDIR=$(pwd) + cd unix + ./configure --prefix=/usr \ + --mandir=/usr/share/man + make + + tdbc_pkg=tdbc1.1.5 + + sed -e "s|$SRCDIR/unix|/usr/lib|" \ + -e "s|$SRCDIR|/usr/include|" \ + -i tclConfig.sh + + sed -e "s|$SRCDIR/unix/pkgs/${tdbc_pkg}|/usr/lib/${tdbc_pkg}|" \ + -e "s|$SRCDIR/pkgs/${tdbc_pkg}/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/${tdbc_pkg}/library|/usr/lib/tcl${BPM_PKG_VERSION%.*}|" \ + -e "s|$SRCDIR/pkgs/${tdbc_pkg}|/usr/include|" \ + -i pkgs/${tdbc_pkg}/tdbcConfig.sh + + itcl_pkg=itcl4.2.3 + + sed -e "s|$SRCDIR/unix/pkgs/${itcl_pkg}|/usr/lib/${itcl_pkg}|" \ + -e "s|$SRCDIR/pkgs/${itcl_pkg}/generic|/usr/include|" \ + -e "s|$SRCDIR/pkgs/${itcl_pkg}|/usr/include|" \ + -i pkgs/${itcl_pkg}/itclConfig.sh + + unset SRCDIR +} + +# The check function is executed in the source directory +# This function is used to run tests to verify the package has been compiled correctly +check() { + cd unix + make test +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + cd unix + make DESTDIR="$BPM_OUTPUT" install + chmod -v u+w "$BPM_OUTPUT"/usr/lib/libtcl8.6.so + make DESTDIR="$BPM_OUTPUT" install-private-headers + ln -sfv tclsh${BPM_PKG_VERSION%.*} "$BPM_OUTPUT"/usr/bin/tclsh + mv "$BPM_OUTPUT"/usr/share/man/man3/{Thread,Tcl_Thread}.3 + mkdir -p "$BPM_OUTPUT"/usr/share/licenses/tcl/ + install -v -m644 ../license.terms "$BPM_OUTPUT"/usr/share/licenses/tcl/license.terms + cd ../Documentation + mkdir -v -p "$BPM_OUTPUT"/usr/share/doc/tcl + cp -v -r ./html/* "$BPM_OUTPUT"/usr/share/doc/tcl +}