Diff

Differences From Artifact [394ddd8947]:

To Artifact [12528bdfc5]:


    13     13   
    14     14   SRC="src/tk${TCLVERS}.tar.gz"
    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         -export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR
           20  +PATCHSCRIPTDIR="$(pwd)/patchscripts"
           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
    21     26   
    22     27   rm -rf 'build' 'out' 'inst'
    23     28   mkdir 'build' 'out' 'inst' || exit 1
    24     29   
    25     30   # Determine Tcl version
    26     31   TCL_VERSION="unknown"
    27     32   if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
................................................................................
    29     34   fi
    30     35   export TCL_VERSION
    31     36   
    32     37   
    33     38   if [ ! -f "${SRC}" ]; then
    34     39   	mkdir 'src' >/dev/null 2>/dev/null
    35     40   
           41  +	use_fossil='0'
    36     42   	if echo "${TCLVERS}" | grep '^cvs_' >/dev/null; then
    37         -		CVSTAG=$(echo "${TCLVERS}" | sed 's/^cvs_//g')
    38         -		export CVSTAG
           43  +		use_fossil='1'
           44  +	elif echo "${TCLVERS}" | grep '^fossil_' >/dev/null; then
           45  +		use_fossil='1'
           46  +	fi
    39     47   
           48  +	if [ "${use_fossil}" = "1" ]; then
    40     49   		(       
           50  +			FOSSILDATE="$(cat "${TCLFOSSILDATE}" 2>/dev/null)"
           51  +
    41     52   			cd src || exit 1
    42     53   
    43         -			cvs -z3 -d:pserver:anonymous@tcl.cvs.sourceforge.net:/cvsroot/tktoolkit co -r "${CVSTAG}" -P tk
           54  +			workdir="tmp-$$${RANDOM}${RANDOM}${RANDOM}"
           55  +			rm -rf "${workdir}"
    44     56   
    45         -			mv tk "tk${TCLVERS}"
           57  +			mkdir "${workdir}" || exit 1
           58  +			cd "${workdir}" || exit 1
    46     59   
    47         -			tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}"
           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'
           61  +			gzip -dc "tmp-tk.tar.gz" | tar -xf -
           62  +
           63  +			mv "tk-fossil" "tk${TCLVERS}"
           64  +                        
           65  +			tar -cf - "tk${TCLVERS}" | gzip -c > "../../${SRC}"
           66  +
           67  +			cd ..
           68  +			rm -rf "${workdir}"
    48     69   		)
    49     70   	else
    50     71   		rm -f "${SRC}.tmp"
    51     72   		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
    52     73   		mv "${SRC}.tmp" "${SRC}"
    53     74   	fi
    54     75   fi
................................................................................
    82    103   				continue
    83    104   			fi
    84    105   
    85    106   			echo "Applying: ${patch}"
    86    107   			${PATCH:-patch} -p1 < "${patch}"
    87    108   		done
    88    109   	)
          110  +
          111  +	# Apply patch scripts if needed
          112  +	for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do
          113  +		if [ -f "${patchscript}" ]; then
          114  +			echo "Running patch script: ${patchscript}"
          115  +                                
          116  +			(
          117  +				. "${patchscript}"
          118  +			)
          119  +		fi
          120  +	done
    89    121   
    90    122   	for dir in unix win macosx win64 __fail__; do
    91    123   		if [ "${dir}" = "__fail__" ]; then
    92    124   			exit 1
    93    125   		fi
    94    126   
    95    127   		# Windows/amd64 workarounds
................................................................................
   139    171   		) || continue
   140    172   
   141    173   		echo "Running: ${MAKE:-make} install"
   142    174   		${MAKE:-make} install || continue
   143    175   
   144    176   		# Update to include resources, if found
   145    177   		if [ "${dir}" = "win" ]; then
          178  +			echo ' *** Importing user-specified icon'
          179  +			cp "${KITCREATOR_ICON}" rc/tk.ico
          180  +
          181  +			echo ' *** Importing user-specified resources'
          182  +			cat "${KITCREATOR_RC}" | grep -v '^ *tclsh  *ICON' >> "./rc/tk_base.rc"
          183  +
   146    184   			echo ' *** Creating tkbase.res.o to support Windows build'
   147    185   			echo "\"${RC:-windres}\" -o tkbase.res.o  --define STATIC_BUILD --include \"./../generic\" --include \"${TCLCONFIGDIR}/../generic\" --include \"${TCLCONFIGDIR}\" --include \"./rc\" \"./rc/tk_base.rc\""
   148    186   			"${RC:-windres}" -o tkbase.res.o  --define STATIC_BUILD --include "./../generic" --include "${TCLCONFIGDIR}/../generic" --include "${TCLCONFIGDIR}" --include "./rc" "./rc/tk_base.rc"
   149    187   
   150    188   			if [ -f "tkbase.res.o" ]; then
   151    189   				cp "tkbase.res.o" "${INSTDIR}/lib/"
   152    190   			fi