config_host.mk.in                        |    1 
 configure.ac                             |    4 -
 instsetoo_native/CustomTarget_install.mk |  114 ++++++++++++++++---------------
 solenv/bin/call_installer.sh             |   15 ----
 4 files changed, 63 insertions(+), 71 deletions(-)

New commits:
commit 0a89c1d929dfef0b178f6911ec8d7b1efd0c34b5
Author:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
AuthorDate: Mon Dec 5 18:14:17 2022 +0100
Commit:     Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
CommitDate: Thu Dec 8 15:18:30 2022 +0000

    build installer packages with make parallelism instead of GNU parallel
    
    6204336cc7242ff1b0fdc26ccb7f8dd4f362fb78 added support for building 
installsets
    in parrallel using the GNU parallel tool, this patch changes that to use 
make's
    own parallelism, dropping the need for the external tool.
    
    By not creating huge commandline for all packages at once/sequentially, the
    workarounds to modify the PATH variable can also be dropped.
    
    Since : is a special character in makefiles separating a target from
    prerequisites delimiter in the installer-tuples has been changed to the
    hyphenation point.
    
    The dependencies on the install.phony target have been moved to the actual
    installset targets (and those are .PHONY targets as well since the target 
file
    isn't actually generatead).
    
    Also unify the tuples for the different platforms, even if the first 
element is
    only used for Windows.
    
    Move the msi templates to a separate directory for the different types, so 
that
    packaging can also be done in parallel on Windows. Move the setup back to 
the
    makefile so it can be setup prior to running the script.
    
    Previoulsy the script used grep to remove comments from the msi template 
files,
    and had to use "|| true" since grep would also return error when not 
finding a
    match/on empty files. Switch that to awk so it can run without that 
workaround.
    
    Change-Id: I2f8b73e04d0f601cb0b4e2d8352a38ef9957bc17
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143679
    Tested-by: Jenkins
    Reviewed-by: Thorsten Behrens <thorsten.behr...@allotropia.de>
    Reviewed-by: Christian Lohmaier <lohmaier+libreoff...@googlemail.com>
    (cherry picked from commit b14c1066356e76412aac8bb1ee17cf02bfbd182a)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143715

diff --git a/config_host.mk.in b/config_host.mk.in
index b9aa72a2cadb..8fa172b89a87 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -259,7 +259,6 @@ export GIO_LIBS=$(gb_SPACE)@GIO_LIBS@
 export GIT_REFERENCE_SRC=@GIT_REFERENCE_SRC@
 export GIT_LINK_SRC=@GIT_LINK_SRC@
 export GIT_NEEDED_SUBMODULES=@GIT_NEEDED_SUBMODULES@
-export GNUPARALLEL=@GNUPARALLEL@
 export EPOXY_CFLAGS=$(gb_SPACE)@EPOXY_CFLAGS@
 export EPOXY_LIBS=$(gb_SPACE)@EPOXY_LIBS@
 export GLM_CFLAGS=$(gb_SPACE)@GLM_CFLAGS@
diff --git a/configure.ac b/configure.ac
index b9e13de79a57..e0b7d1a32812 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2942,10 +2942,6 @@ if test -z "$COMPRESSIONTOOL"; then
 fi
 AC_SUBST(COMPRESSIONTOOL)
 
-# use GNU parallel for packaging, if available
-AC_PATH_PROG(GNUPARALLEL, parallel)
-AC_SUBST(GNUPARALLEL)
-
 AC_MSG_CHECKING([for GNU or BSD tar])
 for a in $GNUTAR gtar gnutar tar bsdtar /usr/sfw/bin/gtar; do
     $a --version 2> /dev/null | egrep "GNU|bsdtar"  2>&1 > /dev/null
diff --git a/instsetoo_native/CustomTarget_install.mk 
b/instsetoo_native/CustomTarget_install.mk
index e4642c6ed6d2..fd27209c533e 100644
--- a/instsetoo_native/CustomTarget_install.mk
+++ b/instsetoo_native/CustomTarget_install.mk
@@ -29,16 +29,6 @@ $(eval $(call 
gb_CustomTarget_register_targets,instsetoo_native/install,\
 
 .PHONY: $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony
 
-$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony: \
-       $(SRCDIR)/solenv/bin/make_installer.pl \
-       $(foreach ulf,$(instsetoo_ULFLIST),$(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/$(ulf).ulf) \
-       $(if $(filter-out WNT,$(OS)),\
-               $(addprefix $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/,\
-                       bin/find-requires-gnome.sh \
-                       bin/find-requires-x11.sh) \
-       ) \
-       $(call gb_Postprocess_get_target,AllModulesButInstsetNative)
-
 $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/bin/find-requires-%.sh: 
$(SRCDIR)/instsetoo_native/inc_openoffice/unix/find-requires-%.sh
        cat $< | tr -d "\015" > $@
        chmod a+x $@
@@ -60,63 +50,81 @@ export instsetoo_OUT := $(WORKDIR)/installation
 export LOCAL_OUT := $(instsetoo_OUT)
 export LOCAL_COMMON_OUT := $(instsetoo_OUT)
 
-instsetoo_native_WITH_LANG := en-US $(filter-out en-US,$(gb_WITH_LANG))
-
-define instsetoo_native_install_command
-$(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 $@) \
-    $(if $(filter WNT,$(OS)), \
-       && PATH="$(shell cygpath -u $(SRCDIR)/solenv/bin):$$PATH" \
-    , \
-       && PATH="$(SRCDIR)/solenv/bin:$$PATH") \
-    $(foreach curpkg,$(1),\
-    && call_installer.sh $(if $(verbose),-verbose,-quiet) $(curpkg) \
-    ),$@.log))
-endef
-
-$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony:
+ifeq (WNT,$(OS))
+instsetoo_installer_langs := $(subst $(WHITESPACE),$(COMMA),$(strip en-US 
$(filter-out en-US,$(gb_WITH_LANG))))
+else
+instsetoo_installer_langs := en-US
+endif
+
+# delimiter is U+2027 Hyphenation point - files with colon in their name 
confuse the heck out of
+# make and cannot be used as targets or prerequisites. For passing to 
call_installer.sh it is
+# substituted by the : so that cut doesn't stumble over the delimiter
+ifeq (TRUE,$(LIBO_TEST_INSTALL))
+instsetoo_installer_targets = openoffice‧en-US‧‧‧archive‧nostrip
+ifeq (ODK,$(filter ODK,$(BUILD_TYPE)))
+instsetoo_installer_targets += sdkoo‧en-US‧_SDK‧‧archive‧nostrip
+endif
+else
+instsetoo_installer_targets := $(foreach pkgformat,$(PKGFORMAT),\
+        openoffice‧$(instsetoo_installer_langs)‧‧‧$(pkgformat)‧$(if 
$(filter-out archive,$(pkgformat)),strip,nostrip) \
+        $(if $(filter 
ODK,$(BUILD_TYPE)),sdkoo‧en-US‧_SDK‧‧$(pkgformat)‧nostrip) \
+        $(if $(and $(filter HELP,$(BUILD_TYPE)),$(filter-out MACOSX,$(OS))), \
+            $(foreach 
lang,$(gb_HELP_LANGS),ooohelppack‧$(lang)‧‧-helppack‧$(pkgformat)‧nostrip)) \
+        $(if $(filter-out WNT,$(OS)), \
+            $(foreach lang,$(filter-out 
en-US,$(gb_WITH_LANG)),ooolangpack‧$(lang)‧‧-languagepack‧$(pkgformat)‧nostrip)))
+endif
+
+instsetoo_wipe:
+       $(call gb_Output_announce,wiping installation output dir,$(true),WIPE,6)
+       rm -rf $(instsetoo_OUT)
+
+# list both as prerequisites so that make won't treat the $(template) one as 
intermediate /
+# won't attempt to delete it after the $(template)/Binary and the rest of the 
chain was made
+instsetoo_msi_templates: $(foreach template,openoffice ooohelppack 
sdkoo,$(addprefix \
+        $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_templates/,$(template)
 $(template)/Binary))
+
+# use awk instead of grep to not have to deal with grep exiting with error on 
files with no comments
+$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_templates/%: 
$(SRCDIR)/instsetoo_native/inc_%/windows/msi_templates/*.*
+       $(call gb_Output_announce,setting up msi templates for type 
$(@F),$(true),AWK,4)
+       rm -rf $@ && mkdir -p $@ && cd $@ $(foreach file,$(^F),&& awk 
'!/^#/{print}' $(<D)/$(file) > $(file))
+
+$(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_templates/%/Binary: 
$(SRCDIR)/instsetoo_native/inc_common/windows/msi_templates/Binary/*.* \
+            $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/msi_templates/%
+       $(call gb_Output_announce,setting up msi templates for type $* - 
copying binary assets,$(true),CPY,4)
+       rm -rf $@ && mkdir -p $@ && cd $@ && cp 
$(SRCDIR)/instsetoo_native/inc_common/windows/msi_templates/Binary/*.* ./
+
+# with all languages the logfile name would be too long when building the 
windows installation set,
+# that's the reason for the substitution to multilang below in case more than 
just en-US is packaged
+$(instsetoo_installer_targets): $(SRCDIR)/solenv/bin/make_installer.pl \
+        $(foreach ulf,$(instsetoo_ULFLIST),$(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/win_ulffiles/$(ulf).ulf) \
+        $(if $(filter-out WNT,$(OS)),\
+            $(addprefix $(call 
gb_CustomTarget_get_workdir,instsetoo_native/install)/,\
+                bin/find-requires-gnome.sh \
+                bin/find-requires-x11.sh) \
+        ,instsetoo_msi_templates) \
+        $(call gb_Postprocess_get_target,AllModulesButInstsetNative) | 
instsetoo_wipe
+       $(call gb_Output_announce,$(if $(filter 
en-US$(COMMA)%,$(instsetoo_installer_langs)),$(subst 
$(instsetoo_installer_langs),multilang,$@),$@),$(true),INST,1)
+       $(call gb_Trace_StartRange,$@,INSTALLER)
+       $(call gb_Helper_print_on_error, \
+           $(SRCDIR)/solenv/bin/call_installer.sh $(if 
$(verbose),-verbose,-quiet) $(subst ‧,:,$@),\
+           $(call gb_CustomTarget_get_workdir,instsetoo_native/install)/$(if 
$(filter en-US$(COMMA)%,$(instsetoo_installer_langs)),$(subst 
$(instsetoo_installer_langs),multilang,$@),$@).log)
+       $(call gb_Trace_EndRange,$@,INSTALLER)
+
+$(call gb_CustomTarget_get_workdir,instsetoo_native/install)/install.phony: 
$(instsetoo_installer_targets)
        $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
        $(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: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: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)/
        rmdir $(TESTINSTALLDIR)/LibreOffice*_archive_sdk/LibreOffice*_SDK
        rmdir $(TESTINSTALLDIR)/LibreOffice*_archive_sdk
 endif
-else # LIBO_TEST_INSTALL
-       $(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)
diff --git a/solenv/bin/call_installer.sh b/solenv/bin/call_installer.sh
index f1db809f7faf..8b8032f7f386 100755
--- a/solenv/bin/call_installer.sh
+++ b/solenv/bin/call_installer.sh
@@ -20,21 +20,10 @@ 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"
+if [ "${OS}" = "WNT" ] && [ -n "${MSITEMPL}" ]; then
+    EXTRA_PARAMS="${EXTRA_PARAMS} -msitemplate 
${WORKDIR}/CustomTarget/instsetoo_native/install/msi_templates/${MSITEMPL}"
     EXTRA_PARAMS="${EXTRA_PARAMS} -msilanguage 
${WORKDIR}/CustomTarget/instsetoo_native/install/win_ulffiles"
 fi
 

Reply via email to