summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-20 21:45:21 +0000
committerLucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de>2017-11-21 00:51:43 +0000
commitc27beab66023847435fb88cd5cc75916dca37057 (patch)
treec43c23133f5b837925785d5501aa4cff14980415
parentd01c0269b8e5e467f82cd28392579c4c43fe63bc (diff)
downloadmidipix_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.
-rwxr-xr-xbuild.sh38
-rwxr-xr-x[-rw-r--r--]check_updates.sh (renamed from subr/mode_check_updates.subr)0
-rw-r--r--etc/build.usage7
-rw-r--r--patches/mksh.local.patch5
-rw-r--r--subr/build.subr62
-rw-r--r--subr/pkg_build.subr30
-rw-r--r--subr/pkg_build_clean.subr (renamed from subr/pkg_clean.subr)2
-rw-r--r--subr/pkg_configure_autotools.subr (renamed from subr/pkg_autoconf.subr)25
-rw-r--r--subr/pkg_configure_patch.subr (renamed from subr/pkg_patch.subr)18
-rw-r--r--subr/pkg_configure_patch_pre.subr (renamed from subr/pkg_patch_pre.subr)10
-rw-r--r--subr/pkg_disabled.subr14
-rw-r--r--subr/pkg_fetch.subr82
-rw-r--r--subr/pkg_fetch_extract.subr (renamed from subr/pkg_extract.subr)2
-rw-r--r--subr/pkg_fetch_git.subr49
-rw-r--r--subr/pkg_fetch_subdirs.subr (renamed from subr/pkg_build_dir.subr)6
-rw-r--r--subr/pkg_fetch_wget.subr42
-rw-r--r--subr/pkg_install.subr117
-rw-r--r--subr/pkg_install_files.subr54
-rw-r--r--subr/pkg_install_libs.subr49
-rw-r--r--subr/pkg_install_make.subr20
-rw-r--r--subr/pkg_install_pkgconfig.subr16
-rw-r--r--subr/pkg_install_pre.subr18
-rw-r--r--subr/pkg_install_purge_la.subr12
-rw-r--r--subr/pkg_install_strip.subr31
-rw-r--r--subr/pkg_install_subdirs.subr17
-rw-r--r--subr/pkg_setup_env.subr33
-rw-r--r--subr/pkg_setup_vars.subr31
-rw-r--r--subr/pkg_strip.subr37
-rw-r--r--subr/pkg_work_dir.subr12
-rw-r--r--subr/post_build_files.subr15
-rw-r--r--subr/pre_build_files.subr20
-rw-r--r--subr/pre_check.subr (renamed from subr/pre_prereqs.subr)2
-rw-r--r--subr/pre_subdirs.subr4
-rw-r--r--vars/apr.vars6
-rw-r--r--vars/build.vars49
-rw-r--r--vars/cmake.vars4
-rw-r--r--vars/dist_digest.subr (renamed from subr/post_sha256sums.subr)5
-rw-r--r--vars/dist_etc.subr (renamed from subr/post_copy_etc.subr)2
-rw-r--r--vars/dist_tarballs.subr (renamed from subr/post_tarballs.subr)5
-rw-r--r--vars/env.vars23
-rw-r--r--vars/gcc.vars2
-rw-r--r--vars/install_strip_host.vars2
-rw-r--r--vars/libfirm.vars4
-rw-r--r--vars/libxml2.vars2
-rw-r--r--vars/musl.vars10
-rw-r--r--vars/perl.vars2
-rw-r--r--vars/pkgconf_host.vars4
-rw-r--r--vars/psxstub.vars2
-rw-r--r--vars/ruby.vars6
-rw-r--r--vars/vim.vars10
-rw-r--r--vars/xz_flavour_minipix.vars2
51 files changed, 505 insertions, 515 deletions
diff --git a/build.sh b/build.sh
index 1ebd2ee9..c04b691a 100755
--- a/build.sh
+++ b/build.sh
@@ -12,7 +12,6 @@ case ${1} in
-4) ARG_IPV4_ONLY=1; ;;
-6) ARG_IPV6_ONLY=1; ;;
-c) ARG_CLEAN=1; ;;
--C) ARG_CHECK_UPDATES=1; ;;
-N) ARG_OFFLINE=1; ;;
-i) ARG_IGNORE_SHA256SUMS=1; ;;
-R) ARG_RELAXED=1; ;;
@@ -39,18 +38,14 @@ case ${1} in
exec cat etc/build.usage;
fi; ;;
esac; shift; done;
-pre_setup_env; pre_prereqs; pre_subdirs; pre_build_files;
+pre_setup_env; pre_check; pre_subdirs; build_files_init;
#
#
#
{(
-if [ "${ARG_CHECK_UPDATES:-0}" -eq 0 ]; then
- log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}.";
- log_env_vars "build (global)" ${LOG_ENV_VARS};
-else
- log_msg info "Version check run started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}.";
-fi;
+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)";
@@ -65,10 +60,6 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do
unset PKG_NAME_PARENT;
if [ "${PKG_NAME#*_flavour_*}" != "${PKG_NAME}" ]; then
PKG_NAME_PARENT="${PKG_NAME%_flavour_*}";
- elif [ "${ARG_CHECK_UPDATES:-0}" -eq 1 ]\
- && [ "${BUILD_PACKAGE#*.*}" = "${BUILD_PACKAGE}" ]; then
- (mode_check_pkg_updates "${PKG_NAME}" "${BUILD_PACKAGE}");
- continue;
else
unset BUILD_SCRIPT_RC;
fi;
@@ -81,10 +72,8 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do
while [ ${#} -gt 0 ]; do
_pkg_step_cmds=""; _pkg_step_cmd_args="";
case "${1#*:}" in
- abstract) _pkg_step_cmds="pkg_${PKG_NAME}_${1%:*}";
- _pkg_step_cmd_args="${ARG_RESTART_AT:-ALL}"; ;;
- always) _pkg_step_cmds="pkg_${1%:*}"; ;;
- main) if [ "${BUILD_TARGET}" = "INVARIANTS" ]; then
+ dynamic)
+ if [ "${BUILD_TARGET}" = "INVARIANTS" ]; then
_pkg_step_cmds="pkg_${PKG_NAME}_${1%:*} pkg_${1%:*}";
elif [ -n "${BUILD_PACKAGES_RESTART}" ]; then
if [ -z "${ARG_RESTART_AT}" ]\
@@ -94,10 +83,20 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do
elif ! is_build_script_done "${PKG_NAME}" "${1%:*}"; then
_pkg_step_cmds="pkg_${PKG_NAME}_${1%:*} pkg_${1%:*}";
fi; ;;
- optional)
+ invariant)
+ _pkg_step_cmds="pkg_${1%:*}"; ;;
+ variant)
if lmatch "${ARG_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="${ARG_RESTART_AT:-ALL}"; ;;
+ all)
+ if test_cmd "pkg_${PKG_NAME}_${1%:*}"; then
+ "pkg_${PKG_NAME}_${1%:*}" "${ARG_RESTART_AT:-ALL}";
+ break;
+ fi; ;;
*) continue; ;;
esac;
for __ in ${_pkg_step_cmds}; do
@@ -134,10 +133,7 @@ for BUILD_TARGET_LC in $(subst_tgts invariants ${BUILD_TARGETS_META:-world}); do
break;
fi;
done;
-if [ "${BUILD_SCRIPT_RC:-0}" -eq 0 ]; then
- post_copy_etc; post_sha256sums; post_tarballs;
-fi;
-post_build_files;
+build_files_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).";
if [ ${ARG_RELAXED:-0} -eq 1 ]\
diff --git a/subr/mode_check_updates.subr b/check_updates.sh
index 9699d360..9699d360 100644..100755
--- a/subr/mode_check_updates.subr
+++ b/check_updates.sh
diff --git a/etc/build.usage b/etc/build.usage
index ff07df9d..9f2747fb 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -1,4 +1,4 @@
-usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-C] [-h]
+usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-h]
[-i] [-N] [-r package[,...][:step]] [-R] [-t[.gz|.bz2|.xz] [-v]
[<target>[ ...]]
-x Set the xtrace sh(1)ell option for debugging purposes.
@@ -6,7 +6,6 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-C] [-h]
-a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64.
-b debug|release Selects debug or release build; defaults to debug.
-c Clean ${PREFIX} before processing build scripts.
- -C Check package(s) for updates upstream.
-h Show this screen.
-i Ignore SHA256 hash mismatches when downloading files.
-N Offline mode: no {wget,git-{clone,pull}}(1) calls.
@@ -24,8 +23,8 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-C] [-h]
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
<target>[ ...] One of:
host_toolchain, native_toolchain, runtime, host_packages,
- lib_packages, dev_packages, leaf_packages, minipix, devroot,
- dev, or world.
+ lib_packages, dev_packages, leaf_packages, minipix, dist,
+ devroot, dev, or world.
${HOME}/midipix_build.vars, ../midipix_build.vars, and build.vars are sourced
if they exist.
diff --git a/patches/mksh.local.patch b/patches/mksh.local.patch
new file mode 100644
index 00000000..a1793470
--- /dev/null
+++ b/patches/mksh.local.patch
@@ -0,0 +1,5 @@
+--- mksh/Makefile.orig 1970-01-01 00:00:00.000000000 +0000
++++ mksh/Makefile 2017-11-21 00:35:22.280000000 +0000
+@@ -0,0 +1,2 @@
++all::
++ sh Build.sh
diff --git a/subr/build.subr b/subr/build.subr
index d6e72898..b7341632 100644
--- a/subr/build.subr
+++ b/subr/build.subr
@@ -47,46 +47,28 @@ build_fileop() {
fi;
};
-install_files() {
- local _verbose _prefix _ln_target _ln_fname _mkdir_fname \
- _file_fname_src _file_fname_dst;
- if [ "${1}" = "-v" ]; then
- _verbose=1; shift;
- fi; _prefix="${1}"; shift;
- while [ ${#} -gt 0 ]; do
- case "${1}" in
- @*=*)
- _ln_target="${1%=*}";
- _ln_target="${_ln_target#@}";
- _ln_fname="${1#*=}";
- if [ "${_ln_fname#/}" = "${_ln_fname}" ]; then
- _ln_fname="${_prefix:+${_prefix}/}${_ln_fname}";
- fi;
- if [ -e "${_ln_fname}" ]; then
- if [ ${_verbose:-0} -eq 1 ]; then
- echo build_fileop rm "${_ln_fname}";
- fi;
- build_fileop rm "${_ln_fname}";
- fi;
- 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}";
- ;;
- *)
- _file_fname_src="${1%=*}";
- _file_fname_dst="${1#*=}";
- 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}";
- ;;
- esac; shift;
- done;
+build_files_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;
+};
+build_files_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="";
};
is_build_script_done() {
diff --git a/subr/pkg_build.subr b/subr/pkg_build.subr
index 4cb29d29..70801628 100644
--- a/subr/pkg_build.subr
+++ b/subr/pkg_build.subr
@@ -7,23 +7,19 @@ pkg_build() {
if [ ! -x "${PKG_CONFIGURE}" ]; then
_no_autoconf=1;
fi;
- if [ -n "${PKG_BUILD_CMDLINE}" ]; then
- ${PKG_BUILD_CMDLINE};
- else
- # 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 \
- ${PKG_MAKEFLAGS_BUILD} \
- ${PKG_MAKEFLAGS_BUILD_EXTRA} \
- AR=${AR} ${_no_autoconf:+CC=${CC}} RANLIB=${RANLIB} \
- "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}" \
- "${CFLAGS_FOR_BUILD:+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD}}" \
- "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}" \
- "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}" \
- "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}"\
- "LIBTOOL=${PKG_SLIBTOOL:-slibtool}";
- fi;
+ # 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 \
+ ${PKG_MAKEFLAGS_BUILD} \
+ ${PKG_MAKEFLAGS_BUILD_EXTRA} \
+ AR=${AR} ${_no_autoconf:+CC=${CC}} RANLIB=${RANLIB} \
+ "${PKG_CFLAGS_BUILD:+CFLAGS=${PKG_CFLAGS_BUILD}}" \
+ "${CFLAGS_FOR_BUILD:+CFLAGS_FOR_BUILD=${CFLAGS_FOR_BUILD}}" \
+ "${PKG_CFLAGS_BUILD_EXTRA:+CFLAGS+=${PKG_CFLAGS_BUILD_EXTRA}}" \
+ "${PKG_LDFLAGS_BUILD:+LDFLAGS=${PKG_LDFLAGS_BUILD}}" \
+ "${PKG_LDFLAGS_BUILD_EXTRA:+LDFLAGS+=${PKG_LDFLAGS_BUILD_EXTRA}}"\
+ "LIBTOOL=${PKG_SLIBTOOL:-slibtool}";
};
# vim:filetype=sh
diff --git a/subr/pkg_clean.subr b/subr/pkg_build_clean.subr
index 4cfaa15a..8b2e909d 100644
--- a/subr/pkg_clean.subr
+++ b/subr/pkg_build_clean.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_clean() {
+pkg_build_clean() {
make clean;
};
diff --git a/subr/pkg_autoconf.subr b/subr/pkg_configure_autotools.subr
index 8a0ea124..dbad6a30 100644
--- a/subr/pkg_autoconf.subr
+++ b/subr/pkg_configure_autotools.subr
@@ -2,32 +2,32 @@
# set -o errexit -o noglob are assumed.
#
-pkg_autoconf() {
- local __;
+pkg_configure_autotools() {
+ local _script_fname _subdir_tgt;
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
+ for _script_fname in bootstrap bootstrap.sh autogen.sh ""; do
+ if [ -z "${_script_fname}" ]; then
(build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf)\
|| exit 1 && break;
- 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
+ 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
+ if [ -e "${_subdir_tgt}" ]; then
echo install -m 0700 \
"${MIDIPIX_BUILD_PWD}/etc/config.sub" \
- "${___}/config.sub";
+ "${_subdir_tgt}/config.sub";
install -m 0700 \
"${MIDIPIX_BUILD_PWD}/etc/config.sub" \
- "${___}/config.sub";
+ "${_subdir_tgt}/config.sub";
break;
fi;
done;
- (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && "${SHELL}" "${__}")\
- || exit 1 && break;
+ (build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && \
+ "${SHELL}" "${_script_fname}") || exit 1 && break;
fi;
done;
fi;
@@ -38,9 +38,6 @@ pkg_autoconf() {
-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}/";
- 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_patch.subr b/subr/pkg_configure_patch.subr
index fadd1ed8..f40d73d7 100644
--- a/subr/pkg_patch.subr
+++ b/subr/pkg_configure_patch.subr
@@ -2,21 +2,21 @@
# set -o errexit -o noglob are assumed.
#
-pkg_patch() {
+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 \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}/*.patch \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}/*.patch \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local.patch \
- ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local.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_NAME}/*.patch \
+ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}/*.patch \
+ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}/*.patch \
+ ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch \
+ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local.patch \
+ ${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local.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}"\
&& [ -r "${_patch_fname}" ]; then
diff --git a/subr/pkg_patch_pre.subr b/subr/pkg_configure_patch_pre.subr
index f6ab9f05..d228bd83 100644
--- a/subr/pkg_patch_pre.subr
+++ b/subr/pkg_configure_patch_pre.subr
@@ -2,15 +2,15 @@
# set -o errexit -o noglob are assumed.
#
-pkg_patch_pre() {
- local __;
- for __ in \
+pkg_configure_patch_pre() {
+ local _patch_path;
+ for _patch_path in \
${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}_pre.local.patch \
${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}_pre.local@${BUILD_HNAME}.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 "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${__}";
+ if [ -r "${_patch_path}" ]; then
+ patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_path}";
fi;
done;
};
diff --git a/subr/pkg_disabled.subr b/subr/pkg_disabled.subr
deleted file mode 100644
index f9580c64..00000000
--- a/subr/pkg_disabled.subr
+++ /dev/null
@@ -1,14 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_disabled() {
- local _pkg_name_uc;
- _pkg_name_uc="$(toupper "${PKG_NAME}")";
- if [ "$(get_var_unsafe PKG_${_pkg_name_uc}_DISABLED)" = "1" ]; then
- log_msg vnfo "Skipping disabled package \`${PKG_NAME}.'";
- exit 0;
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_fetch.subr b/subr/pkg_fetch.subr
deleted file mode 100644
index 7c71c344..00000000
--- a/subr/pkg_fetch.subr
+++ /dev/null
@@ -1,82 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-# N.B. URLs ($1) may contain `?' or '&' characters.
-pkgp_fetch() {
- local _url="${1}" _sha256sum_src="${2}";
- if [ -z "${3}" ]; then
- _url_dst="${DLCACHEDIR}/$(basename "${_url}")";
- else
- _url_dst="${DLCACHEDIR}/${3}";
- fi;
- if [ "${ARG_OFFLINE:-0}" -eq 1 ]\
- || [ -e "${_url_dst}.fetched" ]; then
- return 0;
- else
- wget ${DEFAULT_WGET_ARGS} -c -O "${_url_dst}" "${_url}";
- fi;
- if [ -n "${_sha256sum_src}" ]; then
- 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}.)";
- else
- log_msg warn "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
- fi;
- fi;
- fi;
- touch "${_url_dst}.fetched";
-};
-
-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}" &&\
- 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}" &&\
- git checkout -b "${_branch}");
- fi;
- fi;
- fi;
- build_fileop rm "${_tgtdir}/${_subdir}";
- build_fileop cp "${DLCACHEDIR}/${_subdir}" "${_tgtdir}";
-};
-
-pkgp_fetch_urls_git() {
- 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 "${_tgtdir}" "${_subdir}" "${_url}" "${_git_branch}";
- done;
-};
-
-pkg_fetch() {
- if [ -n "${1}" ]; then
- if [ "${1}" = "-git" ]; then
- shift; pkgp_fetch_urls_git "${1}" "${PKG_BASE_DIR}";
- else
- pkgp_fetch "${1}" "${2}";
- fi;
- else
- if [ -n "${PKG_URL}" ]; then
- pkgp_fetch "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}";
- fi;
- if [ -n "${PKG_URLS_GIT}" ]; then
- pkgp_fetch_urls_git "${PKG_URLS_GIT}" "${PKG_BASE_DIR}";
- fi;
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_extract.subr b/subr/pkg_fetch_extract.subr
index 909dc730..71155b44 100644
--- a/subr/pkg_extract.subr
+++ b/subr/pkg_fetch_extract.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_extract() {
+pkg_fetch_extract() {
if [ -n "${PKG_URL}" ]\
&& [ "${PKG_URL_TYPE:-wget}" = wget ]; then
build_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}";
diff --git a/subr/pkg_fetch_git.subr b/subr/pkg_fetch_git.subr
new file mode 100644
index 00000000..0ff61ae2
--- /dev/null
+++ b/subr/pkg_fetch_git.subr
@@ -0,0 +1,49 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+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}" &&\
+ 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}" &&\
+ git checkout -b "${_branch}");
+ fi;
+ fi;
+ fi;
+ build_fileop rm "${_tgtdir}/${_subdir}";
+ build_fileop cp "${DLCACHEDIR}/${_subdir}" "${_tgtdir}";
+};
+
+pkgp_fetch_urls_git() {
+ local _tgtdir _url_spec _subdir _url _git_branch;
+ _tgtdir="${1}"; shift;
+ for _url_spec in "${@}"; do
+ _subdir="${_url_spec%=*}";
+ _url="${_url_spec#*=}";
+ _url="${_url%@*}";
+ if [ "${_url_spec#*@}" != "${_url_spec}" ]; then
+ _git_branch=${_url_spec#*@};
+ fi;
+ pkgp_fetch_git "${_tgtdir}" "${_subdir}" "${_url}" "${_git_branch}";
+ done;
+};
+
+pkg_fetch_git() {
+ if [ ${#} -gt 0 ]; then
+ pkgp_fetch_urls_git "${PKG_BASE_DIR}" "${@}";
+ else
+ if [ -n "${PKG_URLS_GIT}" ]; then
+ pkgp_fetch_urls_git "${PKG_BASE_DIR}" ${PKG_URLS_GIT};
+ fi;
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_build_dir.subr b/subr/pkg_fetch_subdirs.subr
index 2143e057..680871e2 100644
--- a/subr/pkg_build_dir.subr
+++ b/subr/pkg_fetch_subdirs.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_build_dir() {
+pkg_fetch_subdirs() {
if [ -z "${PKG_BUILD_DIR}" ]; then
if [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure" ]\
|| [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.ac" ]\
@@ -14,6 +14,10 @@ pkg_build_dir() {
else
PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}";
fi;
+ if [ ! -d "${PKG_BUILD_DIR}" ]; then
+ build_fileop mkdir "${PKG_BUILD_DIR}";
+ fi;
+ build_fileop cd "${PKG_BUILD_DIR}";
};
# vim:filetype=sh
diff --git a/subr/pkg_fetch_wget.subr b/subr/pkg_fetch_wget.subr
new file mode 100644
index 00000000..5dd0cc55
--- /dev/null
+++ b/subr/pkg_fetch_wget.subr
@@ -0,0 +1,42 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+# N.B. URLs ($1) may contain `?' or '&' characters.
+pkgp_fetch_wget() {
+ local _url="${1}" _sha256sum_src="${2}";
+ if [ -z "${3}" ]; then
+ _url_dst="${DLCACHEDIR}/$(basename "${_url}")";
+ else
+ _url_dst="${DLCACHEDIR}/${3}";
+ fi;
+ if [ "${ARG_OFFLINE:-0}" -eq 1 ]\
+ || [ -e "${_url_dst}.fetched" ]; then
+ return 0;
+ else
+ wget ${DEFAULT_WGET_ARGS} -c -O "${_url_dst}" "${_url}";
+ fi;
+ if [ -n "${_sha256sum_src}" ]; then
+ 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}.)";
+ else
+ log_msg warn "Warning: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)";
+ fi;
+ fi;
+ fi;
+ touch "${_url_dst}.fetched";
+};
+
+pkg_fetch_wget() {
+ if [ -n "${1}" ]; then
+ pkgp_fetch_wget "${1}" "${2}";
+ else
+ if [ -n "${PKG_URL}" ]; then
+ pkgp_fetch_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}";
+ fi;
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr
index b4ccbded..6635e4f2 100644
--- a/subr/pkg_install.subr
+++ b/subr/pkg_install.subr
@@ -2,120 +2,13 @@
# set -o errexit -o noglob are assumed.
#
-pkgp_install_clean_lib() {
- local __;
- if [ -d ${PKG_PREFIX}/lib ]; then
- for __ in $(find ${PKG_PREFIX}/lib -type f -name \*.la); do
- build_fileop rm ${__};
- done;
- fi;
-};
-
-pkgp_install_lib_link() {
- local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \
- _lib_link_tgt _lib_link_path;
- _lib_link_tgt="$(find "${_so_dir}" \
- -name "${_lib_name%%.*}.*.lib.a" |\
- 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 "${_lib_link_tgt}" \
- "${_lib_link_path}";
- fi;
-};
-
-pkgp_install_libs() {
- local _so_src_path _so_dst_path _so_dst_dir \
- _lib_src_path _lib_name _lib_dst_path;
- if [ "${PKG_BUILD_TYPE}" != "host" ] \
- && test_cmd perk \
- && test_cmd ${PKG_TARGET}-mdso; then
- for _so_src_path in \
- $(find \( -name "*.so" \
- -or -name "*.so.[0-9]*" \
- -or -name "*.so.[0-9]*.[0-9]*" \
- -or -name "*.so.[0-9]*.[0-9]*.[0-9]*" \) -print);
- do _so_src_path="${_so_src_path#./}";
- if [ "$(readlink -f "${_so_src_path}")" = "/dev/null" ]; then
- continue;
- else case "${_so_src_path}" in
- *.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}")";
- _so_dst_path="$(find "${PKG_PREFIX}/lib" \
- -name "$(basename "${_so_src_path}")" \
- -size "$(stat -c %s "${_so_src_path}")c")";
- _so_dst_dir="${_so_dst_path%/*}";
- fi;
- if [ -z "${_so_dst_path}" ]; then
- continue;
- elif [ ! -L "${_lib_src_path}" ]; then
- _lib_dst_path="${_so_dst_dir}/${_lib_name}";
- perk -e "${_so_src_path}" |\
- "${PKG_TARGET}-mdso" \
- -i "${_lib_src_path}" \
- -n "${_so_src_path}" -;
- build_fileop rm "${_lib_dst_path}";
- build_fileop cp "${_lib_src_path}" "${_lib_dst_path}";
- fi;
- pkgp_install_lib_link "${_so_dst_path}" "${_so_dst_dir}" "${_lib_name}";
- done;
- fi;
-};
-
-pkgp_install_pkgconfig() {
- local __;
- 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}/' \
- "${__}";
- fi;
- done;
-};
-
pkg_install() {
- pkgp_install_pkgconfig;
- if [ ${PKG_NO_MAKE_INSTALL:-0} -eq 0 ]; then
- 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}" \
- "${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
- build_fileop mkdir "${PKG_PREFIX_EXTRA}";
- tar -C ../destdir -cpf - . | tar -C "${PKG_PREFIX_EXTRA}" -xpf -;
- fi;
- fi;
- pkgp_install_clean_lib;
- if [ -n "${PKG_INSTALL_FILES}" ]; then
- (install_files -v ${PKG_PREFIX} ${PKG_INSTALL_FILES});
- fi;
- if [ "${PKG_NO_INSTALL_LIBS:-0}" -eq 0 ]; then
- pkgp_install_libs;
+ build_fileop mkdir "${PKG_PREFIX}";
+ tar -C ../destdir -cpf - . | tar -C "${PKG_PREFIX}" -xpf -;
+ if [ -n "${PKG_PREFIX_EXTRA}" ]; then
+ build_fileop mkdir "${PKG_PREFIX_EXTRA}";
+ tar -C ../destdir -cpf - . | tar -C "${PKG_PREFIX_EXTRA}" -xpf -;
fi;
- pkgp_install_pkgconfig;
};
# vim:filetype=sh
diff --git a/subr/pkg_install_files.subr b/subr/pkg_install_files.subr
new file mode 100644
index 00000000..23f3cbdb
--- /dev/null
+++ b/subr/pkg_install_files.subr
@@ -0,0 +1,54 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkgp_install_files() {
+ local _verbose _prefix _ln_target _ln_fname _mkdir_fname \
+ _file_fname_src _file_fname_dst;
+ if [ "${1}" = "-v" ]; then
+ _verbose=1; shift;
+ fi; _prefix="${1}"; shift;
+ while [ ${#} -gt 0 ]; do
+ case "${1}" in
+ @*=*)
+ _ln_target="${1%=*}";
+ _ln_target="${_ln_target#@}";
+ _ln_fname="${1#*=}";
+ if [ "${_ln_fname#/}" = "${_ln_fname}" ]; then
+ _ln_fname="${_prefix:+${_prefix}/}${_ln_fname}";
+ fi;
+ if [ -e "${_ln_fname}" ]; then
+ build_fileop rm "${_ln_fname}";
+ fi;
+ 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}";
+ ;;
+ *)
+ _file_fname_src="${1%=*}";
+ _file_fname_dst="${1#*=}";
+ 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}";
+ ;;
+ esac; shift;
+ done;
+};
+
+pkg_install_files() {
+ if [ ${#} -ge 2 ]; then
+ pkgp_install_files -v "${@}";
+ else
+ if [ -n "${PKG_INSTALL_FILES}" ]; then
+ pkgp_install_files -v "${PWD}/../destdir" ${PKG_INSTALL_FILES};
+ fi;
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_libs.subr b/subr/pkg_install_libs.subr
new file mode 100644
index 00000000..29ec8915
--- /dev/null
+++ b/subr/pkg_install_libs.subr
@@ -0,0 +1,49 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkgp_install_lib_link() {
+ local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \
+ _lib_link_tgt _lib_link_path;
+ _lib_link_tgt="$(find "${_so_dir}" \
+ -name "${_lib_name%%.*}.*.lib.a" |\
+ 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 "${_lib_link_tgt}" \
+ "${_lib_link_path}";
+ fi;
+};
+
+pkg_install_libs() {
+ local _so_src_path _so_dst_dir _lib_src_path _lib_name _lib_dst_path;
+ if [ "${PKG_BUILD_TYPE}" != "host" ]; then
+ for _so_src_path in \
+ $(find "${PWD}/../destdir" \
+ \( -name "*.so" \
+ -or -name "*.so.[0-9]*" \
+ -or -name "*.so.[0-9]*.[0-9]*" \
+ -or -name "*.so.[0-9]*.[0-9]*.[0-9]*" \) -print);
+ do if [ "$(readlink -f "${_so_src_path}")" = "/dev/null" ]; then
+ continue;
+ else case "${_so_src_path}" in
+ *.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}")";
+ _so_dst_dir="${_so_src_path%/*}";
+ fi;
+ if [ ! -L "${_lib_src_path}" ]; then
+ _lib_dst_path="${_so_dst_dir}/${_lib_name}";
+ perk -e "${_so_src_path}" |\
+ "${PKG_TARGET}-mdso" \
+ -i "${_lib_dst_path}" \
+ -n "${_so_src_path}" -;
+ fi;
+ pkgp_install_lib_link "${_so_src_path}" "${_so_dst_dir}" "${_lib_name}";
+ done;
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_make.subr b/subr/pkg_install_make.subr
new file mode 100644
index 00000000..3cdf837e
--- /dev/null
+++ b/subr/pkg_install_make.subr
@@ -0,0 +1,20 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_install_make() {
+ 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_MAKE_INSTALL_VNAME:-DESTDIR}=${PWD}/../destdir/" \
+ ${PKG_INSTALL_TARGET:=install};
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_pkgconfig.subr b/subr/pkg_install_pkgconfig.subr
new file mode 100644
index 00000000..b46069a3
--- /dev/null
+++ b/subr/pkg_install_pkgconfig.subr
@@ -0,0 +1,16 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_install_pkgconfig() {
+ local __;
+ for __ in $(find "${PWD}/../destdir" -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}/' \
+ "${__}";
+ fi;
+ done;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_pre.subr b/subr/pkg_install_pre.subr
deleted file mode 100644
index 7ab8a9e2..00000000
--- a/subr/pkg_install_pre.subr
+++ /dev/null
@@ -1,18 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_install_pre() {
- if [ "${PKG_NAME%flavour_minipix}" != "${PKG_NAME}" ] \
- && [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ] \
- && [ -e "${PREFIX_MINIPIX}" ]; then
- find "${PREFIX_MINIPIX}" -perm /a=x \
- \( -type f -or -type l \) > "${WORKDIR}/.stat_minipix.old";
- elif [ "${BUILD}" = release ] \
- && [ -e "${PREFIX_NATIVE}/bin" ]; then
- find "${PREFIX_NATIVE}/bin" -perm /a=x \
- \( -type f -or -type l \) > "${WORKDIR}/.stat_native.old";
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_install_purge_la.subr b/subr/pkg_install_purge_la.subr
new file mode 100644
index 00000000..9eb160fb
--- /dev/null
+++ b/subr/pkg_install_purge_la.subr
@@ -0,0 +1,12 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_install_purge_la() {
+ local __;
+ for __ in $(find "${PWD}/../destdir/lib" -type f -name \*.la); do
+ build_fileop rm ${__};
+ done;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_strip.subr b/subr/pkg_install_strip.subr
new file mode 100644
index 00000000..0a64b5a1
--- /dev/null
+++ b/subr/pkg_install_strip.subr
@@ -0,0 +1,31 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkgp_strip_tree() {
+ local _tree_root="${1}" _bin_path;
+ if [ ! -e "${_tree_root}" ]; then
+ return;
+ fi;
+ for _bin_path in $(find "${_tree_root}" -perm /a=x \
+ \( -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}";
+ ${TARGET}-strip ${_bin_path};
+ fi;
+ set -o errexit;
+ done;
+};
+
+pkg_strip() {
+ if [ "${PKG_NAME%flavour_minipix}" != "${PKG_NAME}" ] \
+ && [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ]; then
+ pkgp_strip_tree "${PWD}/../destdir";
+ elif [ "${BUILD}" = release ]; then
+ pkgp_strip_tree "${PWD}/../destdir/bin";
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/subr/pkg_install_subdirs.subr b/subr/pkg_install_subdirs.subr
new file mode 100644
index 00000000..c63eda70
--- /dev/null
+++ b/subr/pkg_install_subdirs.subr
@@ -0,0 +1,17 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_install_subdirs() {
+ pkg_install_files "${PWD}/.." \
+ /=destdir \
+ /=destdir/bin \
+ /=destdir/lib \
+ /=destdir/sbin \
+ /=destdir/share/man/man1 \
+ /=destdir/share/man \
+ @.=destdir/usr \
+ @share/man=destdir/man;
+};
+
+# vim:filetype=sh
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
diff --git a/subr/pkg_setup_vars.subr b/subr/pkg_setup_vars.subr
index 07b91fcb..fc9f8537 100644
--- a/subr/pkg_setup_vars.subr
+++ b/subr/pkg_setup_vars.subr
@@ -3,18 +3,19 @@
#
pkgp_setup_pkg_vars() {
- local _pkg_name="${1}" _pkg_name_uc _build_uc _vname __;
+ local _pkg_name="${1}" _pkg_name_uc _build_uc _vname_dst _vname_src;
_pkg_name_uc="$(toupper "${_pkg_name}")";
_build_uc="$(toupper "${BUILD}")";
- for _vname in PREFIX ${PKG_BUILD_VARS}; do
- for __ in "DEFAULT_${_vname}" \
- "${BUILD_TARGET}_${_vname}" \
- "PKG_${_pkg_name_uc}_${_vname}" \
- "PKG_${_pkg_name_uc}_${_vname}_${_build_uc}"; do
- if [ -n "$(get_var_unsafe "${__}")" ]; then
- set_var_unsafe "PKG_${_vname}" "$(get_var_unsafe ${__})";
- if ! lmatch "${PKG_ENV_VARS}" " " "${__}"; then
- PKG_ENV_VARS="${PKG_ENV_VARS:+${PKG_ENV_VARS} }${__}";
+ 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
+ PKG_ENV_VARS="${PKG_ENV_VARS:+${PKG_ENV_VARS} }${_vname_src}";
fi;
fi;
done;
@@ -22,10 +23,12 @@ pkgp_setup_pkg_vars() {
};
pkg_setup_vars() {
- local __;
- for __ in vars/${PKG_NAME}.vars; do
- [ \( -e "${__}" \) -o \( -L "${__}" \) ]\
- && { . "${__}"; };
+ local _vars_path;
+ for _vars_path in vars/${PKG_NAME}.vars; do
+ if [ -e "${_vars_path}" ]\
+ || [ -L "${_vars_path}" ]; then
+ . "${_vars_path}";
+ fi;
done;
if [ -n "${PKG_NAME_PARENT}" ]; then
pkgp_setup_pkg_vars "${PKG_NAME_PARENT}";
diff --git a/subr/pkg_strip.subr b/subr/pkg_strip.subr
deleted file mode 100644
index 9f6ce31f..00000000
--- a/subr/pkg_strip.subr
+++ /dev/null
@@ -1,37 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkgp_strip_tree() {
- local _tree_old="${1}" _tree_root="${2}";
- local _tree_new="${_tree_old%.*}.new" _tree_diff="${_tree_old%.*}.diff";
- if [ ! -e "${_tree_old}" ] \
- || [ ! -e "${_tree_root}" ]; then
- return;
- fi;
- find "${_tree_root}" -perm /a=x \( -type f -or -type l \) > "${_tree_new}";
- set +o errexit;
- for _pname in $(diff -u "${_tree_old}" "${_tree_new}" |\
- sed -n '3,${/^+/s/^+//p}'); do
- if objdump -sj .debug_info "${_pname}" >/dev/null 2>&1; then
- log_msg info "Stripping ${_pname}...";
- log_msg vnfo "${TARGET}-strip ${_pname}";
- ${TARGET}-strip ${_pname};
- fi;
- done;
- build_fileop rm "${_tree_old}" "${_tree_new}" "${_tree_diff}";
- set -o errexit;
-};
-
-pkg_strip() {
- if [ "${PKG_NAME%flavour_minipix}" != "${PKG_NAME}" ] \
- && [ ${ARG_DEBUG_MINIPIX:-0} -eq 0 ]; then
- pkgp_strip_tree "${WORKDIR}/.stat_minipix.old" \
- "${PREFIX_MINIPIX}";
- elif [ "${BUILD}" = release ]; then
- pkgp_strip_tree "${WORKDIR}/.stat_native.old" \
- "${PREFIX_NATIVE}/bin";
- fi;
-};
-
-# vim:filetype=sh
diff --git a/subr/pkg_work_dir.subr b/subr/pkg_work_dir.subr
deleted file mode 100644
index 5d18278c..00000000
--- a/subr/pkg_work_dir.subr
+++ /dev/null
@@ -1,12 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pkg_work_dir() {
- if [ ! -d "${PKG_BUILD_DIR}" ]; then
- build_fileop mkdir "${PKG_BUILD_DIR}";
- fi;
- build_fileop cd "${PKG_BUILD_DIR}";
-};
-
-# vim:filetype=sh
diff --git a/subr/post_build_files.subr b/subr/post_build_files.subr
deleted file mode 100644
index 6c74a7c9..00000000
--- a/subr/post_build_files.subr
+++ /dev/null
@@ -1,15 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-post_build_files() {
- : $((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;
-};
-
-# vim:filetype=sh
diff --git a/subr/pre_build_files.subr b/subr/pre_build_files.subr
deleted file mode 100644
index 3fbcf0cb..00000000
--- a/subr/pre_build_files.subr
+++ /dev/null
@@ -1,20 +0,0 @@
-#
-# set -o errexit -o noglob are assumed.
-#
-
-pre_build_files() {
- 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="";
-};
-
-# vim:filetype=sh
diff --git a/subr/pre_prereqs.subr b/subr/pre_check.subr
index f048365e..28e229e9 100644
--- a/subr/pre_prereqs.subr
+++ b/subr/pre_check.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pre_prereqs() {
+pre_check() {
local __ _exit;
for __ in ${CHECK_PATH_VARS}; do
if [ -z "${___:=$(get_var_unsafe "${__}")}" ]; then
diff --git a/subr/pre_subdirs.subr b/subr/pre_subdirs.subr
index 6d857d8a..4f724204 100644
--- a/subr/pre_subdirs.subr
+++ b/subr/pre_subdirs.subr
@@ -12,17 +12,19 @@ pre_subdirs() {
fi;
done;
fi;
- install_files "" \
+ pkg_install_files "" \
/=${DLCACHEDIR} \
/=${WORKDIR} \
/=${PREFIX} \
/=${PREFIX}/bin \
+ /=${PREFIX}/share/man \
/=${PREFIX}/${TARGET}/bin \
/=${PREFIX}/${TARGET}/lib \
/=${PREFIX}/x86_64-w64-mingw32 \
/=${PREFIX_CROSS} \
/=${PREFIX_MINIPIX}/bin \
/=${PREFIX_NATIVE} \
+ /=${PREFIX_NATIVE}/share/man \
/=${PREFIX_NATIVE}/${TARGET}/lib \
@.=${PREFIX}/usr \
@.=${PREFIX}/x86_64-w64-mingw32/mingw \
diff --git a/vars/apr.vars b/vars/apr.vars
index a36daa44..de302737 100644
--- a/vars/apr.vars
+++ b/vars/apr.vars
@@ -2,12 +2,12 @@
# set -o errexit -o noglob are assumed.
#
-pkg_apr_install_post() {
+pkg_apr_install_make_post() {
sed -e 's,echo "\$APR_BUILD_DIR/libtool",echo '"${PREFIX}"'/bin/slibtool,' \
-e 's,echo "\${installbuilddir}/libtool",echo '"${PREFIX}"'/bin/slibtool,' \
-e 's,flags="\$flags -I\$includedir \$EXTRA_INCLUDES",flags="-I'"${PKG_PREFIX}"'/include/apr-1",' \
- "${PKG_PREFIX}/bin/apr-1-config" > "${PREFIX}/bin/${PKG_TARGET}-apr-1-config";
- chmod +x "${PREFIX}/bin/${PKG_TARGET}-apr-1-config";
+ "${PWD}/../destdir/bin/apr-1-config" > "${PWD}/../destdir/bin/${PKG_TARGET}-apr-1-config";
+ chmod +x "${PWD}/../destdir/bin/${PKG_TARGET}-apr-1-config";
};
# vim:filetype=sh
diff --git a/vars/build.vars b/vars/build.vars
index 936ef723..19e817b5 100644
--- a/vars/build.vars
+++ b/vars/build.vars
@@ -3,7 +3,7 @@
#
INVARIANTS_PACKAGES="chainport";
: ${PKG_CHAINPORT_URLS_GIT:="chainport=${DEFAULT_GITROOT}/ports/chainport"};
-: ${PKG_CHAINPORT_BUILD_STEPS_DISABLE:="build:main configure:main install:main"};
+: ${PKG_CHAINPORT_BUILD_STEPS_DISABLE:="configure:dynamic build:dynamic install_make:dynamic install:dynamic"};
#
# Build target host_toolchain
@@ -24,7 +24,7 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}";
: ${PKG_PERK_HOST_PREFIX:=${PREFIX}};
: ${PKG_MDSO_HOST_URLS_GIT:="mdso=${DEFAULT_GITROOT}/mdso"};
: ${PKG_MDSO_HOST_CONFIGURE_ARGS:="--prefix=/usr"};
-: ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso bin/mdso=${TARGET}/bin/mdso"};
+: ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso /=${TARGET}/bin bin/mdso=${TARGET}/bin/mdso"};
: ${PKG_MDSO_HOST_PREFIX:=${PREFIX}};
: ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa};
: ${PKG_BINUTILS_HOST_VERSION:=2.24.51};
@@ -47,7 +47,7 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}";
: ${PKG_GCC_STAGE1_BASE_DIR:=${WORKDIR}};
: ${PKG_PSXSTUB_URLS_GIT:="psxstub=${DEFAULT_GITROOT}/psxstub"};
: ${PKG_PSXSTUB_BUILD_DIR:=psxstub};
-: ${PKG_PSXSTUB_BUILD_STEPS_DISABLE:=build:main};
+: ${PKG_PSXSTUB_BUILD_STEPS_DISABLE:=build:dynamic};
: ${PKG_MUSL_NO_COMPLEX_VERSION:=1.1.12};
: ${PKG_MUSL_NO_COMPLEX_BASE_DIR:=${WORKDIR}};
: ${PKG_GCC_RUNTIME_VERSION:=4.6.4};
@@ -58,10 +58,9 @@ HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}";
: ${PKG_GCC_LIBSTDCPP_V3_BASE_DIR:=${WORKDIR}};
: ${PKG_GCC_FULL_VERSION:=4.6.4};
: ${PKG_GCC_FULL_BASE_DIR:=${WORKDIR}};
-: ${PKG_INSTALL_STRIP_HOST_BUILD_STEPS_DISABLE:="fetch:main extract:main build:main"};
: ${PKG_INSTALL_STRIP_HOST_URL:=none};
: ${PKG_PSXTYPES_HOST_URLS_GIT:=psxtypes=${DEFAULT_GITROOT}/psxtypes};
-: ${PKG_PSXTYPES_HOST_BUILD_STEPS_DISABLE:=build:main};
+: ${PKG_PSXTYPES_HOST_BUILD_STEPS_DISABLE:=build:dynamic};
: ${PKG_LDSO_HOST_URLS_GIT:=pemagine=${DEFAULT_GITROOT}/pemagine};
: ${PKG_LDSO_HOST_BUILD_TYPE:=cross};
: ${PKG_LDSO_HOST_CFLAGS_CONFIGURE_EXTRA:="-O0 -DPE_LDSO -I${PREFIX_CROSS}/include"};
@@ -133,7 +132,7 @@ NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}";
: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_BASE_DIR:=${WORKDIR}};
: ${PKG_MDSO_URLS_GIT:="mdso=${DEFAULT_GITROOT}/mdso"};
: ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"};
-: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso @../../bin/mdso=${TARGET}/bin/mdso"};
+: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso /=${TARGET}/bin @../../bin/mdso=${TARGET}/bin/mdso"};
#
# Build target runtime
@@ -154,7 +153,7 @@ RUNTIME_PREFIX="${PREFIX_NATIVE}";
: ${PKG_LDSO_URLS_GIT:=pemagine=${DEFAULT_GITROOT}/pemagine};
: ${PKG_LDSO_CFLAGS_CONFIGURE_EXTRA:="-O0 -DPE_LDSO"};
: ${PKG_LDSO_CONFIGURE_ARGS_EXTRA:=--disable-shared};
-: ${PKG_LDSO_INSTALL_FILES:="@../../lib/libldso.a=${TARGET}/lib/libldso.a"};
+: ${PKG_LDSO_INSTALL_FILES:="/=${TARGET}/lib @../../lib/libldso.a=${TARGET}/lib/libldso.a"};
: ${PKG_LDSO_MAKEFLAGS_BUILD_EXTRA:=STATIC_LIB_NAME=libldso.a};
: ${PKG_LDSO_MAKEFLAGS_INSTALL_EXTRA:=STATIC_LIB_NAME=libldso.a};
: ${PKG_NTCON_URLS_GIT:=ntcon=${DEFAULT_GITROOT}/ntcon};
@@ -165,10 +164,9 @@ RUNTIME_PREFIX="${PREFIX_NATIVE}";
: ${PKG_PSXSCL_CFLAGS_CONFIGURE_EXTRA:=-O0};
: ${PKG_PSXSCL_INSTALL_TARGET_EXTRA:=install-lib};
: ${PKG_PSXSCL_STRACE_URLS_GIT:=psxscl=${DEFAULT_GITROOT_HEAD}/psxscl};
+: ${PKG_PSXSCL_STRACE_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_PSXSCL_STRACE_CFLAGS_CONFIGURE_EXTRA:="-DPSX_INTERNAL_STRACE -O0"};
: ${PKG_PSXSCL_STRACE_INSTALL_FILES:="/=lib/psxscl_strace lib/libpsxscl.so=lib/psxscl_strace/"};
-: ${PKG_PSXSCL_STRACE_NO_INSTALL_LIBS:=1};
-: ${PKG_PSXSCL_STRACE_NO_MAKE_INSTALL:=1};
: ${PKG_NTCTTY_URLS_GIT:=ntctty=${DEFAULT_GITROOT_HEAD}/ntctty};
: ${PKG_NTCTTY_CFLAGS_CONFIGURE_EXTRA:=-O0};
: ${PKG_PTYCON_URLS_GIT:=ptycon=${DEFAULT_GITROOT_HEAD}/ptycon};
@@ -194,6 +192,7 @@ HOST_PACKAGES_PREFIX="${PREFIX}";
: ${PKG_CMAKE_HOST_VERSION:=3.6.3};
: ${PKG_CMAKE_HOST_URL:=https://cmake.org/files/v${PKG_CMAKE_HOST_VERSION%.*}/cmake-${PKG_CMAKE_HOST_VERSION}.tar.gz};
: ${PKG_CMAKE_HOST_CONFIGURE_ARGS:="--parallel=${DEFAULT_BUILD_CPUS} --prefix=${PREFIX}"};
+: ${PKG_CMAKE_HOST_DISABLED:=1};
: ${PKG_LLVM_HOST_SHA256SUM:=6e82ce4adb54ff3afc18053d6981b6aed1406751b8742582ed50f04b5ab475f9};
: ${PKG_LLVM_HOST_VERSION:=3.8.1};
: ${PKG_LLVM_HOST_URL:=http://releases.llvm.org/${PKG_LLVM_HOST_VERSION}/llvm-${PKG_LLVM_HOST_VERSION}.src.tar.xz};
@@ -211,7 +210,7 @@ HOST_PACKAGES_PREFIX="${PREFIX}";
: ${PKG_GLIB_HOST_SHA256SUM:=fe22998ff0394ec31e6e5511c379b74011bee61a4421bca7fcab223dfbe0fc6a};
: ${PKG_GLIB_HOST_VERSION:=2.54.0};
: ${PKG_GLIB_HOST_URL:=http://ftp.gnome.org/pub/GNOME/sources/glib/${PKG_GLIB_HOST_VERSION%.[0-9]}/glib-${PKG_GLIB_HOST_VERSION}.tar.xz};
-: ${PKG_GLIB_HOST_BUILD_STEPS_DISABLE:=patch:main};
+: ${PKG_GLIB_HOST_BUILD_STEPS_DISABLE:=configure_patch:dynamic};
: ${PKG_GLIB_HOST_CONFIGURE_ARGS_EXTRA:="--disable-dtrace --disable-libelf --disable-libmount"};
: ${PKG_GLIB_HOST_ENV_VARS_EXTRA:=LIBFFI_CFLAGS=-I${PREFIX}/lib/libffi-${PKG_LIBFFI_HOST_VERSION}/include:LIBFFI_LIBS=-L${PREFIX}/lib64 -lffi};
: ${PKG_GLIB_HOST_MAKEFLAGS_BUILD_EXTRA:=-j1};
@@ -224,7 +223,7 @@ HOST_PACKAGES_PREFIX="${PREFIX}";
: ${PKG_RUBY_HOST_SHA256SUM:=ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507};
: ${PKG_RUBY_HOST_VERSION:=2.3.0};
: ${PKG_RUBY_HOST_URL:=https://cache.ruby-lang.org/pub/ruby/${PKG_RUBY_HOST_VERSION%.*}/ruby-${PKG_RUBY_HOST_VERSION}.tar.gz};
-: ${PKG_RUBY_HOST_BUILD_STEPS_DISABLE:=patch:main};
+: ${PKG_RUBY_HOST_BUILD_STEPS_DISABLE:=configure_patch:dynamic};
: ${PKG_RUBY_HOST_CFLAGS_CONFIGURE:="-g0 -O1"};
: ${PKG_RUBY_HOST_CONFIGURE_ARGS_EXTRA:="--disable-install-rdoc --with-out-ext=fiddle"};
@@ -270,11 +269,11 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_BZIP2_SHA256SUM:=a2848f34fcd5d6cf47def00461fcb528a0484d8edef8208d6d2e2909dc61d9cd};
: ${PKG_BZIP2_VERSION:=1.0.6};
: ${PKG_BZIP2_URL:=http://www.bzip.org/1.0.6/bzip2-${PKG_BZIP2_VERSION}.tar.gz};
+: ${PKG_BZIP2_BUILD_STEPS_DISABLE:=build_clean:variant};
: ${PKG_BZIP2_CFLAGS_BUILD_EXTRA:=${LIB_PACKAGES_CFLAGS_CONFIGURE}};
: ${PKG_BZIP2_INSTALL_FILES:="@bzdiff=bin/bzcmp @bzgrep=bin/bzegrep @bzgrep=bin/bzfgrep @bzmore=bin/bzless libbz2.so.1.0=lib/ libbz2.so.1.0.6=lib/"};
: ${PKG_BZIP2_MAKEFLAGS_BUILD_EXTRA:=-f Makefile-libbz2_so};
: ${PKG_BZIP2_MAKE_INSTALL_VNAME:=PREFIX};
-: ${PKG_BZIP2_NO_CLEAN:=1};
: ${PKG_CURL_SHA256SUM:=7f8240048907e5030f67be0a6129bc4b333783b9cca1391026d700835a788dde};
: ${PKG_CURL_VERSION:=7.51.0};
: ${PKG_CURL_URL:=https://curl.haxx.se/download/curl-${PKG_CURL_VERSION}.tar.bz2};
@@ -414,6 +413,7 @@ LIB_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_CMAKE_URL:=https://cmake.org/files/v${PKG_CMAKE_VERSION%.*}/cmake-${PKG_CMAKE_VERSION}.tar.gz};
: ${PKG_CMAKE_CFLAGS_CONFIGURE_EXTRA:="-g0 -O2"};
: ${PKG_CMAKE_CONFIGURE_ARGS:="--parallel=${DEFAULT_BUILD_CPUS} --prefix="};
+: ${PKG_CMAKE_DISABLED:=1};
: ${PKG_INPUTPROTO_SHA256SUM:=893a6af55733262058a27b38eeb1edc733669f01d404e8581b167f03c03ef31d};
: ${PKG_INPUTPROTO_VERSION:=2.3.2};
@@ -595,12 +595,12 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_CHICKEN_SHA256SUM:=e3dc2b8f95b6a3cd59c85b5bb6bdb2bd9cefc45b5d536a20cad74e3c63f4ad89};
: ${PKG_CHICKEN_VERSION:=4.11.0};
: ${PKG_CHICKEN_URL:=https://code.call-cc.org/releases/4.11.0/chicken-${PKG_CHICKEN_VERSION}.tar.gz};
+: ${PKG_CHICKEN_BUILD_STEPS_DISABLE:=build_clean:variant};
: ${PKG_CHICKEN_MAKEFLAGS_BUILD:="PLATFORM=midipix-${ARCH} PREFIX=${PREFIX_NATIVE} TARGET_PREFIX=${PREFIX_NATIVE} C_COMPILER=${TARGET}-gcc HOSTSYSTEM=${TARGET}"};
: ${PKG_CHICKEN_MAKEFLAGS_BUILD_EXTRA_DEBUG:=DEBUGBUILD=1};
: ${PKG_CHICKEN_MAKEFLAGS_BUILD_EXTRA_RELEASE:=DEBUGBUILD=0};
: ${PKG_CHICKEN_MAKE_INSTALL_VNAME:=TARGET_PREFIX};
: ${PKG_CHICKEN_MAKEFLAGS_INSTALL:="PLATFORM=midipix-${ARCH} PREFIX=${PREFIX_NATIVE} C_COMPILER=${TARGET}-gcc HOSTSYSTEM=${TARGET} CROSS_CHICKEN=1"};
-: ${PKG_CHICKEN_NO_CLEAN:=1};
: ${PKG_COREUTILS_SHA256SUM:=1117b1a16039ddd84d51a9923948307cfa28c2cea03d1a2438742253df0a0c65};
: ${PKG_COREUTILS_VERSION:=8.28};
: ${PKG_COREUTILS_URL:=https://ftp.gnu.org/gnu/coreutils/coreutils-${PKG_COREUTILS_VERSION}.tar.xz};
@@ -638,8 +638,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_FIGLET_SHA256SUM:=bf88c40fd0f077dab2712f54f8d39ac952e4e9f2e1882f1195be9e5e4257417d};
: ${PKG_FIGLET_VERSION:=2.2.5};
: ${PKG_FIGLET_URL:=ftp://ftp.figlet.org/pub/figlet/program/unix/figlet-${PKG_FIGLET_VERSION}.tar.gz};
+: ${PKG_FIGLET_BUILD_STEPS_DISABLE:=build_clean:variant};
: ${PKG_FIGLET_MAKEFLAGS_BUILD:=CC=${TARGET}-gcc LD=${TARGET}-gcc};
-: ${PKG_FIGLET_NO_CLEAN:=1};
: ${PKG_FILE_SHA256SUM:=8639dc4d1b21e232285cd483604afc4a6ee810710e00e579dbe9591681722b50};
: ${PKG_FILE_VERSION:=5.32};
: ${PKG_FILE_URL:=ftp://ftp.astron.com/pub/file/file-${PKG_FILE_VERSION}.tar.gz};
@@ -686,11 +686,11 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_JOHN_SHA256SUM:=952cf68369fb5b27f2d112ce7ca1eb16b975c85cbce8c658abb8bc5a20e1b266};
: ${PKG_JOHN_VERSION:=1.8.0};
: ${PKG_JOHN_URL:=http://www.openwall.com/john/j/john-${PKG_JOHN_VERSION}.tar.xz};
+: ${PKG_JOHN_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_JOHN_DISABLED:=$(if [ "${ARCH}" = "nt32" ]; then echo 1; fi)};
: ${PKG_JOHN_INSTALL_FILES:="run/john=bin/ run/mailer=bin/ run/makechr=bin/ run/relbench=bin/ run/unafs=bin/ run/unique=bin/ run/unshadow=bin/ /=share/john run/ascii.chr=share/john/ run/digits.chr=share/john/ run/john.conf=share/john/ run/lm_ascii.chr=share/john/ run/password.lst=share/john/"};
: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA_DEBUG:="-C src midipix-x86-64"};
: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA_RELEASE:="-C src midipix-x86-64 LDFLAGS_DEBUG=-s"};
-: ${PKG_JOHN_NO_MAKE_INSTALL:=1};
: ${PKG_JOHN_SUBDIR:=john-${PKG_JOHN_VERSION}};
: ${PKG_LDNS_SHA256SUM:=c19f5b1b4fb374cfe34f4845ea11b1e0551ddc67803bd6ddd5d2a20f0997a6cc};
: ${PKG_LDNS_VERSION:=1.7.0};
@@ -737,10 +737,9 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_MKSH_SHA256SUM:=8bce3837c386684aa7780f085f1a4dbd5e3e26fb5c528ee0d41ae29af7f39013};
: ${PKG_MKSH_VERSION:=R54};
: ${PKG_MKSH_URL:=http://pub.allbsd.org/MirOS/dist/mir/mksh/mksh-${PKG_MKSH_VERSION}.tgz};
-: ${PKG_MKSH_BUILD_CMDLINE:="sh Build.sh"};
+: ${PKG_MKSH_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_MKSH_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PACKAGES_CFLAGS_CONFIGURE:+${PACKAGES_CFLAGS_CONFIGURE} }-DMKSH_NOPROSPECTOFWORK"};
: ${PKG_MKSH_INSTALL_FILES:="mksh=bin/ /=share/doc/mksh/examples dot.mkshrc=share/doc/mksh/examples/ mksh.1=share/man/man1/"};
-: ${PKG_MKSH_NO_MAKE_INSTALL:=1};
: ${PKG_MKSH_SUBDIR:=mksh};
: ${PKG_MTR_SHA256SUM:=f2979db9e2f41aa8e6574e7771767c9afe111d9213814eb47f5e1e71876e4382};
: ${PKG_MTR_VERSION:=0.92};
@@ -774,8 +773,8 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_OPENSSH_CONFIGURE_ARGS_EXTRA_DEBUG:=--disable-strip};
: ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys};
: ${PKG_P7ZIP_URLS_GIT:="p7zip-midipix.git=https://github.com/lalbornoz/p7zip-midipix.git@master"};
+: ${PKG_P7ZIP_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_P7ZIP_INSTALL_FILES:="bin/7za=bin/"};
-: ${PKG_P7ZIP_NO_MAKE_INSTALL:=1};
: ${PKG_PACMAN_SHA256SUM:=84599e2ee2158134fd704f1cd681ea46e021165bed4df5f002aa1748caef9e7b};
: ${PKG_PACMAN_VERSION:=5.0.1};
: ${PKG_PACMAN_URL:=https://projects.archlinux.org/pacman.git/snapshot/pacman-${PKG_PACMAN_VERSION}.tar.gz};
@@ -840,10 +839,10 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_ST_SHA256SUM:=f7870d906ccc988926eef2cc98950a99cc78725b685e934c422c03c1234e6000};
: ${PKG_ST_VERSION:=0.7};
: ${PKG_ST_URL:=https://dl.suckless.org/st/st-${PKG_ST_VERSION}.tar.gz};
+: ${PKG_ST_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_ST_CFLAGS_BUILD_EXTRA:=${LEAF_PACKAGES_CFLAGS_CONFIGURE} -I${PREFIX_NATIVE}/include/freetype2};
: ${PKG_ST_INSTALL_FILES:=st=bin/ st.1=share/man/man1/ st.info=bin/};
: ${PKG_ST_LDFLAGS_BUILD_EXTRA:=-L${PREFIX_NATIVE}/lib -lX11 -lXft -lfreetype -lfontconfig};
-: ${PKG_ST_NO_MAKE_INSTALL:=1};
: ${PKG_TAR_SHA256SUM:=cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0};
: ${PKG_TAR_VERSION:=1.29};
: ${PKG_TAR_URL:=https://ftp.gnu.org/gnu/tar/tar-${PKG_TAR_VERSION}.tar.gz};
@@ -877,7 +876,6 @@ LEAF_PACKAGES_PREFIX="${PREFIX_NATIVE}";
: ${PKG_VIM_VERSION:=7.4.1952};
: ${PKG_VIM_URL:=https://github.com/vim/vim/archive/v${PKG_VIM_VERSION}.tar.gz};
: ${PKG_VIM_BUILD_DIR:=vim-${PKG_VIM_VERSION}};
-: ${PKG_VIM_CONFIG_CACHE_EXTRA:=${PKG_VIM_BUILD_DIR}/src/auto};
: ${PKG_VIM_CONFIGURE_ARGS_EXTRA:=--with-tlib=ncursesw};
: ${PKG_VIM_ENV_VARS_EXTRA:=PKG_CONFIG=${PREFIX}/bin/${TARGET}-pkg-config};
: ${PKG_VIM_INSTALL_FILES:=@vim=bin/vi};
@@ -930,10 +928,10 @@ MINIPIX_PREFIX="${PREFIX_MINIPIX}";
: ${PKG_PTYCON_FLAVOUR_MINIPIX_CONFIGURE_ARGS:="--prefix= --strict --host=${TARGET}"};
: ${PKG_PTYCON_FLAVOUR_MINIPIX_ENV_VARS_EXTRA:="CFLAGS_PATH=-I${PREFIX_NATIVE}/include:LDFLAGS_PATH=-L${PREFIX_NATIVE}/lib"};
: ${PKG_PTYCON_FLAVOUR_MINIPIX_INSTALL_TARGET:=install-static-app};
+: ${PKG_BZIP2_FLAVOUR_MINIPIX_BUILD_STEPS_DISABLE:="${PKG_BZIP2_BUILD_STEPS_DISABLE:+${PKG_BZIP2_BUILD_STEPS_DISABLE} }install_make:dynamic"};
: ${PKG_BZIP2_FLAVOUR_MINIPIX_INSTALL_FILES:="bzip2=bin/ @bzip2=bin/bunzip2 @bzip2=bin/bzcat @bzip2=bin/bzip2recover @bzip2=bin/bzgrep @bzip2=bin/bzmore @bzip2=bin/bzdiff"};
: ${PKG_BZIP2_FLAVOUR_MINIPIX_LDFLAGS_BUILD_EXTRA:="-static"};
: ${PKG_BZIP2_FLAVOUR_MINIPIX_MAKEFLAGS_BUILD_EXTRA:="-f Makefile"};
-: ${PKG_BZIP2_FLAVOUR_MINIPIX_NO_MAKE_INSTALL:=1};
: ${PKG_BZIP2_FLAVOUR_MINIPIX_PREFIX:=${PREFIX_MINIPIX}};
: ${PKG_GZIP_FLAVOUR_MINIPIX_LDFLAGS_BUILD_EXTRA:="-static"};
: ${PKG_GZIP_FLAVOUR_MINIPIX_LDFLAGS_INSTALL_EXTRA:="-static"};
@@ -943,7 +941,7 @@ MINIPIX_PREFIX="${PREFIX_MINIPIX}";
: ${PKG_XZ_FLAVOUR_MINIPIX_PREFIX:=${PREFIX_MINIPIX}};
: ${PKG_BASH_CONFIGURE_ARGS_EXTRA:="--without-bash-malloc --with-curses"};
: ${PKG_BASH_FLAVOUR_MINIPIX_CONFIGURE_ARGS_EXTRA:="--enable-static-link --without-bash-malloc --with-curses"};
-: ${PKG_BASH_FLAVOUR_MINIPIX_NO_MAKE_INSTALL:=1};
+: ${PKG_BASH_FLAVOUR_MINIPIX_BUILD_STEPS_DISABLE:=install_make:dynamic};
: ${PKG_BASH_FLAVOUR_MINIPIX_INSTALL_FILES:="bash=bin/ bashbug=bin/"};
: ${PKG_COREUTILS_FLAVOUR_MINIPIX_LDFLAGS_BUILD_EXTRA:="-static"};
: ${PKG_COREUTILS_FLAVOUR_MINIPIX_MAKEFLAGS_BUILD_EXTRA:="SHARED=0"};
@@ -954,11 +952,16 @@ MINIPIX_PREFIX="${PREFIX_MINIPIX}";
: ${PKG_TAR_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL:="-C src install-binPROGRAMS"};
#
+# Build target dist
+#
+DIST_PACKAGES="dist_etc dist_digest dist_tarballs";
+
+#
# Build meta-targets
#
DEVROOT_TARGET="host_toolchain native_toolchain runtime";
DEV_TARGET="${DEVROOT_TARGET} dev_packages";
-WORLD_TARGET="${DEVROOT_TARGET} host_packages lib_packages leaf_packages minipix";
+WORLD_TARGET="${DEVROOT_TARGET} host_packages lib_packages leaf_packages minipix dist";
ALL_TARGETS="${WORLD_TARGET} devroot dev world";
# vim:filetype=sh textwidth=0
diff --git a/vars/cmake.vars b/vars/cmake.vars
index 40f3d85d..4b302e39 100644
--- a/vars/cmake.vars
+++ b/vars/cmake.vars
@@ -38,14 +38,14 @@ pkg_cmake_configure() {
"../cmake-${PKG_VERSION}";
};
-pkg_cmake_install_pre() {
+pkg_cmake_install_make_pre() {
if [ ! -e cmake_install.cmake.orig ]; then
sed -i.orig '/^\s*set(CMAKE_INSTALL_PREFIX ".*")$/s/".*"/""/' \
cmake_install.cmake;
fi;
};
-pkg_cmake_host_install_pre() {
+pkg_cmake_host_install_make_pre() {
pkg_cmake_install_pre;
};
diff --git a/subr/post_sha256sums.subr b/vars/dist_digest.subr
index 41b131d9..1b98fb6d 100644
--- a/subr/post_sha256sums.subr
+++ b/vars/dist_digest.subr
@@ -2,10 +2,9 @@
# set -o errexit -o noglob are assumed.
#
-post_sha256sums() {
+dist_digest_all() {
local __;
- if [ "${BUILD_SCRIPT_RC:-0}" -eq 0 ]\
- && [ "${ARG_TARBALL:-0}" -eq 1 ]; then
+ if [ "${ARG_TARBALL:-0}" -eq 1 ]; then
log_msg info "Compiling SHA256 sums...";
if [ -e "${PREFIX}/SHA256SUMS" ]; then
build_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last";
diff --git a/subr/post_copy_etc.subr b/vars/dist_etc.subr
index 9681e14a..e7e0a92a 100644
--- a/subr/post_copy_etc.subr
+++ b/vars/dist_etc.subr
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-post_copy_etc() {
+dist_etc_all() {
tar -C etc -cpf - midipix.sh README midipix_shortcut.vbs |\
tar -C ${PREFIX} -xpf -;
chmod +x ${PREFIX}/midipix.sh;
diff --git a/subr/post_tarballs.subr b/vars/dist_tarballs.subr
index 2082366b..7cf075a0 100644
--- a/subr/post_tarballs.subr
+++ b/vars/dist_tarballs.subr
@@ -65,9 +65,8 @@ postp_tarball_src() {
fi;
};
-post_tarballs() {
- if [ "${BUILD_SCRIPT_RC:-0}" -eq 0 ]\
- && [ "${ARG_TARBALL:-0}" -eq 1 ]; then
+dist_tarballs_all() {
+ if [ "${ARG_TARBALL:-0}" -eq 1 ]; then
log_msg info "Building distribution tarballs...";
case "${TARBALL_SUFFIX}" in
bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then
diff --git a/vars/env.vars b/vars/env.vars
index cf6ac9d1..818f87f9 100644
--- a/vars/env.vars
+++ b/vars/env.vars
@@ -16,22 +16,23 @@
: ${PREFIX_CROSS:=${PREFIX}/${TARGET}};
: ${DLCACHEDIR:=${PREFIX_ROOT}/dlcache};
: ${WORKDIR:=${PREFIX}/tmp};
-: ${BUILD_STEPS:="disabled:always setup_vars:always setup_env:always
- all:abstract fetch:main extract:main clone:main
- patch_pre:main build_dir:always work_dir:always
- autoconf:main patch:main configure:main clean:optional build:main
- install_pre:main install:main strip:main finish:always"};
-: ${PKG_BUILD_VARS:="BASE_DIR BUILD_CMDLINE BUILD_DIR BUILD_STEPS_DISABLE
- BUILD_TYPE CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA
- CFLAGS_INSTALL_EXTRA CONFIG_CACHE_EXTRA CONFIGURE CONFIGURE_ARGS
+: ${BUILD_STEPS:="setup_vars:invariant setup_env:invariant all:all
+ 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"};
+: ${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
CONFIGURE_ARGS_EXTRA CXXFLAGS_CONFIGURE_EXTRA DISABLED
ENV_VARS_EXTRA INSTALL_FILES INSTALL_TARGET INSTALL_TARGET_EXTRA
LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA
LDFLAGS_INSTALL_EXTRA MAKE_INSTALL_VNAME MAKEFLAGS_BUILD
MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA
- NO_CLEAN NO_INSTALL_LIBS NO_MAKE_INSTALL PREFIX_EXTRA SHA256SUM
- SLIBTOOL SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"};
-: ${CLEAR_ENV_VARS_EXCEPT:="ARG_VERBOSE GITROOT_HEAD HOME PATH SHELL TERM TARBALL_SIGN_GPG_KEY USER"};
+ PREFIX_EXTRA SHA256SUM SLIBTOOL SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"};
+: ${CLEAR_ENV_VARS_EXCEPT:="ARG_VERBOSE DEFAULT_GITROOT_HEAD HOME PATH SHELL TERM TARBALL_SIGN_GPG_KEY USER"};
: ${CLEAR_PREFIX_DIRS:="bin i686-nt32-midipix include lib lib64 libexec minipix native share tmp x86_64-nt64-midipix"};
# Default flags
diff --git a/vars/gcc.vars b/vars/gcc.vars
index bcb092ed..12902647 100644
--- a/vars/gcc.vars
+++ b/vars/gcc.vars
@@ -97,7 +97,7 @@ pkg_gcc_stage1_all() {
esac;
# GCC, stage1.
if ! is_build_script_done "${PKG_NAME}" fetch "${_restart_at}"; then
- pkg_fetch -git "cbb-gcc-${PKG_GCC_VERSION}=${GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}";
+ pkg_fetch_git "cbb-gcc-${PKG_GCC_VERSION}=${DEFAULT_GITROOT}/cbb/cbb-gcc-${PKG_GCC_VERSION}";
set_build_script_done "${PKG_NAME}" fetch -patch;
fi;
if ! is_build_script_done "${PKG_NAME}" patch "${_restart_at}"; then
diff --git a/vars/install_strip_host.vars b/vars/install_strip_host.vars
index f8d6ca8e..081226bd 100644
--- a/vars/install_strip_host.vars
+++ b/vars/install_strip_host.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_install_strip_host_install() {
+pkg_install_strip_host_all() {
if [ -e "${PREFIX}/bin/${TARGET}-install-strip" ]; then
build_fileop rm "${PREFIX}/bin/${TARGET}-install-strip";
fi;
diff --git a/vars/libfirm.vars b/vars/libfirm.vars
index 59ed78f1..7b3556d4 100644
--- a/vars/libfirm.vars
+++ b/vars/libfirm.vars
@@ -12,12 +12,12 @@ pkg_cparser_configure_pre() {
export LDFLAGS_PATH="-L../../sysroot/lib";
};
-pkg_libfirm_install() {
+pkg_libfirm_install_make() {
make ${MAKEFLAGS} DESTDIR=../../sysroot install;
make ${MAKEFLAGS} DESTDIR="${PREFIX_NATIVE}" install;
};
-pkg_cparser_install() {
+pkg_cparser_install_make() {
make ${MAKEFLAGS} DESTDIR=../../sysroot install;
make ${MAKEFLAGS} DESTDIR="${PREFIX_NATIVE}" install;
};
diff --git a/vars/libxml2.vars b/vars/libxml2.vars
index f0bd0f02..1952c2d6 100644
--- a/vars/libxml2.vars
+++ b/vars/libxml2.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_libxml2_install_post() {
+pkg_libxml2_install_make_post() {
if [ -e "${PREFIX}/bin/${TARGET}-xml2-config" ]; then
build_fileop rm "${PREFIX}/bin/${TARGET}-xml2-config";
fi;
diff --git a/vars/musl.vars b/vars/musl.vars
index ce0110cb..c9d21883 100644
--- a/vars/musl.vars
+++ b/vars/musl.vars
@@ -23,16 +23,16 @@ pkg_musl_no_complex_all() {
local _install _restart_at="${1}";
PKG_MUSL_VERSION="${PKG_MUSL_NO_COMPLEX_VERSION}";
# Git clone what we need.
- pkg_fetch -git "lazy=${GITROOT}/lazy";
+ pkg_fetch_git "lazy=${DEFAULT_GITROOT}/lazy";
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
- pkg_fetch "http://www.musl-libc.org/releases/musl-${PKG_MUSL_VERSION}.tar.gz" \
+ 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";
- pkg_fetch -git "mmglue=${GITROOT}/mmglue";
+ pkg_fetch_git "mmglue=${DEFAULT_GITROOT}/mmglue";
set_build_script_done "${PKG_NAME}" fetch -extract;
fi;
if ! is_build_script_done "${PKG_NAME}" extract "${_restart_at}"; then
@@ -60,7 +60,7 @@ pkg_musl_native_all() {
local _install _restart_at="${1}";
PKG_MUSL_VERSION="${PKG_MUSL_NATIVE_VERSION}";
# Git clone what we need.
- pkg_fetch -git "lazy=${GITROOT}/lazy";
+ pkg_fetch_git "lazy=${DEFAULT_GITROOT}/lazy";
export lz_arch="${ARCH}" lz_cflags_debug="-O2" lz_target="${TARGET}";
# Musl: build (full)
_install=install;
@@ -83,7 +83,7 @@ pkg_musl_full_all() {
local _install _restart_at="${1}";
PKG_MUSL_VERSION="${PKG_MUSL_FULL_VERSION}";
# Git clone what we need.
- pkg_fetch -git "lazy=${GITROOT}/lazy";
+ pkg_fetch_git "lazy=${DEFAULT_GITROOT}/lazy";
export lz_arch="${ARCH}" lz_cflags_debug="-O2" lz_target="${TARGET}";
# Musl: build (full)
_install=install;
diff --git a/vars/perl.vars b/vars/perl.vars
index edfd111b..a011debb 100644
--- a/vars/perl.vars
+++ b/vars/perl.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_perl_extract_post() {
+pkg_perl_fetch_extract_post() {
local _fname_src _fname_dst _cflag;
(build_fileop cd "${WORKDIR}";
for _fname_src in $(find perl-cross -type f \
diff --git a/vars/pkgconf_host.vars b/vars/pkgconf_host.vars
index 8f77adf7..bde06b1e 100644
--- a/vars/pkgconf_host.vars
+++ b/vars/pkgconf_host.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_pkgconf_host_install_post() {
+pkg_pkgconf_host_install_make_post() {
if [ -e "${PREFIX}/bin/${TARGET}-pkg-config" ]; then
build_fileop rm "${PREFIX}/bin/${TARGET}-pkg-config";
fi;
@@ -17,7 +17,7 @@ EOF
build_fileop rm "${PREFIX}/bin/pkg-config";
};
-pkg_pkgconf_install_post() {
+pkg_pkgconf_install_make_post() {
if [ -e "${PREFIX_NATIVE}/bin/pkg-config" ]; then
build_fileop rm "${PREFIX_NATIVE}/bin/pkg-config";
fi;
diff --git a/vars/psxstub.vars b/vars/psxstub.vars
index dbdb0a24..af4bfd9f 100644
--- a/vars/psxstub.vars
+++ b/vars/psxstub.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_psxstub_install() {
+pkg_psxstub_install_make() {
if [ "${TARGET}" = i686-nt32-midipix ] \
|| [ "${TARGET}" = x86_64-nt64-midipix ]; then
build_fileop cd "${PKG_BASE_DIR}/psxstub";
diff --git a/vars/ruby.vars b/vars/ruby.vars
index 649f619a..55ba881d 100644
--- a/vars/ruby.vars
+++ b/vars/ruby.vars
@@ -2,15 +2,15 @@
# set -o errexit -o noglob are assumed.
#
-pkg_ruby_install_pre() {
+pkg_ruby_install_make_pre() {
if [ ! -e rbconfig.rb.orig ]; then
sed -i.orig '/^\s*CONFIG\["prefix"\]\s*=.*$/s/=.*$/= ""/' \
rbconfig.rb;
fi;
};
-pkg_ruby_host_install_pre() {
- pkg_ruby_install_pre;
+pkg_ruby_host_install_make_pre() {
+ pkg_ruby_install_make_pre;
};
# vim:filetype=sh
diff --git a/vars/vim.vars b/vars/vim.vars
new file mode 100644
index 00000000..0e0ab509
--- /dev/null
+++ b/vars/vim.vars
@@ -0,0 +1,10 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_vim_configure_pre() {
+ build_fileop cp "${MIDIPIX_BUILD_PWD}/etc/config.cache" \
+ "${PKG_BASE_DIR}/${PKG_SUBDIR}/src/auto";
+};
+
+# vim:filetype=sh
diff --git a/vars/xz_flavour_minipix.vars b/vars/xz_flavour_minipix.vars
index 6b2c2685..18820f1d 100644
--- a/vars/xz_flavour_minipix.vars
+++ b/vars/xz_flavour_minipix.vars
@@ -2,7 +2,7 @@
# set -o errexit -o noglob are assumed.
#
-pkg_xz_flavour_minipix_install() {
+pkg_xz_flavour_minipix_install_make() {
make LIBTOOL=slibtool -C src/lzmainfo install-binPROGRAMS DESTDIR=${PREFIX_MINIPIX};
make LIBTOOL=slibtool -C src/scripts install-nodist_binSCRIPTS DESTDIR=${PREFIX_MINIPIX};
make LIBTOOL=slibtool -C src/xz install-binPROGRAMS DESTDIR=${PREFIX_MINIPIX};