From 36c4a8a8340e5c739148cb7a7121bf6110d0a173 Mon Sep 17 00:00:00 2001 From: Lucio Andrés Illanes Albornoz Date: Jan 18 2019 23:18:44 +0000 Subject: vars/build.vars:invariants: adds invariants_zipdist. etc/build.usage, subr/build_args.subr: adds -z. vars/invariants_tarballs.vars:pkgp_dist_tarball_src(): only include package build directories. vars/invariants_zipdist.vars: added. vars/midipix.vars: adds ${DEFAULT_ZIPDIST_FNAME_PREFIX}. --- diff --git a/etc/build.usage b/etc/build.usage index 4d1ba99..88c819c 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] [[ ..]] -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 b1d778f..750aa53 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 1d4cff8..fa1f54c 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 9802082..d9a6aaa 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 0000000..b1f84b2 --- /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 3406f6f..f17a046 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:="