From 9d2842a58a294b1938708253af8adee23d1de95c Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Mar 04 2020 19:31:39 +0000 Subject: subr/build_init.subr:build_init(): call buildp_init_prereqs() after buildp_init_getopts(). subr/build_init.subr:buildp_init_prereqs(): split from buildp_init_env(). etc/README.md: updated. --- diff --git a/etc/README.md b/etc/README.md index 0b53a1a..fb0ad89 100644 --- a/etc/README.md +++ b/etc/README.md @@ -62,7 +62,7 @@ Install the build-time dependencies listed in section [2.1](#21-build-time-depen clone this repository, and run the following command line: ```shell -./build.sh -a nt64 -b release -D minipix,zipdist -P -v +./build.sh -a nt64 -b release -P -v ``` By default, the build will take place within ``${HOME}/midipix/nt64/release`` @@ -128,10 +128,10 @@ following hardware at minimum: * 7200 RPM SATA 3.1 HDD * 6 GB RAM -| Target architecture | Build type | Distribution kinds selected | Average build time | Disk space required | Peak RAM usage | -| ------------------- | ---------- | --------------------------- | ------------------ | ------------------- | -------------- | -| nt64 | debug | (none) | 2 hours | 57.60 GB | ? GB | -| nt64 | release | (none) | 1 hours 45 minutes | 35.16 GB | 1.52 GB | +| Target architecture | Build type | Distribution kinds selected | Average build time | Disk space required | +| ------------------- | ---------- | --------------------------- | ------------------ | ------------------- | +| nt64 | debug | (none) | 2 hours | 57.60 GB | +| nt64 | release | (none) | 1 hours 45 minutes | 35.16 GB | Package archive files and/or Git repositories additionally consume at least 1.70 GB. diff --git a/subr/build_init.subr b/subr/build_init.subr index b5867fb..7d52d9b 100644 --- a/subr/build_init.subr +++ b/subr/build_init.subr @@ -72,32 +72,14 @@ buildp_init_defaults() { }; buildp_init_env() { - local _cmd="" _cmds_missing="" _fname="" _rc=0; _status=""; + local _fname="" _rc=0; _status=""; if ! cd "$(dirname "${0}")" || ! umask 022; then printf "Error: failed to setup environment.\n"; exit 1; else for _fname in $(find subr -name *.subr); do if ! . "${_fname}"; then printf "Error: failed to source \`%s'.\n" "${_fname}"; exit 1; fi; - done; - for _cmd in \ - awk bunzip2 cat chmod cmake cp date find flock g++ \ - gcc git grep gunzip gzip hostname install kill \ - ln lzip make mkdir mkfifo mv paste patch perl \ - pgrep pkill printf readlink rm sed seq sha256sum \ - sort stat tail tar test touch tr wget xz zip; do - if ! which "${_cmd}" >/dev/null 2>&1; then - _cmds_missing="${_cmds_missing:+${_cmds_missing} }${_cmd}"; - fi; - done; - if [ -n "${_cmds_missing}" ]; then - _rc=1; _status="Error: missing prerequisite package(s): ${_cmds_missing}"; - elif ! awk -V 2>/dev/null | grep -q "^GNU Awk "; then - _rc=1; _status="Error: awk(1) in \$PATH must be GNU Awk."; - elif ! sed --version 2>/dev/null | grep -q "^GNU sed "; then - _rc=1; _status="Error: sed(1) in \$PATH must be GNU sed."; - fi; - fi; + done; fi; return "${_rc}"; }; @@ -179,6 +161,28 @@ buildp_init_getopts() { return "${_rc}"; }; +buildp_init_prereqs() { + local _cmd="" _cmds_missing="" _rc=0; _status=""; + for _cmd in \ + awk bunzip2 cat chmod cmake cp date find flock g++ \ + gcc git grep gunzip gzip hostname install kill \ + ln lzip make mkdir mkfifo mv paste patch perl \ + pgrep pkill printf readlink rm sed seq sha256sum \ + sort stat tail tar test touch tr wget xz zip; do + if ! which "${_cmd}" >/dev/null 2>&1; then + _cmds_missing="${_cmds_missing:+${_cmds_missing} }${_cmd}"; + fi; + done; + if [ -n "${_cmds_missing}" ]; then + _rc=1; _status="Error: missing prerequisite package(s): ${_cmds_missing}"; + elif ! awk -V 2>/dev/null | grep -q "^GNU Awk "; then + _rc=1; _status="Error: awk(1) in \$PATH must be GNU Awk."; + elif ! sed --version 2>/dev/null | grep -q "^GNU sed "; then + _rc=1; _status="Error: sed(1) in \$PATH must be GNU sed."; + fi; + return "${_rc}"; +}; + buildp_init_vars() { local _default_build_groups="" _fname="" _group="" _groups="" _rc=0; _status=""; if ! rtl_lmatch "${ARCH}" "nt32 nt64"; then @@ -250,6 +254,7 @@ build_init() { if ! buildp_init_env \ || ! buildp_init_defaults \ || ! buildp_init_getopts "${@}" \ + || ! buildp_init_prereqs \ || ! buildp_init_vars \ || ! buildp_init_args \ || ! buildp_init_files; then