summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-22 01:32:50 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-22 02:35:10 +0000
commit32ad217d197203a97dfcc0076e748731d2315c0b (patch)
tree1f4dd5799daa9ac8540cddcc45b4c1557cb0ac70
parent465073d1a9f8ead60dbe66a26b55c0c1927e63c6 (diff)
downloadmidipix_build-32ad217d197203a97dfcc0076e748731d2315c0b.tar.bz2
midipix_build-32ad217d197203a97dfcc0076e748731d2315c0b.tar.xz
subr/*: reorganised as {ex{,_{pkg,rtl,setup}},pkg}_*.
-rwxr-xr-xbuild.sh72
-rw-r--r--etc/build.usage2
-rw-r--r--subr/build.subr181
-rw-r--r--subr/ex_pkg_dispatch.subr (renamed from subr/pkg_setup_dispatch.subr)34
-rw-r--r--subr/ex_pkg_env.subr (renamed from subr/pkg_setup_env.subr)15
-rw-r--r--subr/ex_pkg_state.subr64
-rw-r--r--subr/ex_pkg_vars.subr (renamed from subr/pkg_setup_vars.subr)18
-rw-r--r--subr/ex_rtl.subr60
-rw-r--r--subr/ex_rtl_fileop.subr39
-rw-r--r--subr/ex_rtl_log.subr45
-rw-r--r--subr/ex_setup_args.subr (renamed from subr/pre_setup_args.subr)10
-rw-r--r--subr/ex_setup_checks.subr (renamed from subr/pre_check.subr)16
-rw-r--r--subr/ex_setup_env.subr (renamed from subr/pre_setup_env.subr)8
-rw-r--r--subr/ex_setup_subdirs.subr (renamed from subr/pre_subdirs.subr)4
-rw-r--r--subr/pkg_build.subr2
-rw-r--r--subr/pkg_configure_autotools.subr6
-rw-r--r--subr/pkg_configure_patch.subr8
-rw-r--r--subr/pkg_fetch_distclean.subr15
-rw-r--r--subr/pkg_fetch_extract.subr2
-rw-r--r--subr/pkg_fetch_git.subr8
-rw-r--r--subr/pkg_fetch_subdirs.subr4
-rw-r--r--subr/pkg_fetch_wget.subr6
-rw-r--r--subr/pkg_finish.subr9
-rw-r--r--subr/pkg_install.subr2
-rw-r--r--subr/pkg_install_files.subr8
-rw-r--r--subr/pkg_install_libs.subr6
-rw-r--r--subr/pkg_install_make.subr2
-rw-r--r--subr/pkg_install_purge_la.subr2
-rw-r--r--subr/pkg_install_strip.subr4
-rw-r--r--subr/pkg_setup_distclean.subr12
-rw-r--r--subr/pkg_setup_subdirs.subr10
-rw-r--r--subr/pre_state.subr31
-rw-r--r--vars/build.vars2
-rw-r--r--vars/clang_host.vars10
-rw-r--r--vars/cmake.vars2
-rw-r--r--vars/dist_digest.vars4
-rw-r--r--vars/dist_tarballs.vars24
-rw-r--r--vars/env.vars13
-rw-r--r--vars/gcc.vars96
-rw-r--r--vars/git.vars2
-rw-r--r--vars/install_strip_host.vars2
-rw-r--r--vars/libxml2.vars2
-rw-r--r--vars/llvm_host.vars10
-rw-r--r--vars/musl.vars58
-rw-r--r--vars/nginx.vars2
-rw-r--r--vars/perl.vars10
-rw-r--r--vars/pkgconf_host.vars8
-rw-r--r--vars/psxstub.vars4
-rw-r--r--vars/python3.vars6
-rw-r--r--vars/vim.vars2
50 files changed, 476 insertions, 486 deletions
diff --git a/build.sh b/build.sh
index 20578262..c54400ac 100755
--- a/build.sh
+++ b/build.sh
@@ -3,48 +3,50 @@
#
for __ in $(find subr -name *.subr); do . "${__}"; done;
-pre_setup_args "${@}"; pre_setup_env; pre_check; pre_subdirs;
-pre_state init; {(
-log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}.";
-log_env_vars "build (global)" ${LOG_ENV_VARS};
-for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do
- BUILD_TARGET="$(toupper "${BUILD_TARGET_LC}")";
- BUILD_PACKAGES="$(get_var_unsafe ${BUILD_TARGET}_PACKAGES)";
- if [ "${BUILD_TARGET}" != "INVARIANTS" ]\
- && [ -n "${BUILD_PACKAGES_RESTART}" ]; then
- BUILD_PACKAGES="$(lfilter "${BUILD_PACKAGES}" "${BUILD_PACKAGES_RESTART}")";
- fi;
- for PKG_NAME in ${BUILD_PACKAGES}; do
- pkg_setup_dispatch "${BUILD_TARGET}" "${PKG_NAME}" \
- "${ARG_RESTART}" "${ARG_RESTART_AT}";
- BUILD_SCRIPT_RC=${?};
- case ${BUILD_SCRIPT_RC} in
- 0) log_msg succ "Finished \`${PKG_NAME}' build.";
- : $((BUILD_NFINI+=1)); continue; ;;
- *) log_msg fail "Build failed in \`${PKG_NAME}' (last return code ${BUILD_SCRIPT_RC}.).";
- : $((BUILD_NFAIL+=1));
- if [ ${ARG_RELAXED:-0} -eq 1 ]; then
- BUILD_PKGS_FAILED="${BUILD_PKGS_FAILED:+${BUILD_PKGS_FAILED} }${PKG_NAME}";
- continue;
- else
- break;
- fi;
- esac;
+ex_setup_args "${@}"; ex_setup_env; ex_setup_checks; ex_setup_subdirs;
+ex_pkg_state_init; {(
+ex_log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}.";
+ex_log_env_vars "build (global)" ${LOG_ENV_VARS};
+for BUILD_TARGET_META in invariants ${BUILD_TARGETS_META:-world}; do
+ for BUILD_TARGET_LC in $(ex_get_var_unsafe "$(ex_toupper "${BUILD_TARGET_META}")_TARGET"); do
+ BUILD_TARGET="$(ex_toupper "${BUILD_TARGET_LC}")";
+ BUILD_PACKAGES="$(ex_get_var_unsafe ${BUILD_TARGET}_PACKAGES)";
+ if [ "${BUILD_TARGET}" != "INVARIANTS" ]\
+ && [ -n "${BUILD_PACKAGES_RESTART}" ]; then
+ BUILD_PACKAGES="$(ex_lfilter "${BUILD_PACKAGES}" "${BUILD_PACKAGES_RESTART}")";
+ fi;
+ for PKG_NAME in ${BUILD_PACKAGES}; do
+ ex_pkg_dispatch "${BUILD_TARGET}" "${PKG_NAME}" \
+ "${ARG_RESTART}" "${ARG_RESTART_AT}";
+ BUILD_SCRIPT_RC=${?};
+ case ${BUILD_SCRIPT_RC} in
+ 0) ex_log_msg succ "Finished \`${PKG_NAME}' build.";
+ : $((BUILD_NFINI+=1)); continue; ;;
+ *) ex_log_msg fail "Build failed in \`${PKG_NAME}' (last return code ${BUILD_SCRIPT_RC}.).";
+ : $((BUILD_NFAIL+=1));
+ if [ ${ARG_RELAXED:-0} -eq 1 ]; then
+ BUILD_PKGS_FAILED="${BUILD_PKGS_FAILED:+${BUILD_PKGS_FAILED} }${PKG_NAME}";
+ continue;
+ else
+ break;
+ fi;
+ esac;
+ done;
+ if [ "${BUILD_SCRIPT_RC:-0}" -ne 0 ]; then
+ break;
+ fi;
done;
- if [ "${BUILD_SCRIPT_RC:-0}" -ne 0 ]; then
- break;
- fi;
-done; pre_state fini;
-log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${BUILD_NBUILT} build script(s).";
-log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s).";
+done; ex_pkg_state_fini;
+ex_log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${BUILD_NBUILT} build script(s).";
+ex_log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s).";
if [ ${ARG_RELAXED:-0} -eq 1 ]\
&& [ -n "${BUILD_PKGS_FAILED}" ]; then
- log_msg info "Build script failure(s) in: ${BUILD_PKGS_FAILED}.";
+ ex_log_msg info "Build script failure(s) in: ${BUILD_PKGS_FAILED}.";
fi;
exit "${BUILD_SCRIPT_RC:-0}")} 2>&1 | tee "${BUILD_LOG_FNAME}" & TEE_PID="${!}";
trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; \
- log_msg fail \"Build aborted.\"; \
+ ex_log_msg fail \"Build aborted.\"; \
echo kill ${TEE_PID}; \
kill ${TEE_PID}" HUP INT TERM USR1 USR2; wait;
diff --git a/etc/build.usage b/etc/build.usage
index c68dc4c2..165f957b 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -12,7 +12,7 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-h]
-r package[,...][:step] Restart the specified comma-separated build(s) completely
or at the optionally specified step. Currently defined
steps are:
- setup_distclean, fetch_wget, fetch_git, fetch_extract,
+ fetch_distclean, fetch_wget, fetch_git, fetch_extract,
configure_patch_pre, configure_autotools, configure_patch,
configure, build_clean, build, install_subdirs, install_make,
install_files, install_libs, install_pkgconfig, install_purge_la,
diff --git a/subr/build.subr b/subr/build.subr
deleted file mode 100644
index 526d9f25..00000000
--- a/subr/build.subr
+++ /dev/null
@@ -1,181 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-basename() { echo "${1##*/}"; };
-date() { command date "+${1:-${TIMESTAMP_FMT}}"; };
-dirname() { echo "${1%/*}"; };
-get_var_unsafe() { eval echo \${${1}}; };
-set_var_unsafe() { [ -n "${2}" ] && eval ${1}=\"${2}\" || return 0; };
-pop_IFS() { IFS="${_pI_IFS}"; unset _pI_IFS; };
-push_IFS() { _pI_IFS="${IFS}"; IFS="${1}"; };
-set_build_dir() { PKG_BUILD_DIR="${1}-${2}-${PKG_TARGET}"; };
-test_cmd() { command -v "${1}" >/dev/null; };
-toupper() { echo "${1}" | tr a-z A-Z; };
-
-build_fileop() {
- local _op="${1}"; shift;
- if [ "${_op}" = cd ]; then
- log_msg varn "Changing working directory to \`${1}'.";
- [ \( -n "${1}" \) -a \( -L "${1}" -o -e "${1}" \) ] && cd -- "${1}";
- elif [ "${_op}" = cp ]; then
- log_msg varn "Copying \`${1}' to \`${2}' w/ -pPR.";
- [ ${#} -ge 2 ] && cp -pPR -- "${@}";
- elif [ "${_op}" = ln_symbolic ]; then
- log_msg varn "Linking \`${1}' to \`${2}' w/ -fs";
- [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}";
- elif [ "${_op}" = mv ]; then
- log_msg varn "Moving \`${1}' to \`${2}' w/ -fs";
- [ \( -n "${1}" \) -a \( -n "${2}" \) ] && mv -f -- "${1}" "${2}";
- elif [ "${_op}" = mkdir ]\
- || [ "${_op}" = rm ]; then
- while [ ${#} -gt 0 ]; do
- if [ -z "${1}" ]; then
- return 1;
- elif [ "${_op}" = mkdir ]\
- && [ ! -e "${1}" ]; then
- log_msg varn "Making directory \`${1}'.";
- mkdir -p -- "${1}";
- elif [ "${_op}" = rm ]\
- && [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then
- log_msg varn "Removing directory or file \`${1}'.";
- rm -rf -- "${1}";
- fi; shift;
- done;
- else
- log_msg failexit "Error: build_fileop() called w/ invalid parameter(s) \`${@}'.";
- fi;
-};
-
-is_build_script_done() {
- local _done_fname="${WORKDIR}/.${1}.${2}" _restart_at="${3}";
- if [ -z "${_restart_at}" ]; then
- if [ -e "${_done_fname}" ]; then
- return 0; # Skip
- else
- return 1; # Build
- fi;
- elif [ "${_restart_at}" = "ALL" ]; then
- return 1; # Build
- elif lmatch "${_restart_at}" , "${2}"; then
- return 1; # Build
- else
- return 0; # Skip
- fi;
-};
-set_build_script_done() {
- local _pkg_fname="${1}";
- local _done_fname_pfx="${WORKDIR}/.${_pkg_fname}";
- shift; while [ ${#} -ge 1 ]; do
- if [ "${1#-}" != "${1}" ]; then
- build_fileop rm "${_done_fname_pfx}.${1#-}";
- else
- touch "${_done_fname_pfx}.${1}";
- log_msg info "Finished build step ${1} of package \`${_pkg_fname}'.";
- fi; shift;
- done;
-};
-
-lfilter() {
- [ "x${1}" = "x-not" ] && { local _notfl=1; shift; }
- local _list="${1}" _filter="${2}" _lnew _litem _lfilter _filterfl;
- [ -z "${_filter}" ] && { echo "${_list}"; return 0; };
- for _litem in ${_list}; do
- _filterfl=0;
- for _lfilter in ${_filter}; do
- if [ "${_notfl:-0}" -eq 0 ]\
- && [ "${_lfilter}" = "${_litem}" ]; then
- _lnew="${_lnew:+${_lnew} }${_litem}"; break;
- elif [ "${_notfl:-0}" -eq 1 ]\
- && [ "${_lfilter}" = "${_litem}" ]; then
- _filterfl=1; break;
- fi;
- done;
- if [ "${_notfl:-0}" -eq 1 ]\
- && [ "${_filterfl:-0}" -eq 0 ]; then
- _lnew="${_lnew:+${_lnew} }${_litem}";
- fi;
- done;
- echo "${_lnew}";
-};
-
-lmatch() {
- local _cmp="${3}"; push_IFS "${2}"; set -- ${1}; pop_IFS;
- while [ ${#} -gt 0 ]; do
- if [ "${1}" = "${_cmp}" ]; then
- return 0;
- fi; shift;
- done; return 1;
-};
-
-log_env_vars() {
- local _nvar=1 _arg _arg_len_max=0;
- log_msg info "Variables for this ${1:-build}:"; shift;
- while [ ${_nvar} -le ${#} ]; do
- _arg="$(eval echo \${${_nvar}})";
- _arg="${_arg%%=*}";
- if [ ${#_arg} -gt ${_arg_len_max} ]; then
- _arg_len_max=${#_arg};
- fi; : $((_nvar+=1));
- done;
- while [ ${#} -gt 0 ]; do
- log_msg info "$(printf \
- "%${_arg_len_max}.${_arg_len_max}s=%s" \
- "${1%%=*}" "$(get_var_unsafe ${1#*=})")";
- shift;
- done;
-};
-
-log_msg() {
- local _lvl="${1}"; shift;
- if [ "${_lvl#v}" != "${_lvl}" ]\
- && [ ${ARG_VERBOSE:-0} -eq 0 ]; then
- return;
- fi;
- case "${_lvl}" in
- failexit) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
- fail) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
- info) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;;
- vnfo) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;;
- succ) printf "\033[0m\033[${LOG_MSG_SUCC_COLOUR}m"; ;;
- warn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;;
- varn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;;
- esac;
- if [ ${#} -gt 1 ]; then
- printf "==> %s %s %s\033[0m\n" "$(date)" "${1}" "$*";
- else
- printf "==> %s %s\033[0m\n" "$(date)" "${1}";
- fi; [ ${_lvl} = failexit ] && exit 1 || return 0;
-};
-
-run_cmd_unsplit() {
- local _cmd="${1}" _cmdline _rc; shift;
- while [ ${#} -gt 0 ]; do
- [ -n "${1}" ] &&\
- _cmdline="${_cmdline:+${_cmdline}:}${1}";
- shift;
- done;
- push_IFS :; ${_cmd} ${_cmdline}; _rc=$?; pop_IFS;
- return ${_rc};
-};
-
-set_env_vars_with_sep() {
- local _sep="${1}"; shift; push_IFS ${_sep}; set -- ${1};
- while [ ${#} -gt 0 ]; do
- export "${1}"; shift;
- done; pop_IFS;
-};
-
-subst_tgts() {
- local _pkgs;
- while [ ${#} -ge 1 ]; do
- _pkgs="$(get_var_unsafe "$(toupper "${1}")_TARGET")";
- if [ -n "${_pkgs}" ]; then
- echo "${_pkgs}";
- else
- echo "${1}";
- fi; shift;
- done;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_setup_dispatch.subr b/subr/ex_pkg_dispatch.subr
index c4482578..99c9ff8f 100644
--- a/subr/pkg_setup_dispatch.subr
+++ b/subr/ex_pkg_dispatch.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_setup_dispatch() {
+ex_pkg_dispatch() {
local _tgt_name="${1}" _pkg_name="${2}" \
_restart="${3}" _restart_at="${4}" \
_pkg_step_cmds _pkg_step_cmd_args;
@@ -10,11 +10,14 @@ pkg_setup_dispatch() {
PKG_NAME_PARENT="${_pkg_name%_flavour_*}";
fi;
(set -o errexit -o noglob;
+ ex_pkg_vars; ex_pkg_env;
+ ex_build_fileop mkdir "${PKG_BASE_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}";
if [ -n "${_restart}" ]\
|| [ "${_tgt_name}" = "INVARIANTS" ]\
- || ! is_build_script_done "${_pkg_name}" finish; then
- set -- $(lfilter -not "${BUILD_STEPS}" \
- "$(get_var_unsafe PKG_$(toupper "${_pkg_name}")_BUILD_STEPS_DISABLE)");
+ || ! ex_pkg_state_test "${_pkg_name}" finish; then
+ set -- $(ex_lfilter -not "${BUILD_STEPS}" \
+ "$(ex_get_var_unsafe PKG_$(ex_toupper "${_pkg_name}")_BUILD_STEPS_DISABLE)");
while [ ${#} -gt 0 ]; do
_pkg_step_cmds=""; _pkg_step_cmd_args="";
case "${1#*:}" in
@@ -23,40 +26,41 @@ pkg_setup_dispatch() {
_pkg_step_cmds="pkg_${_pkg_name}_${1%:*} pkg_${1%:*}";
elif [ -n "${_restart}" ]; then
if [ -z "${_restart_at}" ]\
- || lmatch "${_restart_at}" , "${1%:*}"; then
+ || ex_lmatch "${_restart_at}" , "${1%:*}"; then
_pkg_step_cmds="pkg_${_pkg_name}_${1%:*} pkg_${1%:*}";
fi;
- elif ! is_build_script_done "${_pkg_name}" "${1%:*}"; then
+ elif ! ex_pkg_state_test "${_pkg_name}" "${1%:*}"; then
_pkg_step_cmds="pkg_${_pkg_name}_${1%:*} pkg_${1%:*}";
fi; ;;
invariant)
_pkg_step_cmds="pkg_${1%:*}"; ;;
variant)
- if lmatch "${_restart_at}" "," "${1%:*}"; then
+ if ex_lmatch "${_restart_at}" "," "${1%:*}"; then
_pkg_step_cmds="pkg_${_pkg_name}_${1%:*} pkg_${1%:*}";
fi; ;;
virtual)
_pkg_step_cmds="pkg_${_pkg_name}_${1%:*}";
_pkg_step_cmd_args="${_restart_at:-ALL}"; ;;
all)
- if test_cmd "pkg_${_pkg_name}_${1%:*}"; then
+ if ex_test_cmd "pkg_${_pkg_name}_${1%:*}"; then
"pkg_${_pkg_name}_${1%:*}" "${_restart_at:-ALL}";
break;
fi; ;;
- *) break; ;;
+ finish) ex_pkg_state_push "${_pkg_name}" finish; ;;
+ *) ;;
esac;
for __ in ${_pkg_step_cmds}; do
- if test_cmd "${__}"; then
- test_cmd "pkg_${_pkg_name}_${1%:*}_pre" \
+ if ex_test_cmd "${__}"; then
+ ex_test_cmd "pkg_${_pkg_name}_${1%:*}_pre" \
&& "pkg_${_pkg_name}_${1%:*}_pre"
"${__}" ${_pkg_step_cmd_args};
- test_cmd "pkg_${_pkg_name}_${1%:*}_post" \
+ ex_test_cmd "pkg_${_pkg_name}_${1%:*}_post" \
&& "pkg_${_pkg_name}_${1%:*}_post"
- if [ "${1#*:}" != "always" ]\
+ if [ "${1#*:}" != "invariant" ]\
&& [ ${#} -ge 2 ]; then
- set_build_script_done "${_pkg_name}" "${1%:*}" "-${2#*:}";
+ ex_pkg_state_push "${_pkg_name}" "${1%:*}" "-${2#*:}";
else
- set_build_script_done "${_pkg_name}" "${1%:*}";
+ ex_pkg_state_push "${_pkg_name}" "${1%:*}";
fi; break;
fi;
done;
diff --git a/subr/pkg_setup_env.subr b/subr/ex_pkg_env.subr
index f8d720d7..240c6289 100644
--- a/subr/pkg_setup_env.subr
+++ b/subr/ex_pkg_env.subr
@@ -2,18 +2,18 @@
# set -o errexit -o noglob are assumed.
#
-pkg_setup_env() {
+ex_pkg_env() {
+ local _vname;
if [ -z "${PKG_URL}" ]\
&& [ -z "${PKG_URLS_GIT}" ]\
&& [ -z "${PKG_VERSION}" ]\
&& ! test_cmd "pkg_${PKG_NAME}_all"; then
- log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars.";
+ ex_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}.'";
+ ex_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}";
case "${PKG_BASE_DIR}" in
@@ -21,7 +21,7 @@ pkg_setup_env() {
*) PKG_BASE_DIR="${WORKDIR}/${PKG_NAME}-${PKG_BUILD_TYPE:-native}-${PKG_TARGET}";
if [ -n "${ARG_RESTART}" ]\
&& [ -z "${ARG_RESTART_AT}" ]; then
- build_fileop rm "${PKG_BASE_DIR}";
+ ex_build_fileop rm "${PKG_BASE_DIR}";
fi; ;;
esac;
PKG_DESTDIR="${PKG_BASE_DIR}/destdir";
@@ -49,11 +49,14 @@ pkg_setup_env() {
esac; ;;
esac; ;;
esac;
+ for _vname in $(ex_split : ${PKG_ENV_VARS_EXTRA}); do
+ export "${_vname}";
+ done;
fi;
if [ -n "${PKG_ENV_VARS}" ]\
&& [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then
PKG_ENV_VARS="$(echo "${PKG_ENV_VARS}" | tr " " "\n" | sort | tr "\n" " ")";
- log_env_vars "build" ${PKG_ENV_VARS};
+ ex_log_env_vars "build" ${PKG_ENV_VARS};
fi;
};
diff --git a/subr/ex_pkg_state.subr b/subr/ex_pkg_state.subr
new file mode 100644
index 00000000..4cc0a8b0
--- /dev/null
+++ b/subr/ex_pkg_state.subr
@@ -0,0 +1,64 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+ex_pkg_state_build_dir() {
+ PKG_BUILD_DIR="${1}-${2}-${PKG_TARGET}";
+};
+
+ex_pkg_state_fini() {
+ : $((BUILD_TIMES_SECS=$(ex_date %s)-${BUILD_TIMES_SECS}));
+ : $((BUILD_TIMES_HOURS=${BUILD_TIMES_SECS}/3600));
+ : $((BUILD_TIMES_MINUTES=(${BUILD_TIMES_SECS}%3600)/60));
+ : $((BUILD_TIMES_SECS=(${BUILD_TIMES_SECS}%3600)%60));
+ if [ -f "${BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then
+ ex_build_fileop rm ${BUILD_STATUS_IN_PROGRESS_FNAME};
+ fi;
+};
+
+ex_pkg_state_init() {
+ if [ -e ${BUILD_STATUS_IN_PROGRESS_FNAME} ]; then
+ ex_log_msg failexit "Error: another build targeting this architecture and build type is currently in progress.";
+ else
+ touch ${BUILD_STATUS_IN_PROGRESS_FNAME};
+ fi;
+ if [ -e ${BUILD_LOG_FNAME} ]; then
+ mv -- ${BUILD_LOG_FNAME} ${BUILD_LOG_LAST_FNAME};
+ fi;
+ BUILD_DATE_START="$(ex_date %Y-%m-%d-%H-%M-%S)";
+ BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}};
+ BUILD_TIMES_SECS=$(ex_date %s);
+ BUILD_PKGS_FAILED="";
+};
+
+ex_pkg_state_push() {
+ local _pkg_fname="${1}";
+ local _done_fname_pfx="${WORKDIR}/.${_pkg_fname}";
+ shift; while [ ${#} -ge 1 ]; do
+ if [ "${1#-}" != "${1}" ]; then
+ ex_build_fileop rm "${_done_fname_pfx}.${1#-}";
+ else
+ touch "${_done_fname_pfx}.${1}";
+ ex_log_msg info "Finished build step ${1} of package \`${_pkg_fname}'.";
+ fi; shift;
+ done;
+};
+
+ex_pkg_state_test() {
+ local _done_fname="${WORKDIR}/.${1}.${2}" _restart_at="${3}";
+ if [ -z "${_restart_at}" ]; then
+ if [ -e "${_done_fname}" ]; then
+ return 0; # Skip
+ else
+ return 1; # Build
+ fi;
+ elif [ "${_restart_at}" = "ALL" ]; then
+ return 1; # Build
+ elif ex_lmatch "${_restart_at}" , "${2}"; then
+ return 1; # Build
+ else
+ return 0; # Skip
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_setup_vars.subr b/subr/ex_pkg_vars.subr
index fc9f8537..07c2cacd 100644
--- a/subr/pkg_setup_vars.subr
+++ b/subr/ex_pkg_vars.subr
@@ -2,19 +2,19 @@
# set -o errexit -o noglob are assumed.
#
-pkgp_setup_pkg_vars() {
+exp_pkg_vars() {
local _pkg_name="${1}" _pkg_name_uc _build_uc _vname_dst _vname_src;
- _pkg_name_uc="$(toupper "${_pkg_name}")";
- _build_uc="$(toupper "${BUILD}")";
+ _pkg_name_uc="$(ex_toupper "${_pkg_name}")";
+ _build_uc="$(ex_toupper "${BUILD}")";
for _vname_dst in PREFIX ${PKG_BUILD_VARS}; do
for _vname_src in \
"DEFAULT_${_vname_dst}" \
"${BUILD_TARGET}_${_vname_dst}" \
"PKG_${_pkg_name_uc}_${_vname_dst}" \
"PKG_${_pkg_name_uc}_${_vname_dst}_${_build_uc}"; do
- if [ -n "$(get_var_unsafe "${_vname_src}")" ]; then
- set_var_unsafe "PKG_${_vname_dst}" "$(get_var_unsafe ${_vname_src})";
- if ! lmatch "${PKG_ENV_VARS}" " " "${_vname_src}"; then
+ if [ -n "$(ex_get_var_unsafe "${_vname_src}")" ]; then
+ ex_set_var_unsafe "PKG_${_vname_dst}" "$(ex_get_var_unsafe ${_vname_src})";
+ if ! ex_lmatch "${PKG_ENV_VARS}" " " "${_vname_src}"; then
PKG_ENV_VARS="${PKG_ENV_VARS:+${PKG_ENV_VARS} }${_vname_src}";
fi;
fi;
@@ -22,7 +22,7 @@ pkgp_setup_pkg_vars() {
done;
};
-pkg_setup_vars() {
+ex_pkg_vars() {
local _vars_path;
for _vars_path in vars/${PKG_NAME}.vars; do
if [ -e "${_vars_path}" ]\
@@ -31,9 +31,9 @@ pkg_setup_vars() {
fi;
done;
if [ -n "${PKG_NAME_PARENT}" ]; then
- pkgp_setup_pkg_vars "${PKG_NAME_PARENT}";
+ exp_pkg_vars "${PKG_NAME_PARENT}";
fi;
- pkgp_setup_pkg_vars "${PKG_NAME}";
+ exp_pkg_vars "${PKG_NAME}";
};
# vim:filetype=sh
diff --git a/subr/ex_rtl.subr b/subr/ex_rtl.subr
new file mode 100644
index 00000000..b014a384
--- /dev/null
+++ b/subr/ex_rtl.subr
@@ -0,0 +1,60 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+IFS_NL="
+";
+
+ex_basename() { echo "${1##*/}"; };
+ex_date() { command date "+${1:-${TIMESTAMP_FMT}}"; };
+ex_dirname() { echo "${1%/*}"; };
+ex_get_var_unsafe() { eval echo \${${1}}; };
+ex_set_var_unsafe() { [ -n "${2}" ] && eval ${1}=\"${2}\" || return 0; };
+ex_split() { local IFS="${1}"; set -- $(echo "${2}"); IFS="${IFS_NL}"; echo "${*}"; };
+ex_test_cmd() { command -v "${1}" >/dev/null; };
+ex_toupper() { echo "${1}" | tr a-z A-Z; };
+
+ex_lfilter() {
+ [ "x${1}" = "x-not" ] && { local _notfl=1; shift; }
+ local _list="${1}" _filter="${2}" _lnew _litem _ex_lfilter _filterfl;
+ [ -z "${_filter}" ] && { echo "${_list}"; return 0; };
+ for _litem in ${_list}; do
+ _filterfl=0;
+ for _ex_lfilter in ${_filter}; do
+ if [ "${_notfl:-0}" -eq 0 ]\
+ && [ "${_ex_lfilter}" = "${_litem}" ]; then
+ _lnew="${_lnew:+${_lnew} }${_litem}"; break;
+ elif [ "${_notfl:-0}" -eq 1 ]\
+ && [ "${_ex_lfilter}" = "${_litem}" ]; then
+ _filterfl=1; break;
+ fi;
+ done;
+ if [ "${_notfl:-0}" -eq 1 ]\
+ && [ "${_filterfl:-0}" -eq 0 ]; then
+ _lnew="${_lnew:+${_lnew} }${_litem}";
+ fi;
+ done;
+ echo "${_lnew}";
+};
+
+ex_lmatch() {
+ local _cmp="${3}" IFS="${2}"; set -- ${1};
+ while [ ${#} -gt 0 ]; do
+ if [ "${1}" = "${_cmp}" ]; then
+ return 0;
+ fi; shift;
+ done; return 1;
+};
+
+ex_run_cmd_unsplit() {
+ local _cmd="${1}" _cmdline _rc IFS; shift;
+ while [ ${#} -gt 0 ]; do
+ [ -n "${1}" ] &&\
+ _cmdline="${_cmdline:+${_cmdline}:}${1}";
+ shift;
+ done;
+ IFS=:; ${_cmd} ${_cmdline}; _rc=$?;
+ return ${_rc};
+};
+
+# vim:filetype=sh
diff --git a/subr/ex_rtl_fileop.subr b/subr/ex_rtl_fileop.subr
new file mode 100644
index 00000000..3732ab5e
--- /dev/null
+++ b/subr/ex_rtl_fileop.subr
@@ -0,0 +1,39 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+ex_build_fileop() {
+ local _op="${1}"; shift;
+ if [ "${_op}" = cd ]; then
+ ex_log_msg varn "Changing working directory to \`${1}'.";
+ [ \( -n "${1}" \) -a \( -L "${1}" -o -e "${1}" \) ] && cd -- "${1}";
+ elif [ "${_op}" = cp ]; then
+ ex_log_msg varn "Copying \`${1}' to \`${2}' w/ -pPR.";
+ [ ${#} -ge 2 ] && cp -pPR -- "${@}";
+ elif [ "${_op}" = ln_symbolic ]; then
+ ex_log_msg varn "Linking \`${1}' to \`${2}' w/ -fs";
+ [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}";
+ elif [ "${_op}" = mv ]; then
+ ex_log_msg varn "Moving \`${1}' to \`${2}' w/ -fs";
+ [ \( -n "${1}" \) -a \( -n "${2}" \) ] && mv -f -- "${1}" "${2}";
+ elif [ "${_op}" = mkdir ]\
+ || [ "${_op}" = rm ]; then
+ while [ ${#} -gt 0 ]; do
+ if [ -z "${1}" ]; then
+ return 1;
+ elif [ "${_op}" = mkdir ]\
+ && [ ! -e "${1}" ]; then
+ ex_log_msg varn "Making directory \`${1}'.";
+ mkdir -p -- "${1}";
+ elif [ "${_op}" = rm ]\
+ && [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then
+ ex_log_msg varn "Removing directory or file \`${1}'.";
+ rm -rf -- "${1}";
+ fi; shift;
+ done;
+ else
+ ex_log_msg failexit "Error: ex_build_fileop() called w/ invalid parameter(s) \`${@}'.";
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/ex_rtl_log.subr b/subr/ex_rtl_log.subr
new file mode 100644
index 00000000..f4e250a5
--- /dev/null
+++ b/subr/ex_rtl_log.subr
@@ -0,0 +1,45 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+ex_log_env_vars() {
+ local _nvar=1 _arg _arg_len_max=0;
+ ex_log_msg info "Variables for this ${1:-build}:"; shift;
+ while [ ${_nvar} -le ${#} ]; do
+ _arg="$(eval echo \${${_nvar}})";
+ _arg="${_arg%%=*}";
+ if [ ${#_arg} -gt ${_arg_len_max} ]; then
+ _arg_len_max=${#_arg};
+ fi; : $((_nvar+=1));
+ done;
+ while [ ${#} -gt 0 ]; do
+ ex_log_msg info "$(printf \
+ "%${_arg_len_max}.${_arg_len_max}s=%s" \
+ "${1%%=*}" "$(ex_get_var_unsafe ${1#*=})")";
+ shift;
+ done;
+};
+
+ex_log_msg() {
+ local _lvl="${1}"; shift;
+ if [ "${_lvl#v}" != "${_lvl}" ]\
+ && [ ${ARG_VERBOSE:-0} -eq 0 ]; then
+ return;
+ fi;
+ case "${_lvl}" in
+ failexit) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
+ fail) printf "\033[0m\033[${LOG_MSG_FAIL_COLOUR}m"; ;;
+ info) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;;
+ vnfo) printf "\033[0m\033[${LOG_MSG_INFO_COLOUR}m"; ;;
+ succ) printf "\033[0m\033[${LOG_MSG_SUCC_COLOUR}m"; ;;
+ warn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;;
+ varn) printf "\033[0m\033[${LOG_MSG_WARN_COLOUR}m"; ;;
+ esac;
+ if [ ${#} -gt 1 ]; then
+ printf "==> %s %s %s\033[0m\n" "$(ex_date)" "${1}" "$*";
+ else
+ printf "==> %s %s\033[0m\n" "$(ex_date)" "${1}";
+ fi; [ ${_lvl} = failexit ] && exit 1 || return 0;
+};
+
+# vim:filetype=sh
diff --git a/subr/pre_setup_args.subr b/subr/ex_setup_args.subr
index e9c10a50..637a7d38 100644
--- a/subr/pre_setup_args.subr
+++ b/subr/ex_setup_args.subr
@@ -16,7 +16,7 @@ BUILD_ARGS_SPEC="
ARG_VERBOSE:-v
ARG_XTRACE:-x";
-pre_setup_args() {
+ex_setup_args() {
local _spec="${BUILD_ARGS_SPEC}" _spec_arg _found;
while [ ${#} -gt 0 ]; do
if [ "${1#-}" = "${1}" ]; then
@@ -26,11 +26,11 @@ pre_setup_args() {
case "${_spec_arg}" in
*:${1}) case "${_spec_arg#*:}" in
arg:*)
- set_var_unsafe "${_spec_arg%%:*}" "${2}"; shift; ;;
+ ex_set_var_unsafe "${_spec_arg%%:*}" "${2}"; shift; ;;
selfarg:*)
- set_var_unsafe "${_spec_arg%%:*}" "${1}"; ;;
+ ex_set_var_unsafe "${_spec_arg%%:*}" "${1}"; ;;
*)
- set_var_unsafe "${_spec_arg%%:*}" 1; ;;
+ ex_set_var_unsafe "${_spec_arg%%:*}" 1; ;;
esac; _found=1; break; ;;
*) _found=0; ;;
esac;
@@ -59,7 +59,7 @@ pre_setup_args() {
fi;
while [ ${#} -gt 0 ]; do
case "${1}" in
- *=*) set_var_unsafe "${1%%=*}" "${1#*=}"; ;;
+ *=*) ex_set_var_unsafe "${1%%=*}" "${1#*=}"; ;;
*) BUILD_TARGETS_META="${BUILD_TARGETS_META:+${BUILD_TARGETS_META} }${1}"; ;;
esac; shift; done;
};
diff --git a/subr/pre_check.subr b/subr/ex_setup_checks.subr
index 28e229e9..803810d2 100644
--- a/subr/pre_check.subr
+++ b/subr/ex_setup_checks.subr
@@ -2,31 +2,31 @@
# set -o errexit -o noglob are assumed.
#
-pre_check() {
+ex_setup_checks() {
local __ _exit;
for __ in ${CHECK_PATH_VARS}; do
- if [ -z "${___:=$(get_var_unsafe "${__}")}" ]; then
- log_msg failexit "Error: variable \`${__}' is empty or unset.";
+ if [ -z "${___:=$(ex_get_var_unsafe "${__}")}" ]; then
+ ex_log_msg failexit "Error: variable \`${__}' is empty or unset.";
elif [ "${___#* *}" != "${___}" ]; then
- log_msg failexit "Error: variable \`${__}' contains one or more whitespace characters.";
+ ex_log_msg failexit "Error: variable \`${__}' contains one or more whitespace characters.";
fi;
done;
for __ in ${CHECK_PREREQ_CMDS} $(eval echo ${CHECK_PREREQ_FILES_DYNAMIC}) ${CHECK_PREREQ_FILES}; do
if [ "${__#/}" != "${__}" ]; then
if [ ! -e "${__}" ]; then
- log_msg fail "Error: missing prerequisite file \`${__}'.";
+ ex_log_msg fail "Error: missing prerequisite file \`${__}'.";
_exit=1;
fi;
else
- if ! test_cmd "${__}"; then
- log_msg fail "Error: missing prerequisite command \`${__}'.";
+ if ! ex_test_cmd "${__}"; then
+ ex_log_msg fail "Error: missing prerequisite command \`${__}'.";
_exit=1;
fi;
fi;
done;
for __ in ${CHECK_PREREQ_PERL_MODULES}; do
if ! perl -M"${__}" -e "" 2>/dev/null; then
- log_msg fail "Error: missing prerequisite Perl module \`${__}'.";
+ ex_log_msg fail "Error: missing prerequisite Perl module \`${__}'.";
_exit=1;
fi;
done;
diff --git a/subr/pre_setup_env.subr b/subr/ex_setup_env.subr
index c1876d31..8907d7eb 100644
--- a/subr/pre_setup_env.subr
+++ b/subr/ex_setup_env.subr
@@ -1,4 +1,4 @@
-pre_setup_env() {
+ex_setup_env() {
local __;
set -o noglob;
if [ -z "${DEFAULT_BUILD_CPUS}" ]\
@@ -13,9 +13,9 @@ pre_setup_env() {
else
if [ "${BUILD}" != debug ]\
&& [ "${BUILD}" != release ]; then
- log_msg failexit "Error: unknown build type \`${BUILD}'.";
+ ex_log_msg failexit "Error: unknown build type \`${BUILD}'.";
fi;
- log_msg failexit "Error: invalid architecture \`${ARCH}'.";
+ ex_log_msg failexit "Error: invalid architecture \`${ARCH}'.";
fi;
for __ in ${HOME}/midipix_build.vars ../midipix_build.vars ./vars/env.vars ./vars/build.vars; do
[ -e ${__} ] && . ${__};
@@ -27,7 +27,7 @@ pre_setup_env() {
DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}";
fi;
for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do
- if ! lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
+ if ! ex_lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then
unset "${__}";
fi;
done;
diff --git a/subr/pre_subdirs.subr b/subr/ex_setup_subdirs.subr
index f40b3ba3..9385a339 100644
--- a/subr/pre_subdirs.subr
+++ b/subr/ex_setup_subdirs.subr
@@ -2,10 +2,10 @@
# set -o errexit -o noglob are assumed.
#
-pre_subdirs() {
+ex_setup_subdirs() {
local __;
if [ ${ARG_CLEAN:-0} -eq 1 ]; then
- log_msg info "-c specified, cleaning prefix...";
+ ex_log_msg info "-c specified, cleaning prefix...";
for __ in ${CLEAR_PREFIX_DIRS}; do
if [ -e ${PREFIX}/${__} ]; then
build_rm ${PREFIX}/${__};
diff --git a/subr/pkg_build.subr b/subr/pkg_build.subr
index 70801628..dd2e8f2e 100644
--- a/subr/pkg_build.subr
+++ b/subr/pkg_build.subr
@@ -10,7 +10,7 @@ pkg_build() {
# N.B. We only specify CC= here if the current package does not use GNU
# autoconf as it often abuses it by appending -std={gnu99,...} to it
# instead of amending CFLAGS.
- run_cmd_unsplit make \
+ ex_run_cmd_unsplit make \
${PKG_MAKEFLAGS_BUILD} \
${PKG_MAKEFLAGS_BUILD_EXTRA} \
AR=${AR} ${_no_autoconf:+CC=${CC}} RANLIB=${RANLIB} \
diff --git a/subr/pkg_configure_autotools.subr b/subr/pkg_configure_autotools.subr
index dbad6a30..6bc7593c 100644
--- a/subr/pkg_configure_autotools.subr
+++ b/subr/pkg_configure_autotools.subr
@@ -12,7 +12,7 @@ pkg_configure_autotools() {
&& [ ! -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]; then
for _script_fname in bootstrap bootstrap.sh autogen.sh ""; do
if [ -z "${_script_fname}" ]; then
- (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf)\
+ (ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf)\
|| exit 1 && break;
elif [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/${_script_fname}" ]; then
for _subdir_tgt in "${PKG_BASE_DIR}/${PKG_SUBDIR}/build-aux" "${PKG_BASE_DIR}/${PKG_SUBDIR}"; do
@@ -26,7 +26,7 @@ pkg_configure_autotools() {
break;
fi;
done;
- (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && \
+ (ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && \
"${SHELL}" "${_script_fname}") || exit 1 && break;
fi;
done;
@@ -37,7 +37,7 @@ pkg_configure_autotools() {
-exec echo install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" {} \; \
-exec install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" {} \;;
if [ "${PKG_BUILD_TYPE}" != host ]; then
- build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${PKG_BUILD_DIR}/";
+ ex_build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${PKG_BUILD_DIR}/";
fi;
fi;
};
diff --git a/subr/pkg_configure_patch.subr b/subr/pkg_configure_patch.subr
index f40d73d7..5dfda784 100644
--- a/subr/pkg_configure_patch.subr
+++ b/subr/pkg_configure_patch.subr
@@ -6,9 +6,9 @@ pkg_configure_patch() {
local _patch_fname _patches_done;
set +o noglob;
for _patch_fname in \
- ${WORKDIR}/chainport-native-${PKG_TARGET}/chainport/${PKG_NAME}.midipix.patch \
- ${WORKDIR}/chainport-native-${PKG_TARGET}/chainport/${PKG_SUBDIR}.midipix.patch \
- ${WORKDIR}/chainport-native-${PKG_TARGET}/chainport/${PKG_SUBDIR%-*}.midipix.patch \
+ ${WORKDIR}/chainport-host-invariants/chainport/${PKG_NAME}.midipix.patch \
+ ${WORKDIR}/chainport-host-invariants/chainport/${PKG_SUBDIR}.midipix.patch \
+ ${WORKDIR}/chainport-host-invariants/chainport/${PKG_SUBDIR%-*}.midipix.patch \
${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch \
${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}/*.patch \
${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}/*.patch \
@@ -18,7 +18,7 @@ pkg_configure_patch() {
${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local@${BUILD_HNAME}.patch \
${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local@${BUILD_HNAME}.patch \
${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local@${BUILD_HNAME}.patch; do
- if ! lmatch "${_patches_done}" " " "${_patch_fname}"\
+ 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}";
diff --git a/subr/pkg_fetch_distclean.subr b/subr/pkg_fetch_distclean.subr
new file mode 100644
index 00000000..19f0b741
--- /dev/null
+++ b/subr/pkg_fetch_distclean.subr
@@ -0,0 +1,15 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_fetch_distclean() {
+ if [ "$(stat -c %i "${PKG_BASE_DIR}")" \
+ != "$(stat -c %i "${WORKDIR}")" ]; then
+ ex_build_fileop cd "${WORKDIR}";
+ ex_build_fileop rm "${PKG_BASE_DIR}";
+ ex_build_fileop mkdir "${PKG_BASE_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}";
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_fetch_extract.subr b/subr/pkg_fetch_extract.subr
index 71155b44..33d450d2 100644
--- a/subr/pkg_fetch_extract.subr
+++ b/subr/pkg_fetch_extract.subr
@@ -5,7 +5,7 @@
pkg_fetch_extract() {
if [ -n "${PKG_URL}" ]\
&& [ "${PKG_URL_TYPE:-wget}" = wget ]; then
- build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}";
+ ex_build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}";
if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then
bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -;
elif [ "${PKG_FNAME##*.tar.}" = "gz" ]; then
diff --git a/subr/pkg_fetch_git.subr b/subr/pkg_fetch_git.subr
index 0ff61ae2..8340ca4f 100644
--- a/subr/pkg_fetch_git.subr
+++ b/subr/pkg_fetch_git.subr
@@ -6,20 +6,20 @@ pkgp_fetch_git() {
local _tgtdir="${1}" _subdir="${2}" _url="${3}" _branch="${4}";
if [ "${ARG_OFFLINE:-0}" -eq 0 ]; then
if [ -e "${DLCACHEDIR}/${_subdir}" ]; then
- (build_fileop cd "${DLCACHEDIR}/${_subdir}" &&\
+ (ex_build_fileop cd "${DLCACHEDIR}/${_subdir}" &&\
git pull origin "${_branch:-main}");
else
git clone "${_url}" "${DLCACHEDIR}/${_subdir}";
if [ -n "${_branch}" -a \
\( -z "${_branch#main}" \) -a \
\( -z "${_branch#master}" \) ]; then
- (build_fileop cd "${DLCACHEDIR}/${_subdir}" &&\
+ (ex_build_fileop cd "${DLCACHEDIR}/${_subdir}" &&\
git checkout -b "${_branch}");
fi;
fi;
fi;
- build_fileop rm "${_tgtdir}/${_subdir}";
- build_fileop cp "${DLCACHEDIR}/${_subdir}" "${_tgtdir}";
+ ex_build_fileop rm "${_tgtdir}/${_subdir}";
+ ex_build_fileop cp "${DLCACHEDIR}/${_subdir}" "${_tgtdir}";
};
pkgp_fetch_urls_git() {
diff --git a/subr/pkg_fetch_subdirs.subr b/subr/pkg_fetch_subdirs.subr
index 680871e2..7d097d03 100644
--- a/subr/pkg_fetch_subdirs.subr
+++ b/subr/pkg_fetch_subdirs.subr
@@ -15,9 +15,9 @@ pkg_fetch_subdirs() {
PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
fi;
if [ ! -d "${PKG_BUILD_DIR}" ]; then
- build_fileop mkdir "${PKG_BUILD_DIR}";
+ ex_build_fileop mkdir "${PKG_BUILD_DIR}";
fi;
- build_fileop cd "${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BUILD_DIR}";
};
# vim:filetype=sh
diff --git a/subr/pkg_fetch_wget.subr b/subr/pkg_fetch_wget.subr
index 5dd0cc55..731354e8 100644
--- a/subr/pkg_fetch_wget.subr
+++ b/subr/pkg_fetch_wget.subr
@@ -6,7 +6,7 @@
pkgp_fetch_wget() {
local _url="${1}" _sha256sum_src="${2}";
if [ -z "${3}" ]; then
- _url_dst="${DLCACHEDIR}/$(basename "${_url}")";
+ _url_dst="${DLCACHEDIR}/$(ex_basename "${_url}")";
else
_url_dst="${DLCACHEDIR}/${3}";
fi;
@@ -20,9 +20,9 @@ pkgp_fetch_wget() {
set -- $(openssl dgst -sha256 "${_url_dst}"); shift $((${#}-1));
if [ "${_sha256sum_dst:=${1}}" != "${_sha256sum_src}" ]; then
if [ "${ARG_IGNORE_SHA256SUMS:-0}" -eq 0 ]; then
- log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
+ ex_log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
else
- log_msg warn "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
+ ex_log_msg warn "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
fi;
fi;
fi;
diff --git a/subr/pkg_finish.subr b/subr/pkg_finish.subr
deleted file mode 100644
index 609f2b6e..00000000
--- a/subr/pkg_finish.subr
+++ /dev/null
@@ -1,9 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_finish() {
- :;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index fa890d4d..ca85f4d1 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -6,7 +6,7 @@ pkg_install() {
local _dst_path;
for _dst_path in "${PKG_PREFIX}" "${PKG_PREFIX_EXTRA}"; do
if [ -n "${_dst_path}" ]; then
- build_fileop mkdir "${_dst_path}";
+ ex_build_fileop mkdir "${_dst_path}";
tar -C "${PKG_DESTDIR}" -cpf - . |\
tar -C "${_dst_path}" -xpf -;
fi;
diff --git a/subr/pkg_install_files.subr b/subr/pkg_install_files.subr
index d82b665d..88acf60d 100644
--- a/subr/pkg_install_files.subr
+++ b/subr/pkg_install_files.subr
@@ -18,16 +18,16 @@ pkgp_install_files() {
_ln_fname="${_prefix:+${_prefix}/}${_ln_fname}";
fi;
if [ -e "${_ln_fname}" ]; then
- build_fileop rm "${_ln_fname}";
+ ex_build_fileop rm "${_ln_fname}";
fi;
- build_fileop ln_symbolic "${_ln_target}" "${_ln_fname}";
+ ex_build_fileop ln_symbolic "${_ln_target}" "${_ln_fname}";
;;
/=*)
_mkdir_fname="${1#/=}";
if [ "${_mkdir_fname#/}" = "${_mkdir_fname}" ]; then
_mkdir_fname="${_prefix:+${_prefix}/}${_mkdir_fname}";
fi;
- build_fileop mkdir "${_mkdir_fname}";
+ ex_build_fileop mkdir "${_mkdir_fname}";
;;
*)
_file_fname_src="${1%=*}";
@@ -35,7 +35,7 @@ pkgp_install_files() {
if [ "${_file_fname_dst#/}" = "${_file_fname_dst}" ]; then
_file_fname_dst="${_prefix:+${_prefix}/}${_file_fname_dst}";
fi;
- build_fileop cp "${_file_fname_src}" "${_file_fname_dst}";
+ ex_build_fileop cp "${_file_fname_src}" "${_file_fname_dst}";
;;
esac; shift;
done;
diff --git a/subr/pkg_install_libs.subr b/subr/pkg_install_libs.subr
index 56152a0c..1894a2d0 100644
--- a/subr/pkg_install_libs.subr
+++ b/subr/pkg_install_libs.subr
@@ -21,8 +21,8 @@ pkgp_install_lib_link() {
sort | tail -1)";
if [ -n "${_lib_link_tgt}" ]; then
_lib_link_path="${_so_path%.so*}.lib.a";
- build_fileop rm "${_lib_link_path}";
- build_fileop ln_symbolic "$(basename "${_lib_link_tgt}")" \
+ ex_build_fileop rm "${_lib_link_path}";
+ ex_build_fileop ln_symbolic "$(ex_basename "${_lib_link_tgt}")" \
"${_lib_link_path}";
fi;
};
@@ -40,7 +40,7 @@ pkg_install_libs() {
*.so) _lib_src_path="${_so_src_path%%.so}.lib.a"; ;;
*.so.*) _lib_src_path="${_so_src_path%%.so.*}.${_so_src_path##*.so.}.lib.a"; ;;
esac;
- _lib_name="$(basename "${_lib_src_path}")";
+ _lib_name="$(ex_basename "${_lib_src_path}")";
_so_dst_dir="${_so_src_path%/*}";
fi;
if [ ! -L "${_lib_src_path}" ]; then
diff --git a/subr/pkg_install_make.subr b/subr/pkg_install_make.subr
index a9841655..8207d7e8 100644
--- a/subr/pkg_install_make.subr
+++ b/subr/pkg_install_make.subr
@@ -3,7 +3,7 @@
#
pkg_install_make() {
- run_cmd_unsplit make \
+ ex_run_cmd_unsplit make \
${PKG_MAKEFLAGS_INSTALL} \
${PKG_MAKEFLAGS_INSTALL_EXTRA} \
AR=${AR} CC=${CC} RANLIB=${RANLIB} \
diff --git a/subr/pkg_install_purge_la.subr b/subr/pkg_install_purge_la.subr
index be5ab489..61725673 100644
--- a/subr/pkg_install_purge_la.subr
+++ b/subr/pkg_install_purge_la.subr
@@ -5,7 +5,7 @@
pkg_install_purge_la() {
local _la_path;
for _la_path in $(find "${PKG_DESTDIR}" -type f -name \*.la); do
- build_fileop rm ${_la_path};
+ ex_build_fileop rm ${_la_path};
done;
};
diff --git a/subr/pkg_install_strip.subr b/subr/pkg_install_strip.subr
index 53282187..e91e6eaf 100644
--- a/subr/pkg_install_strip.subr
+++ b/subr/pkg_install_strip.subr
@@ -11,8 +11,8 @@ pkgp_strip_tree() {
\( -type f -or -type l \)); do
set +o errexit;
if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then
- log_msg info "Stripping ${_bin_path}...";
- log_msg vnfo "${TARGET}-strip ${_bin_path}";
+ ex_log_msg info "Stripping ${_bin_path}...";
+ ex_log_msg vnfo "${TARGET}-strip ${_bin_path}";
${TARGET}-strip ${_bin_path};
fi;
set -o errexit;
diff --git a/subr/pkg_setup_distclean.subr b/subr/pkg_setup_distclean.subr
deleted file mode 100644
index fc5999c8..00000000
--- a/subr/pkg_setup_distclean.subr
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_setup_distclean() {
- if [ "$(stat -c %i "${PKG_BASE_DIR}")" \
- != "$(stat -c %i "${WORKDIR}")" ]; then
- build_fileop rm "${PKG_BASE_DIR}";
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_setup_subdirs.subr b/subr/pkg_setup_subdirs.subr
deleted file mode 100644
index 1fc279cb..00000000
--- a/subr/pkg_setup_subdirs.subr
+++ /dev/null
@@ -1,10 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_setup_subdirs() {
- build_fileop mkdir "${PKG_BASE_DIR}";
- build_fileop cd "${PKG_BASE_DIR}";
-};
-
-# vim:filetype=sh
diff --git a/subr/pre_state.subr b/subr/pre_state.subr
deleted file mode 100644
index 58bfc59a..00000000
--- a/subr/pre_state.subr
+++ /dev/null
@@ -1,31 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pre_state() {
- case "${1}" in
- fini) : $((BUILD_TIMES_SECS=$(command date +%s)-${BUILD_TIMES_SECS}));
- : $((BUILD_TIMES_HOURS=${BUILD_TIMES_SECS}/3600));
- : $((BUILD_TIMES_MINUTES=(${BUILD_TIMES_SECS}%3600)/60));
- : $((BUILD_TIMES_SECS=(${BUILD_TIMES_SECS}%3600)%60));
- if [ -f "${BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then
- build_fileop rm ${BUILD_STATUS_IN_PROGRESS_FNAME};
- fi;
- ;;
- init) if [ -e ${BUILD_STATUS_IN_PROGRESS_FNAME} ]; then
- log_msg failexit "Error: another build targeting this architecture and build type is currently in progress.";
- else
- touch ${BUILD_STATUS_IN_PROGRESS_FNAME};
- fi;
- if [ -e ${BUILD_LOG_FNAME} ]; then
- mv -- ${BUILD_LOG_FNAME} ${BUILD_LOG_LAST_FNAME};
- fi;
- BUILD_DATE_START="$(date %Y-%m-%d-%H-%M-%S)";
- BUILD_NFINI=${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}};
- BUILD_TIMES_SECS=$(command date +%s);
- BUILD_PKGS_FAILED="";
- ;;
- esac;
-};
-
-# vim:filetype=sh
diff --git a/vars/build.vars b/vars/build.vars
index b42b68ed..a792d3d5 100644
--- a/vars/build.vars
+++ b/vars/build.vars
@@ -1,6 +1,7 @@
#
# Build target invariants
#
+INVARIANTS_BUILD_TYPE="host";
INVARIANTS_PACKAGES="chainport";
: ${PKG_CHAINPORT_URLS_GIT:="chainport=${DEFAULT_GITROOT}/ports/chainport"};
: ${PKG_CHAINPORT_BUILD_STEPS_DISABLE:="configure:dynamic build:dynamic install_make:dynamic install:dynamic"};
@@ -949,6 +950,7 @@ DIST_PACKAGES="dist_etc dist_digest dist_tarballs";
#
# Build meta-targets
#
+INVARIANTS_TARGET="invariants";
DEVROOT_TARGET="host_toolchain native_toolchain runtime";
DEV_TARGET="${DEVROOT_TARGET} dev_packages";
WORLD_TARGET="${DEVROOT_TARGET} host_packages lib_packages leaf_packages minipix dist";
diff --git a/vars/clang_host.vars b/vars/clang_host.vars
index 06bf2001..01413bee 100644
--- a/vars/clang_host.vars
+++ b/vars/clang_host.vars
@@ -3,10 +3,10 @@
#
pkg_clang_host_configure() {
- build_fileop rm "../cfe-${PKG_VERSION}-host";
- build_fileop mkdir "../cfe-${PKG_VERSION}-host";
- build_fileop cd "../cfe-${PKG_VERSION}-host";
- log_msg info "Bootstrapping clang_host...";
+ ex_build_fileop rm "../cfe-${PKG_VERSION}-host";
+ ex_build_fileop mkdir "../cfe-${PKG_VERSION}-host";
+ ex_build_fileop cd "../cfe-${PKG_VERSION}-host";
+ ex_log_msg info "Bootstrapping clang_host...";
("${PREFIX}/bin/cmake" \
"../cfe-${PKG_VERSION}.src" \
-DCLANG_BUILD_EXAMPLES:BOOL=OFF \
@@ -19,7 +19,7 @@ pkg_clang_host_configure() {
-DLLVM_PREFIX="${PKG_PREFIX}" \
-G "Unix Makefiles" \
-Wno-dev);
- log_msg info "Finished bootstrapping clang_host.";
+ ex_log_msg info "Finished bootstrapping clang_host.";
};
# vim:filetype=sh
diff --git a/vars/cmake.vars b/vars/cmake.vars
index de8aa90c..2c8d19dc 100644
--- a/vars/cmake.vars
+++ b/vars/cmake.vars
@@ -3,7 +3,7 @@
#
pkg_cmake_configure() {
- build_fileop cp "${PREFIX}/share/cmake-${PKG_VERSION%.*}/Modules/Platform/BSDOS.cmake" \
+ ex_build_fileop cp "${PREFIX}/share/cmake-${PKG_VERSION%.*}/Modules/Platform/BSDOS.cmake" \
"${PREFIX}/share/cmake-${PKG_VERSION%.*}/Modules/Platform/Midipix.cmake";
rm -f config.cache;
env CFLAGS="-L${PKG_PREFIX}/lib --sysroot=${PKG_PREFIX}" \
diff --git a/vars/dist_digest.vars b/vars/dist_digest.vars
index 5d28af38..de94df72 100644
--- a/vars/dist_digest.vars
+++ b/vars/dist_digest.vars
@@ -5,9 +5,9 @@
pkg_dist_digest_all() {
local __;
if [ -n "${ARG_TARBALL}" ]; then
- log_msg info "Compiling SHA256 sums...";
+ ex_log_msg info "Compiling SHA256 sums...";
if [ -e "${PREFIX}/SHA256SUMS" ]; then
- build_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last";
+ ex_build_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last";
fi;
(cd "${PREFIX}";
for __ in $(find "${PREFIX_NATIVE#${PREFIX}/}" -type f -perm /a=x \
diff --git a/vars/dist_tarballs.vars b/vars/dist_tarballs.vars
index 43f52184..f39ac170 100644
--- a/vars/dist_tarballs.vars
+++ b/vars/dist_tarballs.vars
@@ -11,12 +11,12 @@ pkgp_dist_tarball_dist() {
-not -path ./tmp -not -path ./tmp/\*) \
midipix_shortcut.vbs midipix.sh README SHA256SUMS |\
"${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_FNAME}";
- log_msg info "Finished building binary distribution tarball.";
+ ex_log_msg info "Finished building binary distribution tarball.";
if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] && \
gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then
gpg --armor --passphrase-file /dev/null \
--local-user "${TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_FNAME}";
- log_msg info "Signed binary distribution tarball.";
+ ex_log_msg info "Signed binary distribution tarball.";
fi;
};
@@ -24,12 +24,12 @@ pkgp_dist_tarball_toolchain() {
TARBALL_CROSS_FNAME="${TARBALL_CROSS_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}";
tar -cpf - bin include lib lib64 libexec share "${TARGET}" |\
"${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_CROSS_FNAME}";
- log_msg info "Finished building toolchain tarball.";
+ ex_log_msg info "Finished building toolchain tarball.";
if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] && \
gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then
gpg --armor --passphrase-file /dev/null \
--local-user "${TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_CROSS_FNAME}";
- log_msg info "Signed toolchain tarball.";
+ ex_log_msg info "Signed toolchain tarball.";
fi;
};
@@ -38,36 +38,36 @@ pkgp_dist_tarball_minipix() {
tar -cpf - minipix \
midipix_shortcut.vbs midipix.sh README |\
"${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_MINIPIX_FNAME}";
- log_msg info "Finished building binary Minipix distribution tarball.";
+ ex_log_msg info "Finished building binary Minipix distribution tarball.";
if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] && \
gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then
gpg --armor --passphrase-file /dev/null \
--local-user "${TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_MINIPIX_FNAME}";
- log_msg info "Signed binary Minipix distribution tarball.";
+ ex_log_msg info "Signed binary Minipix distribution tarball.";
fi;
};
pkgp_dist_tarball_src() {
TARBALL_SRC_FNAME="${TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}";
- log_msg info "Building source tarball...";
+ ex_log_msg info "Building source tarball...";
tar -cpf - $(find tmp -mindepth 2 -maxdepth 2 \
-not -path tmp/.\* \
-not -path tmp/ntctty/.git \
-not -path tmp/psxscl/.git \
-not -path tmp/ptycon/.git) |\
"${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_SRC_FNAME}";
- log_msg info "Finished building source tarball.";
+ ex_log_msg info "Finished building source tarball.";
if [ -x "$(which gpg 2>/dev/null)" -a -n "${TARBALL_SIGN_GPG_KEY}" ] && \
gpg --list-keys "${TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then
gpg --armor --passphrase-file /dev/null \
--local-user "${TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_SRC_FNAME}";
- log_msg info "Signed source tarball.";
+ ex_log_msg info "Signed source tarball.";
fi;
};
pkg_dist_tarballs_all() {
if [ -n "${ARG_TARBALL}" ]; then
- log_msg info "Building distribution tarballs...";
+ ex_log_msg info "Building distribution tarballs...";
case "${TARBALL_SUFFIX}" in
bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then
TARBALL_COMPRESS_CMD="pbzip2";
@@ -81,9 +81,9 @@ pkg_dist_tarballs_all() {
fi; ;;
xz) TARBALL_COMPRESS_CMD="xz";
TARBALL_COMPRESS_ARGS="-T0"; ;;
- *) log_msg failexit "Unknown tarball suffix \`.${TARBALL_SUFFIX}'.";
+ *) ex_log_msg failexit "Unknown tarball suffix \`.${TARBALL_SUFFIX}'.";
esac;
- build_fileop cd "${PREFIX}"; PREFIX_BASENAME="${PREFIX_NATIVE##*/}";
+ ex_build_fileop cd "${PREFIX}"; PREFIX_BASENAME="${PREFIX_NATIVE##*/}";
pkgp_dist_tarball_dist; pkgp_dist_tarball_toolchain; pkgp_dist_tarball_minipix;
if [ "${BUILD}" = "debug" ]; then
pkgp_dist_tarball_src;
diff --git a/vars/env.vars b/vars/env.vars
index 0ed61756..cac525c7 100644
--- a/vars/env.vars
+++ b/vars/env.vars
@@ -16,14 +16,13 @@
: ${PREFIX_CROSS:=${PREFIX}/${TARGET}};
: ${DLCACHEDIR:=${PREFIX_ROOT}/dlcache};
: ${WORKDIR:=${PREFIX}/tmp};
-: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant setup_distclean:variant setup_subdirs:invariant
- all:all
- fetch_wget:dynamic fetch_git:dynamic fetch_extract:dynamic fetch_subdirs:invariant fetch:virtual
+: ${BUILD_STEPS:="all:all
+ fetch_distclean:variant fetch_wget:dynamic fetch_git:dynamic fetch_extract:dynamic fetch_subdirs:invariant fetch:virtual
configure_patch_pre:dynamic configure_autotools:dynamic configure_patch:dynamic configure:dynamic
build_clean:variant build:dynamic
install_subdirs:dynamic install_make:dynamic install_files:dynamic install_libs:dynamic
install_pkgconfig:dynamic install_purge_la:dynamic install_strip:dynamic install:dynamic
- finish:invariant"};
+ finish:finish"};
: ${PKG_BUILD_VARS:="BASE_DIR BUILD_DIR BUILD_STEPS_DISABLE BUILD_TYPE
CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA
CFLAGS_INSTALL_EXTRA CONFIGURE CONFIGURE_ARGS
@@ -45,10 +44,10 @@
: ${DEFAULT_CFLAGS_RELEASE:="-g0 -O2"};
: ${DEFAULT_CFLAGS_RELEASE_HOST:="-g0 -O2"};
: ${DEFAULT_CFLAGS_RELEASE_RUNTIME:="-g0 -O2"};
-: ${DEFAULT_CFLAGS:=$(get_var_unsafe "DEFAULT_CFLAGS_$(toupper "${BUILD}")")};
+: ${DEFAULT_CFLAGS:=$(ex_get_var_unsafe "DEFAULT_CFLAGS_$(ex_toupper "${BUILD}")")};
: ${DEFAULT_CFLAGS_CONFIGURE:=${DEFAULT_CFLAGS}};
-: ${DEFAULT_CFLAGS_HOST:=$(get_var_unsafe "DEFAULT_CFLAGS_$(toupper "${BUILD}")_HOST")};
-: ${DEFAULT_CFLAGS_RUNTIME:=$(get_var_unsafe "DEFAULT_CFLAGS_$(toupper "${BUILD}")_RUNTIME")};
+: ${DEFAULT_CFLAGS_HOST:=$(ex_get_var_unsafe "DEFAULT_CFLAGS_$(ex_toupper "${BUILD}")_HOST")};
+: ${DEFAULT_CFLAGS_RUNTIME:=$(ex_get_var_unsafe "DEFAULT_CFLAGS_$(ex_toupper "${BUILD}")_RUNTIME")};
: ${DEFAULT_GITROOT:=git://midipix.org};
: ${DEFAULT_GITROOT_HEAD:=git://midipix.org};
: ${DEFAULT_MAKE_INSTALL_VNAME:=DESTDIR};
diff --git a/vars/gcc.vars b/vars/gcc.vars
index 5391aeec..277ba8a8 100644
--- a/vars/gcc.vars
+++ b/vars/gcc.vars
@@ -39,9 +39,9 @@ pkgp_gcc_setup_env() {
};
pkgp_gcc_configure() {
- build_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
- build_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
"../cbb-gcc-${PKG_GCC_VERSION}/configure" "${@}"\
--disable-bootstrap \
--disable-libmudflap \
@@ -64,7 +64,7 @@ pkgp_gcc_configure() {
--enable-threads=posix \
--target="${PKG_TARGET}" \
--with-fpmath=sse;
- set_build_script_done "${PKG_NAME}" configure -build;
+ ex_pkg_state_push "${PKG_NAME}" configure -build;
};
pkg_gcc_stage1_cross_x86_64_w64_mingw32_all() {
@@ -84,33 +84,33 @@ pkg_gcc_stage1_all() {
case "${PKG_NAME}" in
gcc_stage1)
PKG_GCC_VERSION="${PKG_GCC_STAGE1_VERSION}";
- set_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross;
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross;
;;
gcc_stage1_cross_x86_64_w64_mingw32)
PKG_GCC_VERSION="${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION}";
- set_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross;
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross;
;;
gcc_stage1_native_x86_64_w64_mingw32)
PKG_GCC_VERSION="${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION}";
- set_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native;
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native;
;;
esac;
# GCC, stage1.
- if ! is_build_script_done "${PKG_NAME}" fetch "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" fetch "${_restart_at}"; then
pkg_fetch_git "cbb-gcc-${PKG_GCC_VERSION}=${DEFAULT_GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}";
- set_build_script_done "${PKG_NAME}" fetch -patch;
+ ex_pkg_state_push "${PKG_NAME}" fetch -patch;
fi;
- if ! is_build_script_done "${PKG_NAME}" patch "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" patch "${_restart_at}"; then
if [ -e "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch" ]; then
patch -b -d "${PKG_BASE_DIR}" -p0 < "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch";
fi;
- set_build_script_done "${PKG_NAME}" patch -configure;
+ ex_pkg_state_push "${PKG_NAME}" patch -configure;
fi;
pkgp_gcc_setup_env "${PKG_GCC_VERSION}";
- if ! is_build_script_done "${PKG_NAME}" configure "${_restart_at}"; then
- build_fileop mkdir "${PKG_PREFIX}/include";
+ if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then
+ ex_build_fileop mkdir "${PKG_PREFIX}/include";
[ \! -d "${PKG_PREFIX}/usr" ] && \
- build_fileop ln_symbolic . "${PKG_PREFIX}/usr";
+ ex_build_fileop ln_symbolic . "${PKG_PREFIX}/usr";
case "${PKG_NAME}" in
gcc_stage1)
pkgp_gcc_configure \
@@ -137,13 +137,13 @@ pkg_gcc_stage1_all() {
--without-headers; ;;
esac;
else
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
fi;
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} all-gcc;
- set_build_script_done "${PKG_NAME}" build -install;
+ ex_pkg_state_push "${PKG_NAME}" build -install;
fi;
- if ! is_build_script_done "${PKG_NAME}" install "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then
case "${PKG_NAME}" in
gcc_stage1)
make ${PKG_MAKEFLAGS_BUILD} install-gcc; ;;
@@ -154,10 +154,10 @@ pkg_gcc_stage1_all() {
esac;
__="$(uname -s)";
if [ "${__#*CYGWIN*}" != "${__}" ]; then
- build_fileop ln_symbolic "${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a" \
- build_fileop ln_symbolic "${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.so";
+ ex_build_fileop ln_symbolic "${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.dll.a" \
+ ex_build_fileop ln_symbolic "${PREFIX}/libexec/gcc/${PKG_TARGET}/${PKG_GCC_VERSION}/liblto_plugin.so";
fi;
- set_build_script_done "${PKG_NAME}" install finish;
+ ex_pkg_state_push "${PKG_NAME}" install finish;
fi;
exit 0;
};
@@ -165,16 +165,16 @@ pkg_gcc_stage1_all() {
pkg_gcc_runtime_all() {
local _restart_at="${1}";
export MAKE="make LIBTOOL=slibtool";
- set_build_dir "cbb-gcc-${PKG_GCC_RUNTIME_VERSION}" cross;
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_RUNTIME_VERSION}" cross;
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
# GCC, compiler runtime.
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} all-target-libgcc;
- set_build_script_done "${PKG_NAME}" build -install;
+ ex_pkg_state_push "${PKG_NAME}" build -install;
fi;
- if ! is_build_script_done "${PKG_NAME}" install "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} install-target-libgcc;
- set_build_script_done "${PKG_NAME}" install finish;
+ ex_pkg_state_push "${PKG_NAME}" install finish;
fi;
exit 0;
};
@@ -182,16 +182,16 @@ pkg_gcc_runtime_all() {
pkg_gcc_libstdcpp_v3_all() {
local _restart_at="${1}";
export MAKE="make LIBTOOL=slibtool";
- set_build_dir "cbb-gcc-${PKG_GCC_LIBSTDCPP_V3_VERSION}" cross;
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_LIBSTDCPP_V3_VERSION}" cross;
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
# GCC, libstdc++-v3.
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} all-target-libstdc++-v3;
- set_build_script_done "${PKG_NAME}" build -install;
+ ex_pkg_state_push "${PKG_NAME}" build -install;
fi;
- if ! is_build_script_done "${PKG_NAME}" install "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} install-target-libstdc++-v3;
- set_build_script_done "${PKG_NAME}" install finish;
+ ex_pkg_state_push "${PKG_NAME}" install finish;
fi;
exit 0;
};
@@ -199,16 +199,16 @@ pkg_gcc_libstdcpp_v3_all() {
pkg_gcc_full_all() {
local _restart_at="${1}";
export MAKE="make LIBTOOL=slibtool";
- set_build_dir "cbb-gcc-${PKG_GCC_FULL_VERSION}" cross;
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_FULL_VERSION}" cross;
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
# GCC, everything else.
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD};
- set_build_script_done "${PKG_NAME}" build -install;
+ ex_pkg_state_push "${PKG_NAME}" build -install;
fi;
- if ! is_build_script_done "${PKG_NAME}" install "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} install;
- set_build_script_done "${PKG_NAME}" install finish;
+ ex_pkg_state_push "${PKG_NAME}" install finish;
fi;
exit 0;
};
@@ -218,12 +218,12 @@ pkg_gcc_native_all() {
PKG_GCC_VERSION="${PKG_GCC_NATIVE_VERSION}";
export MAKE="make LIBTOOL=slibtool";
# GCC, native.
- set_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native;
+ ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native;
pkgp_gcc_setup_env "${PKG_GCC_VERSION}";
- if ! is_build_script_done "${PKG_NAME}" configure "${_restart_at}"; then
- build_fileop mkdir "${PKG_PREFIX}/${PKG_TARGET}";
+ if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then
+ ex_build_fileop mkdir "${PKG_PREFIX}/${PKG_TARGET}";
if [ \! -d "${PKG_PREFIX}/${PKG_TARGET}/usr" ]; then
- build_fileop ln_symbolic . "${PKG_PREFIX}/${PKG_TARGET}/usr";
+ ex_build_fileop ln_symbolic . "${PKG_PREFIX}/${PKG_TARGET}/usr";
fi;
if [ "${ARCH}" = nt32 ]; then
_configure_host="i686-nt32-midipix";
@@ -240,18 +240,18 @@ pkg_gcc_native_all() {
--with-mpfr="${PKG_PREFIX}" \
--with-sysroot=;
else
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
fi;
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} all-gcc;
make ${PKG_MAKEFLAGS_BUILD} all-target-libgcc;
make ${PKG_MAKEFLAGS_BUILD} all-target-libstdc++-v3;
make ${PKG_MAKEFLAGS_BUILD} all;
- set_build_script_done "${PKG_NAME}" build -install;
+ ex_pkg_state_push "${PKG_NAME}" build -install;
fi;
- if ! is_build_script_done "${PKG_NAME}" install "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then
make ${PKG_MAKEFLAGS_BUILD} "DESTDIR=${PKG_PREFIX}" install;
- set_build_script_done "${PKG_NAME}" install finish;
+ ex_pkg_state_push "${PKG_NAME}" install finish;
fi;
exit 0;
};
diff --git a/vars/git.vars b/vars/git.vars
index 873d0921..fc5fb89c 100644
--- a/vars/git.vars
+++ b/vars/git.vars
@@ -6,7 +6,7 @@ pkg_git_install_post() {
local __ _new;
for __ in $(find "${PKG_DESTDIR}" -name "Git*::*" -type f); do
_new="$(echo ${__} | sed "s/::/./g")";
- build_fileop mv "${__}" "${_new}";
+ ex_build_fileop mv "${__}" "${_new}";
done;
};
diff --git a/vars/install_strip_host.vars b/vars/install_strip_host.vars
index 081226bd..5e8524a8 100644
--- a/vars/install_strip_host.vars
+++ b/vars/install_strip_host.vars
@@ -4,7 +4,7 @@
pkg_install_strip_host_all() {
if [ -e "${PREFIX}/bin/${TARGET}-install-strip" ]; then
- build_fileop rm "${PREFIX}/bin/${TARGET}-install-strip";
+ ex_build_fileop rm "${PREFIX}/bin/${TARGET}-install-strip";
fi;
cat > "${PREFIX}/bin/${TARGET}-install-strip" <<EOF
#!/bin/sh
diff --git a/vars/libxml2.vars b/vars/libxml2.vars
index 1952c2d6..0a59f8da 100644
--- a/vars/libxml2.vars
+++ b/vars/libxml2.vars
@@ -4,7 +4,7 @@
pkg_libxml2_install_make_post() {
if [ -e "${PREFIX}/bin/${TARGET}-xml2-config" ]; then
- build_fileop rm "${PREFIX}/bin/${TARGET}-xml2-config";
+ ex_build_fileop rm "${PREFIX}/bin/${TARGET}-xml2-config";
fi;
cat > "${PREFIX}/bin/${TARGET}-xml2-config" <<EOF
#!/bin/sh
diff --git a/vars/llvm_host.vars b/vars/llvm_host.vars
index 88fa55ec..b84a339a 100644
--- a/vars/llvm_host.vars
+++ b/vars/llvm_host.vars
@@ -3,10 +3,10 @@
#
pkg_llvm_host_configure() {
- build_fileop rm "../llvm-${PKG_VERSION}-host";
- build_fileop mkdir "../llvm-${PKG_VERSION}-host";
- build_fileop cd "../llvm-${PKG_VERSION}-host";
- log_msg info "Bootstrapping llvm_host...";
+ ex_build_fileop rm "../llvm-${PKG_VERSION}-host";
+ ex_build_fileop mkdir "../llvm-${PKG_VERSION}-host";
+ ex_build_fileop cd "../llvm-${PKG_VERSION}-host";
+ ex_log_msg info "Bootstrapping llvm_host...";
("${PREFIX}/bin/cmake" \
"../llvm-${PKG_VERSION}.src" \
-DCMAKE_BUILD_TYPE=Release \
@@ -20,7 +20,7 @@ pkg_llvm_host_configure() {
-DSPHINX_WARNINGS_AS_ERRORS=NO \
-G "Unix Makefiles" \
-Wno-dev);
- log_msg info "Finished bootstrapping llvm_host.";
+ ex_log_msg info "Finished bootstrapping llvm_host.";
};
# vim:filetype=sh
diff --git a/vars/musl.vars b/vars/musl.vars
index c9d21883..5605872f 100644
--- a/vars/musl.vars
+++ b/vars/musl.vars
@@ -4,9 +4,9 @@
#
pkgp_musl_configure() {
- build_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
- build_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
- build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
env lz_cflags_cmdline="" \
lz_debug="yes" \
../lazy/lazy \
@@ -27,31 +27,31 @@ pkg_musl_no_complex_all() {
export lz_arch="${ARCH}" lz_cflags_debug="-O2" lz_target="${TARGET}";
# Musl: build (no-complex)
_install=install_no_complex;
- set_build_dir "musl-${PKG_MUSL_VERSION}" cross;
- if ! is_build_script_done "${PKG_NAME}" fetch "${_restart_at}"; then
+ ex_pkg_state_build_dir "musl-${PKG_MUSL_VERSION}" cross;
+ if ! ex_pkg_state_test "${PKG_NAME}" fetch "${_restart_at}"; then
pkg_fetch_wget "http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz" \
"${PKG_MUSL_NO_COMPLEX_SHA256SUM}";
- build_fileop rm "${PKG_BASE_DIR}/mmglue";
+ ex_build_fileop rm "${PKG_BASE_DIR}/mmglue";
pkg_fetch_git "mmglue=${DEFAULT_GITROOT}/mmglue";
- set_build_script_done "${PKG_NAME}" fetch -extract;
+ ex_pkg_state_push "${PKG_NAME}" fetch -extract;
fi;
- if ! is_build_script_done "${PKG_NAME}" extract "${_restart_at}"; then
- build_fileop rm "musl-${PKG_MUSL_VERSION}";
+ if ! ex_pkg_state_test "${PKG_NAME}" extract "${_restart_at}"; then
+ ex_build_fileop rm "musl-${PKG_MUSL_VERSION}";
tar -C "${PKG_BASE_DIR}" -xf "${DLCACHEDIR}/musl-${PKG_MUSL_VERSION}.tar.gz";
set +o noglob;
- build_fileop cp ${PKG_BASE_DIR}/mmglue/* "${PKG_BASE_DIR}/musl-${PKG_MUSL_VERSION}/";
+ ex_build_fileop cp ${PKG_BASE_DIR}/mmglue/* "${PKG_BASE_DIR}/musl-${PKG_MUSL_VERSION}/";
set -o noglob;
- set_build_script_done "${PKG_NAME}" extract -configure;
+ ex_pkg_state_push "${PKG_NAME}" extract -configure;
fi;
- if ! is_build_script_done "${PKG_NAME}" configure "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then
pkgp_musl_configure;
- set_build_script_done "${PKG_NAME}" configure -build;
+ ex_pkg_state_push "${PKG_NAME}" configure -build;
else
- build_fileop cd "${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BUILD_DIR}";
fi;
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
./lazy -e "${_install}" -x build;
- set_build_script_done "${PKG_NAME}" build finish;
+ ex_pkg_state_push "${PKG_NAME}" build finish;
fi;
exit 0;
};
@@ -64,17 +64,17 @@ pkg_musl_native_all() {
export lz_arch="${ARCH}" lz_cflags_debug="-O2" lz_target="${TARGET}";
# Musl: build (full)
_install=install;
- set_build_dir "musl-${PKG_MUSL_VERSION}" native;
- if ! is_build_script_done "${PKG_NAME}" configure "${_restart_at}"; then
+ ex_pkg_state_build_dir "musl-${PKG_MUSL_VERSION}" native;
+ if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then
pkgp_musl_configure;
- set_build_script_done "${PKG_NAME}" configure -build;
+ ex_pkg_state_push "${PKG_NAME}" configure -build;
else
- build_fileop cd "${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BUILD_DIR}";
fi;
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
./lazy -e "${_install}" -x build;
- build_fileop ln_symbolic ../lib/libc.so "${PKG_PREFIX}/bin/ldd";
- set_build_script_done "${PKG_NAME}" build finish;
+ ex_build_fileop ln_symbolic ../lib/libc.so "${PKG_PREFIX}/bin/ldd";
+ ex_pkg_state_push "${PKG_NAME}" build finish;
fi;
exit 0;
};
@@ -87,16 +87,16 @@ pkg_musl_full_all() {
export lz_arch="${ARCH}" lz_cflags_debug="-O2" lz_target="${TARGET}";
# Musl: build (full)
_install=install;
- set_build_dir "musl-${PKG_MUSL_VERSION}" cross;
- if ! is_build_script_done "${PKG_NAME}" configure "${_restart_at}"; then
+ ex_pkg_state_build_dir "musl-${PKG_MUSL_VERSION}" cross;
+ if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then
pkgp_musl_configure;
- set_build_script_done "${PKG_NAME}" configure -build;
+ ex_pkg_state_push "${PKG_NAME}" configure -build;
else
- build_fileop cd "${PKG_BUILD_DIR}";
+ ex_build_fileop cd "${PKG_BUILD_DIR}";
fi;
- if ! is_build_script_done "${PKG_NAME}" build "${_restart_at}"; then
+ if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then
./lazy -e "${_install}" -x build;
- set_build_script_done "${PKG_NAME}" build finish;
+ ex_pkg_state_push "${PKG_NAME}" build finish;
fi;
exit 0;
};
diff --git a/vars/nginx.vars b/vars/nginx.vars
index 09cb2012..9a5096bb 100644
--- a/vars/nginx.vars
+++ b/vars/nginx.vars
@@ -5,7 +5,7 @@
pkg_nginx_configure() {
export CFLAGS="${PKG_CFLAGS_CONFIGURE} -I${PKG_PREFIX}/include -pipe -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror";
export LDFLAGS="${PKG_LDFLAGS_CONFIGURE} -L${PKG_PREFIX}/lib";
- build_fileop mkdir objs/src objs/src/core objs/src/event objs/src/event/modules objs/src/http objs/src/http/modules objs/src/os/unix;
+ ex_build_fileop mkdir objs/src objs/src/core objs/src/event objs/src/event/modules objs/src/http objs/src/http/modules objs/src/os/unix;
};
# vim:filetype=sh
diff --git a/vars/perl.vars b/vars/perl.vars
index 494139bd..95068258 100644
--- a/vars/perl.vars
+++ b/vars/perl.vars
@@ -4,17 +4,17 @@
pkg_perl_fetch_extract_post() {
local _fname_src _fname_dst _cflag;
- (build_fileop cd "${PKG_BASE_DIR}";
+ (ex_build_fileop cd "${PKG_BASE_DIR}";
for _fname_src in $(find perl-cross -type f \
-not -path perl-cross/.git/\* -not -name .gitignore); do
_fname_dst="perl-${PKG_VERSION}${_fname_src#perl-cross}";
if [ -f "${_fname_dst}" ]; then
- build_fileop mv "${_fname_dst}" "${_fname_dst}.orig";
+ ex_build_fileop mv "${_fname_dst}" "${_fname_dst}.orig";
fi;
- if [ ! -d "$(dirname "${_fname_dst}")" ]; then
- build_fileop mkdir "$(dirname "${_fname_dst}")";
+ if [ ! -d "$(ex_dirname "${_fname_dst}")" ]; then
+ ex_build_fileop mkdir "$(ex_dirname "${_fname_dst}")";
fi;
- build_fileop cp "${_fname_src}" "${_fname_dst}";
+ ex_build_fileop cp "${_fname_src}" "${_fname_dst}";
done);
for _cflag in ${PKG_CFLAGS_CONFIGURE}; do
PKG_CONFIGURE_ARGS="${PKG_CONFIGURE_ARGS:+${PKG_CONFIGURE_ARGS} }-A ccflags=${_cflag}";
diff --git a/vars/pkgconf_host.vars b/vars/pkgconf_host.vars
index bde06b1e..7262697f 100644
--- a/vars/pkgconf_host.vars
+++ b/vars/pkgconf_host.vars
@@ -4,7 +4,7 @@
pkg_pkgconf_host_install_make_post() {
if [ -e "${PREFIX}/bin/${TARGET}-pkg-config" ]; then
- build_fileop rm "${PREFIX}/bin/${TARGET}-pkg-config";
+ ex_build_fileop rm "${PREFIX}/bin/${TARGET}-pkg-config";
fi;
cat > "${PREFIX}/bin/${TARGET}-pkg-config" <<EOF
#!/bin/sh
@@ -14,14 +14,14 @@ fi;
"\$(dirname "\${0}")"/pkgconf --define-variable=prefix="\${PREFIX_NATIVE%/}/" "\${@}";
EOF
chmod +x "${PREFIX}/bin/${TARGET}-pkg-config";
- build_fileop rm "${PREFIX}/bin/pkg-config";
+ ex_build_fileop rm "${PREFIX}/bin/pkg-config";
};
pkg_pkgconf_install_make_post() {
if [ -e "${PREFIX_NATIVE}/bin/pkg-config" ]; then
- build_fileop rm "${PREFIX_NATIVE}/bin/pkg-config";
+ ex_build_fileop rm "${PREFIX_NATIVE}/bin/pkg-config";
fi;
- build_fileop ln_symbolic pkgconf "${PREFIX_NATIVE}/bin/pkg-config";
+ ex_build_fileop ln_symbolic pkgconf "${PREFIX_NATIVE}/bin/pkg-config";
};
# vim:filetype=sh
diff --git a/vars/psxstub.vars b/vars/psxstub.vars
index 95777170..1664b51a 100644
--- a/vars/psxstub.vars
+++ b/vars/psxstub.vars
@@ -5,10 +5,10 @@
pkg_psxstub_install_make() {
if [ "${TARGET}" = i686-nt32-midipix ] \
|| [ "${TARGET}" = x86_64-nt64-midipix ]; then
- build_fileop cd "${PKG_BASE_DIR}/psxstub";
+ ex_build_fileop cd "${PKG_BASE_DIR}/psxstub";
make ${PKG_MAKEFLAGS_BUILD} "DESTDIR=${PKG_PREFIX}" "TARGET=${TARGET}" install;
if [ -e "${PKG_PREFIX}/lib/libpsxscl.a" ]; then
- build_fileop rm "${PKG_PREFIX}/lib/libpsxscl.a";
+ ex_build_fileop rm "${PKG_PREFIX}/lib/libpsxscl.a";
fi;
fi;
};
diff --git a/vars/python3.vars b/vars/python3.vars
index 70e1fa9b..d0edb8e3 100644
--- a/vars/python3.vars
+++ b/vars/python3.vars
@@ -3,15 +3,15 @@
#
pkg_python3_configure_pre() {
- (build_fileop cd "../${PKG_SUBDIR}" && autoconf);
+ (ex_build_fileop cd "../${PKG_SUBDIR}" && autoconf);
(unset AR BLDSHARED CC CFLAGS CPPFLAGS CXX LDFLAGS RANLIB;
- build_fileop mv config.cache "../${PKG_SUBDIR}/config.cache";
+ ex_build_fileop mv config.cache "../${PKG_SUBDIR}/config.cache";
"../${PKG_SUBDIR}/configure";
make _FIP=Programs/host_freeze_importlib Programs/host_freeze_importlib \
BUILDPYTHON=hostpython hostpython \
PGEN=Parser/hostpgen Parser/hostpgen;
make distclean);
- build_fileop mv "../${PKG_SUBDIR}/config.cache" .;
+ ex_build_fileop mv "../${PKG_SUBDIR}/config.cache" .;
};
# vim:filetype=sh
diff --git a/vars/vim.vars b/vars/vim.vars
index 0e0ab509..1507d70d 100644
--- a/vars/vim.vars
+++ b/vars/vim.vars
@@ -3,7 +3,7 @@
#
pkg_vim_configure_pre() {
- build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" \
+ ex_build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" \
"${PKG_BASE_DIR}/${PKG_SUBDIR}/src/auto";
};