Index: server/buildpkgs/Tclx/build.sh ================================================================== --- server/buildpkgs/Tclx/build.sh +++ server/buildpkgs/Tclx/build.sh @@ -1,40 +1,27 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - +# Define parameters VERS=8.4 SRC="src/tclx${VERS}.tar.bz2" SRCURL="http://sourceforge.net/projects/tclx/files/TclX/${VERS}.0/tclx${VERS}.tar.bz2/download" BUILDDIR="tclx${VERS}" -WORKDIR="${TMPDIR:-/tmp}/tclx-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR +# Download source +download_src ( rm -rf build mkdir build -) || exit 1 - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi - -( + cd build/ || exit 1 bzip2 -dc "../${SRC}" | tar -xf - cd "${BUILDDIR}" || exit 1 Index: server/buildpkgs/build_all.sh ================================================================== --- server/buildpkgs/build_all.sh +++ server/buildpkgs/build_all.sh @@ -28,104 +28,107 @@ if [ "${DISTCLEAN}" = "1" ]; then rm -rf tcl fi if [ "${CLEANONLY}" = "0" ]; then - TCLVERS="8.5.9" - TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}" - PROJROOTDIR="$(pwd)" - TCLINSTDIR="$(pwd)/tcl/inst" - export TCLVERS TCLPRIVATE PROJROOTDIR TCLINSTDIR - - mkdir tcl tcl/build >/dev/null 2>/dev/null - - if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then - mkdir tcl/src >/dev/null 2>/dev/null - wget -o /dev/null -O "tcl/src/tcl${TCLVERS}.tar.gz" "http://prdownloads.sourceforge.net/tcl/tcl${TCLVERS}-src.tar.gz" - fi - - echo "Building Tcl ${TCLVERS}" - ( - mkdir tcl/build >/dev/null 2>/dev/null - cd tcl/build || exit 1 - gzip -dc "../src/tcl${TCLVERS}.tar.gz" | tar -xf - - - # DDE and Reg can fail to compile, but we don't care - echo '' > "${TCLPRIVATE}/win/tclWinDde.c" - echo '' > "${TCLPRIVATE}/win/tclWinReg.c" - - for dir in unix win macosx; do - cd "${TCLPRIVATE}/${dir}" || exit 1 - - echo " Executing: ./configure ${CONFIGUREEXTRA}" - ./configure --disable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}" - - ${MAKE:-make} || continue - ${MAKE:-make} install || break - - LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" - LD_RUN_PATH=".:${LD_RUN_PATH}" - export LD_LIBRARY_PATH LD_RUN_PATH - - file tclsh tclsh*.exe 2>/dev/null | grep -iv 'No such file' > "${PROJROOTDIR}/platform.magic.file" - if [ -f tclsh*.exe ]; then - echo 'puts "$::tcl_platform(os)"' | ./tclsh*.exe > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null - else - echo 'puts "$::tcl_platform(os)"' | ./tclsh > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null - fi - echo "${dir}" > "${PROJROOTDIR}/platform.magic.platform" - pwd > "${PROJROOTDIR}/platform.magic.dir" - - break - done - ) > "tcl/build/build.log" 2>&1 || ( - echo 'Failed to build Tcl. See "./tcl/build/build.log"' - echo 'Proceeding with system Tcl. Building might fail.' - ) - - TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")" - export TCLBUILDDIR - - if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then - TCLCONFIGDIR="${TCLINSTDIR}/lib" - elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then - TCLCONFIGDIR="${TCLBUILDDIR}" - else - unset TCLPRIVATE - - TCLCONFIGDIR=$( - ( - echo "${LD_LIBRARY_PATH}" | tr ':' "\n" - cat /etc/ld.so.conf 2>/dev/null - crle 2>/dev/null | grep '^ *Default Library Path' | sed 's@^ *Default Library Path[^:]*:[^:]*/@/@' | tr ':' "\n" - ) | grep '^/' | while read chklibdir; do - if [ -f "${chklibdir}/tclConfig.sh" ]; then - echo "${chklibdir}" - break - fi - done - ) - if [ -z "${TCLCONFIGDIR}" ]; then - TCLCONFIGDIR="/usr/lib" - fi - - TCLPRIVATE="$(dirname "${TCLCONFIGDIR}")/include/tcl-private" - fi - - ADDFLAGS="" - if [ -n "${TCLPRIVATE}" ]; then - ADDFLAGS="${ADDFLAGS} -I${TCLPRIVATE} -I${TCLPRIVATE}/generic" - fi - if [ -n "${TCLBUILDDIR}" ]; then - ADDFLAGS="${ADDFLAGS} -I${TCLBUILDDIR}" - fi - CFLAGS="${ADDFLAGS} ${CFLAGS}" - CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}" - - unset TCLVERS - unset ADDFLAGS - export TCLBUILDDIR TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS + PROJROOTDIR="$(pwd)" + export PROJROOTDIR + + for TCLVERS in 8.5.9 8.4.19; do + TCLSHORTVERS="$(echo "${TCLVERS}" | cut -f 1-2 -d '.')" + TCLPRIVATE="$(pwd)/tcl/build/tcl${TCLVERS}" + TCLINSTDIR="$(pwd)/tcl/inst-${TCLSHORTVERS}" + export TCLVERS TCLPRIVATE TCLINSTDIR + + mkdir tcl tcl/build >/dev/null 2>/dev/null + + if [ ! -f "tcl/src/tcl${TCLVERS}.tar.gz" ]; then + mkdir tcl/src >/dev/null 2>/dev/null + wget -o /dev/null -O "tcl/src/tcl${TCLVERS}.tar.gz" "http://prdownloads.sourceforge.net/tcl/tcl${TCLVERS}-src.tar.gz" + fi + + echo "Building Tcl ${TCLVERS}" + ( + mkdir tcl/build >/dev/null 2>/dev/null + cd tcl/build || exit 1 + gzip -dc "../src/tcl${TCLVERS}.tar.gz" | tar -xf - + + # DDE and Reg can fail to compile, but we don't care + echo '' > "${TCLPRIVATE}/win/tclWinDde.c" + echo '' > "${TCLPRIVATE}/win/tclWinReg.c" + + for dir in unix win macosx; do + cd "${TCLPRIVATE}/${dir}" || exit 1 + + echo " Executing: ./configure --enable-threads ${CONFIGUREEXTRA} --prefix=\"${TCLINSTDIR}\"" + ./configure --enable-threads ${CONFIGUREEXTRA} --prefix="${TCLINSTDIR}" + + echo " Executing: ${MAKE:-make}" + ${MAKE:-make} || continue + + echo " Executing: ${MAKE:-make} install" + ${MAKE:-make} install || break + + LD_LIBRARY_PATH=".:${LD_LIBRARY_PATH}" + LD_RUN_PATH=".:${LD_RUN_PATH}" + export LD_LIBRARY_PATH LD_RUN_PATH + + file tclsh tclsh*.exe 2>/dev/null | grep -iv 'No such file' > "${PROJROOTDIR}/platform.magic.file" + if [ -f tclsh*.exe ]; then + echo 'puts "$::tcl_platform(os)"' | ./tclsh*.exe > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null + else + echo 'puts "$::tcl_platform(os)"' | ./tclsh > "${PROJROOTDIR}/platform.magic.os" 2>/dev/null + fi + echo "${dir}" > "${PROJROOTDIR}/platform.magic.platform" + pwd > "${PROJROOTDIR}/platform.magic.dir" + + break + done + + exit 0 + ) > "tcl/build/build-${TCLVERS}.log" 2>&1 || ( + echo "Failed to build Tcl. See \"./tcl/build/build-${TCLVERS}.log\"" >&2 + echo 'Aborting.' >&2 + + exit 1 + ) || exit 1 + + ( + TCLBUILDDIR="$(cat "${PROJROOTDIR}/platform.magic.dir")" + export TCLBUILDDIR + + if [ -d "${TCLINSTDIR}" -a -f "${TCLINSTDIR}/lib/tclConfig.sh" ]; then + TCLCONFIGDIR="${TCLINSTDIR}/lib" + elif [ -d "${TCLBUILDDIR}" -a -f "${TCLBUILDDIR}/tclConfig.sh" ]; then + TCLCONFIGDIR="${TCLBUILDDIR}" + else + echo 'Unable to find appropriate tclConfig.sh, aborting' >&2 + + exit 1 + fi + + ADDFLAGS="" + if [ -n "${TCLPRIVATE}" ]; then + ADDFLAGS="${ADDFLAGS} -I${TCLPRIVATE} -I${TCLPRIVATE}/generic" + fi + if [ -n "${TCLBUILDDIR}" ]; then + ADDFLAGS="${ADDFLAGS} -I${TCLBUILDDIR}" + fi + CFLAGS="${ADDFLAGS} ${CFLAGS}" + CPPFLAGS="${ADDFLAGS} ${CPPFLAGS}" + + unset TCLVERS + unset ADDFLAGS + export TCLBUILDDIR TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS + + rm -f "${PROJROOTDIR}/platform.magic.env-${TCLSHORTVERS}" + set > "${PROJROOTDIR}/platform.magic.env-${TCLSHORTVERS}" + export >> "${PROJROOTDIR}/platform.magic.env-${TCLSHORTVERS}" + ) + done + + rm -f "${PROJROOTDIR}/platform.magic.dir" fi # Determine platform if [ -z "${FORCE_PLATFORM}" ]; then PLATFORM="$(./platform)" @@ -138,11 +141,11 @@ faileddirs="" if [ -z "${DIRS}" ]; then DIRS="`echo */`" PKGHASHCODE='' else - PKGHASHCODE="$(echo "${DIRS}" | sed 's@[/ ]@@g' | openssl sha1 | awk '{ print $1 }')" + PKGHASHCODE="$((echo "${DIRS}" | tr ' ' "\n" | sort | tr "\n" ' '; echo ) | sed 's@[/ ]@@g' | openssl sha1 | awk '{ print $1 }')" fi for dir in ${DIRS}; do export dir if [ ! -f "${dir}/build.sh" ]; then @@ -177,10 +180,13 @@ rm -rf "${dir}/out" faileddirs="${faileddirs} ${dir}" echo "Failed to build ${dir}" fi done + +# Clean magic-related files +rm -f platform.magic.* # Cleanup is done at this point if [ "${CLEANONLY}" = "1" ]; then exit 0 fi ADDED server/buildpkgs/common.sh Index: server/buildpkgs/common.sh ================================================================== --- /dev/null +++ server/buildpkgs/common.sh @@ -0,0 +1,66 @@ +#! /bin/bash + +function setup_tcl85 () { + source "${PROJROOTDIR}/platform.magic.env-8.5" 2>/dev/null +} + +function setup_tcl84 () { + source "${PROJROOTDIR}/platform.magic.env-8.4" 2>/dev/null +} + +function not_platforms () { + local platform + + for platform in "$@"; do + if [ "${PLATFORM}" = "${platform}" ]; then + rm -rf out + + exit 0 + fi + done +} + +function only_platforms () { + local platform + + for platform in "$@"; do + if [ "${PLATFORM}" = "${platform}" ]; then + return 0 + fi + done + + rm -rf out + + exit 0 +} + +function download () { + local url file + + file="$1" + url="$2" + + if [ -s "${file}" ]; then + return 0 + fi + + rm -f "${file}.tmp" "${file}" + + wget -O "${file}.tmp" "${url}" || return 1 + + mv "${file}.tmp" "${file}" +} + +function download_src () { + if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then + mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null + + download "${SRC}" "${SRCURL}" || exit 1 + fi +} + +WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}" +PLATDIR="$(pwd)/out/${PLATFORM}" +export WORKDIR PLATDIR + +setup_tcl84 Index: server/buildpkgs/dbus-tcl/build.sh ================================================================== --- server/buildpkgs/dbus-tcl/build.sh +++ server/buildpkgs/dbus-tcl/build.sh @@ -1,34 +1,27 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - +# Define parameters VERS=1.0 SRC="src/dbus-tcl-${VERS}.tar.gz" SRCURL="http://sourceforge.net/projects/dbus-tcl/files/dbus-tcl/${VERS}/dbus-tcl${VERS}.tar.gz/download" BUILDDIR="dbus-tcl${VERS}" -WORKDIR="${TMPDIR:-/tmp}/dbus-tcl-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi - +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' + +# Require Tcl 8.5 to build +setup_tcl85 + +# Download source +download_src + +# Build package ( rm -rf build mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null mkdir build @@ -44,8 +37,9 @@ ${MAKE:-make} install-binaries PKG_DIR='' || exit 1 rm -f "${PLATDIR}"/*.a ) || exit 1 +# Create metadata ../create_teapot "${PLATDIR}/teapot.txt" "dbus-tcl" "${VERS}" "${SRCURL}" "${PLATFORM}" "Tcl 8.5" "The DBus-Tcl project provides a Tcl interface to the dbus message bus system. It contains packages that allow Tcl programs to send and receive dbus signals, as well as invoke and respond to dbus method calls. http://dbus-tcl.sourceforge.net/" exit 0 Index: server/buildpkgs/dict/build.sh ================================================================== --- server/buildpkgs/dict/build.sh +++ server/buildpkgs/dict/build.sh @@ -1,42 +1,25 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - -# We only do anything on Tcl 8.4.x -if echo "${TCLVERS}" | grep '^8\.4\.'; then - true -else - rm -rf out - - exit 0 -fi - +# Define parameters VERS=8.5.2 SRC="src/tclDict-${VERS}.tar.gz" SRCURL="http://pascal.scheffers.net/software/tclDict-${VERS}.tar.gz" BUILDDIR="tclDict-${VERS}" -WORKDIR="${TMPDIR:-/tmp}/dict-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' + +# Require Tcl 8.4 to build +setup_tcl84 + +# Download source +download_src ( rm -rf build mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null mkdir build Index: server/buildpkgs/platform ================================================================== --- server/buildpkgs/platform +++ server/buildpkgs/platform @@ -60,11 +60,11 @@ case "${CPUPLAT}" in i?86) CPUPLAT="ix86" ;; - sun4?) + sun4m) CPUPLAT="sparc" ;; esac echo "linux-glibc${GLIBCVERS}-${CPUPLAT}" @@ -72,24 +72,24 @@ SunOS) SUNMAJVER=$(uname -r | cut -f 1 -d .) SUNMINVER=$(uname -r | cut -f 2 -d .) SOLVER="$[${SUNMAJVER} - 3].${SUNMINVER}" - - case "`uname -m`" in - sun4?) - CPUPLAT="sparc" - ;; - *) - CPUPLAT="ix86" - ;; - esac + if [ -z "${CPUPLAT}" ]; then + echo 'Unable to determine platform' >&2 + + exit 1 + fi echo "solaris${SOLVER}-${CPUPLAT}" ;; HP-UX) echo "hpux-${CPUPLAT}" ;; *) - echo "`uname -s | dd conv=lcase 2>/dev/null`-`uname -m | dd conv=lcase 2>/dev/null`" + if [ -z "${CPUPLAT}" ]; then + CPUPLAT="`uname -m | dd conv=lcase 2>/dev/null`" + fi + + echo "`uname -s | dd conv=lcase 2>/dev/null`-${CPUPLAT}" ;; esac Index: server/buildpkgs/sqlite3/build.sh ================================================================== --- server/buildpkgs/sqlite3/build.sh +++ server/buildpkgs/sqlite3/build.sh @@ -1,34 +1,23 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - +# Define parameters VERS=3.7.2 VERSUNDER="$(echo "${VERS}" | sed 's@\.@_@g')" SRC="src/sqlite-${VERSUNDER}.tar.gz" SRCURL="http://www.sqlite.org/sqlite-${VERSUNDER}-tea.tar.gz" BUILDDIR="sqlite${VERS}" -WORKDIR="${TMPDIR:-/tmp}/sqlite-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' + +# Download source +download_src ( rm -rf build mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null mkdir build Index: server/buildpkgs/tcllib/build.sh ================================================================== --- server/buildpkgs/tcllib/build.sh +++ server/buildpkgs/tcllib/build.sh @@ -1,33 +1,21 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" != "tcl" ]; then - rm -rf out - - exit 0 -fi - VERS=1.13 SRC="src/tcllib-${VERS}.tar.gz" SRCURL="http://sourceforge.net/projects/tcllib/files/tcllib/${VERS}/tcllib-${VERS}.tar.gz/download" BUILDDIR="tcllib-${VERS}" -WORKDIR="${TMPDIR:-/tmp}/tcllib-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATFORM PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has NOT been requested +only_platforms 'tcl' + +# Download source +download_src rm -rf "${WORKDIR}" >/dev/null 2>/dev/null mkdir -p "${WORKDIR}" || exit 1 retval=0 Index: server/buildpkgs/tclpkcs11/build.sh ================================================================== --- server/buildpkgs/tclpkcs11/build.sh +++ server/buildpkgs/tclpkcs11/build.sh @@ -1,33 +1,22 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - +# Define parameters VERS=0.9.9 SRC="src/tclpkcs11-${VERS}.tar.gz" SRCURL="http://www.rkeene.org/devel/tclpkcs11-${VERS}.tar.gz" BUILDDIR="tclpkcs11-${VERS}" -WORKDIR="${TMPDIR:-/tmp}/tclpkcs11-$$${RANDOM}${RANDOM}${RANDOM}" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi +export VERS SRC SRCURL BUILDDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' + +# Download source +download_src ( rm -rf build mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null mkdir build Index: server/buildpkgs/tls/build.sh ================================================================== --- server/buildpkgs/tls/build.sh +++ server/buildpkgs/tls/build.sh @@ -1,34 +1,23 @@ #! /bin/bash -if [ ! -x "../platform" ]; then - echo "No platform script found, aborting." >&2 - - exit 1 -fi - -if [ "${PLATFORM}" = "tcl" ]; then - rm -rf out - - exit 0 -fi - +# Define parameters VERS=1.6 SRC="src/tls${VERS}-src.tar.gz" SRCURL="http://sourceforge.net/projects/tls/files/tls/${VERS}/tls${VERS}-src.tar.gz/download" BUILDDIR="tls${VERS}" -WORKDIR="${TMPDIR:-/tmp}/tls-$$${RANDOM}${RANDOM}${RANDOM}" PATCHDIR="$(pwd)/patches" -PLATDIR="$(pwd)/out/${PLATFORM}" - -export VERS SRC SRCURL BUILDDIR WORKDIR PATCHDIR PLATDIR - -if [ ! -f "${SRC}" ]; then - mkdir src >/dev/null 2>/dev/null - - wget -O "${SRC}" "${SRCURL}" || exit 1 -fi +export VERS SRC SRCURL BUILDDIR PATCHDIR + +# Load common functions +source ../common.sh + +# Do not build if the "tcl" platform has been requested +not_platforms 'tcl' + +# Download source +download_src ( rm -rf build mkdir build cd build/ || exit 1