@@ -15,26 +15,18 @@ not_platforms 'tcl' # Download source download_src -( - rm -rf build - mkdir build - cd build/ || exit 1 - - gzip -dc "../${SRC}" | tar -xf - - cd "${BUILDDIR}" || exit 1 - - # Apply patches - for patchfile in "${PATCHDIR}"/all/*.diff "${PATCHDIR}/${VERS}"/*.diff; do - if [ ! -f "${patchfile}" ]; then - continue - fi - - "${PATCH:-patch}" -p1 < "${patchfile}" - done +# Extract source +extract_src + +# Apply appropriate patches +apply_patches + +( + cd "build/${BUILDDIR}" || exit 1 if [ -z "${SSLDIR}" ]; then for chkssldir in $(pkg-config openssl --cflags | sed 's@ *-I *@|@g' | tr '|' "\n" | grep '^/'); do if [ -f "${chkssldir}/openssl/opensslv.h" -o -f "${chkssldir}/opensslv.h" ]; then SSLDIR=$(echo "${chkssldir}" | sed 's@/[^/]*/*$@@')