summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_configure_patch.subr
blob: ff078fec969b725e169d5f82e7d3e6d4cb852023 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#
# set -o errexit -o noglob are assumed.
#

pkg_configure_patch() {
	local _patch_fname _patches_done;
	set +o noglob;
	for _patch_fname in 																\
			${WORKDIR}/chainport-host-invariants/chainport/${PKG_NAME%_host}${PKG_VERSION:+-${PKG_VERSION}}.midipix.patch			\
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch										\
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}.local.patch						\
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}.local@${BUILD_HNAME}.patch				\
			${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}/*.patch}							\
			${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}${PKG_VERSION:+-${PKG_VERSION}}.local.patch}			\
			${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}${PKG_VERSION:+-${PKG_VERSION}}.local@${BUILD_HNAME}.patch}; do
		if ! ex_lmatch "${_patches_done}" " " "${_patch_fname}"\
		&& [ -r "${_patch_fname}" ]; then
			patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}";
			_patches_done="${_patches_done:+${_patches_done} }${_patch_fname}";
		fi;
	done;
	set -o noglob;
};

# vim:filetype=sh