Diff

Differences From Artifact [54785bdfbe]:

To Artifact [b819ea7b3f]:


    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
    21     22   
    22     23   rm -rf 'build' 'out' 'inst'
    23     24   mkdir 'build' 'out' 'inst' || exit 1
    24     25   
    25     26   # Determine Tcl version
    26     27   TCL_VERSION="unknown"
    27     28   if [ -f "${TCLCONFIGDIR}/tclConfig.sh" ]; then
................................................................................
    54     55   			if [ -d "tk${TCLVERS}" ]; then
    55     56   				find "tk${TCLVERS}" -name configure -type f | xargs chmod +x
    56     57                                   
    57     58   				tar -cf - "tk${TCLVERS}" | gzip -c > "../${SRC}"
    58     59   			fi
    59     60   
    60     61   			rm -f "tmp-tk.zip"
           62  +			rm -rf "tk-${CVSTAG}"
    61     63   			rm -rf "tk${TCLVERS}"
    62     64   		)
    63     65   	else
    64     66   		rm -f "${SRC}.tmp"
    65     67   		wget -O "${SRC}.tmp" "${SRCURL}" || exit 1
    66     68   		mv "${SRC}.tmp" "${SRC}"
    67     69   	fi
................................................................................
    96     98   				continue
    97     99   			fi
    98    100   
    99    101   			echo "Applying: ${patch}"
   100    102   			${PATCH:-patch} -p1 < "${patch}"
   101    103   		done
   102    104   	)
          105  +
          106  +	# Apply patch scripts if needed
          107  +	for patchscript in "${PATCHSCRIPTDIR}"/*.sh; do
          108  +		if [ -f "${patchscript}" ]; then
          109  +			echo "Running patch script: ${patchscript}"
          110  +                                
          111  +			(
          112  +				. "${patchscript}"
          113  +			)
          114  +		fi
          115  +	done
   103    116   
   104    117   	for dir in unix win macosx win64 __fail__; do
   105    118   		if [ "${dir}" = "__fail__" ]; then
   106    119   			exit 1
   107    120   		fi
   108    121   
   109    122   		# Windows/amd64 workarounds