Check-in [0527703474]
Overview
Comment:Updated to support finding TCLSH_NATIVE by the root kitcreator script and using that in most places where a native Tcl interpreter is needed

Updated to find date of Fossil checkin when a fossil tag or ID is specified and use that date for checkouts of other projects

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:0527703474d3ddf4612a9850cc6bc9dfa4044444
User & Date: rkeene on 2011-05-28 06:38:41
Other Links: manifest | tags
Context
2011-05-28
23:53
Updated to only mount VFS once

Updated to always load "vfs" check-in: d5ed5900eb user: rkeene tags: trunk

06:38
Updated to support finding TCLSH_NATIVE by the root kitcreator script and using that in most places where a native Tcl interpreter is needed

Updated to find date of Fossil checkin when a fossil tag or ID is specified and use that date for checkouts of other projects check-in: 0527703474 user: rkeene tags: trunk

05:33
More work towards changing scripts to refer to upstream source with Fossil in the name check-in: 6964fef637 user: rkeene tags: trunk
Changes

Modified kitcreator from [bed9e43849] to [9916a29d8c].

     1      1   #! /bin/bash
     2      2   
     3      3   TCLVERS="8.4.19"
     4         -if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | grep '^cvs_' >/dev/null; then
            4  +if echo "$1" | grep '^[0-9][0-9]*\.' >/dev/null || echo "$1" | egrep '^(cvs|fossil)_' >/dev/null; then
     5      5   	TCLVERS="$1"
     6      6   
     7      7   	shift
     8      8   fi
     9      9   export TCLVERS
    10     10   
    11     11   # Determine appropriate mode
................................................................................
   101    101   if [ -f "kit.rc" ]; then
   102    102   	KITCREATOR_RC="$(pwd)/kit.rc"
   103    103   else
   104    104   	KITCREATOR_RC="$(echo "$(pwd)/kitsh/buildsrc"/kitsh-*/kit.rc)"
   105    105   fi
   106    106   export KITCREATOR_ICON KITCREATOR_RC
   107    107   
          108  +# Determine how we invoke a Tcl interpreter
          109  +if [ -z "${TCLSH_NATIVE}" ]; then
          110  +	TCLSH_NATIVE="false"
          111  +fi
          112  +for testsh in "${TCLSH_NATIVE}" tclsh tclsh8.4 tclsh8.5 tclsh8.6 "${TCLKIT:-tclkit}"; do
          113  +	if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
          114  +		TCLSH_NATIVE="${testsh}"
          115  +
          116  +		break
          117  +	fi
          118  +done
          119  +export TCLSH_NATIVE
          120  +
          121  +# Do build
   108    122   failedpkgs=""
   109    123   buildfailed="0"
   110    124   for pkg in tcl tclvfs zlib ${KITCREATOR_PKGS} kitsh; do
   111    125   	echo -n "Building ${pkg} ..."
   112    126   
   113    127   	failed="0"
   114    128   	(

Modified kitsh/build.sh from [d3695d1fba] to [030405272d].

    48     48   			"${AR:-ar}" x "${archive}" || exit 1
    49     49   
    50     50   			rm -f "${archive}"
    51     51   
    52     52   			"${AR:-ar}" cr "${archive}" *.o || exit 1
    53     53   			"${RANLIB:-ranlib}" "${archive}" || true
    54     54   		)
    55         -	done
    56         -
    57         -	# Determine how we invoke a Tcl interpreter
    58         -	for testsh in "${TCLSH_NATIVE:-false}" tclsh tclsh8.4 tclsh8.5 tclsh8.6 "${TCLKIT:-tclkit}"; do
    59         -		if echo 'exit 0' | "${testsh}" >/dev/null 2>/dev/null; then
    60         -			TCLSH_NATIVE="${testsh}"
    61         -
    62         -			break
    63         -		fi
    64     55   	done
    65     56   
    66     57   	# Cleanup, just incase the incoming directory was not pre-cleaned
    67     58   	${MAKE:-make} distclean >/dev/null 2>/dev/null
    68     59   	rm -rf 'starpack.vfs'
    69     60   
    70     61   	# Create VFS directory

Modified tcl/build.sh from [f85e1724d4] to [f8ef582bfc].

    47     47   
    48     48   			workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
    49     49   			rm -rf "${workdir}"
    50     50   
    51     51   			mkdir "${workdir}" || exit 1
    52     52   			cd "${workdir}" || exit 1
    53     53   
           54  +			# Handle Tcl first, since it will be used to base other packages on
    54     55   			wget -O "tmp-tcl.tar.gz" "http://core.tcl.tk/tcl/tarball/tcl-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f 'tmp-tcl.tar.gz'
    55         -			wget -O "tmp-itcl.tar.gz" "http://core.tcl.tk/itcl/tarball/itcl-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f 'tmp-itcl.tar.gz'
    56         -			wget -O "tmp-thread.tar.gz" "http://core.tcl.tk/thread/tarball/thread-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f "tmp-thread.tar.gz"
    57         -			wget -O "tmp-tclconfig.tar.gz" "http://core.tcl.tk/tclconfig/tarball/tclconfig-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f "tmp-tclconfig.tar.gz"
    58         -
    59     56   			gzip -dc 'tmp-tcl.tar.gz' | tar -xf -
           57  +			mv "tcl-fossil" "tcl${TCLVERS}"
           58  +
           59  +			# Determine date of this Tcl release and use that date for all other dependent packages
           60  +			## Unless the release we are talking about is "trunk", in which case we use that everywhere
           61  +			if [ "${FOSSILTAG}" = "trunk" ]; then
           62  +				FOSSILDATE="${FOSSILTAG}"
           63  +			else
           64  +				FOSSILDATE="$(echo 'cd "tcl'"${TCLVERS}"'"; set file [lindex [glob *] 0]; file stat $file finfo; set date $finfo(mtime); set date [expr {$date + 1}]; puts [clock format $date -format {%Y-%m-%dT%H:%M:%S}]' | TZ='UTC' "${TCLSH_NATIVE}")"
           65  +			fi
           66  +
           67  +			## If we are unable to determine the modification date, fall-back to the tag and hope for the best
           68  +			if [ -z "${FOSSILDATE}" ]; then
           69  +				FOSSILDATE="${FOSSILTAG}"
           70  +			fi
           71  +
           72  +			# Handle other packages
           73  +			wget -O "tmp-itcl.tar.gz" "http://core.tcl.tk/itcl/tarball/itcl-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f 'tmp-itcl.tar.gz'
           74  +			wget -O "tmp-thread.tar.gz" "http://core.tcl.tk/thread/tarball/thread-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f "tmp-thread.tar.gz"
           75  +			wget -O "tmp-tclconfig.tar.gz" "http://core.tcl.tk/tclconfig/tarball/tclconfig-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f "tmp-tclconfig.tar.gz"
           76  +
    60     77   			gzip -dc "tmp-itcl.tar.gz" | tar -xf -
    61     78   			gzip -dc "tmp-thread.tar.gz" | tar -xf -
    62     79   			gzip -dc "tmp-tclconfig.tar.gz" | tar -xf -
    63     80   
    64         -			mv "tcl-fossil" "tcl${TCLVERS}"
           81  +			mkdir -p "tcl${TCLVERS}/pkgs/" >/dev/null 2>/dev/null
    65     82   			mv "itcl-fossil" "tcl${TCLVERS}/pkgs/itcl"
    66     83   			mv "thread-fossil" "tcl${TCLVERS}/pkgs/thread"
    67     84   			cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/itcl/tclconfig"
    68     85   			cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/thread/tclconfig"
    69     86   			mv "tclconfig-fossil" "tcl${TCLVERS}/tclconfig"
    70     87   
    71     88   			tar -cf - "tcl${TCLVERS}" | gzip -c > "../../${SRC}"
           89  +			echo "${FOSSILDATE}" > "../../${SRC}.date"
    72     90   
    73     91   			cd ..
    74     92   
    75     93   			rm -rf "${workdir}"
    76     94   		) || exit 1
    77     95   	else
    78     96   		rm -f "${SRC}.tmp"
................................................................................
   133    151   		${MAKE:-make} || continue
   134    152   
   135    153   		echo "Running: ${MAKE:-make} install"
   136    154   		${MAKE:-make} install || (
   137    155   			# Work with Tcl 8.6.x's TCLSH_NATIVE solution for
   138    156   			# cross-compile installs
   139    157   
   140         -			echo "Running: ${MAKE:-make} install TCLSH_NATIVE=\"${TCLKIT:-tclkit}\""
   141         -			${MAKE:-make} install TCLSH_NATIVE="${TCLKIT:-tclkit}"
          158  +			echo "Running: ${MAKE:-make} install TCLSH_NATIVE=\"${TCLSH_NATIVE}\""
          159  +			${MAKE:-make} install TCLSH_NATIVE="${TCLSH_NATIVE}"
   142    160   		) || (
   143    161   			# Make install can fail if cross-compiling using Tcl 8.5.x
   144    162   			# because the Makefile calls "$(TCLSH)".  We can't simply
   145    163   			# redefine TCLSH because it also uses TCLSH as a build target
   146    164   			sed 's@^$(TCLSH)@blah@' Makefile > Makefile.new
   147    165   			cat Makefile.new > Makefile
   148    166   			rm -f Makefile.new
   149    167   
   150         -			echo "Running: ${MAKE:-make} install TCLSH=\"../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")\""
   151         -			${MAKE:-make} install TCLSH="../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")"
          168  +			echo "Running: ${MAKE:-make} install TCLSH=\"../../../../../../../../../../../../../../../../../$(which "${TCLSH_NATIVE}")\""
          169  +			${MAKE:-make} install TCLSH="../../../../../../../../../../../../../../../../../$(which "${TCLSH_NATIVE}")"
   152    170   		) || (
   153    171   			# Make install can fail if cross-compiling using Tcl 8.5.9
   154    172   			# because the Makefile calls "${TCL_EXE}".  We can't simply
   155    173   			# redefine TCL_EXE because it also uses TCL_EXE as a build target
   156    174   			sed 's@^${TCL_EXE}@blah@' Makefile > Makefile.new
   157    175   			cat Makefile.new > Makefile
   158    176   			rm -f Makefile.new
   159    177   
   160         -			echo "Running: ${MAKE:-make} install TCL_EXE=\"../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")\""
   161         -			${MAKE:-make} install TCL_EXE="../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")"
          178  +			echo "Running: ${MAKE:-make} install TCL_EXE=\"../../../../../../../../../../../../../../../../../$(which "${TCLSH_NATIVE}")\""
          179  +			${MAKE:-make} install TCL_EXE="../../../../../../../../../../../../../../../../../$(which "${TCLSH_NATIVE}")"
   162    180   		) || exit 1
   163    181   
   164    182   		mkdir "${OUTDIR}/lib" || exit 1
   165    183   		cp -r "${INSTDIR}/lib"/* "${OUTDIR}/lib/"
   166    184   		rm -rf "${OUTDIR}/lib/pkgconfig"
   167    185   		rm -f "${OUTDIR}"/lib/* >/dev/null 2>/dev/null
   168    186   		find "${OUTDIR}" -name '*.a' | xargs rm -f >/dev/null 2>/dev/null

Modified tk/build.sh from [c993cbeca4] to [12528bdfc5].

    15     15   SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz"
    16     16   BUILDDIR="$(pwd)/build/tk${TCLVERS}"
    17     17   PATCHDIR="$(pwd)/patches"
    18     18   OUTDIR="$(pwd)/out"
    19     19   INSTDIR="$(pwd)/inst"
    20     20   PATCHSCRIPTDIR="$(pwd)/patchscripts"
    21     21   export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR
           22  +
           23  +# Must be kept in-sync with "../tcl/build.sh"
           24  +TCLFOSSILDATE="../tcl/src/tcl${TCLVERS}.tar.gz.date"
           25  +export TCLFOSSILDATE
    22     26   
    23     27   rm -rf 'build' 'out' 'inst'
    24     28   mkdir 'build' 'out' 'inst' || exit 1
    25     29   
    26     30   # Determine Tcl version
    27     31   TCL_VERSION="unknown"
    28     32   if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
................................................................................
    33     37   
    34     38   if [ ! -f "${SRC}" ]; then
    35     39   	mkdir 'src' >/dev/null 2>/dev/null
    36     40   
    37     41   	use_fossil='0'
    38     42   	if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then
    39     43   		use_fossil='1'
    40         -
    41         -		FOSSILTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
    42         -		if [ "${FOSSILTAG}" = "HEAD" ]; then
    43         -			FOSSILTAG="trunk"
    44         -		fi
    45     44   	elif echo "${TCLVERS}" | grep '^fossil_' >/dev/null; then
    46     45   		use_fossil='1'
    47         -
    48         -		FOSSILTAG=$(echo "${TCLVERS}" | sed 's/^fossil_//g')
    49     46   	fi
    50         -	export FOSSILTAG
    51     47   
    52     48   	if [ "${use_fossil}" = "1" ]; then
    53     49   		(       
           50  +			FOSSILDATE="$(cat "${TCLFOSSILDATE}" 2>/dev/null)"
           51  +
    54     52   			cd src || exit 1
    55     53   
    56     54   			workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
    57     55   			rm -rf "${workdir}"
    58     56   
    59     57   			mkdir "${workdir}" || exit 1
    60     58   			cd "${workdir}" || exit 1
    61     59   
    62         -			wget -O "tmp-tk.tar.gz" "http://core.tcl.tk/tk/tarball/tk-fossil.tar.gz?uuid=${FOSSILTAG}" || rm -f 'tmp-tk.tar.gz'
           60  +			wget -O "tmp-tk.tar.gz" "http://core.tcl.tk/tk/tarball/tk-fossil.tar.gz?uuid=${FOSSILDATE}" || rm -f 'tmp-tk.tar.gz'
    63     61   			gzip -dc "tmp-tk.tar.gz" | tar -xf -
    64     62   
    65     63   			mv "tk-fossil" "tk${TCLVERS}"
    66     64                           
    67     65   			tar -cf - "tk${TCLVERS}" | gzip -c > "../../${SRC}"
    68     66   
    69     67   			cd ..