diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2017-02-05 19:08:11 +0100 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <l.illanes@gmx.de> | 2017-02-05 21:24:26 +0000 |
commit | 8022154108dde14f47722bd1a18a475ef2a3f95d (patch) | |
tree | 6215baa0f5338e3cfc7693f8bbdfaeef844744ad /subr/pkg_000000.subr | |
parent | c1aae3835fe7d398b3e22f915fe6d7913b17ee44 (diff) | |
download | midipix_build-8022154108dde14f47722bd1a18a475ef2a3f95d.tar.bz2 midipix_build-8022154108dde14f47722bd1a18a475ef2a3f95d.tar.xz |
build.sh, {subr,vars}/*: general cleanup.
Diffstat (limited to 'subr/pkg_000000.subr')
-rw-r--r-- | subr/pkg_000000.subr | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/subr/pkg_000000.subr b/subr/pkg_000000.subr new file mode 100644 index 00000000..f531eca4 --- /dev/null +++ b/subr/pkg_000000.subr @@ -0,0 +1,39 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_000000() { + local _pkg_name_uc _vars_fname _vname _build_uc __ _log_env_vars; + _pkg_name_uc="$(echo ${PKG_NAME} | tr a-z A-Z)"; + for _vars_fname in vars/${PKG_NAME}.vars; do + [ -e "${_vars_fname}" ] && . "${_vars_fname}"; + done; + for _vname in PREFIX ${PKG_BUILD_VARS}; do + _build_uc="$(echo ${BUILD} | tr a-z A-Z)"; + for __ in "DEFAULT_${_vname}" \ + "${BUILD_TARGET}_${_vname}" \ + "PKG_${_pkg_name_uc}_${_vname}" \ + "PKG_${_pkg_name_uc}_${_vname}_${_build_uc}"; do + set_var_unsafe "PKG_${_vname}" "$(get_var_unsafe ${__})"; + done; + done; + if [ -z "${PKG_URL}" -a -z "${PKG_URLS_GIT}" -a -z "${PKG_VERSION}" ]; then + log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars."; + else + [ -n "${PKG_ENV_VARS_EXTRA}" ] && set_env_vars_with_sep : "${PKG_ENV_VARS_EXTRA}"; + [ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}"; + [ -z "${PKG_SUBDIR}" ] && PKG_SUBDIR="${PKG_FNAME%%.tar*}"; + [ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}"; + [ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)"; + fi; + for __ in $(set); do + if [ "${__#PKG_${_pkg_name_uc}}" != "${__}" ]; then + _log_env_vars="${_log_env_vars:+${_log_env_vars} }${__%%=*}"; + fi; + done; + if [ -n "${_log_env_vars}" ]; then + log_env_vars "build" ${_log_env_vars}; + fi; +}; + +# vim:filetype=sh |