Diff

Differences From Artifact [0a6dc891a3]:

To Artifact [5c88931dca]:


    54     54   function download_src () {
    55     55   	if [ ! -f "${SRC}" -a -n "${SRC}" -a -n "${SRCURL}" ]; then
    56     56   		mkdir -p "$(dirname "${SRC}")" >/dev/null 2>/dev/null
    57     57   
    58     58   		download "${SRC}" "${SRCURL}" || exit 1
    59     59   	fi
    60     60   }
           61  +
           62  +function extract_src () {
           63  +	rm -rf build
           64  +	mkdir build
           65  +
           66  +	(
           67  +		cd build/ || exit 1
           68  +
           69  +		gzip -dc "../${SRC}" | tar -xf -
           70  +		cd "${BUILDDIR}" || exit 1
           71  +	) || exit 1
           72  +}
           73  +
           74  +function apply_patches () {
           75  +	local patchroot patchdir patchfiles patchfile idx
           76  +
           77  +	patchroot="$(pwd)/patches"
           78  +
           79  +	for patchdir in "${patchroot}/all" "${patchroot}/${VERS}"; do
           80  +		unset patchfiles
           81  +
           82  +		if [ -f "${patchdir}/series" ]; then
           83  +			idx=0
           84  +			for patchfile in $(cat "${patchdir}/series"); do
           85  +				patchfiles[${idx}]="${patchdir}/${patchfile}"
           86  +				idx=$[${idx} + 1]
           87  +			done
           88  +		else
           89  +			patchfiles=("${patchdir}"/*.diff)
           90  +		fi
           91  +
           92  +		for patchfile in "${patchfiles[@]}"; do
           93  +			if [ ! -f "${patchfile}" ]; then
           94  +				continue
           95  +			fi
           96  +
           97  +			(
           98  +				cd "build/${BUILDDIR}" || exit 1
           99  +
          100  +				echo "* Applying patch \"${patchfile}\""
          101  +				"${PATCH:-patch}" -p1 < "${patchfile}"
          102  +			)
          103  +		done
          104  +	done
          105  +}
    61    106   
    62    107   WORKDIR="${TMPDIR:-/tmp}/tcl-buildpkgs-$$${RANDOM}${RANDOM}${RANDOM}"
    63    108   PLATDIR="$(pwd)/out/${PLATFORM}"
    64    109   export WORKDIR PLATDIR
    65    110   
    66    111   setup_tcl84