From ec19f02f81c206f54a89ef7e1f49715e90470c31 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz (arab, vxp) Date: Dec 03 2017 16:20:07 +0000 Subject: Separate front end (build.sh, subr/build_*) from dispatcher. --- diff --git a/build.sh b/build.sh index 4c3d9ff..79216ba 100755 --- a/build.sh +++ b/build.sh @@ -2,65 +2,92 @@ # Copyright (c) 2016, 2017 Lucio Andrés Illanes Albornoz # -for __ in $(find subr -name *.subr); do . "${__}"; done; -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}; +buildp_dispatch() { + local _msg="${1}" _pkg_name="${2}" _tgt_name="${3}" \ + _build_tgt_meta _build_tgt_lc; + case "${_msg}" in + # Top-level + start_build) shift; build_args "${@}"; build_init; build_checks; + ex_rtl_log_set_vnfo_lvl "${ARG_VERBOSE:-0}"; + ex_rtl_log_msg info "Build started by ${BUILD_USER:=${USER}}@${BUILD_HNAME:=$(hostname)} at ${BUILD_DATE_START}."; + ex_rtl_log_env_vars "build (global)" ${DEFAULT_LOG_ENV_VARS}; + for _build_tgt_meta in ${BUILD_TARGETS_META:-world}; do + for _build_tgt_lc in $(ex_rtl_get_var_unsafe \ + "$(ex_rtl_toupper "${_build_tgt_meta}")_TARGET"); do + if ! ex_pkg_dispatch "${_build_tgt_lc}" \ + "${ARG_RESTART}" "${ARG_RESTART_AT}" \ + buildp_dispatch; then + break; + fi; + done; + done; + buildp_dispatch finish_build; ;; + finish_build) build_fini; + ex_rtl_log_msg info "${BUILD_NFINI} finished, ${BUILD_NSKIP} skipped, and ${BUILD_NFAIL} failed builds in ${BUILD_NBUILT} build script(s)."; + ex_rtl_log_msg info "Build time: ${BUILD_TIMES_HOURS} hour(s), ${BUILD_TIMES_MINUTES} minute(s), and ${BUILD_TIMES_SECS} second(s)."; + if [ -n "${BUILD_PKGS_FAILED}" ]; then + ex_rtl_log_msg info "Build script failure(s) in: ${BUILD_PKGS_FAILED}."; + exit 1; + fi; ;; -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; - ex_log_msg info "Starting \`${BUILD_TARGET_LC}' build target..."; - for PKG_NAME in ${BUILD_PACKAGES}; do - ex_log_msg info "Starting \`${PKG_NAME}' build..."; - ex_pkg_dispatch "${BUILD_TARGET}" "${PKG_NAME}" \ - "${ARG_RESTART}" "${ARG_RESTART_AT}"; - BUILD_SCRIPT_RC=${?}; - case ${BUILD_SCRIPT_RC} in - 0) : $((BUILD_NFINI+=1)); - if [ "${ARG_VERBOSE2:-0}" -eq 1 ]; then - cat "${WORKDIR}/${PKG_NAME}_stdout.log"; - if [ "${ARG_XTRACE:-0}" -eq 1 ]; then - ex_log_msg vvfo "${WORKDIR}/${PKG_NAME}_stderr.log:"; - cat "${WORKDIR}/${PKG_NAME}_stderr.log"; - fi; - fi; - ex_log_msg succ "Finished \`${PKG_NAME}' build."; ;; - *) : $((BUILD_NFAIL+=1)); - if [ "${ARG_RELAXED:-0}" -eq 1 ]; then - ex_log_msg fail "Build failed in \`${PKG_NAME}', check \`${WORKDIR}/${PKG_NAME}_std{err,out}.log' for details."; - BUILD_PKGS_FAILED="${BUILD_PKGS_FAILED:+${BUILD_PKGS_FAILED} }${PKG_NAME}"; - continue; - else - ex_log_msg fail "${WORKDIR}/${PKG_NAME}_stdout.log:"; - cat "${WORKDIR}/${PKG_NAME}_stdout.log"; - ex_log_msg fail "${WORKDIR}/${PKG_NAME}_stderr.log:"; - cat "${WORKDIR}/${PKG_NAME}_stderr.log"; - ex_log_msg fail "Build failed in \`${PKG_NAME}'."; - break; - fi; ;; - esac; - done; - if [ "${BUILD_SCRIPT_RC:-0}" -ne 0 ]; then - break; - else - ex_log_msg succ "Finished \`${BUILD_TARGET_LC}' build target."; - fi; - done; -done; + # Target build + start_target) ex_rtl_log_msg inf2 "Starting \`${_tgt_name}' build target..."; ;; + finish_target) ex_rtl_log_msg suc2 "Finished \`${_tgt_name}' build target."; ;; -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 - ex_log_msg info "Build script failure(s) in: ${BUILD_PKGS_FAILED}."; -fi; -exit "${BUILD_SCRIPT_RC:-0}" + # Package build + start_pkg) ex_rtl_log_msg info "Starting \`${_pkg_name}' build..."; ;; + finish_pkg) : $((BUILD_NFINI+=1)); + if [ "${ARG_VERBOSE:-0}" -ge 2 ]; then + cat "${BUILD_WORKDIR}/${_pkg_name}_stderrout.log"; + fi; + ex_rtl_log_msg succ "Finished \`${_pkg_name}' build."; ;; + fail_pkg) : $((BUILD_NFAIL+=1)); + if [ "${ARG_RELAXED:-0}" -eq 1 ]; then + ex_rtl_log_msg fail "Build failed in \`${_pkg_name}', check \`${BUILD_WORKDIR}/${_pkg_name}_stderrout.log' for details."; + BUILD_PKGS_FAILED="${BUILD_PKGS_FAILED:+${BUILD_PKGS_FAILED} }${_pkg_name}"; + else + ex_rtl_log_msg fail "${BUILD_WORKDIR}/${_pkg_name}_stderrout.log:"; + cat "${BUILD_WORKDIR}/${_pkg_name}_stderrout.log"; + ex_rtl_log_msg fail "Build failed in \`${_pkg_name}'."; + return 1; + fi; ;; + disabled_pkg) ex_rtl_log_msg vnfo "Skipping disabled package \`${_pkg_name}.'"; ;; + skipped_pkg) ex_rtl_log_msg vnfo "Skipping finished package \`${_pkg_name}.'"; ;; + step_pkg) ex_rtl_log_msg vnfo "Finished build step ${4} of package \`${_pkg_name}'."; ;; + + # Child process + exec_finish) ;; + exec_missing) ex_rtl_log_msg failexit "Error: package \`${_pkg_name}' missing in build.vars."; ;; + exec_start) if [ "${PKG_NO_LOG_VARS:-0}" -eq 0 ]; then + ex_rtl_log_env_vars "build" \ + $(set | awk -F= '/^PKG_/{print $1}' | sort); + fi; + if [ "${ARG_DEBUG_MINIPIX:-0}" -eq 1 ]\ + && [ "${_tgt_name}" = "dist_minipix" ]; then + PKG_BUILD_STEPS="$(ex_rtl_lfilter_not \ + "${PKG_BUILD_STEPS}" "strip")"; + elif [ "${BUILD}" = release ]; then + PKG_BUILD_STEPS="$(ex_rtl_lfilter_not \ + "${PKG_BUILD_STEPS}" "strip")"; + fi; + if [ "${ARG_OFFLINE:-0}" -eq 1 ]; then + PKG_BUILD_STEPS="$(ex_rtl_lfilter_not \ + "${PKG_BUILD_STEPS}" "fetch_git fetch_wget")"; + fi; + if [ "${ARG_TARBALL:-0}" -eq 0 ]; then + case "${_pkg_name}" in + dist_digest) PKG_BUILD_STEPS=""; ;; + dist_tarballs) PKG_BUILD_STEPS=""; ;; + esac; + fi; + if [ "${ARG_XTRACE:-0}" -eq 1 ]; then + set -o xtrace; + fi; ;; + exec_step) ex_rtl_log_msg info "Finished build step ${4} of package \`${_pkg_name}'."; ;; + esac; return 0; +}; + +for __ in $(find subr -name *.subr); do + . "${__}"; done; buildp_dispatch start_build "${@}"; # vim:filetype=sh diff --git a/etc/build.usage b/etc/build.usage index d5fe1aa..6976122 100644 --- a/etc/build.usage +++ b/etc/build.usage @@ -1,35 +1,34 @@ -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[v[v]]] - [[ ...]] - -x Set xtrace during package builds; implies -vv. +usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release] + [-c] [-h] [-N] [-r package[,...][:step]] + [-R] [-t[.gz|.bz2|.xz] [-v[v[v]]] [-x] [[ ...]] -4|-6 Force IPv[46] when downloading files. -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. -h Show this screen. - -i Ignore SHA256 hash mismatches when downloading files. -N Offline mode: no {wget,git-{clone,pull}}(1) calls. -r package[,...][:step] Restart the specified comma-separated build(s) completely or at the optionally specified step. Currently defined steps are: - fetch_distclean, fetch_wget, fetch_git, fetch_extract, + fetch_wget, fetch_git, fetch_extract, configure_patch_pre, configure_autotools, configure_patch, - configure, build_clean, build, install_subdirs, install_make, + configure, build, install_subdirs, install_make, install_files, install_libs, install_pkgconfig, install_purge_la, install_strip, and install. -R Ignore build failures, skip printing package logs, and continue building (relaxed mode.) -t[.gz|.bz2|.xz] Produce binary distribution and source tarballs containing - ${PREFIX} sans ${WORKDIR} and ${PREFIX}/src/midipix_build - and ${WORKDIR} sans top-level regular files at the end of + ${PREFIX} sans ${BUILD_WORKDIR} and ${PREFIX}/src/midipix_build + and ${BUILD_WORKDIR} sans top-level regular files at the end of a build with zero failures. The tarballs will be compressed with either gzip, bzip2, or xz and signed with GPG; the default compression is xz. -v[v[v]] Be verbose; -vv: always print package logs; -vvv: logs fileops. + -x Set xtrace during package builds; implies -vv. --debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix. [ ...] One of: dev, devroot, or world, or: - host or host_toolchain_deps, host_toolchain, - native or native_toolchain_deps, native_toolchain, native_runtime, + host or host_tools, host_toolchain_deps, host_toolchain, host_toolchain_mingw32, + native or native_tools, native_toolchain_deps, native_toolchain, native_toolchain_mingw32, native_runtime, packages_deps or host_packages_deps, native_packages_deps, native_packages_deps_x11, packages or native_packages_cmdline, native_packages_dev, native_packages_etc, native_packages_inet, or dist, dist_minipix, or dist_target. @@ -37,7 +36,7 @@ usage: ./build.sh [-x] [-4|6] [-a nt32|nt64] [-b debug|release] [-c] [-h] ${HOME}/midipix_build.vars, ../midipix_build.vars, and build.vars are sourced if they exist. - Packages that are built by pkg.build will apply local patches in ${WORKDIR} + Packages that are built by pkg.build will apply local patches in ${BUILD_WORKDIR} named ${PKG_SUBDIR}.local.patch. Examples: diff --git a/patches/apk_tools-2.6.8.local.patch b/patches/apk_tools-2.6.8.local.patch index 5119a82..5e94bcd 100644 --- a/patches/apk_tools-2.6.8.local.patch +++ b/patches/apk_tools-2.6.8.local.patch @@ -27,12 +27,18 @@ } int main(int argc, char **argv) ---- apk-tools-2.6.8/src/Makefile.orig 2016-10-25 10:06:30.000000000 +0200 -+++ apk-tools-2.6.8/src/Makefile 2016-12-17 21:25:34.221413300 +0100 -@@ -7,13 +7,13 @@ - ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib) - ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib) +--- apk-tools-2.6.8/src/Makefile.orig 2016-10-25 08:06:30.000000000 +0000 ++++ apk-tools-2.6.8/src/Makefile 2017-12-03 15:36:54.260000000 +0000 +@@ -1,24 +1,15 @@ +-PKG_CONFIG ?= pkg-config + LUAAPK ?= yes +-OPENSSL_CFLAGS := $(shell $(PKG_CONFIG) --cflags openssl) +-OPENSSL_LIBS := $(shell $(PKG_CONFIG) --libs openssl) +- +-ZLIB_CFLAGS := $(shell $(PKG_CONFIG) --cflags zlib) +-ZLIB_LIBS := $(shell $(PKG_CONFIG) --libs zlib) +- -FETCH_LIBS := $(shell $(CC) -print-file-name=libfetch.a) +FETCH_LIBS := $(shell $(CC) -print-file-name=$(PREFIX)/lib/libfetch.a) @@ -41,7 +47,12 @@ LUA_VERSION ?= 5.2 LUA_PC ?= lua$(LUA_VERSION) -LUA_LIBDIR ?= /usr/lib/lua/$(LUA_VERSION) -+LUA_LIBDIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) LIBAPK := YesPlease shlibs-y += apk.so apk.so-objs := lua-apk.o +-CFLAGS_lua-apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\" \ +- $(shell $(PKG_CONFIG) $(LUA_PC) --cflags) ++CFLAGS_lua-apk.o := -DAPK_VERSION=\"$(FULL_VERSION)\" $(LUA_CFLAGS) + LUA_LIB-y := $(obj)/apk.so + install-LUA_LIB-y := $(INSTALLDIR) $(DESTDIR)$(LUA_LIBDIR) && \ + $(INSTALL) $(LUA_LIB-y) $(DESTDIR)$(LUA_LIBDIR) diff --git a/subr/build_args.subr b/subr/build_args.subr new file mode 100644 index 0000000..38f10c5 --- /dev/null +++ b/subr/build_args.subr @@ -0,0 +1,75 @@ +BUILD_ARGS_SPEC=" + ARG_IPV4_ONLY:-4 + ARG_IPV6_ONLY:-6 + ARCH:arg:-a + BUILD:arg:-b + ARG_CLEAN:-c + ARG_DEBUG_MINIPIX:--debug-minipix + ARG_OFFLINE:-N + ARG_RELAXED:-R + ARG_RESTART:arg:-r + ARG_TARBALL:selfarg:-t + ARG_TARBALL:selfarg:-t.bz2 + ARG_TARBALL:selfarg:-t.gz + ARG_TARBALL:selfarg:-t.xz + ARG_VERBOSE:selfarg:-v + ARG_VERBOSE:selfarg:-vv + ARG_VERBOSE:selfarg:-vvv + ARG_XTRACE:-x"; + +build_args() { + local _spec="${BUILD_ARGS_SPEC}" _spec_arg _found; + while [ ${#} -gt 0 ]; do + if [ "${1#-}" = "${1}" ]; then + break; + fi; + for _spec_arg in ${_spec}; do + case "${_spec_arg}" in + *:${1}) case "${_spec_arg#*:}" in + arg:*) + ex_rtl_set_var_unsafe "${_spec_arg%%:*}" "${2}"; shift; ;; + selfarg:*) + ex_rtl_set_var_unsafe "${_spec_arg%%:*}" "${1}"; ;; + *) + ex_rtl_set_var_unsafe "${_spec_arg%%:*}" 1; ;; + esac; _found=1; break; ;; + *) _found=0; ;; + esac; + done; + if [ "${_found:-0}" -eq 0 ]; then + exec cat etc/build.usage; + else + shift; + fi; + done; + if [ -n "${ARG_TARBALL}" ]; then + if [ "${ARG_TARBALL#-t.}" != "${ARG_TARBALL}" ]; then + TARBALL_SUFFIX="${ARG_TARBALL#-t.}"; + else + TARBALL_SUFFIX=xz; + fi; + fi; + case "${ARG_VERBOSE}" in + -v) ARG_VERBOSE=1; ;; + -vv) ARG_VERBOSE=2; ;; + -vvv) ARG_VERBOSE=3; ;; + esac; + if [ "${ARG_XTRACE:-0}" -eq 1 ]; then + ARG_VERBOSE=2; + fi; + if [ -n "${ARG_RESTART}" ]; then + if [ "${ARG_RESTART%:*}" != "${ARG_RESTART}" ]; then + ARG_RESTART_AT="${ARG_RESTART#*:}"; ARG_RESTART="${ARG_RESTART%:*}"; + else + ARG_RESTART_AT=ALL; + fi; + ARG_RESTART="$(echo ${ARG_RESTART} | sed "s/,/ /g")"; + fi; + while [ ${#} -gt 0 ]; do + case "${1}" in + *=*) ex_rtl_set_var_unsafe "${1%%=*}" "${1#*=}"; ;; + *) BUILD_TARGETS_META="${BUILD_TARGETS_META:+${BUILD_TARGETS_META} }${1}"; ;; + esac; shift; done; +}; + +# vim:filetype=sh diff --git a/subr/build_checks.subr b/subr/build_checks.subr new file mode 100644 index 0000000..08abc68 --- /dev/null +++ b/subr/build_checks.subr @@ -0,0 +1,40 @@ +build_checks() { + local __ _exit _pname; + for __ in ${DEFAULT_CHECK_PATH_VARS}; do + if [ -z "${___:=$(ex_rtl_get_var_unsafe "${__}")}" ]; then + ex_rtl_log_msg failexit "Error: variable \`${__}' is empty or unset."; + elif [ "${___#* *}" != "${___}" ]; then + ex_rtl_log_msg failexit "Error: variable \`${__}' contains one or more whitespace characters."; + fi; + done; + for __ in ${DEFAULT_CHECK_PREREQ_CMDS} $(eval echo ${DEFAULT_CHECK_PREREQ_FILES_DYNAMIC}) ${DEFAULT_CHECK_PREREQ_FILES}; do + if [ "${__#/}" != "${__}" ]; then + if [ ! -e "${__}" ]; then + ex_rtl_log_msg fail "Error: missing prerequisite file \`${__}'."; + _exit=1; + fi; + else + if ! ex_rtl_test_cmd "${__}"; then + ex_rtl_log_msg fail "Error: missing prerequisite command \`${__}'."; + _exit=1; + fi; + fi; + done; + for __ in ${DEFAULT_CHECK_PREREQ_PERL_MODULES}; do + if ! perl -M"${__}" -e "" 2>/dev/null; then + ex_rtl_log_msg fail "Error: missing prerequisite Perl module \`${__}'."; + _exit=1; + fi; + done; + if [ ${_exit:-0} = 1 ]; then + exit 1; + fi; + if [ ${ARG_CLEAN:-0} -eq 1 ]; then + ex_rtl_log_msg info "-c specified, cleaning prefix..."; + for _pname in ${DEFAULT_CLEAR_PREFIX_PATHS}; do + ex_rtl_fileop rm ${PREFIX}/${_pname}; + done; + fi; +}; + +# vim:filetype=sh diff --git a/subr/build_init.subr b/subr/build_init.subr new file mode 100644 index 0000000..95ac397 --- /dev/null +++ b/subr/build_init.subr @@ -0,0 +1,60 @@ +build_fini() { + : $((BUILD_TIMES_SECS=$(ex_rtl_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 "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then + ex_rtl_fileop rm ${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}; + fi; +}; + +build_init() { + local __; + set -o noglob; + if [ -z "${DEFAULT_BUILD_CPUS}" ]\ + && [ -e /proc/cpuinfo ]; then + DEFAULT_BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo); + fi; + : ${ARCH:=nt64}; : ${BUILD:=debug}; + if [ "${ARCH}" = nt32 ]; then + DEFAULT_TARGET="i686-nt32-midipix"; + elif [ "${ARCH}" = nt64 ]; then + DEFAULT_TARGET="x86_64-nt64-midipix"; + else + if [ "${BUILD}" != debug ]\ + && [ "${BUILD}" != release ]; then + ex_rtl_log_msg failexit "Error: unknown build type \`${BUILD}'."; + fi; + ex_rtl_log_msg failexit "Error: invalid architecture \`${ARCH}'."; + fi; + for __ in ${HOME}/midipix_build.vars ../midipix_build.vars ./vars/env.vars ./vars/midipix.vars ./vars/build.vars; do + [ -e ${__} ] && . ${__}; + done; + export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; + if [ ${ARG_IPV4_ONLY:-0} -eq 1 ]; then + DEFAULT_WGET_ARGS="-4${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; + elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then + DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; + fi; + ex_rtl_unset_vars $(ex_rtl_lfilter_not \ + "$(export | sed -e 's/^export //' -e 's/=.*$//')" \ + "${DEFAULT_CLEAR_ENV_VARS_EXCEPT}"); + ex_rtl_fileop mkdir "${BUILD_DLCACHEDIR}" "${BUILD_WORKDIR}"; + if [ -e "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}" ]; then + ex_rtl_log_msg failexit "Error: another build targeting this architecture and build type is currently in progress."; + else + touch "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}"; + fi; + if [ -e "${DEFAULT_BUILD_LOG_FNAME}" ]; then + mv -- "${DEFAULT_BUILD_LOG_FNAME} ${DEFAULT_BUILD_LOG_LAST_FNAME}"; + fi; + BUILD_DATE_START="$(ex_rtl_date %Y-%m-%d-%H-%M-%S)"; + BUILD_NFINI="${BUILD_NSKIP:=${BUILD_NFAIL:=${BUILD_NBUILT:=0}}}"; + BUILD_TIMES_SECS="$(ex_rtl_date %s)"; + BUILD_PKGS_FAILED=""; + trap "rm -f "${DEFAULT_BUILD_STATUS_IN_PROGRESS_FNAME}"; \ + ex_rtl_log_msg failexit \"Build aborted.\";" \ + HUP INT TERM USR1 USR2; +}; + +# vim:filetype=sh diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr index f099dd6..90a2371 100644 --- a/subr/ex_pkg_dispatch.subr +++ b/subr/ex_pkg_dispatch.subr @@ -3,47 +3,61 @@ # ex_pkg_dispatch() { - local _tgt_name="${1}" _pkg_name="${2}" \ - _restart="${3}" _restart_at="${4}" \ - _stdout_path _stderr_path \ - _pipe_path _pipe_msg _script_rc=1; - if ex_pkg_state_test "${_pkg_name}" finish \ - && [ -z "${_restart}" ] \ - && [ "${_tgt_name}" != "INVARIANTS" ]; then - return 0; - else - _pipe_path="${WORKDIR}/${_pkg_name}_build.fifo"; - ex_build_fileop rm "${_pipe_path}"; mkfifo "${_pipe_path}"; - _stderr_path="${WORKDIR}/${_pkg_name}_stderr.log"; - _stdout_path="${WORKDIR}/${_pkg_name}_stdout.log"; - ex_build_fileop rm "${_stderr_path}" "${_stdout_path}"; + local _tgt_name="${1}" _restart="${2}" _restart_at="${3}" \ + _dispatch_fn="${4}" _tgt_name_uc \ + _pkg_names _pkg_name _pkg_name_uc \ + _pipe_path _stderrout_path _pipe_msg _script_rc; + ex_rtl_fileop mkdir "${BUILD_WORKDIR}"; + _pipe_path="${BUILD_WORKDIR}/build.fifo"; + _tgt_name_uc="$(ex_rtl_toupper "${_tgt_name}")"; + "${_dispatch_fn}" start_target "" "${_tgt_name}"; + _pkg_names="$(ex_rtl_get_var_unsafe ${_tgt_name_uc}_PACKAGES)"; + if [ -n "${_restart}" ]; then + _pkg_names="$(ex_rtl_lfilter "${_pkg_names}" "${_restart}")"; fi; - (set -o errexit -o noglob; - trap "if [ \${?} -eq 0 ]; then \ - echo \"done ${PKG_NAME}\" >&3; \ - else \ - echo \"fail ${PKG_NAME}\" >&3; \ - fi;" EXIT HUP INT TERM USR1 USR2; - if [ "${ARG_XTRACE:-0}" -eq 1 ]; then - set -o xtrace; - fi; - ex_pkg_vars; - if [ "${PKG_DISABLED:-0}" -eq 1 ]; then - ex_log_msg vnfo "Skipping disabled package \`${PKG_NAME}.'"; - else - ex_pkg_env; - ex_pkg_steps "${_tgt_name}" "${_pkg_name}" \ - "${_restart}" "${_restart_at}"; - fi;) 1>"${_stdout_path}" 2>"${_stderr_path}" \ - 3>"${_pipe_path}" & - while read _pipe_msg; do - case "${_pipe_msg%% *}" in - done) _script_rc=0; break; ;; - fail) _script_rc=1; break; ;; - *) _script_rc=1; break; ;; - esac; done <"${_pipe_path}"; - ex_build_fileop rm "${_pipe_path}"; - return "${_script_rc:-1}"; + for _pkg_name in ${_pkg_names}; do + _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")"; + if [ -n "$(ex_rtl_get_var_unsafe PKG_${_pkg_name_uc}_DISABLED)" ]; then + "${_dispatch_fn}" disabled_pkg "${_pkg_name}" "${_tgt_name}"; + continue; + elif ex_pkg_state_test "${_pkg_name}" finish\ + && [ -z "${_restart_at}" ]; then + "${_dispatch_fn}" skipped_pkg "${_pkg_name}" "${_tgt_name}"; + continue; + else + ex_rtl_fileop mkfifo "${_pipe_path}"; + _stderrout_path="${BUILD_WORKDIR}/${_pkg_name}_stderrout.log"; + _script_rc=1; + "${_dispatch_fn}" start_pkg "${_pkg_name}" "${_tgt_name}"; + fi; + (set -o errexit -o noglob; + ex_pkg_env "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + trap "if [ \${?} -eq 0 ]; then \ + echo \"done ${PKG_NAME}\" >&3; \ + else \ + echo \"fail ${PKG_NAME}\" >&3; \ + fi;" EXIT HUP INT TERM USR1 USR2; + ex_pkg_exec "${_pkg_name}" "${_tgt_name}" "${_restart_at}" \ + "${_dispatch_fn}";) 1>"${_stderrout_path}" 2>&1 3>"${_pipe_path}" & + while read _pipe_msg; do + case "${_pipe_msg%% *}" in + done) _script_rc=0; + "${_dispatch_fn}" finish_pkg "${_pkg_name}" "${_tgt_name}"; + break; ;; + fail) _script_rc=1; + "${_dispatch_fn}" fail_pkg "${_pkg_name}" "${_tgt_name}"; + break; ;; + step) "${_dispatch_fn}" step_pkg ${_pipe_msg#step }; ;; + *) _script_rc=1; + "${_dispatch_fn}" fail_pkg "${_pkg_name}" "${_tgt_name}"; + break; ;; + esac; done <"${_pipe_path}"; + ex_rtl_fileop rm "${_pipe_path}"; + if [ "${_script_rc:-1}" -eq 1 ]; then + return 1; + fi; + done; + "${_dispatch_fn}" finish_target "" "${_tgt_name}"; }; # vim:filetype=sh diff --git a/subr/ex_pkg_env.subr b/subr/ex_pkg_env.subr index 853d785..822ac05 100644 --- a/subr/ex_pkg_env.subr +++ b/subr/ex_pkg_env.subr @@ -2,67 +2,65 @@ # set -o errexit -o noglob are assumed. # +exp_pkg_env_source() { + local _pkg_name="${1}" _tgt_name="${2}" \ + _tgt_name_uc _pkg_name_uc _build_type_uc \ + _vname_dst _vars_set=""; + if [ "${_pkg_name#*_flavour_*}" != "${_pkg_name}" ]; then + PKG_NAME_PARENT="${PKG_NAME%_flavour_*}"; + ex_pkg_env_source "${PKG_NAME_PARENT}"; + fi; + ex_rtl_fileop source_opt "vars/${_pkg_name}.vars"; + _tgt_name_uc="$(ex_rtl_toupper "${_tgt_name}")"; + _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")"; + ex_rtl_set_vars BUILD_TYPE \ + "DEFAULT ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ + _vars_set; + _build_type_uc="$(ex_rtl_toupper "${PKG_BUILD_TYPE}")"; + for _vname_dst in $(ex_rtl_lfilter_not \ + "${DEFAULT_BUILD_VARS}" BUILD_TYPE); do + ex_rtl_set_vars "${_vname_dst}" \ + "DEFAULT DEFAULT_${_build_type_uc} \ + ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ + _vars_set; + done; + ex_rtl_unset_vars $(ex_rtl_lfilter_not \ + "$(set | awk -F= '/^PKG_/{print $1}' | sort)" \ + "${_vars_set}"); +}; + ex_pkg_env() { - local _vname; - if [ -z "${PKG_URL}" ]\ - && [ -z "${PKG_URLS_GIT}" ]\ - && [ -z "${PKG_VERSION}" ]\ - && ! ex_test_cmd "pkg_${PKG_NAME}_all"; then - ex_log_msg failexit "Error: package \`${PKG_NAME}' missing in build.vars."; - return 1; - else - [ -z "${MIDIPIX_BUILD_PWD}" ] && MIDIPIX_BUILD_PWD="$(pwd)"; - [ -z "${PKG_FNAME}" ] && PKG_FNAME="${PKG_URL##*/}"; - [ -z "${PKG_TARGET}" ] && PKG_TARGET="${TARGET}"; - case "${PKG_BASE_DIR}" in - ?*) ;; - *) PKG_BASE_DIR="${WORKDIR}/${PKG_NAME}-${PKG_BUILD_TYPE:-native}-${PKG_TARGET}"; - if [ -n "${ARG_RESTART}" ]\ - && [ -z "${ARG_RESTART_AT}" ]; then - ex_build_fileop rm "${PKG_BASE_DIR}"; - fi; ;; - esac; - ex_build_fileop mkdir "${PKG_BASE_DIR}"; - ex_build_fileop cd "${PKG_BASE_DIR}"; - PKG_DESTDIR="${PKG_BASE_DIR}/destdir"; - case "${PKG_BUILD_TYPE}" in - host) export AR="ar"; - export CC="gcc"; - export CXX="g++"; - export RANLIB="ranlib"; ;; - *) export AR="${PKG_TARGET}-ar"; - export CC="${PKG_TARGET}-gcc"; - export CXX="${PKG_TARGET}-g++"; - export RANLIB="${PKG_TARGET}-ranlib"; - if [ -x "${PREFIX}/bin/${TARGET}-pkg-config" ]; then - export PKGCONFIG="${PREFIX}/bin/${TARGET}-pkg-config"; - export PKG_CONFIG="${PREFIX}/bin/${TARGET}-pkg-config"; - export PKG_CONFIG_LIBDIR="${PKG_PREFIX}/lib/pkgconfig"; - fi; - ;; - esac; - export LIBTOOL="${PKG_SLIBTOOL:-slibtool}"; - export MAKE="make LIBTOOL=${PKG_SLIBTOOL:-slibtool}"; - case "${PKG_SUBDIR}" in - ?*) ;; - *) case "${PKG_URLS_GIT}" in - ?*) PKG_SUBDIR="${PKG_URLS_GIT%%=*}"; ;; - *) case "${PKG_FNAME}" in - *.t*) PKG_SUBDIR="${PKG_FNAME%%.t*}"; ;; - *) PKG_SUBDIR="${PKG_NAME}"; ;; - esac; ;; - esac; ;; + local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" _vname; + exp_pkg_env_source "${_pkg_name}" "${_tgt_name}"; + : ${PKG_NAME:="${_pkg_name}"}; + : ${MIDIPIX_BUILD_PWD:="$(pwd)"}; + : ${PKG_BASE_DIR:="${BUILD_WORKDIR}/${_pkg_name}-${PKG_BUILD_TYPE}-${PKG_TARGET}"}; + : ${PKG_FNAME:="${PKG_URL##*/}"}; + : ${PKG_BUILD_STEPS:="$(ex_rtl_lfilter_not "${DEFAULT_BUILD_STEPS}" \ + "${PKG_BUILD_STEPS_DISABLE}")"}; + if [ -z "${PKG_SUBDIR}" ]; then + if [ -n "${PKG_URLS_GIT}" ]; then + PKG_SUBDIR="${PKG_URLS_GIT%%=*}"; + else case "${PKG_FNAME}" in + *.t*) PKG_SUBDIR="${PKG_FNAME%%.t*}"; ;; + *) PKG_SUBDIR="${_pkg_name}"; ;; + esac; fi; + fi; + if [ -z "${PKG_BUILD_DIR}" ]; then + case "${PKG_IN_TREE:-0}" in + 0) PKG_BUILD_DIR="obj"; ;; + 1) PKG_BUILD_DIR="${PKG_SUBDIR}"; ;; esac; - ex_push_IFS :; - for _vname in ${PKG_ENV_VARS_EXTRA}; do - export "${_vname}"; - done; ex_pop_IFS; - 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" " ")"; - ex_log_env_vars "build" ${PKG_ENV_VARS}; - fi; fi; + PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + PKG_CONFIGURE="${PKG_BASE_DIR}/${PKG_CONFIGURE:-${PKG_SUBDIR}/configure}"; + PKG_DESTDIR="${PKG_BASE_DIR}/${PKG_DESTDIR:-destdir}"; + ex_rtl_push_IFS :; for _vname in ${PKG_ENV_VARS_EXTRA}; do + export "${_vname}"; + done; ex_rtl_pop_IFS; }; +ex_pkg_state_set() { ex_rtl_state_set "${BUILD_WORKDIR}" "${@}"; }; +ex_pkg_state_test() { ex_rtl_state_test "${BUILD_WORKDIR}" "${@}"; }; + # vim:filetype=sh diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr new file mode 100644 index 0000000..21bc3a8 --- /dev/null +++ b/subr/ex_pkg_exec.subr @@ -0,0 +1,60 @@ +# +# set -o errexit -o noglob are assumed. +# + +exp_pkg_exec_pre() { + local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}"; + if [ -z "${PKG_URL}" ]\ + && [ -z "${PKG_URLS_GIT}" ]\ + && [ -z "${PKG_VERSION}" ]\ + && ! ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then + "${_dispatch_fn}" exec_missing "${_pkg_name}" "${_tgt_name}"; + return 1; + elif ! ex_pkg_state_test "${_pkg_name}" "start" "${_restart_at}"; then + if [ "${PKG_NO_CLEAN_BASE_DIR:-0}" -eq 0 ]; then + ex_rtl_fileop rm "${PKG_BASE_DIR}" "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"; + ex_rtl_fileop mkdir "${PKG_BASE_DIR}" "${PKG_BUILD_DIR}" "${PKG_DESTDIR}"; + fi; + ex_pkg_state_set "${_pkg_name}" "start"; + fi; + ex_rtl_fileop cd "${PKG_BUILD_DIR}"; +}; + +ex_pkg_exec() { + local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" \ + _step _step_cmd _step_cmd_pfx _step_rc; + exp_pkg_exec_pre "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + "${_dispatch_fn}" exec_start "${_pkg_name}" "${_tgt_name}"; + if ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then + "pkg_${_pkg_name}_all" "${_restart_at}"; + else set -- ${PKG_BUILD_STEPS}; + while [ ${#} -gt 0 ]; do + _step="${1}"; shift; + if ex_pkg_state_test "${_pkg_name}" "${_step}" \ + "${_restart_at}"; then + continue; + else ex_rtl_try_run \ + "pkg_${_pkg_name}_${_step}_pre" \ + "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + if ex_rtl_test_cmd "pkg_${_pkg_name}_${_step}"; then + ex_rtl_try_run "pkg_${_pkg_name}_${_step}" \ + "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + else + ex_rtl_try_run "pkg_${_step}" \ + "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + fi; + ex_rtl_try_run \ + "pkg_${_pkg_name}_${_step}_post" \ + "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + + fi; + echo "step ${_pkg_name} ${_tgt_name} ${_step}" >&3; + "${_dispatch_fn}" exec_step "${_pkg_name}" "${_tgt_name}" "${_step}"; + ex_pkg_state_set "${_pkg_name}" "${_step}" "${1:+-${1}}"; + done; + "${_dispatch_fn}" exec_finish "${_pkg_name}" "${_tgt_name}"; + ex_pkg_state_set "${_pkg_name}" finish; + fi; +}; + +# vim:filetype=sh diff --git a/subr/ex_pkg_state.subr b/subr/ex_pkg_state.subr deleted file mode 100644 index cb86bf2..0000000 --- a/subr/ex_pkg_state.subr +++ /dev/null @@ -1,67 +0,0 @@ -# -# 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=""; - trap "rm -f ${BUILD_STATUS_IN_PROGRESS_FNAME}; \ - ex_log_msg failexit \"Build aborted.\";" \ - HUP INT TERM USR1 USR2; -}; - -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/ex_pkg_steps.subr b/subr/ex_pkg_steps.subr deleted file mode 100644 index f756d81..0000000 --- a/subr/ex_pkg_steps.subr +++ /dev/null @@ -1,66 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -ex_pkg_steps() { - local _tgt_name="${1}" _pkg_name="${2}" \ - _restart="${3}" _restart_at="${4}" \ - _step _step_type \ - _step_cmds _step_cmd_args \ - _step_cmd_pfx _step_cmd _step_next; - set -- $(ex_lfilter_not "${BUILD_STEPS}" "${PKG_BUILD_STEPS_DISABLE}"); - while [ ${#} -gt 0 ]; do - _step="${1}"; _step_next="${2}"; - _step_cmds=""; _step_cmd_args=""; - _step_type="${_step#*:}"; - _step="${_step%%:*}"; - _step_cmd_pfx="pkg_${_pkg_name}_${_step}"; - case "${_step_type}" in - dynamic) - if [ "${_tgt_name}" = "INVARIANTS" ]; then - _step_cmds="${_step_cmd_pfx} pkg_${_step}"; - elif [ -n "${_restart}" ]; then - if [ -z "${_restart_at}" ]\ - || ex_lmatch "${_restart_at}" , "${_step}"; then - _step_cmds="${_step_cmd_pfx} pkg_${_step}"; - fi; - elif ! ex_pkg_state_test "${_pkg_name}" "${_step}"; then - _step_cmds="${_step_cmd_pfx} pkg_${_step}"; - fi; ;; - invariant) - _step_cmds="pkg_${_step}"; ;; - variant) - if ex_lmatch "${_restart_at}" "," "${_step}"; then - _step_cmds="${_step_cmd_pfx} pkg_${_step}"; - fi; ;; - virtual) - _step_cmds="pkg_${_pkg_name}_${_step}"; - _step_cmd_args="${_restart_at:-ALL}"; ;; - all) - if ex_test_cmd "pkg_${_pkg_name}_${_step}"; then - "${_step_cmd_pfx}" "${_restart_at:-ALL}"; - break; - fi; ;; - finish) ex_pkg_state_push "${_pkg_name}" finish; ;; - *) ;; - esac; - for _step_cmd in ${_step_cmds}; do - if ex_test_cmd "${_step_cmd}"; then - ex_test_cmd "${_step_cmd_pfx}_pre" \ - && "${_step_cmd_pfx}_pre" - "${_step_cmd}" ${_step_cmd_args}; - ex_test_cmd "${_step_cmd_pfx}_post" \ - && "${_step_cmd_pfx}_post" - if [ "${_step_type}" != "invariant" ] \ - && [ -n "${_step_next}" ]; then - ex_pkg_state_push "${_pkg_name}" "${_step}"; - ex_pkg_state_push "${_pkg_name}" "-${_step_next}"; - else - ex_pkg_state_push "${_pkg_name}" "${_step}"; - fi; break; - fi; - done; - shift; done; -}; - -# vim:filetype=sh diff --git a/subr/ex_pkg_vars.subr b/subr/ex_pkg_vars.subr deleted file mode 100644 index 9c23b0d..0000000 --- a/subr/ex_pkg_vars.subr +++ /dev/null @@ -1,40 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -exp_pkg_vars() { - local _pkg_name="${1}" _pkg_name_uc _build_uc _vname_dst _vname_src; - _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 "$(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; - done; - done; -}; - -ex_pkg_vars() { - 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 [ "${PKG_NAME#*_flavour_*}" != "${PKG_NAME}" ]; then - PKG_NAME_PARENT="${_pkg_name%_flavour_*}"; - exp_pkg_vars "${PKG_NAME_PARENT}"; - fi; - exp_pkg_vars "${PKG_NAME}"; -}; - -# vim:filetype=sh diff --git a/subr/ex_rtl.subr b/subr/ex_rtl.subr index 0ab3088..cd9d1be 100644 --- a/subr/ex_rtl.subr +++ b/subr/ex_rtl.subr @@ -2,21 +2,21 @@ # set -o errexit -o noglob are assumed. # -EXP_IFS_NL=" -"; +EXP_RTL_IFS="${IFS}"; -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_pop_IFS() { IFS="${EXP_OLDIFS}"; }; -ex_push_IFS() { EXP_OLDIFS="${IFS}"; IFS="${1}"; }; -ex_push_IFS_nl() { ex_push_IFS "${EXP_IFS_NL}"; }; -ex_test_cmd() { command -v "${1}" >/dev/null; }; -ex_toupper() { echo "${1}" | tr a-z A-Z; }; +ex_rtl_basename() { echo "${1##*/}"; }; +ex_rtl_date() { command date "+${1:-${DEFAULT_TIMESTAMP_FMT}}"; }; +ex_rtl_dirname() { echo "${1%/*}"; }; +ex_rtl_get_var_unsafe() { eval echo \${${1}}; }; +ex_rtl_pop_IFS() { IFS="${EXP_RTL_IFS}"; }; +ex_rtl_push_IFS() { EXP_RTL_IFS="${IFS}"; IFS="${1}"; }; +ex_rtl_try_run() { ex_rtl_test_cmd "${1}" && { "${@}" || exit ${?}; }; }; +ex_rtl_set_var_unsafe() { [ -n "${2}" ] && eval ${1}=\"${2}\" || return 0; }; +ex_rtl_test_cmd() { command -v "${1}" >/dev/null; }; +ex_rtl_toupper() { echo "${1}" | tr a-z A-Z; }; +ex_rtl_unset_vars() { while [ ${#} -gt 0 ]; do unset "${1}"; shift; done; }; -ex_lfilter() { +ex_rtl_lfilter() { local _list="${1}" _filter="${2}" _lnew _litem _litem_filter; if [ -z "${_filter}" ]; then echo "${_list}"; return 0; @@ -31,7 +31,7 @@ ex_lfilter() { echo "${_lnew}"; }; -ex_lfilter_not() { +ex_rtl_lfilter_not() { local _list="${1}" _filter="${2}" _lnew _litem _litem_filter _filterfl; if [ -z "${_filter}" ]; then echo "${_list}"; return 0; @@ -49,7 +49,7 @@ ex_lfilter_not() { echo "${_lnew}"; }; -ex_lmatch() { +ex_rtl_lmatch() { local _cmp="${3}" IFS="${2}"; set -- ${1}; while [ ${#} -gt 0 ]; do if [ "${1}" = "${_cmp}" ]; then @@ -58,7 +58,7 @@ ex_lmatch() { done; return 1; }; -ex_run_cmd_unsplit() { +ex_rtl_run_cmd_unsplit() { local _cmd="${1}" _cmdline _rc IFS; shift; while [ ${#} -gt 0 ]; do [ -n "${1}" ] &&\ @@ -69,4 +69,21 @@ ex_run_cmd_unsplit() { return ${_rc}; }; +ex_rtl_set_vars() { + local _vname_dst="${1}" _vname_src_tmpls="${2}" \ + _vars_set_vname="${3}" _vname_src _vars_set_tmp="" \ + _vars_set_old; + for _vname_src in ${_vname_src_tmpls}; do + _vname_src="${_vname_src}_${_vname_dst}"; + _vval_src="$(ex_rtl_get_var_unsafe "${_vname_src}")"; + if [ -n "${_vval_src}" ]; then + ex_rtl_set_var_unsafe "PKG_${_vname_dst}" "${_vval_src}"; + _vars_set_tmp="${_vars_set_tmp:+${_vars_set_tmp} }PKG_${_vname_dst}"; + fi; + done; + _vars_set_old="$(ex_rtl_get_var_unsafe "${_vars_set_vname}")"; + ex_rtl_set_var_unsafe "${_vars_set_vname}" \ + "${_vars_set_old:+${_vars_set_old} }${_vars_set_tmp}"; +}; + # vim:filetype=sh diff --git a/subr/ex_rtl_fetch.subr b/subr/ex_rtl_fetch.subr new file mode 100644 index 0000000..c5dfc55 --- /dev/null +++ b/subr/ex_rtl_fetch.subr @@ -0,0 +1,63 @@ +# +# set -o errexit -o noglob are assumed. +# + +exp_rtl_fetch_url_git() { + local _tgtdir="${1}" _subdir="${2}" _url="${3}" _branch="${4}" \ + _oldpwd; + if [ -e "${BUILD_DLCACHEDIR}/${_subdir}" ]; then + (ex_rtl_fileop cd "${BUILD_DLCACHEDIR}/${_subdir}" &&\ + git pull origin "${_branch:-main}"); + else + git clone "${_url}" "${BUILD_DLCACHEDIR}/${_subdir}"; + if [ -n "${_branch}" -a \ + \( -z "${_branch#main}" \) -a \ + \( -z "${_branch#master}" \) ]; then + (ex_rtl_fileop cd "${BUILD_DLCACHEDIR}/${_subdir}" &&\ + git checkout -b "${_branch}"); + fi; + fi; + _oldpwd="${PWD}"; ex_rtl_fileop cd "${PKG_BASE_DIR}"; + ex_rtl_fileop rm "${_tgtdir}/${_subdir}"; + ex_rtl_fileop cp "${BUILD_DLCACHEDIR}/${_subdir}" "${_tgtdir}"; + ex_rtl_fileop cd "${_oldpwd}"; +}; + +ex_rtl_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; + exp_rtl_fetch_url_git "${_tgtdir}" "${_subdir}" \ + "${_url}" "${_git_branch}"; + done; +}; + +# N.B. URLs ($1) may contain `?' or '&' characters. +ex_rtl_fetch_url_wget() { + local _url="${1}" _sha256sum_src="${2}"; + if [ -z "${3}" ]; then + _url_dst="${BUILD_DLCACHEDIR}/$(ex_rtl_basename "${_url}")"; + else + _url_dst="${BUILD_DLCACHEDIR}/${3}"; + fi; + if [ -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 + ex_rtl_log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)"; + fi; + fi; + touch "${_url_dst}.fetched"; +}; + +# vim:filetype=sh diff --git a/subr/ex_rtl_fileop.subr b/subr/ex_rtl_fileop.subr index 9cf4423..0666e7d 100644 --- a/subr/ex_rtl_fileop.subr +++ b/subr/ex_rtl_fileop.subr @@ -2,38 +2,91 @@ # set -o errexit -o noglob are assumed. # -ex_build_fileop() { - local _op="${1}"; shift; - if [ "${_op}" = cd ]; then - ex_log_msg vvvo "Changing working directory to \`${1}'."; - [ \( -n "${1}" \) -a \( -L "${1}" -o -e "${1}" \) ] && cd -- "${1}"; - elif [ "${_op}" = cp ]; then - ex_log_msg vvvo "Copying \`${1}' to \`${2}' w/ -pPR."; - [ ${#} -ge 2 ] && cp -pPR -- "${@}"; - elif [ "${_op}" = ln_symbolic ]; then - ex_log_msg vvvo "Linking \`${1}' to \`${2}' w/ -fs"; - [ \( -n "${1}" \) -a \( -n "${2}" \) ] && ln -fs -- "${1}" "${2}"; - elif [ "${_op}" = mv ]; then - ex_log_msg vvvo "Moving \`${1}' to \`${2}' w/ -fs"; - [ \( -n "${1}" \) -a \( -n "${2}" \) ] && mv -f -- "${1}" "${2}"; - elif [ "${_op}" = mkdir ]\ - || [ "${_op}" = rm ]; then +exp_rtl_fileop_check() { + local _prefix="${1}" _pname _rname; shift; + while [ ${#} -gt 0 ]; do + return 0; + shift; done; +}; + +ex_rtl_fileop() { + local _op="${1}" _src _dst; shift; + case "${_op}" in + cd) if [ \( -z "${1}" \) -o ! \( -L "${1}" -o -e "${1}" \) ]; then + ex_rtl_log_msg failexit "Invalid or non-existent directory \`${1}'."; + else + ex_rtl_log_msg vvvo "Changing working directory to \`${1}'."; + exp_rtl_fileop_check "${PREFIX}" "${1}"; + cd -- "${1}"; + fi; ;; + cp) if [ ${#} -lt 2 ]; then + ex_rtl_log_msg failexit "Missing parameters (in: cp ${*}.)"; + else + _src="${*}"; _src="${_src% *}"; + _dst="${*}"; _dst="${_dst##* }"; + ex_rtl_log_msg vvvo "Copying \`${_src}' into \`${_dst}' w/ -pPR."; + exp_rtl_fileop_check "${PREFIX}" "${*}"; + cp -pPR -- "${@}"; + fi; ;; + ln_symbolic) + if [ \( -z "${1}" \) -o \( -z "${2}" \) ]; then + ex_rtl_log_msg failexit "Missing parameters (in: ln_symbolic ${*}.)"; + else + exp_rtl_fileop_check "${PREFIX}" "${2}"; + if ex_rtl_fileop test "${2}"; then + ex_rtl_fileop rm "${2}"; + fi; + ex_rtl_log_msg vvvo "Linking \`${1}' to \`${2}' w/ -fs"; + ln -fs -- "${1}" "${2}"; + fi; ;; + mv) if [ \( -z "${1}" \) -o \( -z "${2}" \) ]; then + ex_rtl_log_msg failexit "Missing parameters (in: mv ${*}.)"; + else + ex_rtl_log_msg vvvo "Moving \`${1}' to \`${2}' w/ -fs"; + exp_rtl_fileop_check "${PREFIX}" "${1}" "${2}"; + mv -f -- "${1}" "${2}"; + fi; ;; + mkdir|mkfifo|rm|source_opt|test|touch) while [ ${#} -gt 0 ]; do if [ -z "${1}" ]; then - return 1; + ex_rtl_log_msg failexit "Missing parameters (in: ${_op} ${*}.)"; elif [ "${_op}" = mkdir ]\ - && [ ! -e "${1}" ]; then - ex_log_msg vvvo "Making directory \`${1}'."; + && [ ! -d "${1}" ]; then + exp_rtl_fileop_check "${PREFIX}" "${1}"; + if ex_rtl_fileop test "${1}"; then + ex_rtl_fileop rm "${1}"; + fi; + ex_rtl_log_msg vvvo "Making directory \`${1}'."; mkdir -p -- "${1}"; + elif [ "${_op}" = mkfifo ]; then + exp_rtl_fileop_check "${PREFIX}" "${1}"; + if ex_rtl_fileop test "${1}"; then + ex_rtl_fileop rm "${1}"; + fi; + ex_rtl_log_msg vvvo "Creating FIFO \`${1}'."; + exp_rtl_fileop_check "${PREFIX}" "${1}"; + mkfifo -- "${1}"; elif [ "${_op}" = rm ]\ - && [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then - ex_log_msg vvvo "Removing directory or file \`${1}'."; + && ex_rtl_fileop test "${1}"; then + ex_rtl_log_msg vvvo "Removing directory or file \`${1}'."; + exp_rtl_fileop_check "${PREFIX}" "${1}"; rm -rf -- "${1}"; + elif [ "${_op}" = source_opt ]\ + && ex_rtl_fileop test "${1}"; then + ex_rtl_log_msg vvvo "Sourcing file \`${1}'."; + exp_rtl_fileop_check "${PREFIX}" "${1}"; + . "${1}"; + elif [ "${_op}" = test ]\ + && ! [ \( -L "${1}" \) -o \( -e "${1}" \) ]; then + return 1; + elif [ "${_op}" = touch ]; then + ex_rtl_log_msg vvvo "Touching file \`${1}'."; + exp_rtl_fileop_check "${PREFIX}" "${1}"; + touch -- "${1}"; fi; shift; - done; - else - ex_log_msg failexit "Error: ex_build_fileop() called w/ invalid parameter(s) \`${@}'."; - fi; + done; ;; + *) ex_rtl_log_msg failexit "Error: ex_rtl_fileop() called w/ invalid parameter(s): ${*}"; ;; + esac; return 0; }; # vim:filetype=sh diff --git a/subr/ex_rtl_install.subr b/subr/ex_rtl_install.subr new file mode 100644 index 0000000..5dc2a08 --- /dev/null +++ b/subr/ex_rtl_install.subr @@ -0,0 +1,44 @@ +# +# set -o errexit -o noglob are assumed. +# + +ex_rtl_install() { + 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 + ex_rtl_fileop rm "${_ln_fname}"; + fi; + ex_rtl_fileop ln_symbolic "${_ln_target}" "${_ln_fname}"; + ;; + /=*) + _mkdir_fname="${1#/=}"; + if [ "${_mkdir_fname#/}" = "${_mkdir_fname}" ]; then + _mkdir_fname="${_prefix:+${_prefix}/}${_mkdir_fname}"; + fi; + ex_rtl_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; + ex_rtl_fileop cp "${_file_fname_src}" "${_file_fname_dst}"; + ;; + esac; shift; + done; +}; + +# vim:filetype=sh diff --git a/subr/ex_rtl_log.subr b/subr/ex_rtl_log.subr index c44085a..71e52fa 100644 --- a/subr/ex_rtl_log.subr +++ b/subr/ex_rtl_log.subr @@ -2,9 +2,9 @@ # set -o errexit -o noglob are assumed. # -ex_log_env_vars() { +ex_rtl_log_env_vars() { local _nvar=1 _arg _arg_len_max=0; - ex_log_msg info "Variables for this ${1:-build}:"; shift; + ex_rtl_log_msg info "Variables for this ${1:-build}:"; shift; while [ ${_nvar} -le ${#} ]; do _arg="$(eval echo \${${_nvar}})"; _arg="${_arg%%=*}"; @@ -13,38 +13,44 @@ ex_log_env_vars() { fi; : $((_nvar+=1)); done; while [ ${#} -gt 0 ]; do - ex_log_msg info "$(printf \ + ex_rtl_log_msg info "$(printf \ "%${_arg_len_max}.${_arg_len_max}s=%s" \ - "${1%%=*}" "$(ex_get_var_unsafe ${1#*=})")"; + "${1%%=*}" "$(ex_rtl_get_var_unsafe ${1#*=})")"; shift; done; }; -ex_log_msg() { +ex_rtl_log_set_vnfo_lvl() { + EXP_RTL_LOG_VNFO_LVL="${1}"; +}; + +ex_rtl_log_msg() { local _lvl="${1}"; shift; if [ "${_lvl}" = vnfo ]\ - && [ ${ARG_VERBOSE:-0} -eq 0 ]; then + && [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 1 ]; then return; elif [ "${_lvl}" = vvfo ]\ - && [ ${ARG_VERBOSE2:-0} -eq 0 ]; then + && [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 2 ]; then return; elif [ "${_lvl}" = vvvo ]\ - && [ ${ARG_VERBOSE3:-0} -eq 0 ]; then + && [ "${EXP_RTL_LOG_VNFO_LVL:-0}" -lt 3 ]; 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_VNFO_COLOUR}m"; ;; - vvfo) printf "\033[0m\033[${LOG_MSG_VVFO_COLOUR}m"; ;; - vvvo) printf "\033[0m\033[${LOG_MSG_VVVO_COLOUR}m"; ;; - succ) printf "\033[0m\033[${LOG_MSG_SUCC_COLOUR}m"; ;; + failexit) printf "\033[0m\033[${DEFAULT_LOG_MSG_FAIL_COLOUR}m"; ;; + fail) printf "\033[0m\033[${DEFAULT_LOG_MSG_FAIL_COLOUR}m"; ;; + info) printf "\033[0m\033[${DEFAULT_LOG_MSG_INFO_COLOUR}m"; ;; + inf2) printf "\033[0m\033[${DEFAULT_LOG_MSG_INF2_COLOUR}m"; ;; + vnfo) printf "\033[0m\033[${DEFAULT_LOG_MSG_VNFO_COLOUR}m"; ;; + vvfo) printf "\033[0m\033[${DEFAULT_LOG_MSG_VVFO_COLOUR}m"; ;; + vvvo) printf "\033[0m\033[${DEFAULT_LOG_MSG_VVVO_COLOUR}m"; ;; + succ) printf "\033[0m\033[${DEFAULT_LOG_MSG_SUCC_COLOUR}m"; ;; + suc2) printf "\033[0m\033[${DEFAULT_LOG_MSG_SUC2_COLOUR}m"; ;; esac; if [ ${#} -gt 1 ]; then - printf "==> %s %s %s\033[0m\n" "$(ex_date)" "${1}" "$*"; + printf "==> %s %s %s\033[0m\n" "$(ex_rtl_date)" "${1}" "$*"; else - printf "==> %s %s\033[0m\n" "$(ex_date)" "${1}"; + printf "==> %s %s\033[0m\n" "$(ex_rtl_date)" "${1}"; fi; [ ${_lvl} = failexit ] && exit 1 || return 0; }; diff --git a/subr/ex_rtl_state.subr b/subr/ex_rtl_state.subr new file mode 100644 index 0000000..fa07ff3 --- /dev/null +++ b/subr/ex_rtl_state.subr @@ -0,0 +1,32 @@ +# +# set -o errexit -o noglob are assumed. +# + +ex_rtl_state_set() { + local _workdir="${1}" _pkg_fname="${2}" _done_fname_pfx; + _done_fname_pfx="${_workdir}/.${_pkg_fname}"; + shift 2; while [ ${#} -ge 1 ]; do + if [ -z "${1}" ]; then + shift; continue; + elif [ "${1#-}" != "${1}" ]; then + ex_rtl_fileop rm "${_done_fname_pfx}.${1#-}"; + else + ex_rtl_fileop touch "${_done_fname_pfx}.${1}"; + fi; + shift; done; +}; + +ex_rtl_state_test() { + local _workdir="${1}" _pkg_name="${2}" _build_step="${3}" \ + _restart_at="${4}" _done_fname; + _done_fname="${_workdir}/.${_pkg_name}.${_build_step}"; + if [ -z "${_restart_at}" ]; then + ex_rtl_fileop test "${_done_fname}"; + elif [ "${_restart_at}" = "ALL" ]; then + return 1; + else + ! ex_rtl_lmatch "${_restart_at}" , "${_build_step}"; + fi; +}; + +# vim:filetype=sh diff --git a/subr/ex_setup_args.subr b/subr/ex_setup_args.subr deleted file mode 100644 index 2f00c6d..0000000 --- a/subr/ex_setup_args.subr +++ /dev/null @@ -1,73 +0,0 @@ -BUILD_ARGS_SPEC=" - ARG_IPV4_ONLY:-4 - ARG_IPV6_ONLY:-6 - ARCH:arg:-a - BUILD:arg:-b - ARG_CLEAN:-c - ARG_DEBUG_MINIPIX:--debug-minipix - ARG_IGNORE_SHA256SUMS:-i - ARG_OFFLINE:-N - ARG_RELAXED:-R - ARG_RESTART:arg:-r - ARG_TARBALL:selfarg:-t - ARG_TARBALL:selfarg:-t.bz2 - ARG_TARBALL:selfarg:-t.gz - ARG_TARBALL:selfarg:-t.xz - ARG_VERBOSE:-v - ARG_VERBOSE2:-vv - ARG_VERBOSE3:-vvv - ARG_XTRACE:-x"; - -ex_setup_args() { - local _spec="${BUILD_ARGS_SPEC}" _spec_arg _found; - while [ ${#} -gt 0 ]; do - if [ "${1#-}" = "${1}" ]; then - break; - fi; - for _spec_arg in ${_spec}; do - case "${_spec_arg}" in - *:${1}) case "${_spec_arg#*:}" in - arg:*) - ex_set_var_unsafe "${_spec_arg%%:*}" "${2}"; shift; ;; - selfarg:*) - ex_set_var_unsafe "${_spec_arg%%:*}" "${1}"; ;; - *) - ex_set_var_unsafe "${_spec_arg%%:*}" 1; ;; - esac; _found=1; break; ;; - *) _found=0; ;; - esac; - done; - if [ "${_found:-0}" -eq 0 ]; then - exec cat etc/build.usage; - else - shift; - fi; - done; - if [ -n "${ARG_TARBALL}" ]; then - if [ "${ARG_TARBALL#-t.}" != "${ARG_TARBALL}" ]; then - TARBALL_SUFFIX="${ARG_TARBALL#-t.}"; - else - TARBALL_SUFFIX=xz; - fi; - fi; - if [ "${ARG_VERBOSE3:-0}" -eq 1 ]\ - || [ "${ARG_XTRACE:-0}" -eq 1 ]; then - ARG_VERBOSE2=1; - fi; - if [ "${ARG_VERBOSE2:-0}" -eq 1 ]; then - ARG_VERBOSE=1; - fi; - if [ -n "${ARG_RESTART}" ]; then - if [ "${ARG_RESTART%:*}" != "${ARG_RESTART}" ]; then - ARG_RESTART_AT="${ARG_RESTART#*:}"; ARG_RESTART="${ARG_RESTART%:*}"; - fi; - BUILD_PACKAGES_RESTART="$(echo ${ARG_RESTART} | sed "s/,/ /g")"; - fi; - while [ ${#} -gt 0 ]; do - case "${1}" in - *=*) ex_set_var_unsafe "${1%%=*}" "${1#*=}"; ;; - *) BUILD_TARGETS_META="${BUILD_TARGETS_META:+${BUILD_TARGETS_META} }${1}"; ;; - esac; shift; done; -}; - -# vim:filetype=sh diff --git a/subr/ex_setup_checks.subr b/subr/ex_setup_checks.subr deleted file mode 100644 index 803810d..0000000 --- a/subr/ex_setup_checks.subr +++ /dev/null @@ -1,38 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -ex_setup_checks() { - local __ _exit; - for __ in ${CHECK_PATH_VARS}; do - if [ -z "${___:=$(ex_get_var_unsafe "${__}")}" ]; then - ex_log_msg failexit "Error: variable \`${__}' is empty or unset."; - elif [ "${___#* *}" != "${___}" ]; then - 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 - ex_log_msg fail "Error: missing prerequisite file \`${__}'."; - _exit=1; - fi; - else - 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 - ex_log_msg fail "Error: missing prerequisite Perl module \`${__}'."; - _exit=1; - fi; - done; - if [ ${_exit:-0} = 1 ]; then - exit 1; - fi; -}; - -# vim:filetype=sh diff --git a/subr/ex_setup_env.subr b/subr/ex_setup_env.subr deleted file mode 100644 index 8907d7e..0000000 --- a/subr/ex_setup_env.subr +++ /dev/null @@ -1,36 +0,0 @@ -ex_setup_env() { - local __; - set -o noglob; - if [ -z "${DEFAULT_BUILD_CPUS}" ]\ - && [ -e /proc/cpuinfo ]; then - DEFAULT_BUILD_CPUS=$(awk '/^processor/{cpus++} END{print cpus}' /proc/cpuinfo); - fi; - : ${ARCH:=nt64}; : ${BUILD:=debug}; - if [ "${ARCH}" = nt32 ]; then - TARGET="i686-nt32-midipix"; - elif [ "${ARCH}" = nt64 ]; then - TARGET="x86_64-nt64-midipix"; - else - if [ "${BUILD}" != debug ]\ - && [ "${BUILD}" != release ]; then - ex_log_msg failexit "Error: unknown build type \`${BUILD}'."; - fi; - 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 ${__} ] && . ${__}; - done; - export PATH="${PREFIX}/bin${PATH:+:${PATH}}"; - if [ ${ARG_IPV4_ONLY:-0} -eq 1 ]; then - DEFAULT_WGET_ARGS="-4${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; - elif [ ${ARG_IPV6_ONLY:-0} -eq 1 ]; then - DEFAULT_WGET_ARGS="-6${DEFAULT_WGET_ARGS:+ ${DEFAULT_WGET_ARGS}}"; - fi; - for __ in $(export | sed -e 's/^export //' -e 's/=.*$//'); do - if ! ex_lmatch "${CLEAR_ENV_VARS_EXCEPT}" " " "${__}"; then - unset "${__}"; - fi; - done; -}; - -# vim:filetype=sh diff --git a/subr/ex_setup_subdirs.subr b/subr/ex_setup_subdirs.subr deleted file mode 100644 index e6f0fbf..0000000 --- a/subr/ex_setup_subdirs.subr +++ /dev/null @@ -1,49 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -ex_setup_subdirs() { - local _pname; - if [ ${ARG_CLEAN:-0} -eq 1 ]; then - ex_log_msg info "-c specified, cleaning prefix..."; - for _pname in ${CLEAR_PREFIX_PATHS}; do - ex_build_fileop rm ${PREFIX}/${_pname}; - done; - fi; - pkg_install_files "" \ - /=${DLCACHEDIR} \ - /=${WORKDIR} \ - /=${PREFIX} \ - /=${PREFIX}/bin \ - /=${PREFIX}/lib/pkgconfig \ - /=${PREFIX}/share/doc \ - /=${PREFIX}/share/info \ - /=${PREFIX}/share/man \ - /=${PREFIX}/${TARGET}/bin \ - /=${PREFIX}/${TARGET}/lib \ - /=${PREFIX}/x86_64-w64-mingw32 \ - /=${PREFIX_CROSS} \ - /=${PREFIX_MINIPIX}/bin \ - /=${PREFIX_NATIVE} \ - /=${PREFIX_NATIVE}/share/doc \ - /=${PREFIX_NATIVE}/share/info \ - /=${PREFIX_NATIVE}/share/man \ - /=${PREFIX_NATIVE}/${TARGET}/lib \ - @.=${PREFIX}/usr \ - @.=${PREFIX}/x86_64-w64-mingw32/mingw \ - /=${PREFIX}/x86_64-w64-mingw32/mingw/include \ - @.=${PREFIX_NATIVE}/usr \ - @../lib/pkgconfig=${PREFIX}/share/pkgconfig \ - @lib=${PREFIX}/lib64 \ - @bin=${PREFIX_MINIPIX}/lib \ - @bin=${PREFIX_MINIPIX}/libexec \ - @bin=${PREFIX_MINIPIX}/share \ - @share/doc=${PREFIX}/doc \ - @share/info=${PREFIX}/info \ - @share/man=${PREFIX}/man \ - @share/doc=${PREFIX_NATIVE}/doc \ - @share/info=${PREFIX_NATIVE}/info \ - @share/man=${PREFIX_NATIVE}/man; -}; - -# vim:filetype=sh diff --git a/subr/pkg_build.subr b/subr/pkg_build.subr index dd2e8f2..038bd56 100644 --- a/subr/pkg_build.subr +++ b/subr/pkg_build.subr @@ -10,16 +10,19 @@ 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. - ex_run_cmd_unsplit make \ + ex_rtl_run_cmd_unsplit make \ ${PKG_MAKEFLAGS_BUILD} \ ${PKG_MAKEFLAGS_BUILD_EXTRA} \ - AR=${AR} ${_no_autoconf:+CC=${CC}} RANLIB=${RANLIB} \ + "AR=${PKG_AR}" "${_no_autoconf:+CC=${PKG_CC}}" \ + "RANLIB=${PKG_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}"; + "${PKG_PKGCONFIG:+PKGCONFIG=${PKG_PKGCONFIG}}" \ + "${PKG_PKG_CONFIG:+PKG_CONFIG=${PKG_PKG_CONFIG}}" \ + "${PKG_PKG_CONFIG_LIBPATH:+PKG_CONFIG_LIBPATH=${PKG_PKG_CONFIG_LIBPATH}}"\ + "LIBTOOL=${PKG_LIBTOOL:-slibtool}"; }; # vim:filetype=sh diff --git a/subr/pkg_build_clean.subr b/subr/pkg_build_clean.subr deleted file mode 100644 index 8b2e909..0000000 --- a/subr/pkg_build_clean.subr +++ /dev/null @@ -1,9 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -pkg_build_clean() { - make clean; -}; - -# vim:filetype=sh diff --git a/subr/pkg_configure.subr b/subr/pkg_configure.subr index acc67a0..23ef26d 100644 --- a/subr/pkg_configure.subr +++ b/subr/pkg_configure.subr @@ -3,18 +3,26 @@ # pkg_configure() { - if [ -n "${PKG_CONFIGURE}" ]; then - PKG_CONFIGURE="${PKG_BASE_DIR}/${PKG_CONFIGURE}"; - else - PKG_CONFIGURE="${PKG_BASE_DIR}/${PKG_SUBDIR}/configure"; - fi; if [ -x "${PKG_CONFIGURE}" ]; then + if [ -n "${PKG_PKGCONFIG}" ]; then + export PKGCONFIG="${PKG_PKGCONFIG}"; + fi; + if [ -n "${PKG_PKG_CONFIG}" ]; then + export PKG_CONFIG="${PKG_PKG_CONFIG}"; + fi; + if [ -n "${PKG_PKG_CONFIG_LIB_PATH}" ]; then + export PKG_CONFIG_LIBPATH="${PKG_PKG_CONFIG_LIBPATH}"; + fi; + AR="${PKG_AR}" \ + CC="${PKG_CC}" \ + RANLIB="${PKG_RANLIB}" \ CFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ CPPFLAGS="${PKG_CFLAGS_CONFIGURE}${PKG_CFLAGS_CONFIGURE_EXTRA:+ ${PKG_CFLAGS_CONFIGURE_EXTRA}}" \ CXXFLAGS="${PKG_CXXFLAGS_CONFIGURE}${PKG_CXXFLAGS_CONFIGURE_EXTRA:+ ${PKG_CXXFLAGS_CONFIGURE_EXTRA}}" \ LDFLAGS="${PKG_LDFLAGS_CONFIGURE}${PKG_LDFLAGS_CONFIGURE_EXTRA:+ ${PKG_LDFLAGS_CONFIGURE_EXTRA}}" \ ${PKG_CONFIGURE} \ ${PKG_CONFIGURE_ARGS} ${PKG_CONFIGURE_ARGS_EXTRA} ${PKG_CONFIGURE_ARGS_EXTRA_DEBUG}; + unset PKGCONFIG PKG_CONFIG PKG_CONFIG_LIBPATH; fi; }; diff --git a/subr/pkg_configure_autotools.subr b/subr/pkg_configure_autotools.subr index 219b171..1617895 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 - (ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && autoconf)\ + (ex_rtl_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; - (ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && \ + (ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_SUBDIR}" && \ "${SHELL}" "${_script_fname}") || exit 1 && break; fi; done; @@ -39,10 +39,10 @@ pkg_configure_autotools() { if [ "${PKG_BUILD_TYPE}" != host ]; then if [ -n "${PKG_CONFIG_CACHE}" ]; then echo "${PKG_CONFIG_CACHE}" |\ - tr " " "\n" >> "${PKG_BUILD_DIR}/config.cache"; + tr " " "\n" > "${PKG_BUILD_DIR}/config.cache"; if [ -n "${PKG_CONFIG_CACHE_EXTRA}" ]; then echo "${PKG_CONFIG_CACHE_EXTRA}" |\ - tr " " "\n" >> "${PKG_BUILD_DIR}/config.cache"; + tr " " "\n" >> "${PKG_BUILD_DIR}/config.cache"; fi; fi; sed -i"" "s,%PREFIX%,${PKG_PREFIX},g" "${PKG_BUILD_DIR}/config.cache"; diff --git a/subr/pkg_configure_patch.subr b/subr/pkg_configure_patch.subr index ff078fe..5793912 100644 --- a/subr/pkg_configure_patch.subr +++ b/subr/pkg_configure_patch.subr @@ -3,23 +3,26 @@ # pkg_configure_patch() { - local _patch_fname _patches_done; - set +o noglob; - for _patch_fname in \ - ${WORKDIR}/chainport-host-invariants/chainport/${PKG_NAME%_host}${PKG_VERSION:+-${PKG_VERSION}}.midipix.patch \ - ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch \ - ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}.local.patch \ - ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}.local@${BUILD_HNAME}.patch \ - ${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}/*.patch} \ - ${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}${PKG_VERSION:+-${PKG_VERSION}}.local.patch} \ - ${PKG_NAME_PARENT:+${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME_PARENT}${PKG_VERSION:+-${PKG_VERSION}}.local@${BUILD_HNAME}.patch}; do - 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}"; + local _pkg_name _pkg_name_full _patch_dir _patch_fname _patches_done; + for _pkg_name in "${PKG_NAME}" "${PKG_NAME_PARENT}"; do + if [ -z "${_pkg_name}" ]; then + continue; + else + _pkg_name_full="${_pkg_name}${PKG_VERSION:+-${PKG_VERSION}}"; + _patch_dir="${MIDIPIX_BUILD_PWD}/patches"; fi; + set +o noglob; for _patch_fname in \ + ${_patch_dir}/${_pkg_name}/*.patch \ + ${_patch_dir}/${_pkg_name_full}.local.patch \ + ${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch \ + "${PKG_PATCHES_EXTRA}"; do + if [ -r "${_patch_fname}" ]\ + && ! ex_rtl_lmatch "${_patches_done}" " " "${_patch_fname}"; then + patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; + _patches_done="${_patches_done:+${_patches_done} }${_patch_fname}"; + fi; + done; set -o noglob; done; - set -o noglob; }; # vim:filetype=sh diff --git a/subr/pkg_fetch_distclean.subr b/subr/pkg_fetch_distclean.subr deleted file mode 100644 index 19f0b74..0000000 --- a/subr/pkg_fetch_distclean.subr +++ /dev/null @@ -1,15 +0,0 @@ -# -# 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 33d450d..1ab1e4f 100644 --- a/subr/pkg_fetch_extract.subr +++ b/subr/pkg_fetch_extract.subr @@ -3,24 +3,24 @@ # pkg_fetch_extract() { + local _oldpwd; if [ -n "${PKG_URL}" ]\ && [ "${PKG_URL_TYPE:-wget}" = wget ]; then - 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 - gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; - elif [ "${PKG_FNAME##*.tar.}" = "xz" ]; then - xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; - elif [ "${PKG_FNAME##*.t}" = "bz2" ]; then - bunzip2 -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; - elif [ "${PKG_FNAME##*.t}" = "gz" ]; then - gunzip -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; - elif [ "${PKG_FNAME##*.t}" = "xz" ]; then - xz -d < "${DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + _oldpwd="${PWD}"; ex_rtl_fileop cd "${PKG_BASE_DIR}"; + ex_rtl_fileop rm "${PKG_BASE_DIR}/${PKG_SUBDIR}"; + if [ "${PKG_FNAME##*.tar.}" = "bz2" ]\ + || [ "${PKG_FNAME##*.t}" = "bz2" ]; then + bunzip2 -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.tar.}" = "gz" ]\ + || [ "${PKG_FNAME##*.t}" = "gz" ]; then + gunzip -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; + elif [ "${PKG_FNAME##*.tar.}" = "xz" ]\ + || [ "${PKG_FNAME##*.t}" = "xz" ]; then + xz -d < "${BUILD_DLCACHEDIR}/${PKG_FNAME}" | tar -C "${PKG_BASE_DIR}" -xf -; else - tar -C "${PKG_BASE_DIR}" -xf "${DLCACHEDIR}/${PKG_FNAME}"; + tar -C "${PKG_BASE_DIR}" -xf "${BUILD_DLCACHEDIR}/${PKG_FNAME}"; fi; + ex_rtl_fileop cd "${_oldpwd}"; fi; }; diff --git a/subr/pkg_fetch_git.subr b/subr/pkg_fetch_git.subr index 8340ca4..67c0545 100644 --- a/subr/pkg_fetch_git.subr +++ b/subr/pkg_fetch_git.subr @@ -2,47 +2,9 @@ # 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 - (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 - (ex_build_fileop cd "${DLCACHEDIR}/${_subdir}" &&\ - git checkout -b "${_branch}"); - fi; - fi; - fi; - ex_build_fileop rm "${_tgtdir}/${_subdir}"; - ex_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; + if [ -n "${PKG_URLS_GIT}" ]; then + ex_rtl_fetch_urls_git "${PKG_BASE_DIR}" ${PKG_URLS_GIT}; fi; }; diff --git a/subr/pkg_fetch_subdirs.subr b/subr/pkg_fetch_subdirs.subr deleted file mode 100644 index 7d097d0..0000000 --- a/subr/pkg_fetch_subdirs.subr +++ /dev/null @@ -1,23 +0,0 @@ -# -# set -o errexit -o noglob are assumed. -# - -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" ]\ - || [ -e "${PKG_BASE_DIR}/${PKG_SUBDIR}/configure.in" ]; then - PKG_BUILD_DIR="${PKG_BASE_DIR}/obj"; - else - PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_SUBDIR}"; - fi; - else - PKG_BUILD_DIR="${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; - fi; - if [ ! -d "${PKG_BUILD_DIR}" ]; then - ex_build_fileop mkdir "${PKG_BUILD_DIR}"; - fi; - 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 95fdc08..56fe79d 100644 --- a/subr/pkg_fetch_wget.subr +++ b/subr/pkg_fetch_wget.subr @@ -2,40 +2,9 @@ # 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}/$(ex_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 - ex_log_msg failexit "Error: hash mismatch for URL \`${_url}' (is: ${_sha256sum_dst}, should be: ${_sha256sum_src}.)"; - else - ex_log_msg vnfo "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; + if [ -n "${PKG_URL}" ]; then + ex_rtl_fetch_url_wget "${PKG_URL}" "${PKG_SHA256SUM}" "${PKG_FNAME}"; fi; }; diff --git a/subr/pkg_install.subr b/subr/pkg_install.subr index c4a0c03..0d74ecf 100644 --- a/subr/pkg_install.subr +++ b/subr/pkg_install.subr @@ -3,7 +3,7 @@ # pkg_install() { - ex_build_fileop mkdir "${PKG_PREFIX}"; + ex_rtl_fileop mkdir "${PKG_PREFIX}"; tar -C "${PKG_DESTDIR}" -cpf - . |\ tar -C "${PKG_PREFIX}" -xpf -; }; diff --git a/subr/pkg_install_files.subr b/subr/pkg_install_files.subr index 88acf60..31f101e 100644 --- a/subr/pkg_install_files.subr +++ b/subr/pkg_install_files.subr @@ -2,52 +2,9 @@ # 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 - ex_build_fileop rm "${_ln_fname}"; - fi; - 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; - ex_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; - ex_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 "${PKG_DESTDIR}" ${PKG_INSTALL_FILES}; - fi; + if [ -n "${PKG_INSTALL_FILES}" ]; then + ex_rtl_install -v "${PKG_DESTDIR}" ${PKG_INSTALL_FILES}; fi; }; diff --git a/subr/pkg_install_libs.subr b/subr/pkg_install_libs.subr index c4b49c6..c3ce16a 100644 --- a/subr/pkg_install_libs.subr +++ b/subr/pkg_install_libs.subr @@ -4,29 +4,28 @@ pkgp_install_lib_check() { local _so_path="${1}" _so_ver="${1##*.so}"; - if [ -z "${_so_ver}" ]; then + if [ -z "${_so_path}" ]; then return 1; - fi; - while [ -n "${_so_ver}" ]; do + else while [ -n "${_so_ver}" ]; do if [ "${_so_ver#[0-9.]}" = "${_so_ver}" ]; then return 1; else _so_ver="${_so_ver#[0-9.]}"; fi; - done; return 0; + done; return 0; fi; }; pkgp_install_lib_link() { - local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \ + local _so_path="${1}" _so_dir="${2}" _lib_name="${3}" \ _lib_link_tgt _lib_link_path; _lib_link_path="${_so_path%.so*}.lib.a"; - _lib_link_tgt="$(find "${_so_dir}" \ - -name "${_lib_name%%.*}.*.lib.a" |\ + _lib_link_tgt="$(find "${_so_dir}" \ + -name "${_lib_name%%.*}.*.lib.a" |\ sort | tail -1)"; if [ -n "${_lib_link_tgt}" ]\ && [ "${_lib_link_tgt}" != "${_lib_link_path}" ]; then - ex_build_fileop rm "${_lib_link_path}"; - ex_build_fileop ln_symbolic "$(ex_basename "${_lib_link_tgt}")" \ + ex_rtl_fileop rm "${_lib_link_path}"; + ex_rtl_fileop ln_symbolic "$(ex_rtl_basename "${_lib_link_tgt}")" \ "${_lib_link_path}"; fi; }; @@ -34,25 +33,29 @@ pkgp_install_lib_link() { 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 "${PKG_DESTDIR}" \ + for _so_src_path in \ + $(find "${PKG_DESTDIR}" \ \( -name "*.so" -or -name "*.so.*" \) -print); - do if ! pkgp_install_lib_check "${_so_src_path}" \ + do if ! pkgp_install_lib_check "${_so_src_path}" \ || [ "$(readlink -f "${_so_src_path}")" = "/dev/null" ]; then continue; - else case "${_so_src_path}" in + else _so_dst_dir="${_so_src_path%/*}"; + 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="$(ex_basename "${_lib_src_path}")"; - _so_dst_dir="${_so_src_path%/*}"; - fi; - if [ ! -L "${_lib_src_path}" ]; then + _lib_name="$(ex_rtl_basename "${_lib_src_path}")"; _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; + if [ ! -L "${_lib_src_path}" ]\ + && [ ! -e "${_lib_dst_path}" ]; then + set -o xtrace + (ex_rtl_fileop cd "$(ex_rtl_dirname "${_so_src_path}")"; + perk -e "$(ex_rtl_basename "${_so_src_path}")" |\ + "${PKG_TARGET}-mdso" \ + -i "$(ex_rtl_basename "${_lib_dst_path}")" \ + -n "$(ex_rtl_basename "${_so_src_path}")" -); + set +o xtrace fi; pkgp_install_lib_link "${_so_src_path}" "${_so_dst_dir}" "${_lib_name}"; done; diff --git a/subr/pkg_install_make.subr b/subr/pkg_install_make.subr index 8207d7e..48489c5 100644 --- a/subr/pkg_install_make.subr +++ b/subr/pkg_install_make.subr @@ -3,16 +3,16 @@ # pkg_install_make() { - ex_run_cmd_unsplit make \ + ex_rtl_run_cmd_unsplit make \ ${PKG_MAKEFLAGS_INSTALL} \ ${PKG_MAKEFLAGS_INSTALL_EXTRA} \ - AR=${AR} CC=${CC} RANLIB=${RANLIB} \ + AR=${PKG_AR} CC=${PKG_CC} RANLIB=${PKG_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_LIBTOOL:-slibtool}" \ "${PKG_MAKE_INSTALL_VNAME:-DESTDIR}=${PKG_DESTDIR}/" \ ${PKG_INSTALL_TARGET:=install}; }; diff --git a/subr/pkg_install_purge_la.subr b/subr/pkg_install_purge_la.subr index 6172567..5355962 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 - ex_build_fileop rm ${_la_path}; + ex_rtl_fileop rm ${_la_path}; done; }; diff --git a/subr/pkg_install_strip.subr b/subr/pkg_install_strip.subr index e91e6ea..5d232a3 100644 --- a/subr/pkg_install_strip.subr +++ b/subr/pkg_install_strip.subr @@ -2,8 +2,8 @@ # set -o errexit -o noglob are assumed. # -pkgp_strip_tree() { - local _tree_root="${1}" _bin_path; +pkg_strip() { + local _tree_root="${PKG_DESTDIR}/bin" _bin_path; if [ ! -e "${_tree_root}" ]; then return; fi; @@ -11,21 +11,12 @@ pkgp_strip_tree() { \( -type f -or -type l \)); do set +o errexit; if objdump -sj .debug_info "${_bin_path}" >/dev/null 2>&1; then - ex_log_msg info "Stripping ${_bin_path}..."; - ex_log_msg vnfo "${TARGET}-strip ${_bin_path}"; - ${TARGET}-strip ${_bin_path}; + ex_rtl_log_msg info "Stripping ${_bin_path}..."; + ex_rtl_log_msg vnfo "${PKG_TARGET}-strip ${_bin_path}"; + ${PKG_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 "${PKG_DESTDIR}"; - elif [ "${BUILD}" = release ]; then - pkgp_strip_tree "${PKG_DESTDIR}/bin"; - fi; -}; - # vim:filetype=sh diff --git a/subr/pkg_install_subdirs.subr b/subr/pkg_install_subdirs.subr index c7b0d08..0ddbf5c 100644 --- a/subr/pkg_install_subdirs.subr +++ b/subr/pkg_install_subdirs.subr @@ -3,20 +3,16 @@ # pkg_install_subdirs() { - pkg_install_files "${PKG_DESTDIR}" \ - /=bin \ - /=lib \ - /=lib/pkgconfig \ - /=sbin \ - /=share/doc \ - /=share/info \ - /=share/man/man1 \ - @.=usr \ - @../lib/pkgconfig=share/pkgconfig \ - @lib=lib64 \ - @share/doc=doc \ - @share/info=info \ - @share/man=man; + local _spec; + for _spec in "${PKG_INSTALL_FILES_DESTDIR}" \ + "${PKG_INSTALL_FILES_DESTDIR_EXTRA}"; do + ex_rtl_install "${PKG_DESTDIR}" ${_spec}; + done; + if [ "${PKG_PREFIX%/}" = "${PREFIX_NATIVE%/}" ]; then + ex_rtl_install \ + "${PKG_DESTDIR}/${DEFAULT_TARGET}" \ + ${PKG_INSTALL_FILES_DESTDIR}; + fi; }; # vim:filetype=sh diff --git a/vars/build.vars b/vars/build.vars index 2548a57..559e9b0 100644 --- a/vars/build.vars +++ b/vars/build.vars @@ -15,165 +15,225 @@ gt_cv_int_divbyzero_sigfpe=yes xorg_cv_malloc0_returns_null=yes"}; # -# Build target invariants +# Build target host_tools # -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"}; -: ${PKG_CHAINPORT_NO_LOG_VARS:=1}; - -# -# Build target host_toolchain_deps -# -HOST_TOOLCHAIN_DEPS_BUILD_TYPE="host"; -HOST_TOOLCHAIN_DEPS_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; -HOST_TOOLCHAIN_DEPS_PACKAGES=" -slibtool_host perk_host mdso_host install_strip_host pkgconf_host binutils_host binutils_host_x86_64_w64_mingw32"; -HOST_TOOLCHAIN_DEPS_PREFIX="${PREFIX}"; +HOST_TOOLS_BUILD_TYPE="host"; +HOST_TOOLS_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; +HOST_TOOLS_PACKAGES=" +chainport_host slibtool_host perk_host +mdso_host install_strip_host pkgconf_host"; +HOST_TOOLS_PREFIX="${PREFIX}"; +: ${PKG_CHAINPORT_HOST_URLS_GIT:="chainport=${DEFAULT_GITROOT}/ports/chainport"}; +: ${PKG_CHAINPORT_HOST_BUILD_STEPS_DISABLE:=build}; +: ${PKG_CHAINPORT_HOST_NO_LOG_VARS:=1}; : ${PKG_SLIBTOOL_HOST_URLS_GIT:="slibtool=${DEFAULT_GITROOT}/slibtool"}; : ${PKG_SLIBTOOL_HOST_CONFIGURE_ARGS:=--host= --prefix=}; : ${PKG_PERK_HOST_URLS_GIT:="perk=${DEFAULT_GITROOT}/perk"}; : ${PKG_PERK_HOST_CONFIGURE_ARGS:="--prefix=/usr"}; -: ${PKG_PERK_HOST_INSTALL_FILES:="@perk=bin/${TARGET}-perk"}; +: ${PKG_PERK_HOST_INSTALL_FILES:="@perk=bin/${DEFAULT_TARGET}-perk"}; : ${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 /=${TARGET}/bin bin/mdso=${TARGET}/bin/mdso"}; +: ${PKG_MDSO_HOST_INSTALL_FILES:="@mdso=bin/${DEFAULT_TARGET}-mdso /=${DEFAULT_TARGET}/bin bin/mdso=${DEFAULT_TARGET}/bin/mdso"}; : ${PKG_INSTALL_STRIP_HOST_NO_LOG_VARS:=1}; : ${PKG_PKGCONF_HOST_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; : ${PKG_PKGCONF_HOST_VERSION:=0.9.12}; : ${PKG_PKGCONF_HOST_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_HOST_VERSION}/pkgconf-${PKG_PKGCONF_HOST_VERSION}.tar.bz2}; : ${PKG_PKGCONF_HOST_CONFIGURE_ARGS:="--prefix=${PREFIX_NATIVE}"}; : ${PKG_PKGCONF_HOST_MAKEFLAGS_INSTALL_EXTRA:=prefix=}; -: ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; -: ${PKG_BINUTILS_HOST_VERSION:=2.24.51}; -: ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_VERSION}.tar.bz2}; -: ${PKG_BINUTILS_HOST_CONFIGURE_ARGS:="--disable-werror --enable-deterministic-archives --prefix=${PREFIX} --target=${TARGET} --with-sysroot=${PREFIX_CROSS}"}; -: ${PKG_BINUTILS_HOST_INSTALL_FILES:="@${TARGET}-windmc=bin/windmc @${TARGET}-windres=bin/windres"}; -: ${PKG_BINUTILS_HOST_MAKEFLAGS_INSTALL_EXTRA:="PREFIX= prefix="}; -: ${PKG_BINUTILS_HOST_SLIBTOOL:=slibtool-static}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_VERSION:=2.24.51}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_VERSION}.tar.bz2}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_CONFIGURE_ARGS:="--disable-werror --enable-deterministic-archives --prefix=${PREFIX} --target=x86_64-w64-mingw32 --with-sysroot=${PREFIX_CROSS}"}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_MAKEFLAGS_INSTALL_EXTRA:="PREFIX= prefix="}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_SLIBTOOL:=slibtool-static}; -: ${PKG_BINUTILS_HOST_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; + +# +# Build target host_toolchain_deps +# +HOST_TOOLCHAIN_DEPS_BUILD_TYPE="host"; +HOST_TOOLCHAIN_DEPS_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; +HOST_TOOLCHAIN_DEPS_PACKAGES=" +gmp_host mpfr_host mpc_host psxtypes_host"; +HOST_TOOLCHAIN_DEPS_PREFIX="${PREFIX_CROSS}"; +: ${PKG_GMP_HOST_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; +: ${PKG_GMP_HOST_VERSION:=5.1.3}; +: ${PKG_GMP_HOST_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_HOST_VERSION}.tar.bz2}; +: ${PKG_GMP_HOST_CONFIGURE_ARGS_EXTRA:=--disable-assembly}; +: ${PKG_GMP_HOST_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/gmp-${PKG_GMP_HOST_VERSION}.midipix.patch"}; +: ${PKG_MPFR_HOST_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b}; +: ${PKG_MPFR_HOST_VERSION:=3.1.2}; +: ${PKG_MPFR_HOST_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_HOST_VERSION}.tar.bz2}; +: ${PKG_MPFR_HOST_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}}; +: ${PKG_MPC_HOST_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff}; +: ${PKG_MPC_HOST_VERSION:=1.0.1}; +: ${PKG_MPC_HOST_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_HOST_VERSION}.tar.gz}; +: ${PKG_MPC_HOST_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}}; +: ${PKG_PSXTYPES_HOST_URLS_GIT:=psxtypes=${DEFAULT_GITROOT}/psxtypes}; +: ${PKG_PSXTYPES_HOST_BUILD_STEPS_DISABLE:=build}; +: ${PKG_PSXTYPES_HOST_IN_TREE:=1}; # # Build target host_toolchain # HOST_TOOLCHAIN_BUILD_TYPE="host"; -HOST_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +HOST_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; HOST_TOOLCHAIN_PACKAGES=" -gcc_stage1_cross_x86_64_w64_mingw32 gcc_stage1 psxstub musl_no_complex -gcc_runtime musl_full gcc_libstdcpp_v3 gcc_full psxtypes_host ldso_host"; +binutils_host gcc_stage1_host psxstub_host musl_no_complex_host gcc_runtime_host +musl_full_host gcc_libstdcpp_v3_host gcc_full_host ldso_host"; HOST_TOOLCHAIN_PREFIX="${PREFIX_CROSS}"; -: ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION:=4.6.4}; -: ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; -: ${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_GCC_STAGE1_VERSION:=4.6.4}; -: ${PKG_GCC_STAGE1_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_PSXSTUB_URLS_GIT:="psxstub=${DEFAULT_GITROOT}/psxstub"}; -: ${PKG_PSXSTUB_BUILD_DIR:=psxstub}; -: ${PKG_PSXSTUB_BUILD_STEPS_DISABLE:=build:dynamic}; -: ${PKG_MUSL_NO_COMPLEX_VERSION:=1.1.12}; -: ${PKG_MUSL_NO_COMPLEX_BASE_DIR:=${WORKDIR}/musl-build}; -: ${PKG_GCC_RUNTIME_VERSION:=4.6.4}; -: ${PKG_GCC_RUNTIME_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_MUSL_FULL_VERSION:=1.1.12}; -: ${PKG_MUSL_FULL_BASE_DIR:=${WORKDIR}/musl-build}; -: ${PKG_GCC_LIBSTDCPP_V3_VERSION:=4.6.4}; -: ${PKG_GCC_LIBSTDCPP_V3_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_GCC_FULL_VERSION:=4.6.4}; -: ${PKG_GCC_FULL_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_PSXTYPES_HOST_URLS_GIT:=psxtypes=${DEFAULT_GITROOT}/psxtypes}; -: ${PKG_PSXTYPES_HOST_BUILD_STEPS_DISABLE:=build:dynamic}; +: ${PKG_BINUTILS_HOST_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; +: ${PKG_BINUTILS_HOST_VERSION:=2.24.51}; +: ${PKG_BINUTILS_HOST_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_VERSION}.tar.bz2}; +: ${PKG_BINUTILS_HOST_CONFIGURE_ARGS:="--disable-werror --enable-deterministic-archives --prefix=${PREFIX} --target=${DEFAULT_TARGET} --with-sysroot=${PREFIX_CROSS}"}; +: ${PKG_BINUTILS_HOST_INSTALL_FILES:="@${DEFAULT_TARGET}-windmc=bin/windmc @${DEFAULT_TARGET}-windres=bin/windres"}; +: ${PKG_BINUTILS_HOST_MAKEFLAGS_INSTALL_EXTRA:="PREFIX= prefix="}; +: ${PKG_BINUTILS_HOST_LIBTOOL:=slibtool-static}; +: ${PKG_BINUTILS_HOST_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/binutils-${PKG_BINUTILS_HOST_VERSION}.midipix.patch"}; +: ${PKG_BINUTILS_HOST_PREFIX:=${PREFIX}}; +: ${PKG_GCC_STAGE1_HOST_VERSION:=4.6.4}; +: ${PKG_GCC_STAGE1_HOST_BASE_DIR:=${BUILD_WORKDIR}/gcc-build}; +: ${PKG_GCC_STAGE1_HOST_PREFIX:=${PREFIX}}; +: ${PKG_PSXSTUB_HOST_URLS_GIT:="psxstub=${DEFAULT_GITROOT}/psxstub"}; +: ${PKG_PSXSTUB_HOST_IN_TREE:=1}; +: ${PKG_PSXSTUB_HOST_BUILD_STEPS_DISABLE:=build}; +: ${PKG_PSXSTUB_HOST_ENV_VARS_EXTRA:=TARGET=${DEFAULT_TARGET}}; +: ${PKG_MUSL_NO_COMPLEX_HOST_VERSION:=1.1.12}; +: ${PKG_MUSL_NO_COMPLEX_HOST_BASE_DIR:=${BUILD_WORKDIR}/musl-build}; +: ${PKG_GCC_RUNTIME_HOST_VERSION:=4.6.4}; +: ${PKG_GCC_RUNTIME_HOST_BASE_DIR:=${BUILD_WORKDIR}/gcc-build}; +: ${PKG_GCC_RUNTIME_HOST_NO_CLEAN_BASE_DIR:=1}; +: ${PKG_GCC_RUNTIME_HOST_PREFIX:=${PREFIX}}; +: ${PKG_MUSL_FULL_HOST_VERSION:=1.1.12}; +: ${PKG_MUSL_FULL_HOST_BASE_DIR:=${BUILD_WORKDIR}/musl-build}; +: ${PKG_MUSL_FULL_HOST_NO_CLEAN_BASE_DIR:=1}; +: ${PKG_GCC_LIBSTDCPP_V3_HOST_VERSION:=4.6.4}; +: ${PKG_GCC_LIBSTDCPP_V3_HOST_BASE_DIR:=${BUILD_WORKDIR}/gcc-build}; +: ${PKG_GCC_LIBSTDCPP_V3_HOST_NO_CLEAN_BASE_DIR:=1}; +: ${PKG_GCC_LIBSTDCPP_V3_HOST_PREFIX:=${PREFIX}}; +: ${PKG_GCC_FULL_HOST_VERSION:=4.6.4}; +: ${PKG_GCC_FULL_HOST_BASE_DIR:=${BUILD_WORKDIR}/gcc-build}; +: ${PKG_GCC_FULL_HOST_NO_CLEAN_BASE_DIR:=1}; +: ${PKG_GCC_FULL_HOST_PREFIX:=${PREFIX}}; : ${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"}; -: ${PKG_LDSO_HOST_CONFIGURE_ARGS:="--host=${TARGET} --prefix= --target=${TARGET} --disable-shared"}; -: ${PKG_LDSO_HOST_INSTALL_FILES:="@../${TARGET}/lib/libldso.a=${PREFIX}/lib/libldso.a"}; +: ${PKG_LDSO_HOST_CONFIGURE_ARGS:="--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET} --disable-shared"}; +: ${PKG_LDSO_HOST_INSTALL_FILES:="@../${DEFAULT_TARGET}/lib/libldso.a=${PREFIX}/lib/libldso.a"}; : ${PKG_LDSO_HOST_MAKEFLAGS_BUILD_EXTRA:=STATIC_LIB_NAME=libldso.a}; : ${PKG_LDSO_HOST_MAKEFLAGS_INSTALL_EXTRA:=STATIC_LIB_NAME=libldso.a}; # +# Build target host_toolchain_mingw32 +# +HOST_TOOLCHAIN_MINGW32_BUILD_TYPE="host"; +HOST_TOOLCHAIN_MINGW32_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix=${PREFIX} --target=x86_64-w64-mingw32"; +HOST_TOOLCHAIN_MINGW32_PACKAGES=" +binutils_host_mingw32 gcc_stage1_cross_mingw32"; +HOST_TOOLCHAIN_MINGW32_TARGET="x86_64-w64-mingw32"; +: ${PKG_BINUTILS_HOST_MINGW32_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; +: ${PKG_BINUTILS_HOST_MINGW32_VERSION:=2.24.51}; +: ${PKG_BINUTILS_HOST_MINGW32_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_HOST_MINGW32_VERSION}.tar.bz2}; +: ${PKG_BINUTILS_HOST_MINGW32_CONFIGURE_ARGS_EXTRA:="--disable-werror --enable-deterministic-archives --with-sysroot=${PREFIX_MINGW32}"}; +: ${PKG_BINUTILS_HOST_MINGW32_MAKEFLAGS_INSTALL:="PREFIX= prefix="}; +: ${PKG_BINUTILS_HOST_MINGW32_LIBTOOL:=slibtool-static}; +: ${PKG_BINUTILS_HOST_MINGW32_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/binutils-${PKG_BINUTILS_HOST_MINGW32_VERSION}.midipix.patch"}; +: ${PKG_BINUTILS_HOST_MINGW32_PREFIX:=${PREFIX}}; +: ${PKG_GCC_STAGE1_CROSS_MINGW32_VERSION:=4.6.4}; +: ${PKG_GCC_STAGE1_CROSS_MINGW32_BASE_DIR:=${BUILD_WORKDIR}/gcc-build-mingw32}; +: ${PKG_GCC_STAGE1_CROSS_MINGW32_PREFIX:=${PREFIX}}; + +# +# Build target native_tools +# +NATIVE_TOOLS_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix=/ --target=${DEFAULT_TARGET}"; +NATIVE_TOOLS_PACKAGES=" +slibtool perk pkgconf"; +NATIVE_TOOLS_PREFIX="${PREFIX_NATIVE}"; +: ${PKG_SLIBTOOL_URLS_GIT:="slibtool=git://midipix.org/slibtool"}; +: ${PKG_SLIBTOOL_CONFIGURE_ARGS:="--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"}; +: ${PKG_PERK_URLS_GIT:="perk=${DEFAULT_GITROOT}/perk"}; +: ${PKG_PERK_CONFIGURE_ARGS:="--prefix=/usr --target=${DEFAULT_TARGET}"}; +: ${PKG_PERK_INSTALL_FILES:="@perk=bin/${DEFAULT_TARGET}-perk"}; +: ${PKG_PKGCONF_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; +: ${PKG_PKGCONF_VERSION:=0.9.12}; +: ${PKG_PKGCONF_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_VERSION}/pkgconf-${PKG_PKGCONF_VERSION}.tar.bz2}; +: ${PKG_PKGCONF_INSTALL_FILES:=/=lib/pkgconfig}; + +# # Build target native_toolchain_deps # -NATIVE_TOOLCHAIN_DEPS_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix=/ --target=${TARGET}"; +NATIVE_TOOLCHAIN_DEPS_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix=/ --target=${DEFAULT_TARGET}"; NATIVE_TOOLCHAIN_DEPS_PACKAGES=" -gmp_host libelf mpfr_host mpc_host perk pkgconf slibtool"; +gmp libelf mpfr mpc"; NATIVE_TOOLCHAIN_DEPS_PREFIX="${PREFIX_NATIVE}"; -: ${PKG_GMP_HOST_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; -: ${PKG_GMP_HOST_VERSION:=5.1.3}; -: ${PKG_GMP_HOST_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_HOST_VERSION}.tar.bz2}; -: ${PKG_GMP_HOST_CONFIGURE_ARGS_EXTRA:=--disable-assembly}; -: ${PKG_GMP_HOST_PREFIX:=${PREFIX_CROSS}}; +: ${PKG_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; +: ${PKG_GMP_VERSION:=5.1.3}; +: ${PKG_GMP_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_VERSION}.tar.bz2}; +: ${PKG_GMP_CONFIGURE_ARGS_EXTRA:=--disable-assembly}; +: ${PKG_GMP_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/gmp-${PKG_GMP_VERSION}.midipix.patch"}; : ${PKG_LIBELF_SHA256SUM:=591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d}; : ${PKG_LIBELF_VERSION:=0.8.13}; : ${PKG_LIBELF_URL:=http://www.mr511.de/software/libelf-${PKG_LIBELF_VERSION}.tar.gz}; -: ${PKG_LIBELF_CONFIGURE_ARGS:="--disable-nls --host=${TARGET} --prefix=${PREFIX_NATIVE} --target=${TARGET}"}; -: ${PKG_MPFR_HOST_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b}; -: ${PKG_MPFR_HOST_VERSION:=3.1.2}; -: ${PKG_MPFR_HOST_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_HOST_VERSION}.tar.bz2}; -: ${PKG_MPFR_HOST_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}}; -: ${PKG_MPFR_HOST_PREFIX:=${PREFIX_CROSS}}; -: ${PKG_MPC_HOST_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff}; -: ${PKG_MPC_HOST_VERSION:=1.0.1}; -: ${PKG_MPC_HOST_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_HOST_VERSION}.tar.gz}; -: ${PKG_MPC_HOST_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}}; -: ${PKG_MPC_HOST_PREFIX:=${PREFIX_CROSS}}; -: ${PKG_PERK_URLS_GIT:="perk=${DEFAULT_GITROOT}/perk"}; -: ${PKG_PERK_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; -: ${PKG_PERK_INSTALL_FILES:="@perk=bin/${TARGET}-perk"}; -: ${PKG_PKGCONF_SHA256SUM:=7ec8b516e655e247f4ba976837cee808134785819ab8f538f652fe919cc6c09f}; -: ${PKG_PKGCONF_VERSION:=0.9.12}; -: ${PKG_PKGCONF_URL:=https://github.com/pkgconf/pkgconf/releases/download/pkgconf-${PKG_PKGCONF_VERSION}/pkgconf-${PKG_PKGCONF_VERSION}.tar.bz2}; -: ${PKG_PKGCONF_INSTALL_FILES:=/=lib/pkgconfig}; -: ${PKG_SLIBTOOL_URLS_GIT:="slibtool=git://midipix.org/slibtool"}; -: ${PKG_SLIBTOOL_CONFIGURE_ARGS:="--host=${TARGET} --prefix= --target=${TARGET}"}; +: ${PKG_LIBELF_MAKE_INSTALL_VNAME:=prefix}; +: ${PKG_LIBELF_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/libelf-${PKG_LIBELF_VERSION}.midipix.patch"}; +: ${PKG_MPFR_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b}; +: ${PKG_MPFR_VERSION:=3.1.2}; +: ${PKG_MPFR_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_VERSION}.tar.bz2}; +: ${PKG_MPFR_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}}; +: ${PKG_MPC_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff}; +: ${PKG_MPC_VERSION:=1.0.1}; +: ${PKG_MPC_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_VERSION}.tar.gz}; +: ${PKG_MPC_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}}; # # Build target native_toolchain # -NATIVE_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${TARGET} --prefix=/ --target=${TARGET}"; +NATIVE_TOOLCHAIN_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix=/ --target=${DEFAULT_TARGET}"; NATIVE_TOOLCHAIN_PACKAGES=" -binutils binutils_x86_64_w64_mingw32 musl_native gcc_native gcc_stage1_native_x86_64_w64_mingw32 mdso"; +binutils musl_full gcc_full mdso"; NATIVE_TOOLCHAIN_PREFIX="${PREFIX_NATIVE}"; : ${PKG_BINUTILS_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; : ${PKG_BINUTILS_VERSION:=2.24.51}; : ${PKG_BINUTILS_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_VERSION}.tar.bz2}; : ${PKG_BINUTILS_CONFIGURE_ARGS_EXTRA:="--enable-deterministic-archives --with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/"}; -: ${PKG_BINUTILS_SLIBTOOL:=slibtool-static}; -: ${PKG_BINUTILS_X86_64_W64_MINGW32_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; -: ${PKG_BINUTILS_X86_64_W64_MINGW32_VERSION:=2.24.51}; -: ${PKG_BINUTILS_X86_64_W64_MINGW32_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_X86_64_W64_MINGW32_VERSION}.tar.bz2}; -: ${PKG_BINUTILS_X86_64_W64_MINGW32_CONFIGURE_ARGS:="--disable-nls --enable-deterministic-archives --host=${TARGET} --prefix=/ --target=x86_64-w64-mingw32 --with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/"}; -: ${PKG_BINUTILS_X86_64_W64_MINGW32_SLIBTOOL:=slibtool-static}; -: ${PKG_MUSL_NATIVE_SHA256SUM:=720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e}; -: ${PKG_MUSL_NATIVE_VERSION:=1.1.12}; -: ${PKG_MUSL_NATIVE_URL:=http://www.musl-libc.org/releases/musl-${PKG_MUSL_NATIVE_VERSION}.tar.gz}; -: ${PKG_MUSL_NATIVE_BASE_DIR:=${WORKDIR}/musl-build}; -: ${PKG_GCC_NATIVE_VERSION:=4.6.4}; -: ${PKG_GCC_NATIVE_BASE_DIR:=${WORKDIR}/gcc-build}; -: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION:=4.6.4}; -: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_TARGET:=x86_64-w64-mingw32}; -: ${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_BASE_DIR:=${WORKDIR}/gcc-build}; +: ${PKG_BINUTILS_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/binutils-${PKG_BINUTILS_VERSION}.midipix.patch"}; +: ${PKG_BINUTILS_LIBTOOL:=slibtool-static}; +: ${PKG_MUSL_FULL_SHA256SUM:=720b83c7e276b4b679c0bffe9509340d5f81fd601508e607e708177df0d31c0e}; +: ${PKG_MUSL_FULL_VERSION:=1.1.12}; +: ${PKG_MUSL_FULL_URL:=http://www.musl-libc.org/releases/musl-${PKG_MUSL_NATIVE_VERSION}.tar.gz}; +: ${PKG_MUSL_FULL_BASE_DIR:=${BUILD_WORKDIR}/musl-build}; +: ${PKG_MUSL_FULL_NO_CLEAN_BASE_DIR:=1}; +: ${PKG_GCC_FULL_VERSION:=4.6.4}; +: ${PKG_GCC_FULL_BASE_DIR:=${BUILD_WORKDIR}/gcc-build}; +: ${PKG_GCC_FULL_NO_CLEAN_BASE_DIR:=1}; : ${PKG_MDSO_URLS_GIT:="mdso=${DEFAULT_GITROOT}/mdso"}; -: ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${TARGET}"}; -: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${TARGET}-mdso /=${TARGET}/bin @../../bin/mdso=${TARGET}/bin/mdso"}; +: ${PKG_MDSO_CONFIGURE_ARGS:="--prefix=/usr --target=${DEFAULT_TARGET}"}; +: ${PKG_MDSO_INSTALL_FILES:="@mdso=bin/${DEFAULT_TARGET}-mdso /=${DEFAULT_TARGET}/bin @../../bin/mdso=${DEFAULT_TARGET}/bin/mdso"}; + +# +# Build target native_toolchain_mingw32 +# +NATIVE_TOOLCHAIN_MINGW32_CONFIGURE_ARGS="--disable-nls --host=${DEFAULT_TARGET} --prefix=/ --target=x86_64-w64-mingw32"; +NATIVE_TOOLCHAIN_MINGW32_PACKAGES=" +binutils_mingw32 gcc_stage1_native_mingw32"; +NATIVE_TOOLCHAIN_MINGW32_PREFIX="${PREFIX_NATIVE}"; +: ${PKG_BINUTILS_MINGW32_SHA256SUM:=250d3b2925c6b211fb16173b0b25bc091c58829fbcad3eb849645e0af52cf7fa}; +: ${PKG_BINUTILS_MINGW32_VERSION:=2.24.51}; +: ${PKG_BINUTILS_MINGW32_URL:=ftp://sourceware.org/pub/binutils/snapshots/binutils-${PKG_BINUTILS_MINGW32_VERSION}.tar.bz2}; +: ${PKG_BINUTILS_MINGW32_CONFIGURE_ARGS_EXTRA:="--enable-deterministic-archives --with-libelf=${PREFIX_NATIVE} --with-gmp=${PREFIX_NATIVE} --with-mpc=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE} --with-sysroot=/"}; +: ${PKG_BINUTILS_MINGW32_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/binutils-${PKG_BINUTILS_MINGW32_VERSION}.midipix.patch"}; +: ${PKG_BINUTILS_MINGW32_LIBTOOL:=slibtool-static}; +: ${PKG_GCC_STAGE1_NATIVE_MINGW32_VERSION:=4.6.4}; +: ${PKG_GCC_STAGE1_NATIVE_MINGW32_TARGET:=x86_64-w64-mingw32}; +: ${PKG_GCC_STAGE1_NATIVE_MINGW32_BASE_DIR:=${BUILD_WORKDIR}/gcc-build-mingw32}; +: ${PKG_GCC_STAGE1_NATIVE_MINGW32_NO_CLEAN_BASE_DIR:=1}; # # Build target native_runtime # NATIVE_RUNTIME_BUILD_TYPE="native"; NATIVE_RUNTIME_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS_RUNTIME}"; -NATIVE_RUNTIME_CONFIGURE_ARGS="--prefix= --strict --host=${TARGET}"; +NATIVE_RUNTIME_CONFIGURE_ARGS="--prefix= --strict --host=${DEFAULT_TARGET}"; NATIVE_RUNTIME_ENV_VARS_EXTRA="CFLAGS_PATH=-I${PREFIX_NATIVE}/include:LDFLAGS_PATH=-L${PREFIX_NATIVE}/lib"; NATIVE_RUNTIME_PACKAGES="psxtypes pemagine dalist ldso ntcon ntapi psxscl psxscl_strace ntctty ptycon u16ports"; NATIVE_RUNTIME_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PSXTYPES_URLS_GIT:=psxtypes=${DEFAULT_GITROOT}/psxtypes}; : ${PKG_PSXTYPES_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_NATIVE}"}; +: ${PKG_PSXTYPES_IN_TREE:=1}; : ${PKG_PEMAGINE_URLS_GIT:=pemagine=${DEFAULT_GITROOT}/pemagine}; : ${PKG_PEMAGINE_CFLAGS_CONFIGURE_EXTRA:=-O0}; : ${PKG_PEMAGINE_INSTALL_TARGET_EXTRA:=install-lib}; @@ -182,7 +242,7 @@ NATIVE_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:="/=${TARGET}/lib @../../lib/libldso.a=${TARGET}/lib/libldso.a"}; +: ${PKG_LDSO_INSTALL_FILES:="/=${DEFAULT_TARGET}/lib @../../lib/libldso.a=${DEFAULT_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}; @@ -193,7 +253,7 @@ NATIVE_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_BUILD_STEPS_DISABLE:=install_make}; : ${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_NTCTTY_URLS_GIT:=ntctty=${DEFAULT_GITROOT_HEAD}/ntctty}; @@ -233,22 +293,25 @@ HOST_PACKAGES_DEPS_PREFIX="${PREFIX}"; : ${PKG_LIBFFI_HOST_SHA256SUM:=d06ebb8e1d9a22d19e38d63fdb83954253f39bedc5d46232a05645685722ca37}; : ${PKG_LIBFFI_HOST_VERSION:=3.2.1}; : ${PKG_LIBFFI_HOST_URL:=ftp://sourceware.org/pub/libffi/libffi-${PKG_LIBFFI_HOST_VERSION}.tar.gz}; +: ${PKG_LIBFFI_HOST_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/libffi-${PKG_LIBFFI_HOST_VERSION}.midipix.patch"}; : ${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:=configure_patch:dynamic}; +: ${PKG_GLIB_HOST_BUILD_STEPS_DISABLE:=configure_patch}; : ${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}/lib -lffi"}; : ${PKG_GLIB_HOST_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX}/lib}; : ${PKG_INFOUNZIP_HOST_URLS_GIT:=infounzip-host=https://github.com/Redfoxmoon3/infounzip.git@master}; +: ${PKG_INFOUNZIP_HOST_IN_TREE:=1}; : ${PKG_INFOZIP_HOST_URLS_GIT:=infozip-host=https://github.com/Redfoxmoon3/infozip.git@master}; +: ${PKG_INFOZIP_HOST_IN_TREE:=1}; : ${PKG_INTLTOOL_HOST_SHA256SUM:=67c74d94196b153b774ab9f89b2fa6c6ba79352407037c8c14d5aeb334e959cd}; : ${PKG_INTLTOOL_HOST_VERSION:=0.51.0}; : ${PKG_INTLTOOL_HOST_URL:=https://launchpad.net/intltool/trunk/${PKG_INTLTOOL_HOST_VERSION}/+download/intltool-${PKG_INTLTOOL_HOST_VERSION}.tar.gz}; : ${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:=configure_patch:dynamic}; +: ${PKG_RUBY_HOST_BUILD_STEPS_DISABLE:=configure_patch}; : ${PKG_RUBY_HOST_CFLAGS_CONFIGURE:="-g0 -O1"}; : ${PKG_RUBY_HOST_CONFIGURE_ARGS_EXTRA:="--disable-install-rdoc --with-out-ext=fiddle"}; @@ -256,7 +319,7 @@ HOST_PACKAGES_DEPS_PREFIX="${PREFIX}"; # Build target native_packages_deps # NATIVE_PACKAGES_DEPS_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_DEPS_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --program-prefix= --target=${TARGET}"; +NATIVE_PACKAGES_DEPS_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --program-prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_DEPS_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_DEPS_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_DEPS_PACKAGES=" @@ -264,7 +327,7 @@ expat libxml2 alsa_lib apr apr_util bzip2 curl libz lmdb libpng libjpeg_turbo tiff giflib libffi gdbm geoip pcre glib gzip libarchive libatomic_ops libpipeline libressl libevent libfetch libgpg_error libassuan libfirm libgcrypt libksba libudns lua ncurses ncursestw ncursesw npth popt shared_mime_info -sqlite3 w32api w32lib xz cmake gmp mpfr mpc"; +sqlite3 w32api w32lib xz cmake"; NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_EXPAT_SHA256SUM:=d9e50ff2d19b3538bd2127902a89987474e1a4db8e43a66a4d1a712ab9a504ff}; : ${PKG_EXPAT_VERSION:=2.2.0}; @@ -283,13 +346,13 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_APR_UTIL_SHA256SUM:=d3e12f7b6ad12687572a3a39475545a072608f4ba03a6ce8a3778f607dd0035b}; : ${PKG_APR_UTIL_VERSION:=1.6.1}; : ${PKG_APR_UTIL_URL:=http://apache.lauf-forum.at/apr/apr-util-${PKG_APR_UTIL_VERSION}.tar.bz2}; -: ${PKG_APR_UTIL_CONFIGURE_ARGS_EXTRA:="--with-apr=${WORKDIR}/apr-native-${TARGET}/obj"}; -: ${PKG_APR_UTIL_INSTALL_FILES:=apu-1-config=${PREFIX}/bin/${TARGET}-apu-1-config}; +: ${PKG_APR_UTIL_CONFIGURE_ARGS_EXTRA:="--with-apr=${BUILD_WORKDIR}/apr-native-${DEFAULT_TARGET}/obj"}; +: ${PKG_APR_UTIL_INSTALL_FILES:=apu-1-config=${PREFIX}/bin/${DEFAULT_TARGET}-apu-1-config}; : ${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_IN_TREE:=1}; : ${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}; @@ -301,8 +364,9 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBZ_SHA256SUM:=abcc2831b7a0e891d0875fa852e9b9510b420d843d3d20aad010f65493fe4f7b}; : ${PKG_LIBZ_VERSION:=1.2.8.2015.12.26}; : ${PKG_LIBZ_URL:=https://sortix.org/libz/release/libz-${PKG_LIBZ_VERSION}.tar.gz}; -: ${PKG_LIBZ_CONFIGURE_ARGS:=--host=${TARGET} --prefix= --target=${TARGET}}; +: ${PKG_LIBZ_CONFIGURE_ARGS:=--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}}; : ${PKG_LMDB_URLS_GIT:="lmdb=https://github.com/Redfoxmoon3/lmdb.git@mdb.master"}; +: ${PKG_LMDB_IN_TREE:=1}; : ${PKG_LIBPNG_SHA256SUM:=2f1e960d92ce3b3abd03d06dfec9637dfbd22febf107a536b44f7a47c60659f6}; : ${PKG_LIBPNG_VERSION:=1.6.34}; : ${PKG_LIBPNG_URL:=https://sourceforge.mirrorservice.org/l/li/libpng/libpng16/${PKG_LIBPNG_VERSION}/libpng-${PKG_LIBPNG_VERSION}.tar.xz}; @@ -322,6 +386,7 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBFFI_VERSION:=3.2.1}; : ${PKG_LIBFFI_URL:=ftp://sourceware.org/pub/libffi/libffi-${PKG_LIBFFI_VERSION}.tar.gz}; : ${PKG_LIBFFI_CFLAGS_CONFIGURE_EXTRA:=-D_WIN64}; +: ${PKG_LIBFFI_PATCHES_EXTRA:="${BUILD_WORKDIR}/chainport/libffi-${PKG_LIBFFI_VERSION}.midipix.patch"}; : ${PKG_GDBM_SHA256SUM:=9d252cbd7d793f7b12bcceaddda98d257c14f4d1890d851c386c37207000a253}; : ${PKG_GDBM_VERSION:=1.13}; : ${PKG_GDBM_URL:=ftp://ftp.gnu.org/gnu/gdbm/gdbm-${PKG_GDBM_VERSION}.tar.gz}; @@ -337,7 +402,7 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GZIP_VERSION:=1.8}; : ${PKG_GZIP_URL:=https://ftp.gnu.org/gnu/gzip/gzip-${PKG_GZIP_VERSION}.tar.gz}; : ${PKG_GZIP_CFLAGS_CONFIGURE_EXTRA:=-DNO_ASM -UASMV}; -: ${PKG_GZIP_CONFIGURE_ARGS:=--host=${TARGET} --prefix= --target=${TARGET}}; +: ${PKG_GZIP_CONFIGURE_ARGS:=--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}}; : ${PKG_GZIP_MAKEFLAGS_BUILD_EXTRA:=OBJA= prefix=}; : ${PKG_GZIP_MAKEFLAGS_INSTALL_EXTRA:="OBJA="}; : ${PKG_LIBARCHIVE_SHA256SUM:=691c194ee132d1f0f7a42541f091db811bc2e56f7107e9121be2bc8c04f1060f}; @@ -362,7 +427,8 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBFETCH_VERSION:=2.33}; : ${PKG_LIBFETCH_URL:=https://sources.archlinux.org/other/libfetch/libfetch-${PKG_LIBFETCH_VERSION}.tar.gz}; : ${PKG_LIBFETCH_ENV_VARS_EXTRA:=CFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=--sysroot=${PREFIX_NATIVE}}; -: ${PKG_LIBFETCH_MAKEFLAGS_BUILD_EXTRA:="E=echo Q= AR=${TARGET}-ar CC=${TARGET}-gcc LD=${TARGET}-gcc"}; +: ${PKG_LIBFETCH_IN_TREE:=1}; +: ${PKG_LIBFETCH_MAKEFLAGS_BUILD_EXTRA:="E=echo Q= AR=${DEFAULT_TARGET}-ar CC=${DEFAULT_TARGET}-gcc LD=${DEFAULT_TARGET}-gcc"}; : ${PKG_LIBFETCH_MAKEFLAGS_INSTALL_EXTRA:="E=echo Q="}; : ${PKG_LIBGPG_ERROR_SHA256SUM:=f628f75843433b38b05af248121beb7db5bd54bb2106f384edac39934261320c}; : ${PKG_LIBGPG_ERROR_VERSION:=1.25}; @@ -371,7 +437,7 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LIBASSUAN_VERSION:=2.4.3}; : ${PKG_LIBASSUAN_URL:=https://www.gnupg.org/ftp/gcrypt/libassuan/libassuan-${PKG_LIBASSUAN_VERSION}.tar.bz2}; : ${PKG_LIBFIRM_URLS_GIT:="libfirm=http://pp.info.uni-karlsruhe.de/git/libfirm.git@master bfirm=${DEFAULT_GITROOT}/compilers/bfirm@main"}; -: ${PKG_LIBFIRM_BASE_DIR:=${WORKDIR}/cparser+libfirm-build}; +: ${PKG_LIBFIRM_BASE_DIR:=${BUILD_WORKDIR}/cparser+libfirm-build}; : ${PKG_LIBFIRM_BUILD_DIR:=build/libfirm}; : ${PKG_LIBFIRM_CONFIGURE:=bfirm/configure}; : ${PKG_LIBFIRM_CONFIGURE_ARGS:="--source-dir=../../libfirm --prefix="}; @@ -387,8 +453,9 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_LUA_SHA256SUM:=5113c06884f7de453ce57702abaac1d618307f33f6789fa870e87a59d772aca2}; : ${PKG_LUA_VERSION:=5.3.3}; : ${PKG_LUA_URL:=https://www.lua.org/ftp/lua-${PKG_LUA_VERSION}.tar.gz}; +: ${PKG_LUA_IN_TREE:=1}; : ${PKG_LUA_MAKE_INSTALL_VNAME:=INSTALL_TOP}; -: ${PKG_LUA_MAKEFLAGS_BUILD_EXTRA:="CC=${TARGET}-gcc midipix"}; +: ${PKG_LUA_MAKEFLAGS_BUILD_EXTRA:="CC=${DEFAULT_TARGET}-gcc midipix"}; : ${PKG_NCURSES_SHA256SUM:=f551c24b30ce8bfb6e96d9f59b42fbea30fa3a6123384172f9e7284bcf647260}; : ${PKG_NCURSES_VERSION:=6.0}; : ${PKG_NCURSES_URL:=https://ftp.gnu.org/gnu/ncurses/ncurses-${PKG_NCURSES_VERSION}.tar.gz}; @@ -418,10 +485,10 @@ NATIVE_PACKAGES_DEPS_PREFIX="${PREFIX_NATIVE}"; : ${PKG_SQLITE3_URL:=https://sqlite.org/2017/sqlite-autoconf-${PKG_SQLITE3_VERSION}.tar.gz}; : ${PKG_SQLITE3_CONFIGURE_ARGS_EXTRA:=--disable-static-shell}; : ${PKG_W32API_URLS_GIT:="w32api=git://github.com/midipix-ports/w32api.ports@main"}; +: ${PKG_W32API_IN_TREE:=1}; : ${PKG_W32API_MAKEFLAGS_BUILD:="DESTDIR=${PREFIX_NATIVE}"}; -: ${PKG_W32API_SUBDIR:=w32api}; : ${PKG_W32LIB_URLS_GIT:="w32lib=git://git.midipix.org/w32lib"}; -: ${PKG_W32LIB_CONFIGURE_ARGS:="--host=${TARGET} --prefix= --target=${TARGET}"}; +: ${PKG_W32LIB_CONFIGURE_ARGS:="--host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"}; : ${PKG_XZ_SHA256SUM:=73df4d5d34f0468bd57d09f2d8af363e95ed6cc3a4a86129d2f2c366259902a2}; : ${PKG_XZ_VERSION:=5.2.2}; : ${PKG_XZ_URL:=https://github.com/xz-mirror/xz/releases/download/v${PKG_XZ_VERSION}/xz-${PKG_XZ_VERSION}.tar.gz}; @@ -430,24 +497,12 @@ NATIVE_PACKAGES_DEPS_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_GMP_SHA256SUM:=752079520b4690531171d0f4532e40f08600215feefede70b24fabdc6f1ab160}; -: ${PKG_GMP_VERSION:=5.1.3}; -: ${PKG_GMP_URL:=https://gmplib.org/download/gmp/gmp-${PKG_GMP_VERSION}.tar.bz2}; -: ${PKG_GMP_CONFIGURE_ARGS_EXTRA:=--disable-assembly}; -: ${PKG_MPFR_SHA256SUM:=79c73f60af010a30a5c27a955a1d2d01ba095b72537dab0ecaad57f5a7bb1b6b}; -: ${PKG_MPFR_VERSION:=3.1.2}; -: ${PKG_MPFR_URL:=ftp://ftp.gnu.org/gnu/mpfr/mpfr-${PKG_MPFR_VERSION}.tar.bz2}; -: ${PKG_MPFR_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE}}; -: ${PKG_MPC_SHA256SUM:=ed5a815cfea525dc778df0cb37468b9c1b554aaf30d9328b1431ca705b7400ff}; -: ${PKG_MPC_VERSION:=1.0.1}; -: ${PKG_MPC_URL:=ftp://ftp.gnu.org/gnu/mpc/mpc-${PKG_MPC_VERSION}.tar.gz}; -: ${PKG_MPC_CONFIGURE_ARGS_EXTRA:=--with-gmp=${PREFIX_NATIVE} --with-mpfr=${PREFIX_NATIVE}}; # # Build target native_packages_deps_x11 # NATIVE_PACKAGES_DEPS_X11_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_DEPS_X11_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --program-prefix= --target=${TARGET}"; +NATIVE_PACKAGES_DEPS_X11_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --program-prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_DEPS_X11_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_DEPS_X11_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_DEPS_X11_PACKAGES=" @@ -589,7 +644,7 @@ DEV_PACKAGES_PREFIX="${NATIVE_PACKAGES_DEPS_PREFIX}"; # Build target native_packages_cmdline # NATIVE_PACKAGES_CMDLINE_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_CMDLINE_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +NATIVE_PACKAGES_CMDLINE_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_CMDLINE_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_CMDLINE_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_CMDLINE_PACKAGES=" @@ -609,8 +664,8 @@ NATIVE_PACKAGES_CMDLINE_PREFIX="${PREFIX_NATIVE}"; : ${PKG_DASH_SHA256SUM:=5ecd5bea72a93ed10eb15a1be9951dd51b52e5da1d4a7ae020efd9826b49e659}; : ${PKG_DASH_VERSION:=0.5.9.1}; : ${PKG_DASH_URL:=https://bintray.com/termux/upstream/download_file?file_path=dash-${PKG_DASH_VERSION}.tar.gz}; +: ${PKG_DASH_FNAME:=dash-${PKG_DASH_VERSION}.tar.gz}; : ${PKG_DASH_INSTALL_FILES:=@dash=bin/sh}; -: ${PKG_DASH_SUBDIR:=dash-${PKG_DASH_VERSION}}; : ${PKG_DATAMASH_SHA256SUM:=e8d46fb22ccc77e5380f26cde622a733f363d388b04a2c22e7fb6de0e9d85996}; : ${PKG_DATAMASH_VERSION:=1.2}; : ${PKG_DATAMASH_URL:=https://ftp.gnu.org/gnu/datamash/datamash-${PKG_DATAMASH_VERSION}.tar.gz}; @@ -618,16 +673,17 @@ NATIVE_PACKAGES_CMDLINE_PREFIX="${PREFIX_NATIVE}"; : ${PKG_DOS2UNIX_VERSION:=7.3.5-beta3}; : ${PKG_DOS2UNIX_URL:=http://waterlan.home.xs4all.nl/dos2unix/dos2unix-${PKG_DOS2UNIX_VERSION}.tar.gz}; : ${PKG_DOS2UNIX_CFLAGS_BUILD_EXTRA:=${PACKAGES_CFLAGS_CONFIGURE}}; +: ${PKG_DOS2UNIX_IN_TREE:=1}; : ${PKG_DOS2UNIX_INSTALL_FILES:="dos2unix=bin/ dos2unix=bin/ @dos2unix=bin/mac2unix @unix2dos=bin/unix2mac"}; : ${PKG_ED_SHA256SUM:=c3521a607b3dfd5d2a087d53a72cdf71970763059c369cb0b330881b8491cd50}; : ${PKG_ED_VERSION:=1.14.2}; : ${PKG_ED_URL:=https://fossies.org/linux/privat/ed-${PKG_ED_VERSION}.tar.gz}; -: ${PKG_ED_CONFIGURE_ARGS:="--prefix= CC=${TARGET}-gcc"}; +: ${PKG_ED_CONFIGURE_ARGS:="--prefix= CC=${DEFAULT_TARGET}-gcc"}; : ${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_IN_TREE:=1}; +: ${PKG_FIGLET_MAKEFLAGS_BUILD:=CC=${DEFAULT_TARGET}-gcc LD=${DEFAULT_TARGET}-gcc}; : ${PKG_FILE_SHA256SUM:=8639dc4d1b21e232285cd483604afc4a6ee810710e00e579dbe9591681722b50}; : ${PKG_FILE_VERSION:=5.32}; : ${PKG_FILE_URL:=ftp://ftp.astron.com/pub/file/file-${PKG_FILE_VERSION}.tar.gz}; @@ -644,19 +700,18 @@ NATIVE_PACKAGES_CMDLINE_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_STEPS_DISABLE:=install_make:dynamic}; -: ${PKG_MKSH_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PACKAGES_CFLAGS_CONFIGURE:+${PACKAGES_CFLAGS_CONFIGURE} }-DMKSH_NOPROSPECTOFWORK"}; +: ${PKG_MKSH_BUILD_STEPS_DISABLE:=install_make}; +: ${PKG_MKSH_ENV_VARS_EXTRA:="CC=${DEFAULT_TARGET}-gcc:CFLAGS=${PACKAGES_CFLAGS_CONFIGURE:+${PACKAGES_CFLAGS_CONFIGURE} }-DMKSH_NOPROSPECTOFWORK"}; +: ${PKG_MKSH_IN_TREE:=1}; : ${PKG_MKSH_INSTALL_FILES:="mksh=bin/ /=share/doc/mksh/examples dot.mkshrc=share/doc/mksh/examples/ mksh.1=share/man/man1/"}; : ${PKG_MKSH_SUBDIR:=mksh}; : ${PKG_SBASE_URLS_GIT:="sbase=http://git.suckless.org/sbase@master"}; +: ${PKG_SBASE_IN_TREE:=1}; : ${PKG_SBASE_MAKE_INSTALL_VNAME:=PREFIX}; : ${PKG_SBASE_PREFIX:=${PREFIX_NATIVE}/suckless}; : ${PKG_SED_SHA256SUM:=cbd6ebc5aaf080ed60d0162d7f6aeae58211a1ee9ba9bb25623daa6cd942683b}; : ${PKG_SED_VERSION:=4.4}; : ${PKG_SED_URL:=https://ftp.gnu.org/gnu/sed/sed-${PKG_SED_VERSION}.tar.xz}; -: ${PKG_SMALLBASIC_URLS_GIT:="SmallBASIC=https://github.com/smallbasic/SmallBASIC@master"}; -: ${PKG_SMALLBASIC_BUILD_DIR:=SmallBASIC}; -: ${PKG_SMALLBASIC_CFLAGS_CONFIGURE_EXTRA:=-std=gnu99}; : ${PKG_TAR_SHA256SUM:=cae466e6e58c7292355e7080248f244db3a4cf755f33f4fa25ca7f9a7ed09af0}; : ${PKG_TAR_VERSION:=1.29}; : ${PKG_TAR_URL:=https://ftp.gnu.org/gnu/tar/tar-${PKG_TAR_VERSION}.tar.gz}; @@ -667,7 +722,9 @@ NATIVE_PACKAGES_CMDLINE_PREFIX="${PREFIX_NATIVE}"; : ${PKG_THE_SILVER_SEARCHER_VERSION:=2.1.0}; : ${PKG_THE_SILVER_SEARCHER_URL:=http://geoff.greer.fm/ag/releases/the_silver_searcher-${PKG_THE_SILVER_SEARCHER_VERSION}.tar.gz}; : ${PKG_TOILET_URLS_GIT:=toilet=https://github.com/cacalabs/toilet@master}; +: ${PKG_TOILET_ENV_VARS_EXTRA:="CACA_CFLAGS=-I${PREFIX_NATIVE}/include:CACA_LIBS=-L${PREFIX_NATIVE} -lcaca"}; : ${PKG_UBASE_URLS_GIT:="ubase=http://git.suckless.org/ubase@master"}; +: ${PKG_UBASE_IN_TREE:=1}; : ${PKG_UBASE_MAKE_INSTALL_VNAME:=PREFIX}; : ${PKG_UBASE_PREFIX:=${PREFIX_NATIVE}/suckless}; : ${PKG_UTIL_LINUX_SHA256SUM:=d5950e4b2839d00aa3781f439bfada8091bc6ed8180d8262c53b4e4304e2d299}; @@ -685,7 +742,7 @@ NATIVE_PACKAGES_CMDLINE_PREFIX="${PREFIX_NATIVE}"; # Build target native_packages_dev # NATIVE_PACKAGES_DEV_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_DEV_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +NATIVE_PACKAGES_DEV_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_DEV_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_DEV_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_DEV_PACKAGES=" @@ -698,14 +755,15 @@ NATIVE_PACKAGES_DEV_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_MAKEFLAGS_BUILD:="PLATFORM=midipix-${ARCH} PREFIX=${PREFIX_NATIVE} TARGET_PREFIX=${PREFIX_NATIVE} C_COMPILER=${DEFAULT_TARGET}-gcc HOSTSYSTEM=${DEFAULT_TARGET}"}; +: ${PKG_CHICKEN_DEBUG_MAKEFLAGS_BUILD_EXTRA:=DEBUGBUILD=1}; +: ${PKG_CHICKEN_RELEASE_MAKEFLAGS_BUILD_EXTRA:=DEBUGBUILD=0}; +: ${PKG_CHICKEN_MAKEFLAGS_INSTALL_EXTRA:="PREFIX= TARGET_PREFIX="}; +: ${PKG_CHICKEN_IN_TREE:=1}; +: ${PKG_CHICKEN_MAKE_INSTALL_VNAME:=DESTDIR}; +: ${PKG_CHICKEN_MAKEFLAGS_INSTALL:="PLATFORM=midipix-${ARCH} PREFIX=${PREFIX_NATIVE} C_COMPILER=${DEFAULT_TARGET}-gcc HOSTSYSTEM=${DEFAULT_TARGET} CROSS_CHICKEN=1"}; : ${PKG_CPARSER_URLS_GIT:="cparser=http://pp.info.uni-karlsruhe.de/git/cparser.git@master bcparser=${DEFAULT_GITROOT}/compilers/bcparser@main"}; -: ${PKG_CPARSER_BASE_DIR:=${WORKDIR}/cparser+libfirm-build}; +: ${PKG_CPARSER_BASE_DIR:=${BUILD_WORKDIR}/cparser+libfirm-build}; : ${PKG_CPARSER_BUILD_DIR:=build/cparser}; : ${PKG_CPARSER_CONFIGURE:=bcparser/configure}; : ${PKG_CPARSER_CONFIGURE_ARGS:="--source-dir=../../cparser --prefix="}; @@ -718,7 +776,7 @@ NATIVE_PACKAGES_DEV_PREFIX="${PREFIX_NATIVE}"; : ${PKG_FLEX_URL:=https://github.com/westes/flex/releases/download/v${PKG_FLEX_VERSION}/flex-${PKG_FLEX_VERSION}.tar.gz}; : ${PKG_FLEX_CONFIGURE_ARGS_EXTRA:=--disable-libfl}; : ${PKG_LUNIX_URLS_GIT:=lunix=https://github.com/Redfoxmoon3/lunix.git@master}; -: ${PKG_LUNIX_BUILD_DIR:=lunix}; +: ${PKG_LUNIX_IN_TREE:=1}; : ${PKG_LUNIX_MAKEFLAGS_BUILD:="all5.3 libdir=${PREFIX_NATIVE}/lib"}; : ${PKG_LUNIX_MAKEFLAGS_INSTALL_EXTRA:="libdir=lib"}; : ${PKG_MAKE_SHA256SUM:=d6e262bf3601b42d2b1e4ef8310029e1dcf20083c5446b4b7aa67081fdffc589}; @@ -741,16 +799,16 @@ NATIVE_PACKAGES_DEV_PREFIX="${PREFIX_NATIVE}"; : ${PKG_PERL_VERSION:=5.22.1}; : ${PKG_PERL_URL:=http://www.cpan.org/src/5.0/perl-${PKG_PERL_VERSION}.tar.gz}; : ${PKG_PERL_URLS_GIT:="perl-cross=https://github.com/lalbornoz/perl-cross@master"}; -: ${PKG_PERL_BASE_DIR:=${WORKDIR}/perl-build}; -: ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_NATIVE}/include --sysroot=${PREFIX_NATIVE} --target=${TARGET}"}; -: ${PKG_PERL_ENV_VARS_EXTRA:="TARGET=${TARGET}"}; +: ${PKG_PERL_BASE_DIR:=${BUILD_WORKDIR}/perl-build}; +: ${PKG_PERL_CONFIGURE_ARGS:="-A ccflags=-I${PREFIX_NATIVE}/include --sysroot=${PREFIX_NATIVE} --target=${DEFAULT_TARGET}"}; +: ${PKG_PERL_ENV_VARS_EXTRA:="TARGET=${DEFAULT_TARGET}"}; : ${PKG_PERL_MAKEFLAGS_BUILD:=-j1}; : ${PKG_PERL_SUBDIR:=perl-${PKG_PERL_VERSION}}; : ${PKG_PYTHON3_SHA256SUM:=687e067d9f391da645423c7eda8205bae9d35edc0c76ef5218dcbe4cc770d0d7}; : ${PKG_PYTHON3_VERSION:=3.5.1}; : ${PKG_PYTHON3_URL:=https://www.python.org/ftp/python/${PKG_PYTHON3_VERSION}/Python-${PKG_PYTHON3_VERSION}.tgz}; -: ${PKG_PYTHON3_CONFIGURE_ARGS:="--build=x86_64 -C --enable-ipv6 --enable-shared --host=${TARGET} --prefix=${PREFIX_NATIVE} --without-ensurepip"}; -: ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${TARGET}-gcc -shared -mout-dsolib --sysroot=${PREFIX_NATIVE}:CC=${TARGET}-gcc:CFLAGS=--sysroot=${PREFIX_NATIVE}:CPPFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=-L${PREFIX_NATIVE}/lib"}: +: ${PKG_PYTHON3_CONFIGURE_ARGS:="--build=x86_64 -C --enable-ipv6 --enable-shared --host=${DEFAULT_TARGET} --prefix=${PREFIX_NATIVE} --without-ensurepip"}; +: ${PKG_PYTHON3_ENV_VARS_EXTRA:="BLDSHARED=${DEFAULT_TARGET}-gcc -shared -mout-dsolib --sysroot=${PREFIX_NATIVE}:CC=${DEFAULT_TARGET}-gcc:CFLAGS=--sysroot=${PREFIX_NATIVE}:CPPFLAGS=--sysroot=${PREFIX_NATIVE}:LDFLAGS=-L${PREFIX_NATIVE}/lib"}: : ${PKG_PYTHON3_SUBDIR:=Python-${PKG_PYTHON3_VERSION}}; : ${PKG_RUBY_SHA256SUM:=ba5ba60e5f1aa21b4ef8e9bf35b9ddb57286cb546aac4b5a28c71f459467e507}; : ${PKG_RUBY_VERSION:=2.3.0}; @@ -758,38 +816,40 @@ NATIVE_PACKAGES_DEV_PREFIX="${PREFIX_NATIVE}"; : ${PKG_RUBY_CONFIGURE_ARGS_EXTRA:="--disable-install-rdoc --with-baseruby=${PREFIX}/bin/ruby --with-out-ext=fiddle"}; : ${PKG_RUBY_MAKEFLAGS_BUILD:=-j1}; : ${PKG_SMALLBASIC_URLS_GIT:="SmallBASIC=https://github.com/smallbasic/SmallBASIC@master"}; -: ${PKG_SMALLBASIC_BUILD_DIR:=SmallBASIC}; : ${PKG_SMALLBASIC_CFLAGS_CONFIGURE_EXTRA:=-std=gnu99}; +: ${PKG_SMALLBASIC_IN_TREE:=1}; # # Build target native_packages_etc # NATIVE_PACKAGES_ETC_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_ETC_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +NATIVE_PACKAGES_ETC_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_ETC_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_ETC_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_ETC_PACKAGES=" -cron hexcurse htop infounzip infozip john less mc nano ncdu mintty p7zip procps_ng qpdf -rxvt_unicode st tmux vim xeyes xwd"; +cron hexcurse htop infounzip infozip john less mc mintty nano ncdu +p7zip procps_ng qpdf rxvt_unicode st tmux vim xeyes xwd"; NATIVE_PACKAGES_ETC_PREFIX="${PREFIX_NATIVE}"; : ${PKG_CRON_URLS_GIT:="pkg-cron.git=git://anonscm.debian.org/pkg-cron/pkg-cron.git@debian/3.0pl1-128"}; -: ${PKG_CRON_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PACKAGES_CFLAGS_CONFIGURE} -D__GNU__"}; +: ${PKG_CRON_ENV_VARS_EXTRA:="CC=${DEFAULT_TARGET}-gcc:CFLAGS=${NATIVE_PACKAGES_ETC_CFLAGS_CONFIGURE} -D__GNU__"}; +: ${PKG_CRON_IN_TREE:=1}; : ${PKG_HEXCURSE_URLS_GIT:="hexcurse=https://github.com/LonnyGomes/hexcurse@master"}; : ${PKG_HEXCURSE_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include/ncursesw}; : ${PKG_HTOP_SHA256SUM:=f410626dfaf6b70fdf73cd7bb33cae768869707028d847fed94a978e974f5666}; : ${PKG_HTOP_VERSION:=2.0.1}; : ${PKG_HTOP_URL:=http://hisham.hm/htop/releases/${PKG_HTOP_VERSION}/htop-${PKG_HTOP_VERSION}.tar.gz}; : ${PKG_INFOUNZIP_URLS_GIT:=infounzip=https://github.com/Redfoxmoon3/infounzip.git@master}; +: ${PKG_INFOUNZIP_IN_TREE:=1}; : ${PKG_INFOZIP_URLS_GIT:=infozip=https://github.com/Redfoxmoon3/infozip.git@master}; +: ${PKG_INFOZIP_IN_TREE:=1}; : ${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_BUILD_STEPS_DISABLE:=install_make}; +: ${PKG_JOHN_DISABLED_NT32:=1}; +: ${PKG_JOHN_IN_TREE:=1}; : ${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_SUBDIR:=john-${PKG_JOHN_VERSION}}; +: ${PKG_JOHN_MAKEFLAGS_BUILD_EXTRA:="-C src midipix-x86-64"}; : ${PKG_LESS_SHA256SUM:=f3dc8455cb0b2b66e0c6b816c00197a71bf6d1787078adeee0bcf2aea4b12706}; : ${PKG_LESS_VERSION:=487}; : ${PKG_LESS_URL:=http://www.greenwoodsoftware.com/less/less-${PKG_LESS_VERSION}.tar.gz}; @@ -804,23 +864,27 @@ NATIVE_PACKAGES_ETC_PREFIX="${PREFIX_NATIVE}"; : ${PKG_NCDU_SHA256SUM:=820e4e4747a2a2ec7a2e9f06d2f5a353516362c22496a10a9834f871b877499a}; : ${PKG_NCDU_VERSION:=1.12}; : ${PKG_NCDU_URL:=https://dev.yorhel.nl/download/ncdu-${PKG_NCDU_VERSION}.tar.gz}; -: ${PKG_MINTTY_URLS_GIT:="bmintty=https://github.com/midipix-ports/bmintty.git@main mintty=https://github.com/midipix-ports/mintty.git@midipix"}; -: ${PKG_MINTTY_BASE_DIR:=${WORKDIR}/mintty-build}; -: ${PKG_MINTTY_CONFIGURE_ARGS:="--debug --strict --target=${TARGET} --source-dir=../mintty --prefix="}; +: ${PKG_MINTTY_URLS_GIT:="mintty=https://github.com/midipix-ports/mintty.git@midipix bmintty=https://github.com/midipix-ports/bmintty.git@main"}; +: ${PKG_MINTTY_BASE_DIR:=${BUILD_WORKDIR}/mintty-build}; +: ${PKG_MINTTY_BUILD_DIR:=build/mintty}; +: ${PKG_MINTTY_CONFIGURE:=bmintty/configure}; +: ${PKG_MINTTY_CONFIGURE_ARGS:="--debug --strict --target=${DEFAULT_TARGET} --source-dir=../../mintty --prefix="}; : ${PKG_MINTTY_LDFLAGS_CONFIGURE_EXTRA:=-L${PREFIX_NATIVE}/lib/w32lib}; : ${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_BUILD_STEPS_DISABLE:=install_make}; +: ${PKG_P7ZIP_IN_TREE:=1}; : ${PKG_P7ZIP_INSTALL_FILES:="bin/7za=bin/"}; : ${PKG_PROCPS_NG_SHA256SUM:=b1036c109f271c7c50325b11a748236f8e58aa1dbafefb30c995ff1d05b4a1a8}; : ${PKG_PROCPS_NG_VERSION:=3.3.12}; : ${PKG_PROCPS_NG_URL:=https://gitlab.com/procps-ng/procps/repository/archive.tar.gz?ref=v${PKG_PROCPS_NG_VERSION}}; : ${PKG_PROCPS_NG_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include/ncursesw}; +: ${PKG_PROCPS_NG_FNAME:=procps_ng-${PKG_PROCPS_NG_VERSION}.tar.gz}; : ${PKG_PROCPS_NG_SUBDIR:=procps-v${PKG_PROCPS_NG_VERSION}-e0784ddaed30d095bb1d9a8ad6b5a23d10a212c4}; : ${PKG_QPDF_SHA256SUM:=a9fdc7e94d38fcd3831f37b6e0fe36492bf79aa6d54f8f66062cf7f9c4155233}; : ${PKG_QPDF_VERSION:=6.0.0}; : ${PKG_QPDF_URL:=http://sourceforge.mirrorservice.org/q/qp/qpdf/qpdf/${PKG_QPDF_VERSION}/qpdf-${PKG_QPDF_VERSION}.tar.gz}; -: ${PKG_QPDF_BUILD_DIR:=qpdf-${PKG_QPDF_VERSION}}; : ${PKG_QPDF_CONFIGURE_ARGS_EXTRA:=--with-random=/dev/urandom}; +: ${PKG_QPDF_IN_TREE:=1}; : ${PKG_RXVT_UNICODE_SHA256SUM:=e94628e9bcfa0adb1115d83649f898d6edb4baced44f5d5b769c2eeb8b95addd}; : ${PKG_RXVT_UNICODE_VERSION:=9.22}; : ${PKG_RXVT_UNICODE_URL:=http://dist.schmorp.de/rxvt-unicode/rxvt-unicode-${PKG_RXVT_UNICODE_VERSION}.tar.bz2}; @@ -828,8 +892,9 @@ NATIVE_PACKAGES_ETC_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_BUILD_STEPS_DISABLE:=install_make}; : ${PKG_ST_CFLAGS_BUILD_EXTRA:=${LEAF_PACKAGES_CFLAGS_CONFIGURE} -I${PREFIX_NATIVE}/include/freetype2 -I${PREFIX_NATIVE}/include}; +: ${PKG_ST_IN_TREE:=1}; : ${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_TMUX_SHA256SUM:=55313e132f0f42de7e020bf6323a1939ee02ab79c48634aa07475db41573852b}; @@ -838,11 +903,11 @@ NATIVE_PACKAGES_ETC_PREFIX="${PREFIX_NATIVE}"; : ${PKG_VIM_SHA256SUM:=8de19b12cabde17b87f915a05e1855f6ff8404962947c5cf2204cf51f1ce5d67}; : ${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_CONFIGURE_ARGS_EXTRA:=--with-tlib=ncursesw}; +: ${PKG_VIM_IN_TREE:=1}; : ${PKG_VIM_INSTALL_FILES:=@vim=bin/vi}; : ${PKG_VIM_MAKEFLAGS_INSTALL_EXTRA:=STRIP=/bin/true}; -: ${PKG_VIM_SUBDIR:=${PKG_VIM_BUILD_DIR}}; +: ${PKG_VIM_SUBDIR:=vim-${PKG_VIM_VERSION}}; : ${PKG_XEYES_SHA256SUM:=975e98680cd59e1f9439016386609546ed08c284d0f05a95276f96aca6e8a521}; : ${PKG_XEYES_VERSION:=1.1.1}; : ${PKG_XEYES_URL:=https://www.x.org/releases/individual/app/xeyes-${PKG_XEYES_VERSION}.tar.bz2}; @@ -854,7 +919,7 @@ NATIVE_PACKAGES_ETC_PREFIX="${PREFIX_NATIVE}"; # Build target native_packages_inet # NATIVE_PACKAGES_INET_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -NATIVE_PACKAGES_INET_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +NATIVE_PACKAGES_INET_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; NATIVE_PACKAGES_INET_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; NATIVE_PACKAGES_INET_MAKEFLAGS_INSTALL="PREFIX= prefix="; NATIVE_PACKAGES_INET_PACKAGES=" @@ -864,7 +929,8 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_APK_TOOLS_SHA256SUM:=def2b2c23cd12fd2a9c19be49653b0d1bf9d81a26dac5a0ee79a1351d674f93b}; : ${PKG_APK_TOOLS_VERSION:=2.6.8}; : ${PKG_APK_TOOLS_URL:=http://git.alpinelinux.org/cgit/apk-tools/snapshot/apk-tools-${PKG_APK_TOOLS_VERSION}.tar.bz2}; -: ${PKG_APK_TOOLS_ENV_VARS_EXTRA:=CFLAGS=--sysroot=${PREFIX_NATIVE}:CROSS_COMPILE=${TARGET}-:LUAAPK=:VERBOSE=1:PREFIX=${PREFIX_NATIVE}}; +: ${PKG_APK_TOOLS_ENV_VARS_EXTRA:=CFLAGS=--sysroot=${PREFIX_NATIVE}:CROSS_COMPILE=${DEFAULT_TARGET}-:LUAAPK=:VERBOSE=1:PREFIX=${PREFIX_NATIVE}:OPENSSL_LIBS=-L${PREFIX_NATIVE}/lib -lssl -lcrypto:ZLIB_LIBS=-L${PREFIX_NATIVE}/lib -lz}; +: ${PKG_APK_TOOLS_IN_TREE:=1}; : ${PKG_APK_TOOLS_MAKEFLAGS_INSTALL_EXTRA:="PREFIX=${PREFIX_NATIVE} MANDIR=/share/man DOCDIR=/share/doc/apk"}; : ${PKG_ARIA2_SHA256SUM:=546e9194a9135d665fce572cb93c88f30fb5601d113bfa19951107ced682dc50}; : ${PKG_ARIA2_VERSION:=1.32.0}; @@ -873,7 +939,7 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_BIND_SHA256SUM:=7f46ad8620f7c3b0ac375d7a5211b15677708fda84ce25d7aeb7222fe2e3c77a}; : ${PKG_BIND_VERSION:=9.11.2}; : ${PKG_BIND_URL:=https://ftp.isc.org/isc/bind9/cur/${PKG_BIND_VERSION%.*}/bind-${PKG_BIND_VERSION}.tar.gz}; -: ${PKG_BIND_CONFIGURE_ARGS_EXTRA:="--with-ecdsa=yes --with-gost=no --with-gssapi=no --with-libtool --with-libxml2=${PREFIX}/bin/${TARGET}-xml2-config --with-libjson=no --with-openssl=${PREFIX_NATIVE} --with-randomdev=/dev/urandom BUILD_CC=gcc"}; +: ${PKG_BIND_CONFIGURE_ARGS_EXTRA:="--with-ecdsa=yes --with-gost=no --with-gssapi=no --with-libtool --with-libxml2=${PREFIX}/bin/${DEFAULT_TARGET}-xml2-config --with-libjson=no --with-openssl=${PREFIX_NATIVE} --with-randomdev=/dev/urandom BUILD_CC=gcc"}; : ${PKG_DROPBEAR_VERSION:=2017.75}; : ${PKG_DROPBEAR_URL:=https://matt.ucc.asn.au/dropbear/releases/dropbear-${PKG_DROPBEAR_VERSION}.tar.bz2}; : ${PKG_DROPBEAR_SHA256SUM:=6cbc1dcb1c9709d226dff669e5604172a18cf5dbf9a201474d5618ae4465098c}; @@ -881,8 +947,8 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_GIT_SHA256SUM:=ccc366d5d674fb755fd98d219c23f2b4e5da8a49d8582a6314813b280d75536b}; : ${PKG_GIT_VERSION:=2.14.1}; : ${PKG_GIT_URL:=https://github.com/git/git/archive/v${PKG_GIT_VERSION}.tar.gz}; -: ${PKG_GIT_BUILD_DIR:=git-${PKG_GIT_VERSION}}; -: ${PKG_GIT_SUBDIR:=${PKG_GIT_BUILD_DIR}}; +: ${PKG_GIT_IN_TREE:=1}; +: ${PKG_GIT_SUBDIR:=git-${PKG_GIT_VERSION}}; : ${PKG_GNUPG_SHA256SUM:=49b9a6a6787ad00d4d2d69d8c7ee8905923782583f06078a064a0c80531d8844}; : ${PKG_GNUPG_VERSION:=2.1.16}; : ${PKG_GNUPG_URL:=https://www.gnupg.org/ftp/gcrypt/gnupg/gnupg-${PKG_GNUPG_VERSION}.tar.bz2}; @@ -890,7 +956,7 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_HTTPD_SHA256SUM:=f87ec2df1c9fee3e6bfde3c8b855a3ddb7ca1ab20ca877bd0e2b6bf3f05c80b2}; : ${PKG_HTTPD_VERSION:=2.4.25}; : ${PKG_HTTPD_URL:=https://xyinn.org/gentoo/distfiles/httpd-${PKG_HTTPD_VERSION}.tar.bz2}; -: ${PKG_HTTPD_CONFIGURE_ARGS_EXTRA:="--with-apr=${PREFIX}/bin/${TARGET}-apr-1-config --with-apr-util=${PREFIX}/bin/${TARGET}-apu-1-config"}; +: ${PKG_HTTPD_CONFIGURE_ARGS_EXTRA:="--with-apr=${PREFIX}/bin/${DEFAULT_TARGET}-apr-1-config --with-apr-util=${PREFIX}/bin/${DEFAULT_TARGET}-apu-1-config"}; : ${PKG_HTTPD_DISABLED:=1}; : ${PKG_INETUTILS_SHA256SUM:=849d96f136effdef69548a940e3e0ec0624fc0c81265296987986a0dd36ded37}; : ${PKG_INETUTILS_VERSION:=1.9.4}; @@ -920,20 +986,21 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_NGINX_SHA256SUM:=4a667f40f9f3917069db1dea1f2d5baa612f1fa19378aadf71502e846a424610}; : ${PKG_NGINX_VERSION:=1.11.3}; : ${PKG_NGINX_URL:=http://nginx.org/download/nginx-${PKG_NGINX_VERSION}.tar.gz}; -: ${PKG_NGINX_BUILD_DIR:=nginx-${PKG_NGINX_VERSION}}; : ${PKG_NGINX_CONFIGURE_ARGS:="--prefix="}; +: ${PKG_NGINX_ENV_VARS_EXTRA:=CC=${DEFAULT_TARGET}-gcc}; +: ${PKG_NGINX_IN_TREE:=1}; : ${PKG_OPENLITESPEED_SHA256SUM:=11cea34ebb0d72e5c620c61dce9ee4982474311dc5f35e0737a6b6d760bcf577}; : ${PKG_OPENLITESPEED_VERSION:=1.4.27}; : ${PKG_OPENLITESPEED_URL:=http://open.litespeedtech.com/packages/openlitespeed-${PKG_OPENLITESPEED_VERSION}.tgz}; -: ${PKG_OPENLITESPEED_BUILD_DIR:=openlitespeed-${PKG_OPENLITESPEED_VERSION}}; -: ${PKG_OPENLITESPEED_CONFIGURE_ARGS:="-C --host=${TARGET} --prefix=/usr/lsws --target=${TARGET} --with-expat=${PREFIX_NATIVE} --with-openssl=${PREFIX_NATIVE} --with-zlib=${PREFIX_NATIVE}" --enable-spdy=no}; +: ${PKG_OPENLITESPEED_CONFIGURE_ARGS:="-C --host=${DEFAULT_TARGET} --prefix=/usr/lsws --target=${DEFAULT_TARGET} --with-expat=${PREFIX_NATIVE} --with-openssl=${PREFIX_NATIVE} --with-zlib=${PREFIX_NATIVE}" --enable-spdy=no}; : ${PKG_OPENLITESPEED_CXXFLAGS_CONFIGURE_EXTRA:="-D_GNU_SOURCE"}; +: ${PKG_OPENLITESPEED_IN_TREE:=1}; : ${PKG_OPENLITESPEED_MAKEFLAGS_BUILD:=-j1}; : ${PKG_OPENLITESPEED_PREFIX:=${PREFIX_NATIVE}/lsws}; : ${PKG_OPENSSH_SHA256SUM:=3ffb989a6dcaa69594c3b550d4855a5a2e1718ccdde7f5e36387b424220fbecc}; : ${PKG_OPENSSH_VERSION:=7.3p1}; : ${PKG_OPENSSH_URL:=http://artfiles.org/openbsd/OpenSSH/portable/openssh-${PKG_OPENSSH_VERSION}.tar.gz}; -: ${PKG_OPENSSH_CONFIGURE_ARGS_EXTRA_DEBUG:=--disable-strip}; +: ${PKG_OPENSSH_DEBUG_CONFIGURE_ARGS_EXTRA:=--disable-strip}; : ${PKG_OPENSSH_INSTALL_TARGET:=install-nokeys}; : ${PKG_PACMAN_SHA256SUM:=84599e2ee2158134fd704f1cd681ea46e021165bed4df5f002aa1748caef9e7b}; : ${PKG_PACMAN_VERSION:=5.0.1}; @@ -949,8 +1016,8 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_THTTPD_SHA256SUM:=b1c4bc37ada7c39cc2bcfbf86b3bc05be91be49f8bb4f55379eaff1f66516d7a}; : ${PKG_THTTPD_VERSION:=2.27}; : ${PKG_THTTPD_URL:=https://acme.com/software/thttpd/thttpd-${PKG_THTTPD_VERSION}.tar.gz}; -: ${PKG_THTTPD_BUILD_DIR:=thttpd-${PKG_THTTPD_VERSION}}; -: ${PKG_THTTPD_CONFIGURE_ARGS:="--disable-nls --host=${TARGET} --prefix= --target=${TARGET}"}; +: ${PKG_THTTPD_CONFIGURE_ARGS:="--disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"}; +: ${PKG_THTTPD_IN_TREE:=1}; : ${PKG_THTTPD_MAKE_INSTALL_VNAME:=prefix}; : ${PKG_THTTPD_MAKEFLAGS_BUILD_EXTRA:=-j1}; : ${PKG_WEECHAT_SHA256SUM:=3061e57460e0e3e4533551c45ced53b222fe0933848250d0fb7337d9aacfd853}; @@ -965,6 +1032,7 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; : ${PKG_WHOIS_SHA256SUM:=048c3b0fd731e5c777c9cf1e01e0ed7aca387891743a97c5b57b3daa8df524a4}; : ${PKG_WHOIS_VERSION:=5.2.18}; : ${PKG_WHOIS_URL:=https://github.com/rfc1036/whois/archive/v${PKG_WHOIS_VERSION}.tar.gz}; +: ${PKG_WHOIS_IN_TREE:=1}; : ${PKG_WHOIS_MAKE_INSTALL_VNAME:=BASEDIR}; : ${PKG_WHOIS_SUBDIR:=whois-${PKG_WHOIS_VERSION}}; @@ -972,7 +1040,8 @@ NATIVE_PACKAGES_INET_PREFIX="${PREFIX_NATIVE}"; # Build target dist_minipix # DIST_MINIPIX_CFLAGS_CONFIGURE="${DEFAULT_CFLAGS:+${DEFAULT_CFLAGS} }--sysroot=${PREFIX_NATIVE}"; -DIST_MINIPIX_CONFIGURE_ARGS="-C --disable-nls --host=${TARGET} --prefix= --target=${TARGET}"; +DIST_MINIPIX_CONFIGURE_ARGS="-C --disable-nls --host=${DEFAULT_TARGET} --prefix= --target=${DEFAULT_TARGET}"; +DIST_MINIPIX_INSTALL_FILES_DESTDIR_EXTRA="@bin=lib @bin=libexec @bin=share"; DIST_MINIPIX_LDFLAGS_CONFIGURE="--sysroot=${PREFIX_NATIVE}"; DIST_MINIPIX_MAKEFLAGS_INSTALL="PREFIX= prefix="; DIST_MINIPIX_PACKAGES=" @@ -980,7 +1049,7 @@ bzip2_flavour_minipix gzip_flavour_minipix xz_flavour_minipix bash_flavour_minipix coreutils_flavour_minipix tar_flavour_minipix ntctty_flavour_minipix ptycon_flavour_minipix"; DIST_MINIPIX_PREFIX="${PREFIX_MINIPIX}"; -: ${PKG_BZIP2_FLAVOUR_MINIPIX_BUILD_STEPS_DISABLE:="${PKG_BZIP2_BUILD_STEPS_DISABLE:+${PKG_BZIP2_BUILD_STEPS_DISABLE} }install_make:dynamic"}; +: ${PKG_BZIP2_FLAVOUR_MINIPIX_BUILD_STEPS_DISABLE:="${PKG_BZIP2_BUILD_STEPS_DISABLE:+${PKG_BZIP2_BUILD_STEPS_DISABLE} }install_make"}; : ${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:="--sysroot=${PREFIX_NATIVE} -static"}; : ${PKG_BZIP2_FLAVOUR_MINIPIX_MAKEFLAGS_BUILD_EXTRA:="-f Makefile"}; @@ -993,19 +1062,19 @@ DIST_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_BUILD_STEPS_DISABLE:=install_make:dynamic}; +: ${PKG_BASH_FLAVOUR_MINIPIX_BUILD_STEPS_DISABLE:=install_make}; : ${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"}; : ${PKG_COREUTILS_FLAVOUR_MINIPIX_INSTALL_TARGET:=install-binPROGRAMS}; -: ${PKG_COREUTILS_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL_EXTRA:=INSTALL_PROGRAM=${TARGET}-install-strip}; +: ${PKG_COREUTILS_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL_EXTRA:=INSTALL_PROGRAM=${DEFAULT_TARGET}-install-strip}; : ${PKG_TAR_FLAVOUR_MINIPIX_LDFLAGS_BUILD_EXTRA:="-static"}; : ${PKG_TAR_FLAVOUR_MINIPIX_MAKEFLAGS_BUILD_EXTRA:="SHARED=0"}; : ${PKG_TAR_FLAVOUR_MINIPIX_MAKEFLAGS_INSTALL:="-C src install-binPROGRAMS"}; -: ${PKG_NTCTTY_FLAVOUR_MINIPIX_CONFIGURE_ARGS:="--prefix= --strict --host=${TARGET}"}; +: ${PKG_NTCTTY_FLAVOUR_MINIPIX_CONFIGURE_ARGS:="--prefix= --strict --host=${DEFAULT_TARGET}"}; : ${PKG_NTCTTY_FLAVOUR_MINIPIX_ENV_VARS_EXTRA:="CFLAGS_PATH=-I${PREFIX_NATIVE}/include:LDFLAGS_PATH=-L${PREFIX_NATIVE}/lib"}; : ${PKG_NTCTTY_FLAVOUR_MINIPIX_INSTALL_TARGET:=install-static-app}; -: ${PKG_PTYCON_FLAVOUR_MINIPIX_CONFIGURE_ARGS:="--prefix= --strict --host=${TARGET}"}; +: ${PKG_PTYCON_FLAVOUR_MINIPIX_CONFIGURE_ARGS:="--prefix= --strict --host=${DEFAULT_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}; @@ -1020,9 +1089,8 @@ DIST_TARGET_PACKAGES="dist_etc dist_digest dist_tarballs"; # DEV_TARGET="dev_packages"; DIST_TARGET="dist_minipix dist_target"; -HOST_TARGET="host_toolchain_deps host_toolchain" -INVARIANTS_TARGET="invariants"; -NATIVE_TARGET="native_toolchain_deps native_toolchain native_runtime"; +HOST_TARGET="host_tools host_toolchain_deps host_toolchain host_toolchain_mingw32"; +NATIVE_TARGET="native_tools native_toolchain_deps native_toolchain native_toolchain_mingw32 native_runtime"; PACKAGES_DEPS_TARGET="host_packages_deps native_packages_deps native_packages_deps_x11"; PACKAGES_TARGET="native_packages_cmdline native_packages_dev native_packages_etc native_packages_inet"; diff --git a/vars/chainport_host.vars b/vars/chainport_host.vars new file mode 100644 index 0000000..94b56b1 --- /dev/null +++ b/vars/chainport_host.vars @@ -0,0 +1,10 @@ +# +# set -o errexit -o noglob are assumed. +# + +pkg_chainport_host_install_make() { + ex_rtl_fileop rm "${BUILD_WORKDIR}/chainport"; + ex_rtl_fileop cp ../chainport "${BUILD_WORKDIR}/chainport"; +}; + +# vim:filetype=sh diff --git a/vars/clang_host.vars b/vars/clang_host.vars index 01413be..4f77980 100644 --- a/vars/clang_host.vars +++ b/vars/clang_host.vars @@ -3,10 +3,10 @@ # pkg_clang_host_configure() { - 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..."; + ex_rtl_fileop rm "../cfe-${PKG_VERSION}-host"; + ex_rtl_fileop mkdir "../cfe-${PKG_VERSION}-host"; + ex_rtl_fileop cd "../cfe-${PKG_VERSION}-host"; + ex_rtl_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); - ex_log_msg info "Finished bootstrapping clang_host."; + ex_rtl_log_msg info "Finished bootstrapping clang_host."; }; # vim:filetype=sh diff --git a/vars/cmake.vars b/vars/cmake.vars index 2c8d19d..c8f5b2a 100644 --- a/vars/cmake.vars +++ b/vars/cmake.vars @@ -3,18 +3,18 @@ # pkg_cmake_configure() { - ex_build_fileop cp "${PREFIX}/share/cmake-${PKG_VERSION%.*}/Modules/Platform/BSDOS.cmake" \ + ex_rtl_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}" \ PREFIX="" \ cmake -DBZIP2_INCLUDE_DIR="${PKG_PREFIX}/include" \ -DBZIP2_LIBRARIES="${PKG_PREFIX}/lib/libbz2.a" \ - -DCMAKE_AR="${PREFIX}/bin/${AR}" \ - -DCMAKE_C_COMPILER="${PREFIX}/bin/${CC}" \ + -DCMAKE_AR="${PREFIX}/bin/${PKG_AR}" \ + -DCMAKE_C_COMPILER="${PREFIX}/bin/${PKG_CC}" \ -DCMAKE_CXX_COMPILER="${PREFIX}/bin/${PKG_TARGET}-g++" \ -DCMAKE_INSTALL_PREFIX= \ - -DCMAKE_RANLIB="${PREFIX}/bin/${RANLIB}" \ + -DCMAKE_RANLIB="${PREFIX}/bin/${PKG_RANLIB}" \ -DCMAKE_SYSTEM_NAME=Midipix \ -DCMAKE_USE_SYSTEM_BZIP2=ON \ -DCMAKE_USE_SYSTEM_CURL=ON \ diff --git a/vars/dist_digest.vars b/vars/dist_digest.vars index de94df7..d831beb 100644 --- a/vars/dist_digest.vars +++ b/vars/dist_digest.vars @@ -4,18 +4,16 @@ pkg_dist_digest_all() { local __; - if [ -n "${ARG_TARBALL}" ]; then - ex_log_msg info "Compiling SHA256 sums..."; - if [ -e "${PREFIX}/SHA256SUMS" ]; then - ex_build_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last"; - fi; - (cd "${PREFIX}"; - for __ in $(find "${PREFIX_NATIVE#${PREFIX}/}" -type f -perm /a=x \ - \( -path "${PREFIX_NATIVE#${PREFIX}/}/bin/*" -or \ - -path "${PREFIX_NATIVE#${PREFIX}/}/lib/*" \)); do - sha256sum "${__}"; - done > "${PREFIX}/SHA256SUMS"); + ex_rtl_log_msg info "Compiling SHA256 sums..."; + if [ -e "${PREFIX}/SHA256SUMS" ]; then + ex_rtl_fileop mv "${PREFIX}/SHA256SUMS" "${PREFIX}/SHA256SUMS.last"; fi; + (cd "${PREFIX}"; + for __ in $(find "${PREFIX_NATIVE#${PREFIX}/}" -type f -perm /a=x \ + \( -path "${PREFIX_NATIVE#${PREFIX}/}/bin/*" -or \ + -path "${PREFIX_NATIVE#${PREFIX}/}/lib/*" \)); do + sha256sum "${__}"; + done > "${PREFIX}/SHA256SUMS"); }; # vim:filetype=sh diff --git a/vars/dist_tarballs.vars b/vars/dist_tarballs.vars index dd06c71..b035e78 100644 --- a/vars/dist_tarballs.vars +++ b/vars/dist_tarballs.vars @@ -3,91 +3,89 @@ # pkgp_dist_tarball_dist() { - TARBALL_FNAME="${TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}"; + TARBALL_FNAME="${DEFAULT_TARBALL_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; tar -cpf - $(find . -maxdepth 2 -mindepth 1 -type d \ -not -path ./${PREFIX_BASENAME} \ -not -path ./${PREFIX_BASENAME}.bak \ -not -path ./${PREFIX_BASENAME}.bak/\* \ -not -path ./tmp -not -path ./tmp/\*) \ midipix_shortcut.vbs midipix.sh README SHA256SUMS |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_FNAME}"; - 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 + "${DEFAULT_TARBALL_COMPRESS_CMD}" ${DEFAULT_TARBALL_COMPRESS_ARGS} -c > "${DEFAULT_TARBALL_FNAME}"; + ex_rtl_log_msg info "Finished building binary distribution tarball."; + if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ + gpg --list-keys "${DEFAULT_TARBALL_SIGN_GPG_KEY}" >/dev/null 2>&1; then gpg --armor --passphrase-file /dev/null \ - --local-user "${TARBALL_SIGN_GPG_KEY}" --sign "${TARBALL_FNAME}"; - ex_log_msg info "Signed binary distribution tarball."; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${DEFAULT_TARBALL_FNAME}"; + ex_rtl_log_msg info "Signed binary distribution tarball."; fi; }; 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}"; - 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 + TARBALL_CROSS_FNAME="${DEFAULT_TARBALL_CROSS_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; + tar -cpf - bin include lib lib64 libexec share "${PKG_TARGET}" |\ + "${DEFAULT_TARBALL_COMPRESS_CMD}" ${DEFAULT_TARBALL_COMPRESS_ARGS} -c > "${DEFAULT_TARBALL_CROSS_FNAME}"; + ex_rtl_log_msg info "Finished building toolchain tarball."; + if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ + gpg --list-keys "${DEFAULT_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}"; - ex_log_msg info "Signed toolchain tarball."; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${DEFAULT_TARBALL_CROSS_FNAME}"; + ex_rtl_log_msg info "Signed toolchain tarball."; fi; }; pkgp_dist_tarball_minipix() { - TARBALL_MINIPIX_FNAME="${TARBALL_MINIPIX_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${TARBALL_SUFFIX}"; + TARBALL_MINIPIX_FNAME="${DEFAULT_TARBALL_MINIPIX_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; tar -cpf - minipix \ midipix_shortcut.vbs midipix.sh README |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_MINIPIX_FNAME}"; - 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 + "${DEFAULT_TARBALL_COMPRESS_CMD}" ${DEFAULT_TARBALL_COMPRESS_ARGS} -c > "${DEFAULT_TARBALL_MINIPIX_FNAME}"; + ex_rtl_log_msg info "Finished building binary Minipix distribution tarball."; + if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ + gpg --list-keys "${DEFAULT_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}"; - ex_log_msg info "Signed binary Minipix distribution tarball."; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${DEFAULT_TARBALL_MINIPIX_FNAME}"; + ex_rtl_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}"; - ex_log_msg info "Building source tarball..."; + TARBALL_SRC_FNAME="${DEFAULT_TARBALL_SRC_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.tar.${DEFAULT_TARBALL_SUFFIX}"; + ex_rtl_log_msg info "Building source tarball..."; tar -cpf - $(find tmp -mindepth 2 -maxdepth 2 \ -not -path tmp/.\* \ -not -path tmp/ntctty\* \ -not -path tmp/psxscl\* \ -not -path tmp/ptycon\*) |\ - "${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${TARBALL_SRC_FNAME}"; - 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 + "${DEFAULT_TARBALL_COMPRESS_CMD}" ${DEFAULT_TARBALL_COMPRESS_ARGS} -c > "${DEFAULT_TARBALL_SRC_FNAME}"; + ex_rtl_log_msg info "Finished building source tarball."; + if [ -x "$(which gpg 2>/dev/null)" -a -n "${DEFAULT_TARBALL_SIGN_GPG_KEY}" ] && \ + gpg --list-keys "${DEFAULT_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}"; - ex_log_msg info "Signed source tarball."; + --local-user "${DEFAULT_TARBALL_SIGN_GPG_KEY}" --sign "${DEFAULT_TARBALL_SRC_FNAME}"; + ex_rtl_log_msg info "Signed source tarball."; fi; }; pkg_dist_tarballs_all() { - if [ -n "${ARG_TARBALL}" ]; then - ex_log_msg info "Building distribution tarballs..."; - case "${TARBALL_SUFFIX}" in - bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then - TARBALL_COMPRESS_CMD="pbzip2"; - else - TARBALL_COMPRESS_CMD="bzip2"; - fi; ;; - gz) if [ -n "$(which pigz 2>/dev/null)" ]; then - TARBALL_COMPRESS_CMD="pigz"; - else - TARBALL_COMPRESS_CMD="gzip"; - fi; ;; - xz) TARBALL_COMPRESS_CMD="xz"; - TARBALL_COMPRESS_ARGS="-T0"; ;; - *) ex_log_msg failexit "Unknown tarball suffix \`.${TARBALL_SUFFIX}'."; - esac; - 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; - fi; + ex_rtl_log_msg info "Building distribution tarballs..."; + case "${DEFAULT_TARBALL_SUFFIX}" in + bz2) if [ -n "$(which pbzip2 2>/dev/null)" ]; then + TARBALL_COMPRESS_CMD="pbzip2"; + else + TARBALL_COMPRESS_CMD="bzip2"; + fi; ;; + gz) if [ -n "$(which pigz 2>/dev/null)" ]; then + TARBALL_COMPRESS_CMD="pigz"; + else + TARBALL_COMPRESS_CMD="gzip"; + fi; ;; + xz) TARBALL_COMPRESS_CMD="xz"; + TARBALL_COMPRESS_ARGS="-T0"; ;; + *) ex_rtl_log_msg failexit "Unknown tarball suffix \`.${DEFAULT_TARBALL_SUFFIX}'."; + esac; + ex_rtl_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; fi; }; diff --git a/vars/env.vars b/vars/env.vars index 2546f06..8d76b81 100644 --- a/vars/env.vars +++ b/vars/env.vars @@ -1,85 +1,29 @@ -# -# WARNING: Do _NOT_ use whitespaces (` ') or tab (` ') -# characters in any of the variables below save for MAKEFLAGS, -# PATH, and TIMESTAMP_FMT. -# -# $PREFIX_{CROSS,NATIVE} and $WORKDIR must be immediately -# beneath $PREFIX. $PREFIX must be o+rwx. The variables mentioned -# should not be forward slash-terminated. -# - -# Path names & variables -: ${PREFIX_ROOT:=${HOME}/midipix}; -: ${PREFIX:=${PREFIX_ROOT}/${ARCH}/${BUILD}}; -: ${PREFIX_MINIPIX:=${PREFIX}/minipix}; -: ${PREFIX_NATIVE:=${PREFIX}/native}; -: ${PREFIX_CROSS:=${PREFIX}/${TARGET}}; -: ${DLCACHEDIR:=${PREFIX_ROOT}/dlcache}; -: ${WORKDIR:=${PREFIX}/tmp}; -: ${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:finish"}; -: ${PKG_BUILD_VARS:="BASE_DIR BUILD_DIR BUILD_STEPS_DISABLE BUILD_TYPE - CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA - CFLAGS_INSTALL_EXTRA CONFIG_CACHE CONFIG_CACHE_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_LOG_VARS SHA256SUM SLIBTOOL SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"}; -: ${CLEAR_ENV_VARS_EXCEPT:="ARG_VERBOSE ARG_VERBOSE2 ARG_VERBOSE3 DEFAULT_GITROOT_HEAD HOME PATH SHELL TERM TARBALL_SIGN_GPG_KEY USER"}; -: ${CLEAR_PREFIX_PATHS:="bin i686-nt32-midipix doc include info lib lib64 libexec man minipix native sbin share tmp usr x86_64-nt64-midipix x86_64-w64-mingw32 midipix.sh midipix_shortcut.vbs README"}; - -# Default flags -: ${DEFAULT_BUILD_CPUS:=1}; -: ${DEFAULT_CFLAGS_DEBUG:="-g2 -O0"}; -: ${DEFAULT_CFLAGS_DEBUG_HOST:="-g0 -O2"}; -: ${DEFAULT_CFLAGS_DEBUG_RUNTIME:="-g3 -O0"}; -: ${DEFAULT_CFLAGS_RELEASE:="-g0 -O2"}; -: ${DEFAULT_CFLAGS_RELEASE_HOST:="-g0 -O2"}; -: ${DEFAULT_CFLAGS_RELEASE_RUNTIME:="-g0 -O2"}; -: ${DEFAULT_CFLAGS:=$(ex_get_var_unsafe "DEFAULT_CFLAGS_$(ex_toupper "${BUILD}")")}; -: ${DEFAULT_CFLAGS_CONFIGURE:=${DEFAULT_CFLAGS}}; -: ${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}; -: ${DEFAULT_MAKEFLAGS_BUILD:=-j${DEFAULT_BUILD_CPUS}}; -: ${DEFAULT_WGET_ARGS:="--no-check-certificate"}; - -# Build {log,status} & tarball names -: ${BUILD_LOG_FNAME:=${PREFIX}/build.log}; -: ${BUILD_LOG_LAST_FNAME:=${PREFIX}/build.log.last}; -: ${BUILD_STATUS_IN_PROGRESS_FNAME:=${PREFIX}/BUILD_IN_PROGRESS}; -: ${LOG_ENV_VARS:="ARCH BUILD DEFAULT_GITROOT HOME PATH PREFIX PREFIX_CROSS PREFIX_NATIVE SHELL USER WORKDIR"}; -: ${LOG_MSG_FAIL_COLOUR:=91}; -: ${LOG_MSG_INFO_COLOUR:=93}; -: ${LOG_MSG_VNFO_COLOUR:=96}; -: ${LOG_MSG_VVFO_COLOUR:=96}; -: ${LOG_MSG_VVVO_COLOUR:=96}; -: ${LOG_MSG_SUCC_COLOUR:=92}; -: ${TARBALL_CROSS_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_cross.}; -: ${TARBALL_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}.}; -: ${TARBALL_MINIPIX_FNAME_PREFIX:=minipix-${ARCH}-${BUILD}.}; -: ${TARBALL_SIGN_GPG_KEY:=}; -: ${TARBALL_SRC_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_src.}; -: ${TARBALL_SUFFIX:=xz}; -: ${TIMESTAMP_FMT:="%Y/%m/%d %H:%M:%S"}; -: ${TIMESTAMP_FMT_STATUS_FILES:=%Y-%m-%d-%H-%M-%S}; - -# Check predicates -: ${CHECK_PREREQ_CMDS:="aclocal autoconf autopoint awk basename bunzip2 find flex gcc git groff gunzip install ld libtool lzma make makeinfo msgfmt nl nroff openssl paste patch python sed sha256sum sort tar tee tic tr uname wget xz"}; -: ${CHECK_PREREQ_FILES:="/usr/include/gmpxx.h /usr/include/mpc.h /usr/include/mpfr.h"}; -: ${CHECK_PREREQ_FILES_DYNAMIC:='/usr/share/groff/$(groff -v 2>/dev/null | awk '\''/^GNU groff version /{print $NF}'\'')/tmac/e.tmac'}; -: ${CHECK_PREREQ_PERL_MODULES:="autodie ExtUtils::MakeMaker"}; -: ${CHECK_PATH_VARS:="PREFIX PREFIX_NATIVE PREFIX_CROSS DLCACHEDIR WORKDIR"}; -: ${CHECK_UPDATES_SKIP:="gmp mpfr mpc binutils binutils_host install_strip_host pkgconf_host psxtypes pemagine dalist ntcon ntapi psxscl psxscl_strace ntctty ptycon pkgconf libevent libressl"}; -: ${CHECK_UPDATES_SHOW_NEW:=6}; +DEFAULT_BUILD_STEPS=" + fetch_wget fetch_git fetch_extract fetch \ + configure_patch_pre configure_autotools configure_patch configure \ + build \ + install_subdirs install_make install_files install_libs \ + install_pkgconfig install_purge_la install_strip install"; +DEFAULT_BUILD_VARS=" + AR BASE_DIR BUILD_DIR BUILD_STEPS_DISABLE BUILD_TYPE CC \ + CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA \ + CFLAGS_INSTALL_EXTRA CONFIG_CACHE CONFIG_CACHE_EXTRA CONFIGURE \ + CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA CXX CXXFLAGS_CONFIGURE_EXTRA \ + DISABLED ENV_VARS_EXTRA FNAME INSTALL_FILES INSTALL_FILES_DESTDIR \ + INSTALL_FILES_DESTDIR_EXTRA INSTALL_TARGET INSTALL_TARGET_EXTRA \ + IN_TREE LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA \ + LDFLAGS_INSTALL_EXTRA LIBTOOL MAKE MAKE_INSTALL_VNAME MAKEFLAGS_BUILD \ + MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA \ + NO_CLEAN_BASE_DIR NO_LOG_VARS PATCHES_EXTRA PKG_CONFIG PKG_CONFIG_LIBDIR \ + PKGCONFIG PREFIX RANLIB SHA256SUM SUBDIR TARGET URL URL_TYPE URLS_GIT VERSION"; +DEFAULT_LOG_MSG_FAIL_COLOUR=91; +DEFAULT_LOG_MSG_INFO_COLOUR=93; +DEFAULT_LOG_MSG_INF2_COLOUR=33; +DEFAULT_LOG_MSG_SUCC_COLOUR=92; +DEFAULT_LOG_MSG_SUC2_COLOUR=32; +DEFAULT_LOG_MSG_VNFO_COLOUR=96; +DEFAULT_LOG_MSG_VVFO_COLOUR=96; +DEFAULT_LOG_MSG_VVVO_COLOUR=96; +DEFAULT_TIMESTAMP_FMT="%Y/%m/%d %H:%M:%S"; # vim:filetype=sh textwidth=0 diff --git a/vars/gcc.vars b/vars/gcc.vars index f3b192b..c5e1f22 100644 --- a/vars/gcc.vars +++ b/vars/gcc.vars @@ -1,31 +1,44 @@ # # set -o errexit -o noglob are assumed. -# Order: stage1, runtime, libstdcpp_v3, full, native -# Order: stage1_x86_64_w64_mingw32, native_x86_64_w64_mingw32 +# Order: stage1_host, runtime_host, libstdcpp_v3_host, full_host, full +# Order: stage1_mingw32, native_mingw32 # +pkgp_gcc_build_dir() { + PKG_BUILD_DIR="${1}-${2}-${PKG_TARGET}"; +}; + pkgp_gcc_setup_env() { local __; export MAKE="make LIBTOOL=slibtool"; - export cbb_ldflags_for_target=--sysroot="${PKG_PREFIX}" \ - cbb_sysroot_for_libgcc="${PKG_PREFIX}" \ - cbb_target="${PKG_TARGET}"; + export cbb_target="${PKG_TARGET}"; case "${PKG_NAME}" in - gcc_stage1) - export cbb_neutral_libiberty=no \ + gcc_stage1_host) + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_CROSS} -midata"; + export cbb_neutral_libiberty=no \ + cbb_ldflags_for_target=--sysroot="${PREFIX_CROSS}" \ + cbb_sysroot_for_libgcc="${PREFIX_CROSS}" \ cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"; ;; - gcc_stage1_cross_x86_64_w64_mingw32) - export cbb_neutral_libiberty=no \ + gcc_stage1_cross_mingw32) + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PREFIX_MINGW32} -midata"; + export cbb_neutral_libiberty=no \ + cbb_ldflags_for_target=--sysroot="${PREFIX_MINGW32}" \ + cbb_sysroot_for_libgcc="${PREFIX_MINGW32}" \ cbb_xgcc_for_specs="${PKG_BASE_DIR}/${PKG_BUILD_DIR}/gcc/xgcc"; ;; - gcc_stage1_native_x86_64_w64_mingw32) - export cbb_neutral_libiberty=no \ + gcc_stage1_native_mingw32) + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX} -midata"; + export cbb_neutral_libiberty=no \ + cbb_ldflags_for_target=--sysroot="${PKG_PREFIX}" \ + cbb_sysroot_for_libgcc="${PKG_PREFIX}" \ cbb_xgcc_for_specs="${PKG_TARGET}-gcc"; ;; - gcc_native) - export cbb_xgcc_for_specs="${PKG_TARGET}-gcc" \ + gcc_full) + GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX} -midata"; + export cbb_xgcc_for_specs="${PKG_TARGET}-gcc" \ + cbb_ldflags_for_target=--sysroot="${PKG_PREFIX}" \ + cbb_sysroot_for_libgcc="${PKG_PREFIX}" \ sysroot_headers_suffix="${PKG_PREFIX}"; ;; esac; - GCCTARGET_FLAGS="-DIN_TARGET_LIBRARY_BUILD --sysroot=${PKG_PREFIX} -midata"; - GCCFLAGS="${CFLAGS:+${CFLAGS} }--include $(readlink -f "${PKG_BASE_DIR}/cbb-gcc-${1}/libc/cbb-musl-pe.h")"; + GCCFLAGS="${PKG_CFLAGS_CONFIGURE} --include $(readlink -f "${PKG_BASE_DIR}/cbb-gcc-${1}/libc/cbb-musl-pe.h")"; for __ in CFLAGS CFLAGS_FOR_BUILD CPPFLAGS_FOR_BUILD CXXFLAGS CXXFLAGS_FOR_BUILD; do export "${__}=${GCCFLAGS}"; done; @@ -39,10 +52,10 @@ pkgp_gcc_setup_env() { }; pkgp_gcc_configure() { - 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" "${@}"\ + ex_rtl_fileop rm "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + ex_rtl_fileop mkdir "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + "../cbb-gcc-${PKG_VERSION}/configure" "${@}"\ --disable-bootstrap \ --disable-libmudflap \ --disable-multilib \ @@ -64,66 +77,68 @@ pkgp_gcc_configure() { --enable-threads=posix \ --target="${PKG_TARGET}" \ --with-fpmath=sse; - ex_pkg_state_push "${PKG_NAME}" configure -build; + ex_pkg_state_set "${PKG_NAME}" configure -build; +}; + +pkg_gcc_stage1_host_all() { + pkg_gcc_stage1_all "${@}"; }; -pkg_gcc_stage1_cross_x86_64_w64_mingw32_all() { +pkg_gcc_stage1_cross_mingw32_all() { + ex_rtl_fileop ln_symbolic . "${PKG_PREFIX}/x86_64-w64-mingw32/mingw"; + ex_rtl_fileop mkdir "${PKG_DESTDIR}/x86_64-w64-mingw32"; + ex_rtl_fileop ln_symbolic . "${PKG_DESTDIR}/x86_64-w64-mingw32/mingw"; + mkdir "${PKG_PREFIX}/x86_64-w64-mingw32/include"; pkg_gcc_stage1_all "${@}"; }; -pkg_gcc_stage1_native_x86_64_w64_mingw32_all() { - export AR="${TARGET}-ar"; - export CC="${TARGET}-gcc"; - export CXX="${TARGET}-g++"; - export RANLIB="${TARGET}-ranlib"; +pkg_gcc_stage1_native_mingw32_all() { + ex_rtl_fileop ln_symbolic . "${PKG_PREFIX}/x86_64-w64-mingw32/mingw"; + ex_rtl_fileop mkdir "${PKG_DESTDIR}/x86_64-w64-mingw32"; + ex_rtl_fileop ln_symbolic . "${PKG_DESTDIR}/x86_64-w64-mingw32/mingw"; + mkdir "${PKG_PREFIX}/x86_64-w64-mingw32/include"; pkg_gcc_stage1_all "${@}"; }; pkg_gcc_stage1_all() { local __ _restart_at="${1}"; case "${PKG_NAME}" in - gcc_stage1) - PKG_GCC_VERSION="${PKG_GCC_STAGE1_VERSION}"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross; + gcc_stage1_host) + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross; ;; - gcc_stage1_cross_x86_64_w64_mingw32) - PKG_GCC_VERSION="${PKG_GCC_STAGE1_CROSS_X86_64_W64_MINGW32_VERSION}"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" cross; + gcc_stage1_cross_mingw32) + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" mingw32; ;; - gcc_stage1_native_x86_64_w64_mingw32) - PKG_GCC_VERSION="${PKG_GCC_STAGE1_NATIVE_X86_64_W64_MINGW32_VERSION}"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native; + gcc_stage1_native_mingw32) + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" native; ;; esac; # GCC, stage1. 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}"; - ex_pkg_state_push "${PKG_NAME}" fetch -patch; + ex_rtl_fetch_urls_git "${PKG_BASE_DIR}" "cbb-gcc-${PKG_VERSION}=${DEFAULT_GITROOT}/cbb/cbb-gcc-${PKG_VERSION}"; + ex_pkg_state_set "${PKG_NAME}" fetch -patch; fi; 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; - ex_pkg_state_push "${PKG_NAME}" patch -configure; + ex_pkg_state_set "${PKG_NAME}" patch -configure; fi; - pkgp_gcc_setup_env "${PKG_GCC_VERSION}"; + pkgp_gcc_setup_env "${PKG_VERSION}"; if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then - ex_build_fileop mkdir "${PKG_PREFIX}/include"; - [ \! -d "${PKG_PREFIX}/usr" ] && \ - ex_build_fileop ln_symbolic . "${PKG_PREFIX}/usr"; case "${PKG_NAME}" in - gcc_stage1) + gcc_stage1_host) pkgp_gcc_configure \ --disable-sjlj-exceptions \ --prefix="${PREFIX}" \ - --with-sysroot="${PREFIX}/${PKG_TARGET}"; ;; - gcc_stage1_cross_x86_64_w64_mingw32) + --with-sysroot="${PREFIX_CROSS}"; ;; + gcc_stage1_cross_mingw32) pkgp_gcc_configure \ --enable-sjlj-exceptions \ --prefix="${PREFIX}" \ - --with-sysroot="${PREFIX}/${PKG_TARGET}"\ + --with-sysroot="${PREFIX_MINGW32}" \ --without-headers; ;; - gcc_stage1_native_x86_64_w64_mingw32) + gcc_stage1_native_mingw32) pkgp_gcc_configure \ --build=x86_64-unknown-linux-gnu \ --enable-sjlj-exceptions \ @@ -137,89 +152,120 @@ pkg_gcc_stage1_all() { --without-headers; ;; esac; else - ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; fi; if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then make ${PKG_MAKEFLAGS_BUILD} all-gcc; - ex_pkg_state_push "${PKG_NAME}" build -install; + ex_pkg_state_set "${PKG_NAME}" build -install; fi; - if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then + if ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}"; then + pkg_install_subdirs; + ex_pkg_state_set "${PKG_NAME}" install_subdirs -install_make; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}"; then case "${PKG_NAME}" in - gcc_stage1) - make ${PKG_MAKEFLAGS_BUILD} install-gcc; ;; - gcc_stage1_cross_x86_64_w64_mingw32) - make ${PKG_MAKEFLAGS_BUILD} install-gcc; ;; - gcc_stage1_native_x86_64_w64_mingw32) - make ${PKG_MAKEFLAGS_BUILD} "DESTDIR=${PKG_PREFIX}" install-gcc; ;; + gcc_stage1_host) + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install-gcc; ;; + gcc_stage1_cross_mingw32) + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install-gcc; ;; + gcc_stage1_native_mingw32) + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install-gcc; ;; esac; __="$(uname -s)"; if [ "${__#*CYGWIN*}" != "${__}" ]; then - 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"; + ex_rtl_fileop ln_symbolic "${PKG_DESTDIR}/libexec/gcc/${PKG_TARGET}/${PKG_VERSION}/liblto_plugin.dll.a" \ + ex_rtl_fileop ln_symbolic "${PKG_DESTDIR}/libexec/gcc/${PKG_TARGET}/${PKG_VERSION}/liblto_plugin.so"; fi; - ex_pkg_state_push "${PKG_NAME}" install finish; + ex_pkg_state_set "${PKG_NAME}" install_make -install; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then + pkg_install; + ex_pkg_state_set "${PKG_NAME}" install finish; fi; }; -pkg_gcc_runtime_all() { +pkg_gcc_runtime_host_all() { local _restart_at="${1}"; export MAKE="make LIBTOOL=slibtool"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_RUNTIME_VERSION}" cross; - ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; # GCC, compiler runtime. if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then make ${PKG_MAKEFLAGS_BUILD} all-target-libgcc; - ex_pkg_state_push "${PKG_NAME}" build -install; + ex_pkg_state_set "${PKG_NAME}" build -install; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}"; then + pkg_install_subdirs; + ex_pkg_state_set "${PKG_NAME}" install_subdirs -install_make; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}"; then + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install-target-libgcc; + ex_pkg_state_set "${PKG_NAME}" install_make -install; fi; if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then - make ${PKG_MAKEFLAGS_BUILD} install-target-libgcc; - ex_pkg_state_push "${PKG_NAME}" install finish; + pkg_install; + ex_pkg_state_set "${PKG_NAME}" install finish; fi; }; -pkg_gcc_libstdcpp_v3_all() { +pkg_gcc_libstdcpp_v3_host_all() { local _restart_at="${1}"; export MAKE="make LIBTOOL=slibtool"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_LIBSTDCPP_V3_VERSION}" cross; - ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; # GCC, libstdc++-v3. if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then make ${PKG_MAKEFLAGS_BUILD} all-target-libstdc++-v3; - ex_pkg_state_push "${PKG_NAME}" build -install; + ex_pkg_state_set "${PKG_NAME}" build -install; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}"; then + pkg_install_subdirs; + ex_pkg_state_set "${PKG_NAME}" install_subdirs -install_make; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}"; then + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install-target-libstdc++-v3; + ex_pkg_state_set "${PKG_NAME}" install_make -install; fi; if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then - make ${PKG_MAKEFLAGS_BUILD} install-target-libstdc++-v3; - ex_pkg_state_push "${PKG_NAME}" install finish; + pkg_install; + ex_pkg_state_set "${PKG_NAME}" install finish; fi; }; -pkg_gcc_full_all() { +pkg_gcc_full_host_all() { local _restart_at="${1}"; export MAKE="make LIBTOOL=slibtool"; - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_FULL_VERSION}" cross; - ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" cross; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; # GCC, everything else. if ! ex_pkg_state_test "${PKG_NAME}" build "${_restart_at}"; then make ${PKG_MAKEFLAGS_BUILD}; - ex_pkg_state_push "${PKG_NAME}" build -install; + ex_pkg_state_set "${PKG_NAME}" build -install; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}"; then + pkg_install_subdirs; + ex_pkg_state_set "${PKG_NAME}" install_subdirs -install_make; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}"; then + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install; + ex_pkg_state_set "${PKG_NAME}" install_make -install; fi; if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then - make ${PKG_MAKEFLAGS_BUILD} install; - ex_pkg_state_push "${PKG_NAME}" install finish; + pkg_install; + ex_pkg_state_set "${PKG_NAME}" install finish; fi; }; -pkg_gcc_native_all() { +pkg_gcc_full_all() { local _restart_at="${1}" _configure_host; - PKG_GCC_VERSION="${PKG_GCC_NATIVE_VERSION}"; export MAKE="make LIBTOOL=slibtool"; # GCC, native. - ex_pkg_state_build_dir "cbb-gcc-${PKG_GCC_VERSION}" native; - pkgp_gcc_setup_env "${PKG_GCC_VERSION}"; + pkgp_gcc_build_dir "cbb-gcc-${PKG_VERSION}" native; + pkgp_gcc_setup_env "${PKG_VERSION}"; if ! ex_pkg_state_test "${PKG_NAME}" configure "${_restart_at}"; then - ex_build_fileop mkdir "${PKG_PREFIX}/${PKG_TARGET}"; + ex_rtl_fileop mkdir "${PKG_PREFIX}/${PKG_TARGET}"; if [ \! -d "${PKG_PREFIX}/${PKG_TARGET}/usr" ]; then - ex_build_fileop ln_symbolic . "${PKG_PREFIX}/${PKG_TARGET}/usr"; + ex_rtl_fileop ln_symbolic . "${PKG_PREFIX}/${PKG_TARGET}/usr"; fi; if [ "${ARCH}" = nt32 ]; then _configure_host="i686-nt32-midipix"; @@ -236,18 +282,26 @@ pkg_gcc_native_all() { --with-mpfr="${PKG_PREFIX}" \ --with-sysroot=; else - ex_build_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; + ex_rtl_fileop cd "${PKG_BASE_DIR}/${PKG_BUILD_DIR}"; fi; 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; - ex_pkg_state_push "${PKG_NAME}" build -install; + ex_pkg_state_set "${PKG_NAME}" build -install; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_subdirs "${_restart_at}"; then + pkg_install_subdirs; + ex_pkg_state_set "${PKG_NAME}" install_subdirs -install_make; + fi; + if ! ex_pkg_state_test "${PKG_NAME}" install_make "${_restart_at}"; then + make ${PKG_MAKEFLAGS_BUILD} "prefix=${PKG_DESTDIR}" install; + ex_pkg_state_set "${PKG_NAME}" install_make -install; fi; if ! ex_pkg_state_test "${PKG_NAME}" install "${_restart_at}"; then - make ${PKG_MAKEFLAGS_BUILD} "DESTDIR=${PKG_PREFIX}" install; - ex_pkg_state_push "${PKG_NAME}" install finish; + pkg_install; + ex_pkg_state_set "${PKG_NAME}" install finish; fi; }; diff --git a/vars/gcc_full_host.vars b/vars/gcc_full_host.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_full_host.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_libstdcpp_v3_host.vars b/vars/gcc_libstdcpp_v3_host.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_libstdcpp_v3_host.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_native.vars b/vars/gcc_native.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_native.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file diff --git a/vars/gcc_runtime_host.vars b/vars/gcc_runtime_host.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_runtime_host.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1.vars b/vars/gcc_stage1.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_stage1.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_cross_mingw32.vars b/vars/gcc_stage1_cross_mingw32.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_stage1_cross_mingw32.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars b/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_stage1_cross_x86_64_w64_mingw32.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_host.vars b/vars/gcc_stage1_host.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_stage1_host.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_native_mingw32.vars b/vars/gcc_stage1_native_mingw32.vars new file mode 120000 index 0000000..55c0ef1 --- /dev/null +++ b/vars/gcc_stage1_native_mingw32.vars @@ -0,0 +1 @@ +gcc.vars \ No newline at end of file diff --git a/vars/gcc_stage1_native_x86_64_w64_mingw32.vars b/vars/gcc_stage1_native_x86_64_w64_mingw32.vars deleted file mode 120000 index 55c0ef1..0000000 --- a/vars/gcc_stage1_native_x86_64_w64_mingw32.vars +++ /dev/null @@ -1 +0,0 @@ -gcc.vars \ No newline at end of file diff --git a/vars/git.vars b/vars/git.vars index 52037a6..4496d52 100644 --- a/vars/git.vars +++ b/vars/git.vars @@ -10,7 +10,7 @@ pkg_git_install_post() { local __ _new; for __ in $(find "${PKG_DESTDIR}" -name "Git*::*" -type f); do _new="$(echo ${__} | sed "s/::/./g")"; - ex_build_fileop mv "${__}" "${_new}"; + ex_rtl_fileop mv "${__}" "${_new}"; done; }; diff --git a/vars/install_strip_host.vars b/vars/install_strip_host.vars index 5e8524a..e897420 100644 --- a/vars/install_strip_host.vars +++ b/vars/install_strip_host.vars @@ -3,14 +3,14 @@ # pkg_install_strip_host_all() { - if [ -e "${PREFIX}/bin/${TARGET}-install-strip" ]; then - ex_build_fileop rm "${PREFIX}/bin/${TARGET}-install-strip"; + if [ -e "${PREFIX}/bin/${PKG_TARGET}-install-strip" ]; then + ex_rtl_fileop rm "${PREFIX}/bin/${PKG_TARGET}-install-strip"; fi; - cat > "${PREFIX}/bin/${TARGET}-install-strip" < "${PREFIX}/bin/${PKG_TARGET}-install-strip" < "${PREFIX}/bin/${TARGET}-xml2-config" < "${PREFIX}/bin/${PKG_TARGET}-xml2-config" < "${PREFIX}/bin/${TARGET}-pkg-config" < "${PREFIX}/bin/${PKG_TARGET}-pkg-config" <