From d01c0269b8e5e467f82cd28392579c4c43fe63bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lucio=20Andr=C3=A9s=20Illanes=20Albornoz=20=28arab=2C=20vx?= =?UTF-8?q?p=29?= Date: Mon, 20 Nov 2017 15:27:06 +0000 Subject: subr/pkg_{autoconf,configure,patch}.subr: reference ${PKG_BASE_DIR} instead of ${WORKDIR}. subr/pkg_build_dir.subr: {build,install} packages nested within ${PKG_BUILD_DIR}/. subr/pkg_distclean.subr: removed from repository. subr/pkg_{extract,fetch}.subr: {extract,fetch} within ${PKG_BASE_DIR}. subr/pkg_install.subr: install to ../destdir to facilitate post-installation processing. subr/pkg_setup_env.subr: set & create ${PKG_BASE_DIR}. subr/pre_subdirs.subr: always create ${PREFIX}/bin. vars/build.vars: consistently use ${PKG_{PREFIX,MAKE_INSTALL_VNAME,MAKEFLAGS_INSTALL}}. vars/env.vars, *: cleanup. --- subr/mode_check_updates.subr | 4 ++-- subr/pkg_autoconf.subr | 35 ++++++++++++++++++----------------- subr/pkg_build_dir.subr | 12 +++++++----- subr/pkg_configure.subr | 4 ++-- subr/pkg_distclean.subr | 12 ------------ subr/pkg_extract.subr | 16 ++++++++-------- subr/pkg_fetch.subr | 18 +++++++++--------- subr/pkg_install.subr | 39 +++++++++++++++++++++------------------ subr/pkg_patch.subr | 10 +++++----- subr/pkg_patch_pre.subr | 3 +-- subr/pkg_setup_env.subr | 3 +++ subr/pkg_work_dir.subr | 6 +++--- subr/pre_setup_env.subr | 8 ++++---- subr/pre_subdirs.subr | 1 + 14 files changed, 84 insertions(+), 87 deletions(-) delete mode 100644 subr/pkg_distclean.subr (limited to 'subr') diff --git a/subr/mode_check_updates.subr b/subr/mode_check_updates.subr index 56423a5b..9699d360 100644 --- a/subr/mode_check_updates.subr +++ b/subr/mode_check_updates.subr @@ -14,13 +14,13 @@ modep_cpu_get_fnames() { _cpugf_pname="${_cpugf_pname%%/*}"; cu_url_index="https://github.com/${_cpugf_uname%%/*}/${_cpugf_pname%%/*}/releases/"; unset _cpu_uname _cpu_pname; - cu_fnames="$(wget ${WGET_ARGS} -qO- ${cu_url_index} |\ + cu_fnames="$(wget ${DEFAULT_WGET_ARGS} -qO- ${cu_url_index} |\ sed -n '//s/^.*\([a-zA-Z]\+-\|v\|\)\(.\+\)<\/span>.*$/\3/p')"; cu_fname_base="${cu_name}"; cu_fname_ext="${cu_fname#v${cu_version}.}"; else cu_url_index="${cu_url%/*}/"; - cu_fnames="$(wget ${WGET_ARGS} -qO- "${cu_url_index}" |\ + cu_fnames="$(wget ${DEFAULT_WGET_ARGS} -qO- "${cu_url_index}" |\ sed -n '/[hH][rR][eE][fF]="[^"]\+"/s/^.*[hH][rR][eE][fF]="\([^"]\+\)".*$/\1/p')"; fi; fi; diff --git a/subr/pkg_autoconf.subr b/subr/pkg_autoconf.subr index fd201282..8a0ea124 100644 --- a/subr/pkg_autoconf.subr +++ b/subr/pkg_autoconf.subr @@ -4,18 +4,18 @@ pkg_autoconf() { local __; - if [ -e "${WORKDIR}/${PKG_SUBDIR}/configure" -o \ - -e "${WORKDIR}/${PKG_SUBDIR}/configure.ac" -o \ - -e "${WORKDIR}/${PKG_SUBDIR}/configure.in" -o \ - -e "${WORKDIR}/${PKG_SUBDIR}/config.guess" ]; then - if [ -e "${WORKDIR}/${PKG_SUBDIR}/configure.ac" ]\ - && [ ! -e "${WORKDIR}/${PKG_SUBDIR}/configure" ]; then + if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" -o \ + -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" -o \ + -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.in" -o \ + -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/config.guess" ]; then + if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" ]\ + && [ ! -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]; then for __ in bootstrap bootstrap.sh autogen.sh ""; do if [ -z "${__}" ]; then - (build_fileop cd "${WORKDIR}/${PKG_SUBDIR}" && autoconf)\ + (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf)\ || exit 1 && break; - elif [ -e "${WORKDIR}/${PKG_SUBDIR}/${__}" ]; then - for ___ in "${WORKDIR}/${PKG_SUBDIR}/build-aux" "${WORKDIR}/${PKG_SUBDIR}"; do + elif [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/${__}" ]; then + for ___ in "${PKG_BASE_DIR}/${PKG_SUBDIR}/build-aux" "${PKG_BASE_DIR}/${PKG_SUBDIR}"; do if [ -e "${___}" ]; then echo install -m 0700 \ "${MIDIPIX_BUILD_PWD}/etc/config.sub" \ @@ -26,20 +26,21 @@ pkg_autoconf() { break; fi; done; - (build_fileop cd "${WORKDIR}/${PKG_SUBDIR}" && "${SHELL}" "${__}")\ + (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && "${SHELL}" "${__}")\ || exit 1 && break; fi; done; fi; - find "${WORKDIR}/${PKG_SUBDIR}" -name config.sub \ - -exec echo mv -- {} {}.orig \; \ - -exec mv -- {} {}.orig \; \ - -exec echo install -m 0700 "${MIDIPIX_BUILD_PWD}/etc/config.sub" {} \; \ + find "${PKG_BASE_DIR}/${PKG_SUBDIR}" -name config.sub \ + -exec echo mv -- {} {}.orig \; \ + -exec mv -- {} {}.orig \; \ + -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 - for __ in ${PKG_BUILD_DIR} ${PKG_CONFIG_CACHE_EXTRA}; do - build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${WORKDIR}/${__}/"; - done; + build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${PKG_BUILD_DIR}/"; + if [ -n "${PKG_CONFIG_CACHE_EXTRA}" ]; then + build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" "${PKG_BASE_DIR}/${PKG_CONFIG_CACHE_EXTRA}/"; + fi; fi; fi; }; diff --git a/subr/pkg_build_dir.subr b/subr/pkg_build_dir.subr index e9104ab2..2143e057 100644 --- a/subr/pkg_build_dir.subr +++ b/subr/pkg_build_dir.subr @@ -4,13 +4,15 @@ pkg_build_dir() { if [ -z "${PKG_BUILD_DIR}" ]; then - if [ -e "${WORKDIR}/${PKG_SUBDIR}/configure" ]\ - || [ -e "${WORKDIR}/${PKG_SUBDIR}/configure.ac" ]\ - || [ -e "${WORKDIR}/${PKG_SUBDIR}/configure.in" ]; then - set_build_dir "${PKG_SUBDIR}" "${PKG_BUILD_TYPE:-native}"; + if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]\ + || [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" ]\ + || [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.in" ]; then + PKG_BUILD_DIR="${PKG_BASE_DIR}/obj"; else - PKG_BUILD_DIR="${PKG_SUBDIR}"; + PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_SUBDIR}"; fi; + else + PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; fi; }; diff --git a/subr/pkg_configure.subr b/subr/pkg_configure.subr index d63b16e6..acc67a09 100644 --- a/subr/pkg_configure.subr +++ b/subr/pkg_configure.subr @@ -4,9 +4,9 @@ pkg_configure() { if [ -n "${PKG_CONFIGURE}" ]; then - PKG_CONFIGURE="${WORKDIR}/${PKG_CONFIGURE}"; + PKG_CONFIGURE="${PKG_BASE_DIR}/${PKG_CONFIGURE}"; else - PKG_CONFIGURE="${WORKDIR}/${PKG_SUBDIR}/configure"; + PKG_CONFIGURE="${PKG_BASE_DIR}/${PKG_SUBDIR}/configure"; fi; if [ -x "${PKG_CONFIGURE}" ]; then CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ diff --git a/subr/pkg_distclean.subr b/subr/pkg_distclean.subr deleted file mode 100644 index 68c09dd4..00000000 --- a/subr/pkg_distclean.subr +++ /dev/null @@ -1,12 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -pkg_distclean() { - if [ "${PKG_SUBDIR}" != "${PKG_BUILD_DIR}" ]; then - build_fileop rm "${WORKDIR}/${PKG_BUILD_DIR}"; - build_fileop mkdir "${WORKDIR}/${PKG_BUILD_DIR}"; - fi; -}; - -# vim:filetype=sh diff --git a/subr/pkg_extract.subr b/subr/pkg_extract.subr index f6ddff2e..909dc730 100644 --- a/subr/pkg_extract.subr +++ b/subr/pkg_extract.subr @@ -5,21 +5,21 @@ pkg_extract() { if [ -n "${PKG_URL}" ]\ && [ "${PKG_URL_TYPE:-wget}" = wget ]; then - build_fileop rm "${WORKDIR}/${PKG_SUBDIR}"; + build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}"; if [ "${PKG_FNAME##*.tar.}" = "bz2" ]; then - bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; elif [ "${PKG_FNAME##*.tar.}" = "gz" ]; then - gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; elif [ "${PKG_FNAME##*.tar.}" = "xz" ]; then - xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; elif [ "${PKG_FNAME##*.t}" = "bz2" ]; then - bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; elif [ "${PKG_FNAME##*.t}" = "gz" ]; then - gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; elif [ "${PKG_FNAME##*.t}" = "xz" ]; then - xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${WORKDIR}" -xf -; + xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; else - tar -C "${WORKDIR}" -xf "${DLCACHEDIR}/${PKG_FNAME}"; + tar -C "${PKG_BASE_DIR}" -xf "${DLCACHEDIR}/${PKG_FNAME}"; fi; fi; }; diff --git a/subr/pkg_fetch.subr b/subr/pkg_fetch.subr index 37c2439e..7c71c344 100644 --- a/subr/pkg_fetch.subr +++ b/subr/pkg_fetch.subr @@ -14,7 +14,7 @@ pkgp_fetch() { || [ -e "${_url_dst}.fetched" ]; then return 0; else - wget ${WGET_ARGS} -c -O "${_url_dst}" "${_url}"; + wget ${DEFAULT_WGET_ARGS} -c -O "${_url_dst}" "${_url}"; fi; if [ -n "${_sha256sum_src}" ]; then set -- $(openssl dgst -sha256 "${_url_dst}"); shift $((${#}-1)); @@ -30,7 +30,7 @@ pkgp_fetch() { }; pkgp_fetch_git() { - local _subdir="${1}" _url="${2}" _branch="${3}"; + 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}" &&\ @@ -45,27 +45,27 @@ pkgp_fetch_git() { fi; fi; fi; - build_fileop rm "${WORKDIR}/${_subdir}"; - build_fileop cp "${DLCACHEDIR}/${_subdir}" "${WORKDIR}"; + build_fileop rm "${_tgtdir}/${_subdir}"; + build_fileop cp "${DLCACHEDIR}/${_subdir}" "${_tgtdir}"; }; pkgp_fetch_urls_git() { - local _url_spec _subdir _url _git_branch; - for _url_spec in ${@}; do + local _tgtdir="${2}" _url_spec _subdir _url _git_branch; + for _url_spec in ${1}; do _subdir="${_url_spec%=*}"; _url="${_url_spec#*=}"; _url="${_url%@*}"; if [ "${_url_spec#*@}" != "${_url_spec}" ]; then _git_branch=${_url_spec#*@}; fi; - pkgp_fetch_git ${_subdir} ${_url} ${_git_branch}; + pkgp_fetch_git "${_tgtdir}" "${_subdir}" "${_url}" "${_git_branch}"; done; }; pkg_fetch() { if [ -n "${1}" ]; then if [ "${1}" = "-git" ]; then - shift; pkgp_fetch_urls_git "${1}"; + shift; pkgp_fetch_urls_git "${1}" "${PKG_BASE_DIR}"; else pkgp_fetch "${1}" "${2}"; fi; @@ -74,7 +74,7 @@ pkg_fetch() { pkgp_fetch "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}"; fi; if [ -n "${PKG_URLS_GIT}" ]; then - pkgp_fetch_urls_git "${PKG_URLS_GIT}"; + pkgp_fetch_urls_git "${PKG_URLS_GIT}" "${PKG_BASE_DIR}"; fi; fi; }; diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index 8e4a5b7a..b4ccbded 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -67,7 +67,7 @@ pkgp_install_libs() { pkgp_install_pkgconfig() { local __; - for __ in $(find "${WORKDIR}/${PKG_BUILD_DIR}" -name \*.pc); do + for __ in $(find "${PKG_BUILD_DIR}" -name \*.pc); do if grep -Eq '^libdir=[^$]+$' "${__}"; then sed -i -e '/^libdir=[^$]\+$/s/^libdir=\(.\+\)$/libdir=${exec_prefix}\1/' \ -e '/^exec_prefix=$/s/^.*$/exec_prefix=${prefix}/' \ @@ -79,30 +79,33 @@ pkgp_install_pkgconfig() { pkg_install() { pkgp_install_pkgconfig; if [ ${PKG_NO_MAKE_INSTALL:-0} -eq 0 ]; then - run_cmd_unsplit make \ - ${PKG_MAKEFLAGS_INSTALL} \ - ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ - AR=${AR} CC=${CC} RANLIB=${RANLIB} \ + build_fileop mkdir ../destdir; + build_fileop mkdir ../destdir/bin; + build_fileop mkdir ../destdir/lib; + build_fileop mkdir ../destdir/sbin; + build_fileop mkdir ../destdir/share/man/man1; + build_fileop mkdir ../destdir/share/man; + build_fileop rm ../destdir/usr; + build_fileop ln_symbolic . ../destdir/usr; + build_fileop rm ../destdir/man; + build_fileop ln_symbolic share/man ../destdir/man; + run_cmd_unsplit make \ + ${PKG_MAKEFLAGS_INSTALL} \ + ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ + AR=${AR} CC=${CC} RANLIB=${RANLIB} \ "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ - "LIBTOOL=${PKG_SLIBTOOL:-slibtool}" \ + "LIBTOOL=${PKG_SLIBTOOL:-slibtool}" \ + "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PWD}/../destdir/" \ ${PKG_INSTALL_TARGET:=install}; + build_fileop mkdir "${PKG_PREFIX}"; + tar -C ../destdir -cpf - . | tar -C "${PKG_PREFIX}" -xpf -; if [ -n "${PKG_PREFIX_EXTRA}" ]; then - run_cmd_unsplit make \ - ${PKG_MAKEFLAGS_INSTALL} \ - ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ - AR=${AR} CC=${CC} RANLIB=${RANLIB} \ - "${PKG_CFLAGS_INSTALL:+CFLAGS=${PKG_CFLAGS_INSTALL}}" \ - "${PKG_CFLAGS_INSTALL_EXTRA:+CFLAGS+=${PKG_CFLAGS_INSTALL_EXTRA}}" \ - "${PKG_LDFLAGS_INSTALL:+LDFLAGS=${PKG_LDFLAGS_INSTALL}}" \ - "${PKG_LDFLAGS_INSTALL_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_INSTALL_EXTRA}}" \ - "${PKG_RANLIB_INSTALL:+RANLIB=${PKG_RANLIB_INSTALL}}" \ - "LIBTOOL=${PKG_SLIBTOOL:-slibtool}" \ - ${PKG_INSTALL_TARGET_EXTRA:=install} \ - DESTDIR=${PKG_PREFIX_EXTRA}; + build_fileop mkdir "${PKG_PREFIX_EXTRA}"; + tar -C ../destdir -cpf - . | tar -C "${PKG_PREFIX_EXTRA}" -xpf -; fi; fi; pkgp_install_clean_lib; diff --git a/subr/pkg_patch.subr b/subr/pkg_patch.subr index eba8f6f2..fadd1ed8 100644 --- a/subr/pkg_patch.subr +++ b/subr/pkg_patch.subr @@ -5,10 +5,10 @@ pkg_patch() { local _patch_fname _patches_done; set +o noglob; - for _patch_fname in \ - ${WORKDIR}/chainport/${PKG_NAME}.midipix.patch \ - ${WORKDIR}/chainport/${PKG_SUBDIR}.midipix.patch \ - ${WORKDIR}/chainport/${PKG_SUBDIR%-*}.midipix.patch \ + 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 \ ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch \ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}/*.patch \ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}/*.patch \ @@ -20,7 +20,7 @@ pkg_patch() { ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local@${BUILD_HNAME}.patch; do if ! lmatch "${_patches_done}" " " "${_patch_fname}"\ && [ -r "${_patch_fname}" ]; then - patch -b -d "${WORKDIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; + patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; _patches_done="${_patches_done:+${_patches_done} }${_patch_fname}"; fi; done; diff --git a/subr/pkg_patch_pre.subr b/subr/pkg_patch_pre.subr index f3402fcd..f6ab9f05 100644 --- a/subr/pkg_patch_pre.subr +++ b/subr/pkg_patch_pre.subr @@ -7,11 +7,10 @@ pkg_patch_pre() { for __ in \ ${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}_pre.local.patch \ ${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}_pre.local@${BUILD_HNAME}.patch \ - ${WORKDIR}/chainport/${PKG_SUBDIR}_pre.midipix.patch \ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}_pre.local.patch \ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}_pre.local@${BUILD_HNAME}.patch; do if [ -r "${__}" ]; then - patch -b -d "${WORKDIR}/${PKG_SUBDIR}" -p1 < "${__}"; + patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${__}"; fi; done; }; diff --git a/subr/pkg_setup_env.subr b/subr/pkg_setup_env.subr index 43d1160c..8bf076b2 100644 --- a/subr/pkg_setup_env.subr +++ b/subr/pkg_setup_env.subr @@ -12,6 +12,9 @@ pkg_setup_env() { [ -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"; diff --git a/subr/pkg_work_dir.subr b/subr/pkg_work_dir.subr index 20b9ce17..5d18278c 100644 --- a/subr/pkg_work_dir.subr +++ b/subr/pkg_work_dir.subr @@ -3,10 +3,10 @@ # pkg_work_dir() { - if [ ! -d "${WORKDIR}/${PKG_BUILD_DIR}" ]; then - build_fileop mkdir "${WORKDIR}/${PKG_BUILD_DIR}"; + if [ ! -d "${PKG_BUILD_DIR}" ]; then + build_fileop mkdir "${PKG_BUILD_DIR}"; fi; - build_fileop cd "${WORKDIR}/${PKG_BUILD_DIR}"; + build_fileop cd "${PKG_BUILD_DIR}"; }; # vim:filetype=sh diff --git a/subr/pre_setup_env.subr b/subr/pre_setup_env.subr index 8bef5820..0f22fdbe 100644 --- a/subr/pre_setup_env.subr +++ b/subr/pre_setup_env.subr @@ -4,9 +4,9 @@ pre_setup_env() { local __; - if [ -z "${BUILD_CPUS}" ]\ + if [ -z "${DEFAULT_BUILD_CPUS}" ]\ && [ -e /proc/cpuinfo ]; then - BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo); + DEFAULT_BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo); fi; : ${ARCH:=nt64}; : ${BUILD:=debug}; if [ "${ARCH}" = nt32 ]; then @@ -25,9 +25,9 @@ pre_setup_env() { done; export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; if [ ${ARG_IPV4_ONLY:-0} -eq 1 ]; then - WGET_ARGS="-4${WGET_ARGS:+ ${WGET_ARGS}}"; + DEFAULT_WGET_ARGS="-4${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then - WGET_ARGS="-6${WGET_ARGS:+ ${WGET_ARGS}}"; + 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 diff --git a/subr/pre_subdirs.subr b/subr/pre_subdirs.subr index bc205032..6d857d8a 100644 --- a/subr/pre_subdirs.subr +++ b/subr/pre_subdirs.subr @@ -16,6 +16,7 @@ pre_subdirs() { /=${DLCACHEDIR} \ /=${WORKDIR} \ /=${PREFIX} \ + /=${PREFIX}/bin \ /=${PREFIX}/${TARGET}/bin \ /=${PREFIX}/${TARGET}/lib \ /=${PREFIX}/x86_64-w64-mingw32 \ -- cgit v1.2.3