Index: common/common.sh ================================================================== --- common/common.sh +++ common/common.sh @@ -5,10 +5,11 @@ internalpkgname="${pkg}" archivedir="${pkgdir}/src" buildsrcdir="${pkgdir}/buildsrc" installdir="${pkgdir}/inst" runtimedir="${pkgdir}/out" +patchdir="${pkgdir}/patches" workdir="${pkgdir}/workdir-$$${RANDOM}${RANDOM}${RANDOM}${RANDOM}.work" _download="$(which download)" function clean() { @@ -114,11 +115,22 @@ return 0 } function apply_patches() { - : + local patch + + for patch in "${patchdir}/all"/${pkg}-${version}-*.diff "${patchdir}/${TCL_VERSION}"/${pkg}-${version}-*.diff; do + if [ ! -f "${patch}" ]; then + continue + fi + + echo "Applying: ${patch}" + ( cd "${workdir}" && ${PATCH:-patch} -p1 ) < "${patch}" || return 1 + done + + return 0 } function preconfigure() { : }