summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--etc/build.usage3
-rw-r--r--subr/build_args.subr3
-rw-r--r--vars/build.vars2
-rw-r--r--vars/invariants_tarballs.vars11
-rw-r--r--vars/invariants_zipdist.vars29
-rw-r--r--vars/midipix.vars1
6 files changed, 41 insertions, 8 deletions
diff --git a/etc/build.usage b/etc/build.usage
index 4d1ba998..88c819c5 100644
--- a/etc/build.usage
+++ b/etc/build.usage
@@ -1,7 +1,7 @@
usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release]
[-c] [-C dir[,..]] [-h] [-N] [-P [jobs]]
[-r ALL[:step,..]] [-r name[,..][:step,..]]
- [-R] [-t[.gz|.bz2|.xz] [-v[v[v]]] [-x]
+ [-R] [-t[.gz|.bz2|.xz] [-v[v[v]]] [-x] [-z]
[--as-needed] [--debug-minipix] [--rpm] [<target>[ ..]]
-4|-6 Force IPv[46] when downloading files.
-a nt32|nt64 Selects 32-bit or 64-bit architecture; defaults to nt64.
@@ -37,6 +37,7 @@ usage: ./build.sh [-4|6] [-a nt32|nt64] [-b debug|release]
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.
+ -z Produce deployable distribution ZIP archive.
--as-needed Don't build unless the midipix_build repository has received new commits.
--debug-minipix Don't strip(1) minipix binaries to facilitate debugging minipix.
--rpm Build RPM packages for each package built; selects host_tools_rpm.
diff --git a/subr/build_args.subr b/subr/build_args.subr
index b1d778f0..750aa535 100644
--- a/subr/build_args.subr
+++ b/subr/build_args.subr
@@ -24,7 +24,8 @@ BUILD_ARGS_SPEC="
ARG_VERBOSE:selfarg:-v:
ARG_VERBOSE:selfarg:-vv:
ARG_VERBOSE:selfarg:-vvv:
- ARG_XTRACE:-x:";
+ ARG_XTRACE:-x:
+ ARG_ZIPDIST:arg:-z:";
build_args() {
local _spec="${BUILD_ARGS_SPEC}" _spec_arg="" _found="";
diff --git a/vars/build.vars b/vars/build.vars
index 1d4cff88..fa1f54c9 100644
--- a/vars/build.vars
+++ b/vars/build.vars
@@ -1631,7 +1631,7 @@ DIST_PACKAGES="dist_minipix_dist dist_etc mpackage";
# Build target invariants
#
INVARIANTS_NO_LOG_VARS=1;
-INVARIANTS_PACKAGES="invariants_digest invariants_gitref invariants_tarballs";
+INVARIANTS_PACKAGES="invariants_digest invariants_gitref invariants_tarballs invariants_zipdist";
#
# Build targets
diff --git a/vars/invariants_tarballs.vars b/vars/invariants_tarballs.vars
index 98020827..d9a6aaad 100644
--- a/vars/invariants_tarballs.vars
+++ b/vars/invariants_tarballs.vars
@@ -50,11 +50,12 @@ pkgp_dist_tarball_minipix() {
pkgp_dist_tarball_src() {
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\*) |\
+ tar -C "${BUILD_WORKDIR}" -cpf - $(cd "${BUILD_WORKDIR}" && find \
+ -maxdepth 1 -mindepth 1 \
+ -name \*-\*-\* \
+ \( -not -name ntctty\* \) \
+ \( -not -name psxscl\* \) \
+ \( -not -name ptycon\* \)) |\
"${TARBALL_COMPRESS_CMD}" ${TARBALL_COMPRESS_ARGS} -c > "${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}" ] && \
diff --git a/vars/invariants_zipdist.vars b/vars/invariants_zipdist.vars
new file mode 100644
index 00000000..b1f84b24
--- /dev/null
+++ b/vars/invariants_zipdist.vars
@@ -0,0 +1,29 @@
+#
+# set -o errexit -o noglob are assumed.
+#
+
+pkg_invariants_zipdist_all() {
+ local _dist_fname="" _mpackage_dname="";
+ if [ -z "${ARG_ZIPDIST}" ]; then
+ exit 0;
+ else
+ ex_rtl_log_msg info "Building deployable distribution ZIP archive...";
+ _dist_fname="${DEFAULT_ZIPDIST_FNAME_PREFIX}${BUILD_USER}@${BUILD_HNAME}-${BUILD_DATE_START}.zip";
+ _mpackage_dname="${BUILD_WORKDIR}/mpackage-native-${DEFAULT_TARGET}/mpackage";
+ "${_mpackage_dname}/mpackage.sh" \
+ --defroot=/dev/fs/c/midipix \
+ --flysyms \
+ --minroot="${PREFIX_MINIPIX}" \
+ --objroot="${BUILD_WORKDIR}" \
+ --pkgroot="${BUILD_WORKDIR}/pkgroot" \
+ --product=Midipix \
+ --subset="${PREFIX}/pkglist.native" \
+ --symbols \
+ --sysroot="${BUILD_WORKDIR}/sysroot" \
+ --target="${DEFAULT_TARGET}" \
+ --tmproot="${BUILD_WORKDIR}/tmproot" \
+ --zipfile="${PREFIX}/${_dist_fname}";
+ fi;
+};
+
+# vim:filetype=sh
diff --git a/vars/midipix.vars b/vars/midipix.vars
index 3406f6fe..f17a046f 100644
--- a/vars/midipix.vars
+++ b/vars/midipix.vars
@@ -85,6 +85,7 @@
: ${DEFAULT_TARBALL_MINIPIX_FNAME_PREFIX:=minipix-${ARCH}-${BUILD}.};
: ${DEFAULT_TARBALL_SRC_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}_src.};
: ${DEFAULT_TARBALL_SUFFIX:=xz};
+: ${DEFAULT_ZIPDIST_FNAME_PREFIX:=midipix-${ARCH}-${BUILD}.};
# Check & clear predicates
: ${DEFAULT_CHECK_PATH_VARS:="