Blame subr.pkg/pkg_install_files.subr

Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
#
8d7a8a
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
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() {
e9fa07
	if [ "${PKG_INSTALL_FILES:+1}" = 1 ]; 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;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 611492
pkgp_install_files_v2() {
e9fa07
	local _ppifv2_status="" _ppifv2_vflag="";
Lucio Andrés Illanes Albornoz 611492
e9fa07
	if [ "${PKG_INSTALL_FILES_V2:+1}" = 1 ]; then
e9fa07
		if rtl_lmatch \$ARG_VERBOSE_TAGS "install" ","; then
e9fa07
			_ppifv2_vflag="-v";
Lucio Andrés Illanes Albornoz 30cdf7
		fi;
Lucio Andrés Illanes Albornoz 611492
		if ! rtl_install_v2							\
e9fa07
				\$_ppifv2_status					\
Lucio Andrés Illanes Albornoz 611492
				-p "_builddir=${PKG_BUILD_DIR}"				\
Lucio Andrés Illanes Albornoz 611492
				-p "_destdir=${PKG_BASE_DIR}/${PKG_DESTDIR}"		\
Lucio Andrés Illanes Albornoz 611492
				-p "_destdir_host=${PKG_BASE_DIR}/${PKG_DESTDIR_HOST}"	\
Lucio Andrés Illanes Albornoz 611492
				-p "_files=${MIDIPIX_BUILD_PWD}/files/${PKG_NAME}"	\
Lucio Andrés Illanes Albornoz 611492
				-p "_name=${PKG_NAME}"					\
Lucio Andrés Illanes Albornoz 611492
				-p "_prefix=${PKG_PREFIX}"				\
Lucio Andrés Illanes Albornoz 611492
				-p "_prefix_host=${PREFIX}"				\
Lucio Andrés Illanes Albornoz 611492
				-p "_prefix_native=${PREFIX_NATIVE}"			\
Lucio Andrés Illanes Albornoz 611492
				-p "_subdir=${PKG_BASE_DIR}/${PKG_SUBDIR}"		\
Lucio Andrés Illanes Albornoz 611492
				-p "_target=${PKG_TARGET}"				\
Lucio Andrés Illanes Albornoz 611492
				-p "_version=${PKG_VERSION:-}"				\
Lucio Andrés Illanes Albornoz 611492
				-p "_workdir=${BUILD_WORKDIR}"				\
e9fa07
				${_ppifv2_vflag} -- "${PKG_DESTDIR}"			\
e9fa07
				"${PKG_INSTALL_FILES_V2}";
e9fa07
		then
Lucio Andrés Illanes Albornoz 611492
			return 1;
Lucio Andrés Illanes Albornoz 611492
		fi;
Lucio Andrés Illanes Albornoz 611492
	fi;
Lucio Andrés Illanes Albornoz 611492
};
Lucio Andrés Illanes Albornoz 611492
938c5c
pkgp_install_files_libraries() {
938c5c
	if [ "${PKG_BUILD_TYPE}" != "host" ]; then
938c5c
		ex_rtl_install_library_archives "${PKG_DESTDIR}" "${PKG_TARGET}-mdso" || return 1;
938c5c
	fi;
938c5c
	ex_rtl_purge_la_files "${PKG_DESTDIR}" || return 1;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz 8e39bd
};
Lucio Andrés Illanes Albornoz 8e39bd
938c5c
pkgp_install_files_perms() {
938c5c
	rtl_set_perms_treeV		\
938c5c
		0755 0755 0644		\
938c5c
		"${PKG_DESTDIR}"	\
938c5c
		"${PKG_DESTDIR_HOST}";
938c5c
	return "${?}";
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 2b85d0
pkgp_install_files_strip() {
f57002
	local _ppifs_pkg_minipixfl=0 _ppifs_rc=0;
938c5c
938c5c
	rtl_match "${PKG_NAME}" "*_minipix"; _ppifs_pkg_minipixfl="${?}";
938c5c
	if [ \( "${_ppifs_pkg_minipixfl}" -eq 0 \) -a \( "${ARG_DEBUG_MINIPIX:-0}" -eq 0 \) ]\
938c5c
	|| [ \( "${BUILD_KIND}" = release \) -a \( "${PKG_BUILD_TYPE}" = native \) ]; then
938c5c
		ex_rtl_strip_files		\
938c5c
			"${PKG_TARGET}-strip"	\
938c5c
			"${PKG_DESTDIR}"	\
938c5c
			--			\
938c5c
			rtl_log_msgV "pkg_strip" "${MSG_pkg_strip}";
938c5c
		_ppifs_rc="${?}";
Lucio Andrés Illanes Albornoz 2b85d0
	fi;
938c5c
938c5c
	return "${_ppifs_rc}";
Lucio Andrés Illanes Albornoz 2b85d0
};
Lucio Andrés Illanes Albornoz 2b85d0
Lucio Andrés Illanes Albornoz 2b85d0
pkg_install_files() {
e9fa07
	local _pif_group_name="${1}" _pif_pkg_name="${2}" _pif_restart_at="${3}";
e9fa07
Lucio Andrés Illanes Albornoz 2b85d0
	if ! pkgp_install_files\
Lucio Andrés Illanes Albornoz 611492
	|| ! pkgp_install_files_v2\
Lucio Andrés Illanes Albornoz 8e39bd
	|| ! pkgp_install_files_perms\
938c5c
	|| ! ex_rtl_fixup_pkgconfig_paths "${PKG_DESTDIR}"\
938c5c
	|| ! pkgp_install_files_strip\
938c5c
	|| ! pkgp_install_files_libraries;
e9fa07
	then
Lucio Andrés Illanes Albornoz bf9edf
		return 1;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
	fi;
e9fa07
	return 0;
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
};
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
64844b
# vim:filetype=sh textwidth=0