[PATCH] impl. platform-specific processing for menubar configs

David Tardon (via Code Review) gerrit at gerrit.libreoffice.org
Sun Apr 7 07:06:43 PDT 2013


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/3232

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/32/3232/1

impl. platform-specific processing for menubar configs

This is the last step needed to obsolete
postprocess/packconfig/packconfig.pl.

Change-Id: Iad6de126a467aadc829244951f98fc8b202fbd95
---
M solenv/gbuild/TargetLocations.mk
M solenv/gbuild/UIConfig.mk
M solenv/gbuild/platform/IOS_ARM_GCC.mk
M solenv/gbuild/platform/WNT_INTEL_GCC.mk
M solenv/gbuild/platform/com_MSC_class.mk
M solenv/gbuild/platform/macosx.mk
M solenv/gbuild/platform/solaris.mk
M solenv/gbuild/platform/unxgcc.mk
8 files changed, 112 insertions(+), 3 deletions(-)



diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 49ed141..484b42c 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -194,6 +194,7 @@
 gb_UIConfig_get_target = $(WORKDIR)/UIConfig/$(1)
 gb_UILocalizeTarget_get_target = $(WORKDIR)/UILocalizeTarget/$(1).done
 gb_UILocalizeTarget_get_workdir = $(WORKDIR)/UILocalizeTarget/$(1)
+gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml
 gb_UnoApiTarget_get_external_headers_target = $(WORKDIR)/UnoApiTarget/$(1).external
 gb_UnoApiTarget_get_headers_target = $(WORKDIR)/UnoApiTarget/$(1).headers
 gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb
@@ -308,6 +309,7 @@
 	ExternalProject \
 	UIConfig \
 	UILocalizeTarget \
+	UIMenubarTarget \
 	UnoApiHeadersTarget \
 	UnoApiTarget \
 	UnpackedTarball \
diff --git a/solenv/gbuild/UIConfig.mk b/solenv/gbuild/UIConfig.mk
index 3aa008f..cf56de6 100644
--- a/solenv/gbuild/UIConfig.mk
+++ b/solenv/gbuild/UIConfig.mk
@@ -78,6 +78,39 @@
 
 endef
 
+# class UIMenubarTarget
+
+# Handles platform-specific processing of menubar config files.
+
+# defined by platform:
+#  gb_UIMenubarTarget_UIMenubarTarget_platform
+#  gb_UIMenubarTarget__command
+
+$(dir $(call gb_UIMenubarTarget_get_target,%)).dir :
+	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(dir $(call gb_UIMenubarTarget_get_target,%))%/.dir :
+	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(call gb_UIMenubarTarget_get_target,%) :
+	$(call gb_UIMenubarTarget__command,$@,$*,$<)
+
+.PHONY : $(call gb_UIMenubarTarget_get_clean_target,%)
+$(call gb_UIMenubarTarget_get_clean_target,%) :
+	$(call gb_Output_announce,$(2),$(false),UIM,1)
+	rm -f $(call gb_UIMenubarTarget_get_target,$*)
+
+# Process a menubar configuration file.
+#
+# gb_UIMenubarTarget_UIMenubarTarget target source
+define gb_UIMenubarTarget_UIMenubarTarget
+$(call gb_UIMenubarTarget_get_target,$(1)) : $(2)
+$(call gb_UIMenubarTarget_get_target,$(1)) :| $(dir $(call gb_UIMenubarTarget_get_target,$(1))).dir
+
+$(call gb_UIMenubarTarget_UIMenubarTarget_platform,$(1),$(2))
+
+endef
+
 # class UIConfig
 
 # Handles UI configuration files.
@@ -242,13 +275,23 @@
 
 endef
 
+define gb_UIConfig__add_menubarfile
+$(call gb_UIMenubarTarget_UIMenubarTarget,$(2),$(3))
+$(call gb_Package_add_file,$(call gb_UIConfig_get_packagename,$(1)_generated),xml/uiconfig/$(1)/menubar/$(notdir $(2)).xml,$(subst $(WORKDIR)/,,$(call gb_UIMenubarTarget_get_target,$(2))))
+$(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(call gb_UIConfig_get_packagename,$(1)_generated))
+
+$(call gb_Package_get_target,$(call gb_UIConfig_get_packagename,$(1)_generated)) : $(call gb_UIMenubarTarget_get_target,$(2))
+$(call gb_Package_get_clean_target,$(call gb_UIConfig_get_packagename,$(1)_generated)) : $(call gb_UIMenubarTarget_get_clean_target,$(2))
+
+endef
+
 # Add menubar config file to the package.
 #
 # The file is relative to $(SRCDIR) and without extension.
 #
 # gb_UIConfig_add_menubarfile target file
 define gb_UIConfig_add_menubarfile
-$(call gb_UIConfig__add_xmlfile,$(1),$(1),menubar,$(2))
+$(call gb_UIConfig__add_menubarfile,$(1),$(2),$(SRCDIR)/$(2).xml)
 
 endef
 
@@ -266,8 +309,7 @@
 #
 # gb_UIConfig_add_generated_menubarfile target file
 define gb_UIConfig_add_generated_menubarfile
-$(call gb_UIConfig__add_xmlfile,$(1),$(1)_generated,menubar,$(2))
-$(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(call gb_UIConfig_get_packagename,$(1)_generated))
+$(call gb_UIConfig__add_menubarfile,$(1),$(2),$(WORKDIR)/$(2).xml)
 
 endef
 
diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk
index e0d8b06..466a821 100644
--- a/solenv/gbuild/platform/IOS_ARM_GCC.mk
+++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk
@@ -286,6 +286,16 @@
 # Package class
 gb_Package_SDKDIRNAME := sdk
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+cp $(3) $(1)
+
+endef
+
+gb_UIMenubarTarget_UIMenubarTarget_platform :=
+
 # Python
 gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
 
diff --git a/solenv/gbuild/platform/WNT_INTEL_GCC.mk b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
index ecb829e..c1d6f39 100644
--- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk
+++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk
@@ -418,6 +418,16 @@
 # Package class
 gb_Package_SDKDIRNAME := sdk
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+cp $(3) $(1)
+
+endef
+
+gb_UIMenubarTarget_UIMenubarTarget_platform :=
+
 # Python
 gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR_FOR_BUILD)/bin" PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
 
diff --git a/solenv/gbuild/platform/com_MSC_class.mk b/solenv/gbuild/platform/com_MSC_class.mk
index 55aff01..ed29dca 100755
--- a/solenv/gbuild/platform/com_MSC_class.mk
+++ b/solenv/gbuild/platform/com_MSC_class.mk
@@ -594,6 +594,16 @@
 # Package class
 gb_Package_SDKDIRNAME := sdk
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+cp $(3) $(1)
+
+endef
+
+gb_UIMenubarTarget_UIMenubarTarget_platform :=
+
 # Python
 gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME="$(OUTDIR_FOR_BUILD)/lib/python" PYTHONPATH="$(OUTDIR_FOR_BUILD)/lib/python;$(OUTDIR_FOR_BUILD)/lib/python/lib-dynload"
 
diff --git a/solenv/gbuild/platform/macosx.mk b/solenv/gbuild/platform/macosx.mk
index 4eabc92..c6c72df 100644
--- a/solenv/gbuild/platform/macosx.mk
+++ b/solenv/gbuild/platform/macosx.mk
@@ -361,6 +361,21 @@
 # Package class
 gb_Package_SDKDIRNAME := LibreOffice$(PRODUCTVERSION)_SDK
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+$(call gb_ExternalExecutable_get_command,xsltproc) -o $(1) $(UI_MENUBAR_XSLT) $(3)
+
+endef
+
+define gb_UIMenubarTarget_UIMenubarTarget_platform
+$(call gb_UIMenubarTarget_get_target,$(1)) : UI_MENUBAR_XSLT := $(SRCDIR)/postprocess/packconfig/macosx/macosx_menubar_modification.xsl
+$(call gb_UIMenubarTarget_get_target,$(1)) : $(SRCDIR)/postprocess/packconfig/macosx/macosx_menubar_modification.xsl
+$(call gb_UIMenubarTarget_get_target,$(1)) :| $(call gb_ExternalExecutable_get_dependencies,xsltproc)
+
+endef
+
 # Python
 gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
 
diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk
index 037a1a1..968b1a3 100644
--- a/solenv/gbuild/platform/solaris.mk
+++ b/solenv/gbuild/platform/solaris.mk
@@ -412,6 +412,16 @@
 # Package class
 gb_Package_SDKDIRNAME := sdk
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+cp $(3) $(1)
+
+endef
+
+gb_UIMenubarTarget_UIMenubarTarget_platform :=
+
 # Python
 gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
 
diff --git a/solenv/gbuild/platform/unxgcc.mk b/solenv/gbuild/platform/unxgcc.mk
index 14f5882..e295edb 100644
--- a/solenv/gbuild/platform/unxgcc.mk
+++ b/solenv/gbuild/platform/unxgcc.mk
@@ -410,6 +410,16 @@
 # Package class
 gb_Package_SDKDIRNAME := sdk
 
+# UIMenubarTarget class
+
+define gb_UIMenubarTarget__command
+$(call gb_Output_announce,$(2),$(true),UIM,1)
+cp $(3) $(1)
+
+endef
+
+gb_UIMenubarTarget_UIMenubarTarget_platform :=
+
 # Python
 gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
 

-- 
To view, visit https://gerrit.libreoffice.org/3232
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iad6de126a467aadc829244951f98fc8b202fbd95
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: master
Gerrit-Owner: David Tardon <dtardon at redhat.com>



More information about the LibreOffice mailing list