Kaydet (Commit) df0c6367 authored tarafından David Tardon's avatar David Tardon

fdo#63591 pack images referenced by .ui files

Change-Id: Ia7e932a98d3f2c8bca981261406798760b69f8e8
üst a47fa9ca
...@@ -47,13 +47,18 @@ $(packimages_DIR)/images.zip : \ ...@@ -47,13 +47,18 @@ $(packimages_DIR)/images.zip : \
$(packimages_DIR)/sorted.lst \ $(packimages_DIR)/sorted.lst \
$(packimages_DIR)/commandimagelist.ilst \ $(packimages_DIR)/commandimagelist.ilst \
$(call gb_Helper_optional,HELP,$(helpimages_DIR)/helpimg.ilst) \ $(call gb_Helper_optional,HELP,$(helpimages_DIR)/helpimg.ilst) \
$(call gb_Postprocess_get_target,AllResources) $(call gb_Postprocess_get_target,AllResources) \
$(call gb_Postprocess_get_target,AllUIConfigs)
$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2) $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),PRL,2)
$(call gb_Helper_abbreviate_dirs, \ $(call gb_Helper_abbreviate_dirs, \
$(PERL) $(SOLARENV)/bin/packimages.pl -g $(SRCDIR)/icon-themes/galaxy \ $(PERL) $(SOLARENV)/bin/packimages.pl -g $(SRCDIR)/icon-themes/galaxy \
-m $(SRCDIR)/icon-themes/galaxy -c $(packimages_DIR) \ -m $(SRCDIR)/icon-themes/galaxy -c $(packimages_DIR) \
$(call gb_Helper_optional,HELP,-l $(helpimages_DIR) ) \ $(call gb_Helper_optional,HELP,-l $(helpimages_DIR) ) \
-l $(packimages_DIR) -l $(dir $(call gb_ResTarget_get_imagelist_target)) -s $< -o $@ \ -l $(packimages_DIR) \
-l $(dir $(call gb_ResTarget_get_imagelist_target)) \
-l $(dir $(call gb_UIConfig_get_imagelist_target)) \
-l $(dir $(call gb_UIConfig_get_imagelist_target,modules/)) \
-s $< -o $@ \
$(if $(findstring s,$(MAKEFLAGS)),> /dev/null)) $(if $(findstring s,$(MAKEFLAGS)),> /dev/null))
$(packimages_DIR)/images_%.zip : \ $(packimages_DIR)/images_%.zip : \
......
<?xml version="1.0" encoding="UTF-8"?>
<!--
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/|node()">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="@*|text()|processing-instruction()|comment()"/>
<xsl:template match="property[@name='pixbuf']">
<xsl:variable name="inpath" select="normalize-space(.)"/>
<xsl:variable name="outpath">
<xsl:choose>
<xsl:when test="starts-with($inpath,'res/')">
<xsl:value-of select="concat('%GLOBALRES%/',substring-after($inpath,'res/'))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('%MODULE%/',$inpath)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:value-of select="$outpath"/>
<xsl:text>&#xA;</xsl:text>
</xsl:template>
</xsl:stylesheet>
...@@ -191,7 +191,9 @@ gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/SrsTemplatePartTarget/$(firstwo ...@@ -191,7 +191,9 @@ gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/SrsTemplatePartTarget/$(firstwo
gb_SrsTemplateTarget_get_include_dir = $(WORKDIR)/SrsTemplatePartTarget/$(firstword $(subst /, ,$(1))) gb_SrsTemplateTarget_get_include_dir = $(WORKDIR)/SrsTemplatePartTarget/$(firstword $(subst /, ,$(1)))
gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1)
gb_ThesaurusIndexTarget_get_target = $(WORKDIR)/ThesaurusIndexTarget/$(basename $(1)).idx gb_ThesaurusIndexTarget_get_target = $(WORKDIR)/ThesaurusIndexTarget/$(basename $(1)).idx
gb_UIConfig_get_target = $(WORKDIR)/UIConfig/$(1) gb_UIConfig_get_imagelist_target = $(WORKDIR)/UIConfig/$(1).ilst
gb_UIConfig_get_target = $(WORKDIR)/UIConfig/$(1).done
gb_UIImageListTarget_get_target = $(WORKDIR)/UIImageListTarget/$(1).ilst
gb_UILocalizeTarget_get_target = $(WORKDIR)/UILocalizeTarget/$(1).done gb_UILocalizeTarget_get_target = $(WORKDIR)/UILocalizeTarget/$(1).done
gb_UILocalizeTarget_get_workdir = $(WORKDIR)/UILocalizeTarget/$(1) gb_UILocalizeTarget_get_workdir = $(WORKDIR)/UILocalizeTarget/$(1)
gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml gb_UIMenubarTarget_get_target = $(WORKDIR)/UIMenubarTarget/$(1).xml
...@@ -311,6 +313,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ ...@@ -311,6 +313,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
CustomTarget \ CustomTarget \
ExternalProject \ ExternalProject \
UIConfig \ UIConfig \
UIImageListTarget \
UILocalizeTarget \ UILocalizeTarget \
UIMenubarTarget \ UIMenubarTarget \
UnoApiHeadersTarget \ UnoApiHeadersTarget \
......
...@@ -111,6 +111,49 @@ $(call gb_UIMenubarTarget_UIMenubarTarget_platform,$(1),$(2)) ...@@ -111,6 +111,49 @@ $(call gb_UIMenubarTarget_UIMenubarTarget_platform,$(1),$(2))
endef endef
# class UIImageListTarget
# Handles creation of image lists for .ui files.
gb_UIImageListTarget_COMMAND = $(call gb_ExternalExecutable_get_command,xsltproc)
gb_UIImageListTarget_DEPS = $(call gb_ExternalExecutable_get_dependencies,xsltproc)
gb_UIImageListTarget_XSLTFILE := $(SRCDIR)/solenv/bin/uiimagelist.xsl
# NOTE: for some reason xsltproc does not produce any file if there is
# no output, so we touch the target to make sure it exists.
define gb_UIImageListTarget__command
$(call gb_Output_announce,$(2),$(true),UIL,1)
$(call gb_Helper_abbreviate_dirs,\
$(gb_UIImageListTarget_COMMAND) -o $@ $(gb_UIImageListTarget_XSLTFILE) $(UIFILE) && \
touch $@ \
)
endef
$(dir $(call gb_UIImageListTarget_get_target,%)).dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(dir $(call gb_UIImageListTarget_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_UIImageListTarget_get_target,%) : $(gb_UIImageListTarget_DEPS) $(gb_UIImageListTarget_XSLTFILE)
$(call gb_UIImageListTarget__command,$@,$*)
.PHONY : $(call gb_UIImageListTarget_get_clean_target,%)
$(call gb_UIImageListTarget_get_clean_target,%) :
$(call gb_Output_announce,$(2),$(false),UIL,1)
rm -f $(call gb_UIImageListTarget_get_target,$*)
# Extract list of images referenced in a .ui file.
#
# gb_UIImageListTarget_UIImageListTarget uifile
define gb_UIImageListTarget_UIImageListTarget
$(call gb_UIImageListTarget_get_target,$(1)) : UIFILE := $(SRCDIR)/$(1).ui
$(call gb_UIImageListTarget_get_target,$(1)) : $(SRCDIR)/$(1).ui
$(call gb_UIImageListTarget_get_target,$(1)) :| $(dir $(call gb_UIImageListTarget_get_target,$(1))).dir
endef
# class UIConfig # class UIConfig
# Handles UI configuration files. # Handles UI configuration files.
...@@ -134,12 +177,17 @@ $(dir $(call gb_UIConfig_get_target,%)).dir : ...@@ -134,12 +177,17 @@ $(dir $(call gb_UIConfig_get_target,%)).dir :
$(dir $(call gb_UIConfig_get_target,%))%/.dir : $(dir $(call gb_UIConfig_get_target,%))%/.dir :
$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
$(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_target,%) : $(call gb_UIConfig_get_imagelist_target,%)
$(call gb_Output_announce,$*,$(true),UIC,2) $(call gb_Output_announce,$*,$(true),UIC,2)
$(call gb_Helper_abbreviate_dirs,\ $(call gb_Helper_abbreviate_dirs,\
touch $@ \ touch $@ \
) )
$(call gb_UIConfig_get_imagelist_target,%) :
$(call gb_Helper_abbreviate_dirs,\
sort -u $(UI_IMAGELISTS) /dev/null > $@ \
)
.PHONY : $(call gb_UIConfig_get_clean_target,%) .PHONY : $(call gb_UIConfig_get_clean_target,%)
$(call gb_UIConfig_get_clean_target,%) : $(call gb_UIConfig_get_clean_target,%) :
$(call gb_Output_announce,$*,$(false),UIC,2) $(call gb_Output_announce,$*,$(false),UIC,2)
...@@ -155,6 +203,8 @@ gb_UIConfig_get_packagesetname = UIConfig/$(1) ...@@ -155,6 +203,8 @@ gb_UIConfig_get_packagesetname = UIConfig/$(1)
# #
# gb_UIConfig_UIConfig modulename # gb_UIConfig_UIConfig modulename
define gb_UIConfig_UIConfig define gb_UIConfig_UIConfig
$(call gb_UIConfig_get_imagelist_target,$(1)) : UI_IMAGELISTS :=
$(call gb_PackageSet_PackageSet_internal,$(call gb_UIConfig_get_packagesetname,$(1))) $(call gb_PackageSet_PackageSet_internal,$(call gb_UIConfig_get_packagesetname,$(1)))
$(call gb_Package_Package_internal,$(call gb_UIConfig_get_packagename,$(1)),$(SRCDIR)) $(call gb_Package_Package_internal,$(call gb_UIConfig_get_packagename,$(1)),$(SRCDIR))
$(call gb_Package_Package_internal,$(call gb_UIConfig_get_packagename,$(1)_generated),$(WORKDIR)) $(call gb_Package_Package_internal,$(call gb_UIConfig_get_packagename,$(1)_generated),$(WORKDIR))
...@@ -164,6 +214,7 @@ $(call gb_Package_set_outdir,$(call gb_UIConfig_get_packagename,$(1)_generated), ...@@ -164,6 +214,7 @@ $(call gb_Package_set_outdir,$(call gb_UIConfig_get_packagename,$(1)_generated),
$(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(call gb_UIConfig_get_packagename,$(1))) $(call gb_PackageSet_add_package,$(call gb_UIConfig_get_packagesetname,$(1)),$(call gb_UIConfig_get_packagename,$(1)))
$(call gb_UIConfig_get_target,$(1)) :| $(dir $(call gb_UIConfig_get_target,$(1))).dir $(call gb_UIConfig_get_target,$(1)) :| $(dir $(call gb_UIConfig_get_target,$(1))).dir
$(call gb_UIConfig_get_imagelist_target,$(1)) :| $(dir $(call gb_UIConfig_get_imagelist_target,$(1))).dir
$(call gb_UIConfig_get_target,$(1)) : $(call gb_PackageSet_get_target,$(call gb_UIConfig_get_packagesetname,$(1))) $(call gb_UIConfig_get_target,$(1)) : $(call gb_PackageSet_get_target,$(call gb_UIConfig_get_packagesetname,$(1)))
$(call gb_Postprocess_get_target,AllUIConfigs) : $(call gb_UIConfig_get_target,$(1)) $(call gb_Postprocess_get_target,AllUIConfigs) : $(call gb_UIConfig_get_target,$(1))
$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_PackageSet_get_clean_target,$(call gb_UIConfig_get_packagesetname,$(1))) $(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_PackageSet_get_clean_target,$(call gb_UIConfig_get_packagesetname,$(1)))
...@@ -200,6 +251,11 @@ endef ...@@ -200,6 +251,11 @@ endef
# gb_UIConfig__add_uifile target file # gb_UIConfig__add_uifile target file
define gb_UIConfig__add_uifile define gb_UIConfig__add_uifile
$(call gb_UIConfig__package_uifile,$(1),$(call gb_UIConfig_get_packagename,$(1)),$(notdir $(2)).ui,$(2).ui) $(call gb_UIConfig__package_uifile,$(1),$(call gb_UIConfig_get_packagename,$(1)),$(notdir $(2)).ui,$(2).ui)
$(call gb_UIImageListTarget_UIImageListTarget,$(2))
$(call gb_UIConfig_get_imagelist_target,$(1)) : UI_IMAGELISTS += $(call gb_UIImageListTarget_get_target,$(2))
$(call gb_UIConfig_get_imagelist_target,$(1)) : $(call gb_UIImageListTarget_get_target,$(2))
$(call gb_UIConfig_get_clean_target,$(1)) : $(call gb_UIImageListTarget_get_clean_target,$(2))
endef endef
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment