diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-20 21:45:21 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-11-21 00:51:43 +0000 |
commit | c27beab66023847435fb88cd5cc75916dca37057 (patch) | |
tree | c43c23133f5b837925785d5501aa4cff14980415 /subr/pkg_setup_env.subr | |
parent | d01c0269b8e5e467f82cd28392579c4c43fe63bc (diff) | |
download | midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.bz2 midipix_build-c27beab66023847435fb88cd5cc75916dca37057.tar.xz |
Refactors build steps along the sequence {setup,fetch,configure,build,install}.
subr/mode_check_updates.subr: seperated into check_updates.sh.
subr/post_{copy_etc,sha256sums,tarballs}.subr: absorbed into `dist' target.
Diffstat (limited to 'subr/pkg_setup_env.subr')
-rw-r--r-- | subr/pkg_setup_env.subr | 33 |
1 files changed, 21 insertions, 12 deletions
diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr index 8bf076b2..c8058e86 100644 --- a/subr/pkg_setup_env.subr +++ b/subr/pkg_setup_env.subr @@ -5,40 +5,49 @@ pkg_setup_env() { if [ -z "${PKG_URL}" ]\ && [ -z "${PKG_URLS_GIT}" ]\ - && [ -z "${PKG_VERSION}" ]; then + && [ -z "${PKG_VERSION}" ]\ + && ! test_cmd "${PKG_NAME}_all"; then log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars."; + elif [ "${PKG_DISABLED:-0}" -eq 1 ]; then + log_msg vnfo "Skipping disabled package \`${PKG_NAME}.'"; + exit 0; else [ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)"; [ -n "${PKG_ENV_VARS_EXTRA}" ] && set_env_vars_with_sep : "${PKG_ENV_VARS_EXTRA}"; [ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}"; [ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}"; [ -z "${PKG_BASE_DIR}" ] && PKG_BASE_DIR="${WORKDIR}/${PKG_NAME}-${PKG_BUILD_TYPE:-native}-${PKG_TARGET}"; - build_fileop mkdir "${PKG_BASE_DIR}"; - build_fileop cd "${PKG_BASE_DIR}"; case "${PKG_BUILD_TYPE}" in host) export AR="ar"; export CC="gcc"; export CXX="g++"; - export RANLIB="ranlib"; ;; + export RANLIB="ranlib"; + export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; + export LIBTOOL="${PKG_SLIBTOOL:-slibtool}"; ;; *) export AR="${PKG_TARGET}-ar"; export CC="${PKG_TARGET}-gcc"; export CXX="${PKG_TARGET}-g++"; - export RANLIB="${PKG_TARGET}-ranlib"; ;; + export RANLIB="${PKG_TARGET}-ranlib"; + export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; + export LIBTOOL="${PKG_SLIBTOOL:-slibtool}"; ;; esac; case "${PKG_SUBDIR}" in ?*) ;; *) case "${PKG_URLS_GIT}" in ?*) PKG_SUBDIR="${PKG_URLS_GIT%%=*}"; ;; - *) PKG_SUBDIR="${PKG_FNAME%%.t*}"; ;; + *) case "${PKG_FNAME}" in + *.t*) PKG_SUBDIR="${PKG_FNAME%%.t*}"; ;; + *) PKG_SUBDIR="${PKG_NAME}"; ;; + esac; ;; esac; ;; esac; - export LIBTOOL="${PKG_SLIBTOOL:-slibtool}"; - export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; - if [ -n "${PKG_ENV_VARS}" ]; then - PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")"; - log_env_vars "build" ${PKG_ENV_VARS}; - fi; fi; + if [ -n "${PKG_ENV_VARS}" ]; then + PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")"; + log_env_vars "build" ${PKG_ENV_VARS}; + fi; + build_fileop mkdir "${PKG_BASE_DIR}"; + build_fileop cd "${PKG_BASE_DIR}"; }; # vim:filetype=sh |