diff options
author | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-04-29 12:46:58 +0200 |
---|---|---|
committer | Thorsten Behrens <thorsten.behrens@allotropia.de> | 2022-05-22 21:35:42 +0200 |
commit | 6204336cc7242ff1b0fdc26ccb7f8dd4f362fb78 (patch) | |
tree | 200376336c9b9e63ea91ddb3df073c4add53b0a0 /solenv/bin | |
parent | 5b74eb7d41bbcf2d35154ae8272f0e71be128b60 (diff) |
Get make_installer calls to run in parallel
If available, use GNU parallel to run N make_installer.pl scripts in
parallel, to scale packaging LibreOffice up with the rest of gbuild.
* fallback if no GNU parallel found - run make_installer sequentially
as before
* push most of the make_installer.pl input param tweaks from gbuild
down into a shared call_installer.sh script
* call gnu parallel with generated number of
"templ:lang:prodname:ext:pkgfmt:strip-flag" tuples, one for each
package to build (empty templ for non-windows, to save on cmd line
length)
* such that we can run all those in parallel (taking into account
the build's PARALLELISM parameter)
* there's still the main package build running epm sequentially for
umpteen sub-packages from within _one_ make_installer.pl instance, but
that's much harder to parallelize from inside Perl (so we punt on
that here)
Change-Id: Ie7d3084ed60d003d587c5e64dc9fb1809b23e409
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133957
Tested-by: Jenkins
Reviewed-by: Thorsten Behrens <thorsten.behrens@allotropia.de>
Diffstat (limited to 'solenv/bin')
-rwxr-xr-x | solenv/bin/call_installer.sh | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/solenv/bin/call_installer.sh b/solenv/bin/call_installer.sh new file mode 100755 index 000000000000..f1db809f7faf --- /dev/null +++ b/solenv/bin/call_installer.sh @@ -0,0 +1,58 @@ +#!/bin/sh + +# unpack parameters +VERBOSITY=$1; shift +MSITEMPL=$(echo "$@" | cut -d ':' -f 1) +LANG=$(echo "$@" | cut -d ':' -f 2) +PRODNAME=$(echo "$@" | cut -d ':' -f 3) +EXTENSION=$(echo "$@" | cut -d ':' -f 4) +PKGFORMAT=$(echo "$@" | cut -d ':' -f 5) +STRIP=$(echo "$@" | cut -d ':' -f 6) + +# need to hack buildid? +if [ "${PKGFORMAT}${LIBO_VERSION_PATCH}" = "deb0" ] || \ + [ "${PKGFORMAT}${LIBO_VERSION_PATCH}" = "rpm0" ] ; then + LIBO_VERSION_PATCH=1 +fi + +# switch to verbose? +if [ "${VERBOSITY}" = "-verbose" ] ; then + set -x +fi + +# populate MSI template dirs for Windows +if [ -n "${MSITEMPL}" ]; then + TEMPLATE_DIR="${WORKDIR}/CustomTarget/instsetoo_native/install/msi_templates" + rm -rf "${TEMPLATE_DIR}" && \ + mkdir -p "${TEMPLATE_DIR}/Binary" && \ + for I in "${SRCDIR}/instsetoo_native/inc_${MSITEMPL}/windows/msi_templates/"*.* ; do \ + "${GREP}" -v '^#' "$I" > "${TEMPLATE_DIR}/$(basename "$I")" || true ; \ + done && \ + "${GNUCOPY}" "${SRCDIR}/instsetoo_native/inc_common/windows/msi_templates/Binary/"*.* "${TEMPLATE_DIR}/Binary" || exit 1 +fi + +# add extra params for Windows +EXTRA_PARAMS= +if [ "${OS}" = "WNT" ] ; then + EXTRA_PARAMS="${EXTRA_PARAMS} -msitemplate ${WORKDIR}/CustomTarget/instsetoo_native/install/msi_templates" + EXTRA_PARAMS="${EXTRA_PARAMS} -msilanguage ${WORKDIR}/CustomTarget/instsetoo_native/install/win_ulffiles" +fi + +# need to strip? +if [ "${STRIP}" = "strip" ] ; then + export ENABLE_STRIP=1 +fi + +# shellcheck disable=SC2086 +# shellcheck disable=SC2154 +${PERL} -w "${SRCDIR}"/solenv/bin/make_installer.pl \ + -f "${BUILDDIR}"/instsetoo_native/util/openoffice.lst \ + -l "${LANG}" \ + -p "${PRODUCTNAME_WITHOUT_SPACES}${PRODNAME}" \ + -u "${instsetoo_OUT}" \ + -packer "${COMPRESSIONTOOL}" \ + -buildid "${LIBO_VERSION_PATCH}" \ + ${EXTRA_PARAMS:+$EXTRA_PARAMS} \ + ${EXTENSION:+"$EXTENSION"} \ + -format "${PKGFORMAT}" \ + "${VERBOSITY}" |