Index: .fossil-settings/ignore-glob ================================================================== --- .fossil-settings/ignore-glob +++ .fossil-settings/ignore-glob @@ -20,10 +20,16 @@ server/buildpkgs/sqlite3/out/* server/buildpkgs/sqlite3/src server/buildpkgs/sqlite3/src/* server/buildpkgs/tcl server/buildpkgs/tcl/* +server/buildpkgs/tcllib/build +server/buildpkgs/tcllib/build/* +server/buildpkgs/tcllib/out +server/buildpkgs/tcllib/out/* +server/buildpkgs/tcllib/src +server/buildpkgs/tcllib/src/* server/buildpkgs/tclpkgs-*.tar.* server/buildpkgs/tclpkgs-*.tar.*/* server/buildpkgs/tls/build server/buildpkgs/tls/build/* server/buildpkgs/tls/out Index: server/buildpkgs/Tclx/build.sh ================================================================== --- server/buildpkgs/Tclx/build.sh +++ server/buildpkgs/Tclx/build.sh @@ -3,10 +3,16 @@ 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=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}" Index: server/buildpkgs/build_all.sh ================================================================== --- server/buildpkgs/build_all.sh +++ server/buildpkgs/build_all.sh @@ -112,12 +112,16 @@ unset TCLBUILDDIR export TCLCONFIGDIR TCLPRIVATE CFLAGS CPPFLAGS fi # Determine platform -PLATFORM="$(./platform)" -export PLATFORM +if [ -z "${FORCE_PLATFORM}" ]; then + PLATFORM="$(./platform)" + export PLATFORM +else + PLATFORM="${FORCE_PLATFORM}" +fi # Build all appropriate directories faileddirs="" for dir in */; do export dir @@ -166,11 +170,10 @@ if [ -n "${faileddirs}" ]; then echo "The following failed to build:${faileddirs}" fi # Create tarfile of built packages -PLATFORM="$(./platform)" DATECODE="$(date +%Y%m%d%H%M)" OUTFILEBASE="tclpkgs-${PLATFORM}-${DATECODE}" tar -cf - */out | bzip2 -9c > "${OUTFILEBASE}.tar.bz2" exit 0 Index: server/buildpkgs/dict/build.sh ================================================================== --- server/buildpkgs/dict/build.sh +++ server/buildpkgs/dict/build.sh @@ -3,10 +3,16 @@ 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=8.5.2 SRC="src/tclDict-${VERS}.tar.gz" SRCURL="http://pascal.scheffers.net/software/tclDict-${VERS}.tar.gz" BUILDDIR="tclDict-${VERS}" Index: server/buildpkgs/sqlite3/build.sh ================================================================== --- server/buildpkgs/sqlite3/build.sh +++ server/buildpkgs/sqlite3/build.sh @@ -3,10 +3,16 @@ 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=3.6.22 VERSUNDER="$(echo "${VERS}" | sed 's@\.@_@g')" SRC="src/sqlite-${VERSUNDER}.tar.gz" SRCURL="http://www.sqlite.org/sqlite-${VERSUNDER}-tea.tar.gz" ADDED server/buildpkgs/tcllib/build.sh Index: server/buildpkgs/tcllib/build.sh ================================================================== --- /dev/null +++ server/buildpkgs/tcllib/build.sh @@ -0,0 +1,162 @@ +#! /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.12 +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 + +rm -rf "${WORKDIR}" >/dev/null 2>/dev/null +mkdir -p "${WORKDIR}" || exit 1 + +retval=0 +( + rm -rf build + mkdir -p "${PLATDIR}" >/dev/null 2>/dev/null + mkdir build + + cd build/ || exit 1 + + gzip -dc "../${SRC}" | tar -xf - + cd "${BUILDDIR}" || exit 1 + + find modules -type f -name '*.test' -o -name 'ChangeLog' -o -name '*.man' -o -name '*.txt' | xargs rm -f + + workfile="${WORKDIR}/file" + worksubfile="${WORKDIR}/subfile" + pkgfiles="" + for file in modules/*/*.tcl; do + cat "${file}" | tr ';[]{}' "\n\n\n\n\n" | sed 's@^[ ]*#.*$@@' "${file}" > "${workfile}" + + if grep '^ *package *provide *' "${workfile}" >/dev/null; then + pkgfiles="${pkgfiles} +${file}" + fi + done + + for file in modules/*/*.tcl; do + filetail="$(basename "${file}")" + if [ "${filetail}" = "pkgIndex.tcl" ]; then + continue + fi + + pkgdir="$(dirname "${file}")" + + cat "${file}" | tr ';[]{} ' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${workfile}" + + # Some packages try to require a package, if that doesn't work they implement it and say they provide it (lies) + # We remove any "package provide blah" in a file also containing "package require blah" + # TODO: We should add "blah" to the recommended packages if we ended up removing anything + grep '^ *package *require *' "${workfile}" | while read blah blah reqpkg remain; do + grep -v "^ *package *provide *${reqpkg} *" "${workfile}" > "${workfile}.new" + mv "${workfile}.new" "${workfile}" + done + + if ! grep '^ *package *provide *[^ ][^ ]* *[^ ][^ ]*' "${workfile}" >/dev/null; then + continue + fi + + # Determine package name and version + pkg="$(grep '^ *package *provide *[^ ][^ ]* *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package *provide *\([^ ][^ ]*\) .*$@\1@' | sed 's@^ *@@;s@ *$@@')" + pkgver="$(grep '^ *package *provide *[^ ][^ ]* *[^ ][^ ]*' "${workfile}" | head -1 | sed 's@^ *package *provide *[^ ][^ ]* *\([^ ][^ ]*\)*$@\1@;s@^[^0-9\.].*@@g')" + + if echo "${pkg}" | grep '^ *\[' >/dev/null || [ -z "${pkg}" ]; then + pkg="$(grep "package *ifneeded *" "${pkgdir}/pkgIndex.tcl" | sed 's@^.*package *ifneeded *\([^ ][^ ]*\) .*$@\1@' | sed 's@^ *@@;s@ *$@@')" + if [ "$(echo "${pkg}" | wc -l | awk '{ print $1 }')" != "1" ]; then + pkg="$(basename "${file}" .tcl)" + + echo "Unable to determine name of package: $file, assuming it is $pkg" + fi + fi + if [ -z "${pkgver}" ]; then + pkgver="$(grep "package *ifneeded *.*source *.* ${filetail}" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package *ifneeded *[^ ][^ ]* *\([^ ][^ ]*\) .*$@\1@' | head -1)" + fi + if [ -z "${pkgver}" ]; then + pkgver="$(grep "package *ifneeded *${pkg} *" "${pkgdir}/pkgIndex.tcl" 2>/dev/null | sed 's@^.*package *ifneeded *[^ ][^ ]* *\([^ ][^ ]*\) .*$@\1@' | head -1)" + fi + if [ -z "${pkgver}" ]; then + echo "Unable to determine version of ${pkg}: $(grep '^ *package *provide *' "${workfile}" | head -1), skipping." + + continue + fi + + # Skip marker package names + if [ "${pkg}" = "@@" ]; then + continue + fi + + # Create output directory + outdir="${PLATDIR}/${pkg}-${pkgver}" + if [ -d "${outdir}" ]; then + echo "ERROR: $outdir already exists, skipping ${file} which provides ${pkg} v${pkgver}" + + continue + fi + mkdir -p "${outdir}" || continue + + # Put relevant files into the directory + if grep '^ *source *' "${workfile}" >/dev/null; then + # Include all the files in the directory that do not contain packages + cp "${file}" "${outdir}" + for subfile in "${pkgdir}"/*; do + if ! echo "${pkgfiles}" | grep "^${subfile}$" >/dev/null; then + cp "${subfile}" "${outdir}" >/dev/null 2>/dev/null + fi + done + grep -v "package *ifneeded *" "${pkgdir}/pkgIndex.tcl" > "${outdir}/pkgIndex.tcl" + grep "package *ifneeded *${pkg} *" "${pkgdir}/pkgIndex.tcl" >> "${outdir}/pkgIndex.tcl" + + # Create Teapot info + pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module" + pkgteapotfile="${outdir}/teapot.txt" + else + # Make a tclModule + cp "${file}" "${outdir}/" + outfile="${outdir}/${filetail}" + + # Create Teapot info + pkgdesc="Part of the Tclib $(basename $(dirname ${file})) module" + pkgteapotfile="${outfile}" + fi + + pkgdeps=$( ( for subfile in "${outdir}"/*.tcl; do + cat "${subfile}" | grep -v 'catch ' | tr ';[]{} ' "\n\n\n\n\n " | sed 's@^ *#.*$@@' > "${worksubfile}" + grep '^ *package *require *' "${worksubfile}" | while read blah blah reqpkg reqpkgver extra; do + reqpkgver="$(echo "${reqpkgver}" | sed 's@ *\$.*$@@')" + if [ -n "${reqpkgver}" ]; then + reqpkgver=$(echo "${reqpkgver}" | sed 's@[+=-]*$@@g') + echo "${reqpkg} ${reqpkgver}" + else + echo "${reqpkg}" + fi + done | sort -u | grep -v '__undefined__' | grep -v '__does_not_exist__' + done | tr "\n" ','; echo ) | sed 's@,,*$@@') + + ../../../create_teapot "${pkgteapotfile}" "$pkg" "$pkgver" "http://tcllib.sourceforge.net/" "tcl" "${pkgdeps}" "${pkgdesc}" + done +) || retval=1 + +rm -rf "${WORKDIR}" + +exit $retval Index: server/buildpkgs/tls/build.sh ================================================================== --- server/buildpkgs/tls/build.sh +++ server/buildpkgs/tls/build.sh @@ -3,10 +3,16 @@ 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.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}"