Blame subr/pkg_install_files.subr

Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
#
Lucio Andrés Illanes Albornoz e1d469
# set +o errexit -o noglob -o nounset is assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
#
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
Lucio Andrés Illanes Albornoz 2b85d0
pkgp_install_files() {
Lucio Andrés Illanes Albornoz e1d469
	if [ -n "${PKG_INSTALL_FILES:-}" ]; then
Lucio Andrés Illanes Albornoz bf9edf
		if ! rtl_install -v "${PKG_DESTDIR}" ${PKG_INSTALL_FILES}; then
Lucio Andrés Illanes Albornoz bf9edf
			return 1;
Lucio Andrés Illanes Albornoz bf9edf
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
	fi;
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 2b85d0
pkgp_install_files_pkgconfig() {
Lucio Andrés Illanes Albornoz 2b85d0
	local _pc_path="";
Lucio Andrés Illanes Albornoz 2b85d0
	for _pc_path in $(find "${PKG_DESTDIR}" -name \*.pc); do
Lucio Andrés Illanes Albornoz 0d1c4f
		if [ -n "$(sed -ne '/^libdir=[^$]*$/p' "${_pc_path}")" ]			\
Lucio Andrés Illanes Albornoz 0d1c4f
		&& ! sed -i""	-e '/^libdir=[^$]*$/s/^libdir=\(.*\)$/libdir=${exec_prefix}\1/'	\
Lucio Andrés Illanes Albornoz 0d1c4f
				-e '/^exec_prefix=$/s/^.*$/exec_prefix=${prefix}/'		\
Lucio Andrés Illanes Albornoz bf9edf
				"${_pc_path}"; then
Lucio Andrés Illanes Albornoz bf9edf
			return 1;
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
	done;
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 2b85d0
pkgp_install_files_strip() {
Lucio Andrés Illanes Albornoz 2b85d0
	local _bin_path="" _tree_root="${PKG_DESTDIR}";
Lucio Andrés Illanes Albornoz 2b85d0
	if [ -e "${_tree_root}" ]\
Lucio Andrés Illanes Albornoz 2b85d0
	&& [ "${BUILD}" = release ]\
Lucio Andrés Illanes Albornoz 2b85d0
	&& [ "${PKG_BUILD_TYPE}" = native ]; then
Lucio Andrés Illanes Albornoz 2b85d0
		if [ "${PKG_NAME%_minipix}" != "${PKG_NAME}" ]\
Lucio Andrés Illanes Albornoz 2b85d0
		&& [ "${ARG_DEBUG_MINIPIX:-0}" -eq 1 ]; then
Lucio Andrés Illanes Albornoz 2b85d0
			return 0;
Lucio Andrés Illanes Albornoz 2b85d0
		fi;
Lucio Andrés Illanes Albornoz 2b85d0
		for _bin_path in $(find "${_tree_root}" -perm /a=x -type f); do
Lucio Andrés Illanes Albornoz 2b85d0
			if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
Lucio Andrés Illanes Albornoz b6a9a1
				rtl_log_msg info "Stripping %s..." "${_bin_path}";
Lucio Andrés Illanes Albornoz bf9edf
				if ! "${PKG_TARGET}-strip" "${_bin_path}"; then
Lucio Andrés Illanes Albornoz bf9edf
					return 1;
Lucio Andrés Illanes Albornoz bf9edf
				fi;
Lucio Andrés Illanes Albornoz 2b85d0
			fi;
Lucio Andrés Illanes Albornoz 2b85d0
		done;
Lucio Andrés Illanes Albornoz 2b85d0
	fi;
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 2b85d0
pkg_install_files() {
Lucio Andrés Illanes Albornoz 2b85d0
	if ! pkgp_install_files\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! pkgp_install_files_pkgconfig\
Lucio Andrés Illanes Albornoz 2b85d0
	|| ! pkgp_install_files_strip; then
Lucio Andrés Illanes Albornoz bf9edf
		return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
};
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
# vim:filetype=sh