summaryrefslogtreecommitdiff
path: root/instsetoo_native
diff options
context:
space:
mode:
authorThorsten Behrens <thorsten.behrens@allotropia.de>2022-04-29 12:46:58 +0200
committerThorsten Behrens <thorsten.behrens@allotropia.de>2022-05-22 21:35:42 +0200
commit6204336cc7242ff1b0fdc26ccb7f8dd4f362fb78 (patch)
tree200376336c9b9e63ea91ddb3df073c4add53b0a0 /instsetoo_native
parent5b74eb7d41bbcf2d35154ae8272f0e71be128b60 (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 'instsetoo_native')
-rw-r--r--instsetoo_native/CustomTarget_install.mk77
1 files changed, 31 insertions, 46 deletions
diff --git a/instsetoo_native/CustomTarget_install.mk b/instsetoo_native/CustomTarget_install.mk
index 0dab73ad904c..47b2ffe1a262 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -62,39 +62,18 @@ export LOCAL_COMMON_OUT := $(instsetoo_OUT)
instsetoo_native_WITH_LANG := en-US $(filter-out en-US,$(gb_WITH_LANG))
-ifeq (WNT,$(OS))
-define instsetoo_native_msitemplates
-
-TEMPLATE_DIR=$(dir $@)msi_templates \
-&& rm -rf $${TEMPLATE_DIR} \
-&& mkdir -p $${TEMPLATE_DIR}/Binary \
-&& for I in $(SRCDIR)/instsetoo_native/inc_$(1)/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
-endef
-else
-instsetoo_native_msitemplates :=
-endif
-
define instsetoo_native_install_command
-$(call instsetoo_native_msitemplates,$(1))
-$(call gb_Helper_print_on_error, \
-cd $(dir $@) \
-$(foreach pkgformat,$(5),\
-&& $(if $(filter-out archive,$(pkgformat)),ENABLE_STRIP=1) $(PERL) -w $< \
- -f $(BUILDDIR)/instsetoo_native/util/openoffice.lst \
- -l $(subst $(WHITESPACE),$(COMMA),$(strip $(2))) \
- -p $(PRODUCTNAME_WITHOUT_SPACES)$(3) \
- -u $(instsetoo_OUT) \
- -packer $(COMPRESSIONTOOL) \
- -buildid $(if $(filter deb0 rpm0,$(pkgformat)$(LIBO_VERSION_PATCH)),1,$(LIBO_VERSION_PATCH)) \
- $(if $(filter WNT,$(OS)), \
- -msitemplate $(dir $@)msi_templates \
- -msilanguage $(dir $@)win_ulffiles \
- ) \
- $(4) \
- -format $(pkgformat) \
- $(if $(verbose),-verbose,-quiet) \
-),$@.log)
+$(if $(GNUPARALLEL), \
+ $(call gb_Helper_print_on_error, \
+ cd $(dir $@) && \
+ $(GNUPARALLEL) -j $(PARALLELISM) $(SRCDIR)/solenv/bin/call_installer.sh $(if $(verbose),-verbose,-quiet) -- $(1) \
+ ,$@.log) \
+, \
+ $(call gb_Helper_print_on_error, \
+ cd $(dir $@) \
+ $(foreach curpkg,$(1),\
+ && $(SRCDIR)/solenv/bin/call_installer.sh $(if $(verbose),-verbose,-quiet) $(curpkg) \
+ ),$@.log))
endef
$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony:
@@ -102,13 +81,13 @@ $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony:
$(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),PRL)
rm -rf $(instsetoo_OUT)
ifeq (TRUE,$(LIBO_TEST_INSTALL))
- $(call instsetoo_native_install_command,openoffice,en-US,,,archive)
+ $(call instsetoo_native_install_command, "openoffice:en-US:::archive:nostrip")
unzip -q -d $(TESTINSTALLDIR) $(instsetoo_OUT)/$(PRODUCTNAME_WITHOUT_SPACES)/archive/install/en-US/LibreOffice*_archive.zip
mv $(TESTINSTALLDIR)/LibreOffice*_archive/LibreOffice*/* $(TESTINSTALLDIR)/
rmdir $(TESTINSTALLDIR)/LibreOffice*_archive/LibreOffice*
rmdir $(TESTINSTALLDIR)/LibreOffice*_archive
ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
- $(call instsetoo_native_install_command,sdkoo,en-US,_SDK,,archive)
+ $(call instsetoo_native_install_command, "sdkoo:en-US:_SDK::archive:nostrip")
unzip -q -d $(TESTINSTALLDIR) $(instsetoo_OUT)/$(PRODUCTNAME_WITHOUT_SPACES)_SDK/archive/install/en-US/LibreOffice*_archive_sdk.zip
mv $(TESTINSTALLDIR)/LibreOffice*_archive_sdk/LibreOffice*_SDK/sdk \
$(TESTINSTALLDIR)/
@@ -116,18 +95,24 @@ ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
rmdir $(TESTINSTALLDIR)/LibreOffice*_archive_sdk
endif
else # LIBO_TEST_INSTALL
- $(call instsetoo_native_install_command,openoffice,$(if $(filter WNT,$(OS)),$(instsetoo_native_WITH_LANG),en-US),,,$(PKGFORMAT))
-ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
- $(call instsetoo_native_install_command,sdkoo,en-US,_SDK,,$(PKGFORMAT))
-endif
-ifeq (HELP,$(filter HELP,$(BUILD_TYPE))$(filter MACOSX,$(OS)))
- $(foreach lang,$(gb_HELP_LANGS),\
- $(call instsetoo_native_install_command,ooohelppack,$(lang),,-helppack,$(PKGFORMAT)))
-endif
-ifneq (WNT,$(OS))
- $(foreach lang,$(instsetoo_native_WITH_LANG),\
- $(call instsetoo_native_install_command,ooolangpack,$(lang),,-languagepack,$(PKGFORMAT)))
-endif
+ $(call instsetoo_native_install_command, \
+ $(foreach pkgformat,$(PKGFORMAT),\
+ $(if $(filter WNT,$(OS)), \
+ "openoffice:$(subst $(WHITESPACE),$(COMMA),$(strip $(instsetoo_native_WITH_LANG))):::$(pkgformat):$(if $(filter-out archive,$(pkgformat)),strip,nostrip)" \
+ $(if $(filter ODK,$(BUILD_TYPE)), \
+ "sdkoo:en-US:_SDK::$(pkgformat):nostrip") \
+ $(if $(filter HELP,$(BUILD_TYPE)), \
+ $(foreach lang,$(gb_HELP_LANGS), \
+ "ooohelppack:$(lang)::-helppack:$(pkgformat):nostrip" )) \
+ , \
+ ":en-US:::$(pkgformat):$(if $(filter-out archive,$(pkgformat)),strip,nostrip)" \
+ $(if $(filter ODK,$(BUILD_TYPE)), \
+ ":en-US:_SDK::$(pkgformat):nostrip") \
+ $(if $(and $(filter HELP,$(BUILD_TYPE)), $(filter-out MACOSX,$(OS))), \
+ $(foreach lang,$(gb_HELP_LANGS), \
+ ":$(lang)::-helppack:$(pkgformat):nostrip" )) \
+ $(foreach lang,$(instsetoo_native_WITH_LANG), \
+ ":$(lang)::-languagepack:$(pkgformat):nostrip" ) )))
endif # LIBO_TEST_INSTALL
touch $@
$(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),PRL)