Diff

Differences From Artifact [805b596118]:

To Artifact [f8ef582bfc]:


    22     22   
    23     23   rm -rf 'build' 'out' 'inst'
    24     24   mkdir 'build' 'out' 'inst' || exit 1
    25     25   
    26     26   if [ ! -f "${SRC}" ]; then
    27     27   	mkdir 'src' >/dev/null 2>/dev/null
    28     28   
           29  +	use_fossil='0'
    29     30   	if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then
    30         -		CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
    31         -		export CVSTAG
           31  +		use_fossil='1'
    32     32   
           33  +		FOSSILTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
           34  +		if [ "${FOSSILTAG}" = "HEAD" ]; then
           35  +			FOSSILTAG="trunk"
           36  +		fi
           37  +	elif echo "${TCLVERS}" | grep '^fossil_' >/dev/null; then
           38  +		use_fossil='1'
           39  +
           40  +		FOSSILTAG=$(echo "${TCLVERS}" | sed 's/^fossil_//g')
           41  +	fi
           42  +	export FOSSILTAG
           43  +
           44  +	if [ "${use_fossil}" = "1" ]; then
    33     45   		(
    34     46   			cd src || exit 1
    35     47   
    36         -			cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tcl co -r "${CVSTAG}" -P tcl
           48  +			workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
           49  +			rm -rf "${workdir}"
    37     50   
    38         -			mv tcl "tcl${TCLVERS}"
           51  +			mkdir "${workdir}" || exit 1
           52  +			cd "${workdir}" || exit 1
    39     53   
    40         -			tar -cf - "tcl${TCLVERS}" | gzip -c > "../${SRC}"
    41         -		)
           54  +			# Handle Tcl first, since it will be used to base other packages on
           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'
           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  +
           77  +			gzip -dc "tmp-itcl.tar.gz" | tar -xf -
           78  +			gzip -dc "tmp-thread.tar.gz" | tar -xf -
           79  +			gzip -dc "tmp-tclconfig.tar.gz" | tar -xf -
           80  +
           81  +			mkdir -p "tcl${TCLVERS}/pkgs/" >/dev/null 2>/dev/null
           82  +			mv "itcl-fossil" "tcl${TCLVERS}/pkgs/itcl"
           83  +			mv "thread-fossil" "tcl${TCLVERS}/pkgs/thread"
           84  +			cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/itcl/tclconfig"
           85  +			cp -r "tclconfig-fossil" "tcl${TCLVERS}/pkgs/thread/tclconfig"
           86  +			mv "tclconfig-fossil" "tcl${TCLVERS}/tclconfig"
           87  +
           88  +			tar -cf - "tcl${TCLVERS}" | gzip -c > "../../${SRC}"
           89  +			echo "${FOSSILDATE}" > "../../${SRC}.date"
           90  +
           91  +			cd ..
           92  +
           93  +			rm -rf "${workdir}"
           94  +		) || exit 1
    42     95   	else
    43     96   		rm -f "${SRC}.tmp"
    44     97   		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
    45     98   		mv "${SRC}.tmp" "${SRC}"
    46     99   	fi
    47    100   fi
    48    101   
................................................................................
    75    128   
    76    129   			(
    77    130   				. "${patchscript}"
    78    131   			)
    79    132   		fi
    80    133   	done
    81    134   
    82         -	# Patch Win32 builds to always provide DllMain if we are building KitDLL
    83         -	if [ "${KITTARGET}" = "kitdll" ]; then
    84         -		## DllMain is needed when building KitDLL
    85         -		for filetopatch in win/tclWin32Dll.c win/tclWinInit.c; do
    86         -			echo "Undefining STATIC_BUILD in \"${filetopatch}\""
    87         -
    88         -			sed 's@STATIC_BUILD@NEVER_STATIC_BUILD@g' "${filetopatch}" > "${filetopatch}.new" && cat "${filetopatch}.new" > "${filetopatch}"
    89         -			rm -f "${filetopatch}.new"
    90         -		done
    91         -	fi
    92         -
    93    135   	for dir in unix win macosx __fail__; do
    94    136   		if [ "${dir}" = "__fail__" ]; then
    95    137   			# If we haven't figured out how to build it, reject.
    96    138   
    97    139   			exit 1
    98    140   		fi
    99    141   
................................................................................
   109    151   		${MAKE:-make} || continue
   110    152   
   111    153   		echo "Running: ${MAKE:-make} install"
   112    154   		${MAKE:-make} install || (
   113    155   			# Work with Tcl 8.6.x's TCLSH_NATIVE solution for
   114    156   			# cross-compile installs
   115    157   
   116         -			echo "Running: ${MAKE:-make} install TCLSH_NATIVE=\"${TCLKIT:-tclkit}\""
   117         -			${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}"
   118    160   		) || (
   119    161   			# Make install can fail if cross-compiling using Tcl 8.5.x
   120    162   			# because the Makefile calls "$(TCLSH)".  We can't simply
   121    163   			# redefine TCLSH because it also uses TCLSH as a build target
   122    164   			sed 's@^$(TCLSH)@blah@' Makefile > Makefile.new
   123    165   			cat Makefile.new > Makefile
   124    166   			rm -f Makefile.new
   125    167   
   126         -			echo "Running: ${MAKE:-make} install TCLSH=\"../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")\""
   127         -			${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}")"
   128    170   		) || (
   129    171   			# Make install can fail if cross-compiling using Tcl 8.5.9
   130    172   			# because the Makefile calls "${TCL_EXE}".  We can't simply
   131    173   			# redefine TCL_EXE because it also uses TCL_EXE as a build target
   132    174   			sed 's@^${TCL_EXE}@blah@' Makefile > Makefile.new
   133    175   			cat Makefile.new > Makefile
   134    176   			rm -f Makefile.new
   135    177   
   136         -			echo "Running: ${MAKE:-make} install TCL_EXE=\"../../../../../../../../../../../../../../../../../$(which "${TCLKIT:-tclkit}")\""
   137         -			${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}")"
   138    180   		) || exit 1
   139    181   
   140    182   		mkdir "${OUTDIR}/lib" || exit 1
   141    183   		cp -r "${INSTDIR}/lib"/* "${OUTDIR}/lib/"
   142    184   		rm -rf "${OUTDIR}/lib/pkgconfig"
   143    185   		rm -f "${OUTDIR}"/lib/* >/dev/null 2>/dev/null
   144    186   		find "${OUTDIR}" -name '*.a' | xargs rm -f >/dev/null 2>/dev/null