gbuild: add support for extension description l10n

This commit is contained in:
Michael Stahl
2011-11-04 22:31:36 +01:00
parent 4570fe5875
commit fddb39b14d
9 changed files with 62 additions and 6 deletions

View File

@@ -33,6 +33,12 @@ gb_Extension_LICENSEFILE := license.txt
else
gb_Extension_LICENSEFILE := LICENSE
endif
gb_Extension_XRMEXTARGET := $(call gb_Executable_get_target,xrmex)
gb_Extension_XRMEXCOMMAND := \
$(gb_XRMEXPRECOMMAND) $(gb_Extension_XRMEXTARGET)
gb_Extension_SDFLOCATION := $(SRCDIR)/translations/$(INPATH)/misc/sdf/
# does not contain en-US because it is special cased in gb_Extension_Extension
gb_Extension_LANGS := $(filter-out en-US,$(gb_WITH_LANG))
# remove extension directory in workdir and oxt file in workdir and outdir
$(call gb_Extension_get_clean_target,%) :
@@ -42,18 +48,41 @@ $(call gb_Extension_get_clean_target,%) :
rm -f $(call gb_Extension_get_target,$*) && \
rm -f $(call gb_Extension_get_outdir_target,$*))
ifeq ($(strip $(gb_WITH_LANG)),)
$(call gb_Extension_get_workdir,%)/description.xml :
$(call gb_Output_announce,$*/description.xml,$(true),CPY,3)
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(call gb_Extension_get_workdir,$*) && \
cp -f $(LOCATION)/description.xml $@)
else
$(call gb_Extension_get_workdir,%)/description.xml : | \
$(gb_Extension_XRMEXTARGET)
$(call gb_Output_announce,$*/description.xml,$(true),XRM,3)
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(call gb_Extension_get_workdir,$*) && \
$(gb_Extension_XRMEXCOMMAND) \
-p $(PRJNAME) \
-i $(filter %.xml,$^) \
-o $@ \
-m $(SDF) \
-l all)
endif
# rule to create oxt package in workdir
# --filesync makes sure that all files in the oxt package will be removed that no longer are in $(FILES)
$(call gb_Extension_get_target,%) :
$(call gb_Extension_get_target,%) : \
$(call gb_Extension_get_workdir,%)/description.xml
$(call gb_Output_announce,$*,$(true),OXT,3)
$(call gb_Helper_abbreviate_dirs_native,\
mkdir -p $(call gb_Extension_get_workdir,$*)/META-INF && \
mkdir -p $(call gb_Extension_get_workdir,$*)/registration && \
cp -f $(LOCATION)/description.xml $(call gb_Extension_get_workdir,$*) && \
mkdir -p $(call gb_Extension_get_workdir,$*)/META-INF \
$(call gb_Extension_get_workdir,$*)/registration && \
cp -f $(LOCATION)/manifest.xml $(call gb_Extension_get_workdir,$*)/META-INF && \
cp -f $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) $(call gb_Extension_get_workdir,$*)/registration && \
cd $(call gb_Extension_get_workdir,$*) && \
$(gb_Extension_ZIPCOMMAND) -rX --filesync $(call gb_Extension_get_target,$*) $(FILES) )
$(gb_Extension_ZIPCOMMAND) -rX --filesync \
$(call gb_Extension_get_target,$*) \
$(FILES) \
$(foreach lang,$(gb_Extension_LANGS),description-$(lang).txt))
# TODO: needs dependency on $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) once readlicense_oo will be gbuildized
# or just another simpler solution
@@ -65,6 +94,13 @@ $(call gb_Extension_get_target,%) :
define gb_Extension_Extension
$(call gb_Extension_get_target,$(1)) : FILES := META-INF description.xml registration
$(call gb_Extension_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2)
$(call gb_Extension_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2)))
$(call gb_Extension_get_target,$(1)) : \
SDF := $(gb_Extension_SDFLOCATION)$(2)/localize.sdf
$(call gb_Extension_get_workdir,$(1))/description.xml : \
$(SRCDIR)/$(2)/description.xml \
$(if $(gb_WITH_LANG),$(gb_Extension_SDFLOCATION)$(2)/localize.sdf)
$(call gb_Extension_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt)
$(eval $(call gb_Module_register_target,$(call gb_Extension_get_outdir_target,$(1)),$(call gb_Extension_get_clean_target,$(1))))
$(call gb_Deliver_add_deliverable,$(call gb_Extension_get_outdir_target,$(1)),$(call gb_Extension_get_target,$(1)),$(1))
$(call gb_Extension_get_outdir_target,$(1)) : $(call gb_Extension_get_target,$(1))

View File

@@ -63,4 +63,7 @@ gb_UnoApiTarget_REGVIEWCOMMAND := $(gb_Helper_set_ld_path) SOLARBINDIR=$(OUTDIR_
# Configuration
gb_CFGEXPRECOMMAND := $(gb_Helper_set_ld_path)
# Extension
gb_XRMEXPRECOMMAND := $(gb_Helper_set_ld_path)
# vim: set noet sw=4:

View File

@@ -449,4 +449,7 @@ gb_CFGEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
# Extension
gb_XRMEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR_FOR_BUILD)/lib
# vim: set noet sw=4:

View File

@@ -542,4 +542,7 @@ gb_CFGEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
# Python
gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
# Extension
gb_XRMEXPRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib
# vim: set noet sw=4:

View File

@@ -417,4 +417,7 @@ gb_CFGEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
# Python
gb_PYTHON_PRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
# Extension
gb_XRMEXPRECOMMAND := LD_LIBRARY_PATH=$(OUTDIR)/lib
# vim: set noet sw=4:

View File

@@ -541,4 +541,7 @@ gb_CFGEXPRECOMMAND := $(gb_Helper_set_ld_path)
# Python
gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload
# Extension
gb_XRMEXPRECOMMAND := $(gb_Helper_set_ld_path)
# vim: set noet sw=4:

View File

@@ -787,4 +787,7 @@ gb_CFGEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
# Python
gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" PYTHONHOME="$(OUTDIR)/lib/python" PYTHONPATH="$(OUTDIR)/lib/python;$(OUTDIR)/lib/python/lib-dynload"
# Extension
gb_XRMEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
# vim: set noet sw=4:

View File

@@ -692,4 +692,7 @@ gb_CFGEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
# Python
gb_PYTHON_PRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin" PYTHONHOME="$(OUTDIR)/lib/python" PYTHONPATH="$(OUTDIR)/lib/python;$(OUTDIR)/lib/python/lib-dynload"
# Extension
gb_XRMEXPRECOMMAND := PATH="$${PATH}:$(OUTDIR)/bin"
# vim: set noet sw=4:

View File

@@ -53,7 +53,6 @@ $(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/script.xlb,$(WIKIS
$(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/dialog.xlb,$(WIKISRC)/dialogs/dialog.xlb))
$(eval $(call gb_Extension_add_file,wiki-publisher,WikiEditor/SendToMediaWiki.xdl,$(WIKISRC)/dialogs/SendToMediaWiki.xdl))
$(eval $(call gb_Extension_add_file,wiki-publisher,filter/odt2mediawiki.xsl,$(WIKISRC)/src/filter/odt2mediawiki.xsl))
$(eval $(call gb_Extension_add_file,wiki-publisher,description-en-US.txt,$(WIKISRC)/src/description-en-US.txt))
$(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikisend.xhp,$(WIKISRC)/help/wikisend.xhp))
$(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikiformats.xhp,$(WIKISRC)/help/wikiformats.xhp))
$(eval $(call gb_Extension_add_file,wiki-publisher,help/en-US/com.sun.wiki-publisher/wikiaccount.xhp,$(WIKISRC)/help/wikiaccount.xhp))