@@ -15,11 +15,12 @@ SRCURL="http://prdownloads.sourceforge.net/tcl/tk${TCLVERS}-src.tar.gz" BUILDDIR="$(pwd)/build/tk${TCLVERS}" PATCHDIR="$(pwd)/patches" OUTDIR="$(pwd)/out" INSTDIR="$(pwd)/inst" -export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR +PATCHSCRIPTDIR="$(pwd)/patchscripts" +export SRC SRCURL BUILDDIR PATCHDIR OUTDIR INSTDIR PATCHSCRIPTDIR rm -rf 'build' 'out' 'inst' mkdir 'build' 'out' 'inst' || exit 1 # Determine Tcl version @@ -56,10 +57,11 @@ tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}" fi rm -f "tmp-tk.zip" + rm -rf "tk-${CVSTAG}" rm -rf "tk${TCLVERS}" ) else rm -f "${SRC}.tmp" wget -O "${SRC}.tmp" "${SRCURL}" || exit 1 @@ -98,10 +100,21 @@ echo "Applying: ${patch}" ${PATCH:-patch} -p1 < "${patch}" done ) + + # Apply patch scripts if needed + for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do + if [ -f "${patchscript}" ]; then + echo "Running patch script: ${patchscript}" + + ( + . "${patchscript}" + ) + fi + done for dir in unix win macosx win64 __fail__; do if [ "${dir}" = "__fail__" ]; then exit 1 fi