summaryrefslogtreecommitdiffhomepage
path: root/subr/build.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-19 14:21:25 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-20 14:46:55 +0000
commit49b46005e7f7ebebcf6b43d451918c5462ac28d4 (patch)
treed226c2bb06d084911b70118e466e23a2de45ae0a /subr/build.subr
parentd27197213a39dd05dee64788ce185f6805207292 (diff)
downloadmidipix_build-49b46005e7f7ebebcf6b43d451918c5462ac28d4.tar.bz2
midipix_build-49b46005e7f7ebebcf6b43d451918c5462ac28d4.tar.xz
vars/{build,env}.vars: diet, pt. II.
vars/build.vars: install w/ `DESTDIR=<prefix> PREFIX= prefix=' by default. vars/build.vars:cmake: build w/ -g0 -O2. vars/cmake.vars: build using cmake_host. vars/pkgconf_host.vars: remove & don't install ${PREFIX}/bin/pkg-config link to avoid confusing host packages. vars/{apr_util,chainport}.vars: replaced w/ corresponding ${PKG_BUILD_STEPS}. patches/perl-5.22.1.local.patch: pass -L. -lperl when linking. patches/smallbasic.local.patch: don't call pcre-config. subr/pkg_autoconf.subr, vars/{lib{caca,udns},toilet}.vars: always install config.sub after bootstrap. subr/pkg_disabled.subr: always silently finish disabled packages. subr/pkg_setup_{env,vars}.subr: split. subr/pkg_{build,install}.subr: always pass LIBTOOL=${PKG_SLIBTOOL:=slibtool}. subr/pkg_{{build,work}_dir,extract,setup_env}.subr: infer ${PKG_BUILD_DIR} from ${PKG_SUBDIR} given the absence of configure{,.{ac,in}}.
Diffstat (limited to 'subr/build.subr')
-rw-r--r--subr/build.subr35
1 files changed, 23 insertions, 12 deletions
diff --git a/subr/build.subr b/subr/build.subr
index 14c932e2..d6e72898 100644
--- a/subr/build.subr
+++ b/subr/build.subr
@@ -11,6 +11,7 @@ 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;
@@ -119,15 +120,26 @@ set_build_script_done() {
};
lfilter() {
- local _list="${1}" _filter="${2}" _lnew _litem _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 [ "${_lfilter}" = "${_litem}" ]; then
+ if [ "${_notfl:-0}" -eq 0 ]\
+ && [ "${_lfilter}" = "${_litem}" ]; then
_lnew="${_lnew:+${_lnew} }${_litem}"; break;
- fi;
+ 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};
+ echo "${_lnew}";
};
lmatch() {
@@ -198,15 +210,14 @@ set_env_vars_with_sep() {
};
subst_tgts() {
+ local _pkgs;
while [ ${#} -ge 1 ]; do
- case "${1}" in
- dev)
- echo "${DEV_PACKAGES}"; ;;
- devroot)
- echo "${DEVROOT_PACKAGES}"; ;;
- world) echo "${WORLD_PACKAGES}"; ;;
- *) echo "${1}"; ;;
- esac; shift;
+ _pkgs="$(get_var_unsafe "$(toupper "${1}")_TARGET")";
+ if [ -n "${_pkgs}" ]; then
+ echo "${_pkgs}";
+ else
+ echo "${1}";
+ fi; shift;
done;
};