Makefile.top | 2 Module_tail_build.mk | 3 postprocess/prj/build.lst | 2 solenv/gbuild/Dictionary.mk | 178 +++++++++++++++++++++++ solenv/gbuild/Extension.mk | 182 +++-------------------- solenv/gbuild/ExtensionTarget.mk | 244 ++++++++++++++++++++++++++++++++ solenv/gbuild/TargetLocations.mk | 15 + solenv/gbuild/gbuild.mk | 2 solenv/gbuild/platform/IOS_ARM_GCC.mk | 4 solenv/gbuild/platform/WNT_INTEL_GCC.mk | 4 solenv/gbuild/platform/WNT_INTEL_MSC.mk | 4 solenv/gbuild/platform/macosx.mk | 4 solenv/gbuild/platform/solaris.mk | 4 solenv/gbuild/platform/unxgcc.mk | 4 14 files changed, 493 insertions(+), 159 deletions(-)
New commits: commit 3d2c49ce800a64eab63c204874c260a75adb6c9c Author: David Tardon <dtar...@redhat.com> Date: Tue Aug 7 20:15:02 2012 +0200 add dictionaries to tail_build Change-Id: If898ad805a1530d201650429b988c2866fb62512 diff --git a/Module_tail_build.mk b/Module_tail_build.mk index 0ac0f53..38b795d 100644 --- a/Module_tail_build.mk +++ b/Module_tail_build.mk @@ -46,6 +46,9 @@ $(eval $(call gb_Module_add_moduledirs,tail_end,\ cui \ dbaccess \ desktop \ + $(if $(filter DICTIONARIES,$(BUILD_TYPE)),\ + dictionaries \ + ) \ dtrans \ drawinglayer \ editeng \ diff --git a/postprocess/prj/build.lst b/postprocess/prj/build.lst index 72332e1..819a19c 100644 --- a/postprocess/prj/build.lst +++ b/postprocess/prj/build.lst @@ -1,4 +1,4 @@ -po postprocess :: BINFILTER:binfilter CRASHREP:crashrep CT2N:ct2n EPM:epm extras HELP:helpcontent2 LIBRSVG:librsvg ODK:odk MORE_FONTS:more_fonts DICTIONARIES:dictionaries LANGUAGETOOL:languagetool MYSQLC:mysqlc DESKTOP:setup_native STLPORT:stlport sysui tail_build NULL +po postprocess :: BINFILTER:binfilter CRASHREP:crashrep CT2N:ct2n EPM:epm extras HELP:helpcontent2 LIBRSVG:librsvg ODK:odk MORE_FONTS:more_fonts LANGUAGETOOL:languagetool MYSQLC:mysqlc DESKTOP:setup_native STLPORT:stlport sysui tail_build NULL po postprocess usr1 - all po_mkout NULL po postprocess\checkxml nmake - all po_checkxml NULL po postprocess\packconfig nmake - all po_packconfig po_checkxml NULL commit 6fa970fb62ce5825640be1b5ce0e0c066e0e5fbd Author: David Tardon <dtar...@redhat.com> Date: Tue Aug 7 20:12:38 2012 +0200 gbuildize dictionaries Change-Id: I8aec0d6b6e7ccc6c674ee98d6a9eb28785ee42b2 diff --git a/Makefile.top b/Makefile.top index 4361777..2622e3e 100644 --- a/Makefile.top +++ b/Makefile.top @@ -53,6 +53,7 @@ cpputools\ cui\ dbaccess\ desktop\ +dictionaries \ drawinglayer\ dtrans\ editeng\ @@ -177,7 +178,6 @@ cppunit\ crashrep\ ct2n\ curl\ -dictionaries \ epm\ expat\ external\ commit 75df7739309ccc5342084e668d9d869620cb3233 Author: David Tardon <dtar...@redhat.com> Date: Tue Aug 7 20:07:47 2012 +0200 add support for dictionaries to gbuild Change-Id: I7d3c066a72c68bdc0b55150714041908bb613f14 diff --git a/solenv/gbuild/Dictionary.mk b/solenv/gbuild/Dictionary.mk new file mode 100644 index 0000000..c40e376 --- /dev/null +++ b/solenv/gbuild/Dictionary.mk @@ -0,0 +1,178 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# 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/. +# + +# ThesaurusIndexTarget class + +gb_ThesaurusIndexTarget_CHECK_TARGET := $(SRCDIR)/dictionaries/util/th_check.pl +gb_ThesaurusIndexTarget_CHECK_COMMAND := PERL_UNICODE=0 $(PERL) -w $(gb_ThesaurusIndexTarget_CHECK_TARGET) +gb_ThesaurusIndexTarget_INDEX_TARGET := $(call gb_Executable_get_target_for_build,idxdict) +gb_ThesaurusIndexTarget_INDEX_COMMAND := $(gb_Helper_set_ld_path) $(gb_ThesaurusIndexTarget_INDEX_TARGET) + +define gb_ThesaurusIndexTarget__command +$(call gb_Output_announce,$(2),$(true),THI,1) +$(call gb_Helper_abbreviate_dirs,\ + $(gb_ThesaurusIndexTarget_INDEX_COMMAND) -o $(1) < $(THESAURUS_FILE) \ +) +endef + #$(gb_ThesaurusIndexTarget_CHECK_COMMAND) $(THESAURUS_FILE) && \ + +$(dir $(call gb_ThesaurusIndexTarget_get_target,%)).dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(dir $(call gb_ThesaurusIndexTarget_get_target,%))%/.dir : + $(if $(wildcard $(dir $@)),,mkdir -p $(dir $@)) + +$(call gb_ThesaurusIndexTarget_get_target,%) : $(gb_ThesaurusIndexTarget_INDEX_TARGET) | $(gb_ThesaurusIndexTarget_CHECK_TARGET) + $(call gb_ThesaurusIndexTarget__command,$@,$*) + +.PHONY : $(call gb_ThesaurusIndexTarget_get_clean_target,%) +$(call gb_ThesaurusIndexTarget_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),THI,1) + $(call gb_Helper_abbreviate_dirs,\ + rm -f $(call gb_ThesaurusIndexTarget_get_target,$*) \ + ) + +# Creates an index for a given thesaurus +# +# The thesaurus' file path is relative to $(SRCDIR). +# +# gb_ThesaurusIndexTarget_ThesaurusIndexTarget thesaurus +define gb_ThesaurusIndexTarget_ThesaurusIndexTarget +$(call gb_ThesaurusIndexTarget_get_target,$(1)) : THESAURUS_FILE := $(SRCDIR)/$(1) +$(call gb_ThesaurusIndexTarget_get_target,$(1)) : $(SRCDIR)/$(1) +$(call gb_ThesaurusIndexTarget_get_target,$(1)) :| $(dir $(call gb_ThesaurusIndexTarget_get_target,$(1))).dir + +endef + +# Dictionary class + +# Handles creation and delivery of dictionary extensions. + +gb_Dictionary_CONFIGURATION_FILE := dictionaries.xcu + +gb_Dictionary_extensionname = Dictionary/$(1) + +# Creates a dictionary extension +# +# gb_Dictionary_Dictionary dictionary srcdir +define gb_Dictionary_Dictionary +$(call gb_ExtensionTarget_ExtensionTarget,$(call gb_Dictionary_extensionname,$(1)),$(2)) +$(call gb_Dictionary_add_root_file,$(1),$(2)/$(gb_Dictionary_CONFIGURATION_FILE)) + +$(call gb_Dictionary_get_target,$(1)) : $(call gb_ExtensionTarget_get_target,$(call gb_Dictionary_extensionname,$(1))) +$(call gb_Dictionary_get_clean_target,$(1)) : $(call gb_ExtensionTarget_get_clean_target,$(call gb_Dictionary_extensionname,$(1))) + +$(call gb_Deliver_add_deliverable,$(call gb_Dictionary_get_target,$(1)),$(call gb_ExtensionTarget_get_target,$(call gb_Dictionary_extensionname,$(1))),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_Dictionary_get_target,$(1)),$(call gb_Dictionary_get_clean_target,$(1)))) + +endef + +# Adds a file from $(SRCDIR) to the dictionary under chosen name +# +# gb_Dictionary_add_file dictionary destfile sourcefile +define gb_Dictionary_add_file +$(call gb_ExtensionTarget_add_file,$(call gb_Dictionary_extensionname,$(1)),$(2),$(SRCDIR)/$(3)) + +endef + +# Adds several files from $(SRCDIR) to the dictionary at once +# +# The files are put into the chosen directory. +# +# gb_Dictionary_add_files dictionary destdir file(s) +define gb_Dictionary_add_files +$(call gb_ExtensionTarget_add_files,$(call gb_Dictionary_extensionname,$(1)),$(2),$(addprefix $(SRCDIR)/,$(3))) + +endef + +# Adds an arbitrary file to the dictionary under chosen name +# +# gb_Dictionary_add_file dictionary destfile sourcefile +define gb_Dictionary_add_generated_file +$(call gb_ExtensionTarget_add_file,$(call gb_Dictionary_extensionname,$(1)),$(2),$(3)) + +endef + +# Adds several arbitrary files to the dictionary at once +# +# The files are put into the chosen directory. +# +# gb_Dictionary_add_files dictionary destdir file(s) +define gb_Dictionary_add_generated_files +$(call gb_ExtensionTarget_add_files,$(call gb_Dictionary_extensionname,$(1)),$(2),$(3)) + +endef + +define gb_Dictionary__add_root_file +$(call gb_ExtensionTarget_add_file,$(call gb_Dictionary_extensionname,$(1)),$(notdir $(2)),$(2)) + +endef + +# Adds a file to the root dir of the dictionary +# +# gb_Dictionary_add_root_file dictionary file +define gb_Dictionary_add_root_file +$(call gb_Dictionary__add_root_file,$(1),$(SRCDIR)/$(2)) + +endef + +# Adds several files to the root dir of the dictionary +# +# gb_Dictionary_add_root_files dictionary file(s) +define gb_Dictionary_add_root_files +$(foreach file,$(2),$(call gb_Dictionary_add_root_file,$(1),$(file))) + +endef + +# Adds a thesaurus to the dictionary +# +# An index for the thesaurus is generated and added to the dictionary as +# well. +# +# gb_Dictionary_add_thesaurus dictionary thesaurus +define gb_Dictionary_add_thesaurus +$(call gb_ThesaurusIndexTarget_ThesaurusIndexTarget,$(2)) +$(call gb_Dictionary_add_root_file,$(1),$(2)) +$(call gb_Dictionary__add_root_file,$(1),$(call gb_ThesaurusIndexTarget_get_target,$(2))) + +endef + +# Adds several thesauri to the dictionary at once +# +# Indexes for the thesauri are generated and added to the dictionary as +# well. +# +# gb_Dictionary_add_thesauri dictionary thesauri +define gb_Dictionary_add_thesauri +$(foreach thesaurus,$(2),$(call gb_Dictionary_add_thesaurus,$(1),$(thesaurus))) + +endef + +# Adds a .property file to the dictionary under chosen name +# +# The file is localized automatically. +# +# gb_Dictionary_add_propertyfile dictionary destfile propertyfile +define gb_Dictionary_add_propertyfile +$(call gb_ExtensionTarget_localize_properties,$(call gb_Dictionary_extensionname,$(1)),$(2),$(SRCDIR)/$(3)) + +endef + +# Adds several .property files to the dictionary at once +# +# The files are put into chosen directory. They are localized automatically. +# +# gb_Dictionary_add_propertyfiles dictionary destdir propertyfile(s) +define gb_Dictionary_add_propertyfiles +$(foreach propertyfile,$(3),$(call gb_Dictionary_add_propertyfile,$(1),$(2)/$(notdir $(propertyfile)),$(propertyfile))) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 7822e2c..24704d3 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -29,6 +29,7 @@ # outdir target pattern gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component +gb_Dictionary_get_target = $(OUTDIR)/pck/$(1).oxt gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT) gb_Executable_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build) gb_Extension_get_target = $(OUTDIR)/bin/$(1).oxt @@ -143,6 +144,7 @@ gb_SrsTarget_get_target = $(WORKDIR)/SrsTarget/$(1).srs gb_SrsTemplatePartTarget_get_target = $(WORKDIR)/SrsTemplatePartTarget/$(firstword $(subst /, ,$(1)))/$(subst _tmpl,,$(notdir $(1))) gb_SrsTemplateTarget_get_include_dir = $(WORKDIR)/SrsTemplatePartTarget/$(firstword $(subst /, ,$(1))) gb_SrsTemplateTarget_get_target = $(WORKDIR)/SrsTemplateTarget/$(1) +gb_ThesaurusIndexTarget_get_target = $(WORKDIR)/ThesaurusIndexTarget/$(basename $(1)).idx gb_UnoApiTarget_get_target = $(WORKDIR)/UnoApiTarget/$(1).rdb gb_UnoApiHeadersTarget_get_bootstrap_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/bootstrap$(2) gb_UnoApiHeadersTarget_get_comprehensive_dir = $(WORKDIR)/UnoApiHeadersTarget/$(1)/comprehensive$(2) @@ -215,6 +217,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ SdiTarget \ SrsTarget \ SrsTemplateTarget \ + ThesaurusIndexTarget \ CppunitTest \ CustomTarget \ ExternalLib \ @@ -234,6 +237,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ )) $(eval $(call gb_Helper_make_outdir_clean_targets,\ + Dictionary \ Executable \ Extension \ InstallScript \ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index a77f57e..f782409 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -321,6 +321,7 @@ include $(foreach class, \ Zip \ Configuration \ ExtensionTarget \ + Dictionary \ Extension \ InstallModuleTarget \ InstallModule \ commit 9b93a2d9db4c245dc96387c0d341652142bd5d44 Author: David Tardon <dtar...@redhat.com> Date: Sun Aug 5 15:41:59 2012 +0200 change handling of description-LANG.txt Change-Id: Iecd7760af418f6e9ff7c9502e27011ee03962705 diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk index 18ff482..e501e18 100644 --- a/solenv/gbuild/Extension.mk +++ b/solenv/gbuild/Extension.mk @@ -30,6 +30,7 @@ define gb_Extension_Extension $(call gb_ExtensionTarget_ExtensionTarget,$(1),$(2)) $(call gb_ExtensionTarget_use_default_license,$(1)) +$(call gb_ExtensionTarget_use_default_description,$(1),$(2)) $(call gb_Extension_get_target,$(1)) : $(call gb_ExtensionTarget_get_target,$(1)) $(call gb_Extension_get_clean_target,$(1)) : $(call gb_ExtensionTarget_get_clean_target,$(1)) diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk index 428c2d4..2a434ef 100644 --- a/solenv/gbuild/ExtensionTarget.mk +++ b/solenv/gbuild/ExtensionTarget.mk @@ -93,7 +93,7 @@ $(call gb_ExtensionTarget_get_target,%) : \ $(call gb_ExtensionTarget__subst_platform,$(call gb_ExtensionTarget_get_workdir,$*)/description.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/description.xml) && \ $(call gb_ExtensionTarget__subst_platform,$(LOCATION)/manifest.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/META-INF/manifest.xml) && \ $(if $(LICENSE),cp -f $(LICENSE) $(call gb_ExtensionTarget_get_rootdir,$*)/registration &&) \ - $(if $(gb_WITH_LANG),cp $(foreach lang,$(gb_ExtensionTarget_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ + $(if $(and $(gb_WITH_LANG),$(DESCRIPTION)),cp $(foreach lang,$(gb_ExtensionTarget_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ cd $(call gb_ExtensionTarget_get_rootdir,$*) && \ $(gb_ExtensionTarget_ZIPCOMMAND) -rX --filesync \ $(call gb_ExtensionTarget_get_target,$*) \ @@ -104,6 +104,7 @@ $(call gb_ExtensionTarget_get_target,%) : \ # add deliverable # add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk) define gb_ExtensionTarget_ExtensionTarget +$(call gb_ExtensionTarget_get_target,$(1)) : DESCRIPTION := $(call gb_ExtensionTarget_get_target,$(1)) : FILES := META-INF description.xml $(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(call gb_ExtensionTarget_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2) @@ -111,11 +112,9 @@ $(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) $(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml ifneq ($(strip $(gb_WITH_LANG)),) -$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(gb_ExtensionTarget_LANGS),description-$(lang).txt) $(call gb_ExtensionTarget_get_target,$(1)) : SDF := $(gb_SDFLOCATION)/$(2)/localize.sdf $(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $$(SDF) endif -$(call gb_ExtensionTarget_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt) endef @@ -135,6 +134,16 @@ $(call gb_ExtensionTarget_get_target,$(1)) : $(gb_ExtensionTarget_LICENSEFILE_DE endef +# Use the default description file +define gb_ExtensionTarget_use_default_description +$(call gb_ExtensionTarget_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt) +$(call gb_ExtensionTarget_get_target,$(1)) : DESCRIPTION := $(true) +ifneq ($(strip $(gb_WITH_LANG)),) +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(gb_ExtensionTarget_LANGS),description-$(lang).txt) +endif + +endef + # adding a file creates a dependency to it # file is copied to $(WORKDIR) # $(3) is the target of the copied file, and $(4) can be used to override that commit 009d6c69eafea1d2bd21d15a3266aefd82e40d45 Author: David Tardon <dtar...@redhat.com> Date: Sun Aug 5 07:37:48 2012 +0200 move platform-specific settings to platform Change-Id: I99bf341df0a8cfe25f0821c8d21d3e27f3b12ea4 diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk index c4ee649..428c2d4 100644 --- a/solenv/gbuild/ExtensionTarget.mk +++ b/solenv/gbuild/ExtensionTarget.mk @@ -27,12 +27,10 @@ # ExtensionTarget class +# platform +# gb_ExtensionTarget_LICENSEFILE_DEFAULT + gb_ExtensionTarget_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q) -ifeq ($(GUI),WNT) -gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt -else -gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE -endif gb_ExtensionTarget_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex) gb_ExtensionTarget_XRMEXCOMMAND := \ $(gb_Helper_set_ld_path) $(gb_ExtensionTarget_XRMEXTARGET) diff --git a/solenv/gbuild/platform/IOS_ARM_GCC.mk b/solenv/gbuild/platform/IOS_ARM_GCC.mk index b1f5d6d..27c9d64 100644 --- a/solenv/gbuild/platform/IOS_ARM_GCC.mk +++ b/solenv/gbuild/platform/IOS_ARM_GCC.mk @@ -322,6 +322,10 @@ gb_ScpConvertTarget_ScpConvertTarget_platform := gb_InstallScript_EXT := .ins +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE + # 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 81d6226..180c35c 100644 --- a/solenv/gbuild/platform/WNT_INTEL_GCC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_GCC.mk @@ -460,6 +460,10 @@ endef gb_InstallScript_EXT := .inf +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt + # 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/WNT_INTEL_MSC.mk b/solenv/gbuild/platform/WNT_INTEL_MSC.mk index a060cc8..0c0c98f 100644 --- a/solenv/gbuild/platform/WNT_INTEL_MSC.mk +++ b/solenv/gbuild/platform/WNT_INTEL_MSC.mk @@ -731,6 +731,10 @@ endef gb_InstallScript_EXT := .inf +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt + # 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 084c4c0..47c9771 100644 --- a/solenv/gbuild/platform/macosx.mk +++ b/solenv/gbuild/platform/macosx.mk @@ -431,6 +431,10 @@ gb_ScpConvertTarget_ScpConvertTarget_platform := gb_InstallScript_EXT := .ins +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE + # Python gb_PYTHON_PRECOMMAND := DYLD_LIBRARY_PATH=$(OUTDIR)/lib diff --git a/solenv/gbuild/platform/solaris.mk b/solenv/gbuild/platform/solaris.mk index 2532c19..bf582c2 100644 --- a/solenv/gbuild/platform/solaris.mk +++ b/solenv/gbuild/platform/solaris.mk @@ -430,6 +430,10 @@ gb_ScpConvertTarget_ScpConvertTarget_platform := gb_InstallScript_EXT := .ins +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE + # 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 ed73734..555aab1 100644 --- a/solenv/gbuild/platform/unxgcc.mk +++ b/solenv/gbuild/platform/unxgcc.mk @@ -432,6 +432,10 @@ gb_ScpConvertTarget_ScpConvertTarget_platform := gb_InstallScript_EXT := .ins +# ExtensionTarget class + +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE + # Python gb_PYTHON_PRECOMMAND := $(gb_Helper_set_ld_path) PYTHONHOME=$(OUTDIR)/lib/python PYTHONPATH=$(OUTDIR)/lib/python:$(OUTDIR)/lib/python/lib-dynload commit 3abc7880e0e09b1a74922067707b37ef45462479 Author: David Tardon <dtar...@redhat.com> Date: Sun Aug 5 07:32:05 2012 +0200 change handling of license file This is a preparation for gbuildizing dictionaries, which does not contain registration/LICENSE like regular extensions. Change-Id: I9b186d101627872b522be0432f6daf21250eb497 diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk index 4f71256..18ff482 100644 --- a/solenv/gbuild/Extension.mk +++ b/solenv/gbuild/Extension.mk @@ -29,6 +29,7 @@ define gb_Extension_Extension $(call gb_ExtensionTarget_ExtensionTarget,$(1),$(2)) +$(call gb_ExtensionTarget_use_default_license,$(1)) $(call gb_Extension_get_target,$(1)) : $(call gb_ExtensionTarget_get_target,$(1)) $(call gb_Extension_get_clean_target,$(1)) : $(call gb_ExtensionTarget_get_clean_target,$(1)) diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk index 599fbb9..c4ee649 100644 --- a/solenv/gbuild/ExtensionTarget.mk +++ b/solenv/gbuild/ExtensionTarget.mk @@ -29,9 +29,9 @@ gb_ExtensionTarget_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q) ifeq ($(GUI),WNT) -gb_ExtensionTarget_LICENSEFILE := license.txt +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/license.txt else -gb_ExtensionTarget_LICENSEFILE := LICENSE +gb_ExtensionTarget_LICENSEFILE_DEFAULT := $(OUTDIR)/bin/osl/LICENSE endif gb_ExtensionTarget_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex) gb_ExtensionTarget_XRMEXCOMMAND := \ @@ -91,25 +91,23 @@ $(call gb_ExtensionTarget_get_target,%) : \ $(call gb_Output_announce,$*,$(true),OXT,3) $(call gb_Helper_abbreviate_dirs,\ mkdir -p $(call gb_ExtensionTarget_get_rootdir,$*)/META-INF \ - $(call gb_ExtensionTarget_get_rootdir,$*)/registration && \ + $(if $(LICENSE),$(call gb_ExtensionTarget_get_rootdir,$*)/registration) && \ $(call gb_ExtensionTarget__subst_platform,$(call gb_ExtensionTarget_get_workdir,$*)/description.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/description.xml) && \ $(call gb_ExtensionTarget__subst_platform,$(LOCATION)/manifest.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/META-INF/manifest.xml) && \ - cp -f $(OUTDIR)/bin/osl/$(gb_ExtensionTarget_LICENSEFILE) $(call gb_ExtensionTarget_get_rootdir,$*)/registration && \ + $(if $(LICENSE),cp -f $(LICENSE) $(call gb_ExtensionTarget_get_rootdir,$*)/registration &&) \ $(if $(gb_WITH_LANG),cp $(foreach lang,$(gb_ExtensionTarget_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ cd $(call gb_ExtensionTarget_get_rootdir,$*) && \ $(gb_ExtensionTarget_ZIPCOMMAND) -rX --filesync \ $(call gb_ExtensionTarget_get_target,$*) \ $(FILES)) -# TODO: needs dependency on $(OUTDIR)/bin/osl/$(gb_ExtensionTarget_LICENSEFILE) once readlicense_oo will be gbuildized -# or just another simpler solution - # set file list and location of manifest and description files # register target and clean target # add deliverable # add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk) define gb_ExtensionTarget_ExtensionTarget -$(call gb_ExtensionTarget_get_target,$(1)) : FILES := META-INF description.xml registration +$(call gb_ExtensionTarget_get_target,$(1)) : FILES := META-INF description.xml +$(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(call gb_ExtensionTarget_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2) $(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) @@ -131,6 +129,14 @@ $(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(2) endef +# Use the default license file +define gb_ExtensionTarget_use_default_license +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += registration +$(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(gb_ExtensionTarget_LICENSEFILE_DEFAULT) +$(call gb_ExtensionTarget_get_target,$(1)) : $(gb_ExtensionTarget_LICENSEFILE_DEFAULT) + +endef + # adding a file creates a dependency to it # file is copied to $(WORKDIR) # $(3) is the target of the copied file, and $(4) can be used to override that commit 9fbbcc122f5de6446d7500334f21445c30057bf6 Author: David Tardon <dtar...@redhat.com> Date: Sat Aug 4 20:11:44 2012 +0200 refactor Extension Change-Id: Ie0fd71b6547d9e04a55ae9690b137579e581e006 diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk index be486be..4f71256 100644 --- a/solenv/gbuild/Extension.mk +++ b/solenv/gbuild/Extension.mk @@ -27,102 +27,15 @@ # Extension class -gb_Extension_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q) -ifeq ($(GUI),WNT) -gb_Extension_LICENSEFILE := license.txt -else -gb_Extension_LICENSEFILE := LICENSE -endif -gb_Extension_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex) -gb_Extension_XRMEXCOMMAND := \ - $(gb_Helper_set_ld_path) $(gb_Extension_XRMEXTARGET) -# propmerge is a perl script -gb_Extension_PROPMERGETARGET := $(OUTDIR_FOR_BUILD)/bin/propmerge -gb_Extension_PROPMERGECOMMAND := \ - $(PERL) $(gb_Extension_PROPMERGETARGET) -gb_Extension_HELPEXTARGET := $(call gb_Executable_get_target_for_build,helpex) -gb_Extension_HELPEXCOMMAND := \ - $(gb_Helper_set_ld_path) $(gb_Extension_HELPEXTARGET) -# does not contain en-US because it is special cased in gb_Extension_Extension -gb_Extension_LANGS := $(filter-out en-US,$(gb_WITH_LANG)) - -# Substitute platform or copy if no platform has been set -define gb_Extension__subst_platform -$(if $(PLATFORM),\ - sed \ - -e 's/@PLATFORM@/$(PLATFORM)/' \ - -e 's/@EXEC_EXTENSION@/$(gb_Executable_EXT)/' \ - -e 's/@SHARED_EXTENSION@/$(gb_Library_DLLEXT)/' \ - $(1) > $(2),\ - cp -f $(1) $(2)) -endef - -# remove extension directory in workdir and oxt file in workdir and outdir -$(call gb_Extension_get_clean_target,%) : - $(call gb_Output_announce,$*,$(false),OXT,3) - $(call gb_Helper_abbreviate_dirs,\ - rm -f -r $(call gb_Extension_get_workdir,$*) && \ - 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,\ - 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_workdir,%)/description.xml - $(call gb_Output_announce,$*,$(true),OXT,3) - $(call gb_Helper_abbreviate_dirs,\ - mkdir -p $(call gb_Extension_get_rootdir,$*)/META-INF \ - $(call gb_Extension_get_rootdir,$*)/registration && \ - $(call gb_Extension__subst_platform,$(call gb_Extension_get_workdir,$*)/description.xml,$(call gb_Extension_get_rootdir,$*)/description.xml) && \ - $(call gb_Extension__subst_platform,$(LOCATION)/manifest.xml,$(call gb_Extension_get_rootdir,$*)/META-INF/manifest.xml) && \ - cp -f $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) $(call gb_Extension_get_rootdir,$*)/registration && \ - $(if $(gb_WITH_LANG),cp $(foreach lang,$(gb_Extension_LANGS),$(call gb_Extension_get_workdir,$*)/description-$(lang).txt) $(call gb_Extension_get_rootdir,$*) &&) \ - cd $(call gb_Extension_get_rootdir,$*) && \ - $(gb_Extension_ZIPCOMMAND) -rX --filesync \ - $(call gb_Extension_get_target,$*) \ - $(FILES)) - -# TODO: needs dependency on $(OUTDIR)/bin/osl/$(gb_Extension_LICENSEFILE) once readlicense_oo will be gbuildized -# or just another simpler solution - -# set file list and location of manifest and description files -# register target and clean target -# add deliverable -# add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk) 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)) : PLATFORM := -$(call gb_Extension_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) -$(call gb_Extension_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml -ifneq ($(strip $(gb_WITH_LANG)),) -$(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(gb_Extension_LANGS),description-$(lang).txt) -$(call gb_Extension_get_target,$(1)) : SDF := $(gb_SDFLOCATION)/$(2)/localize.sdf -$(call gb_Extension_get_workdir,$(1))/description.xml : $$(SDF) -endif -$(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)) +$(call gb_ExtensionTarget_ExtensionTarget,$(1),$(2)) + +$(call gb_Extension_get_target,$(1)) : $(call gb_ExtensionTarget_get_target,$(1)) +$(call gb_Extension_get_clean_target,$(1)) : $(call gb_ExtensionTarget_get_clean_target,$(1)) + +$(call gb_Deliver_add_deliverable,$(call gb_Extension_get_target,$(1)),$(call gb_ExtensionTarget_get_target,$(1)),$(1)) + +$$(eval $$(call gb_Module_register_target,$(call gb_Extension_get_target,$(1)),$(call gb_Extension_get_clean_target,$(1)))) endef @@ -130,21 +43,12 @@ endef # # Only use this if the extension is platform-dependent. define gb_Extension_set_platform -$(call gb_Extension_get_target,$(1)) : PLATFORM := $(2) +$(call gb_ExtensionTarget_set_platform,$(1),$(2)) endef -# adding a file creates a dependency to it -# file is copied to $(WORKDIR) -# $(3) is the target of the copied file, and $(4) can be used to override that -# with a different actual file, which is needed in gb_Extension_add_library -# to make it work on Windows where the DLL doesn't have a gbuild target... define gb_Extension_add_file -$(call gb_Extension_get_target,$(1)) : FILES += $(2) -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) -$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) - mkdir -p $$(dir $$@) && \ - cp -f $(if $(4),$(4),$(3)) $$@ +$(call gb_ExtensionTarget_add_file,$(1),$(2),$(3)) endef @@ -155,69 +59,51 @@ endef # without any subpath. If no path is specified, they are added directly # to the root dir of the extension. define gb_Extension_add_files -$(foreach file,$(3),$(call gb_Extension_add_file,$(1),$(if $(strip $(2)),$(strip $(2))/)$(notdir $(file)),$(file))) +$(call gb_ExtensionTarget_add_files,$(1),$(2),$(3)) endef # add a library from the solver; DO NOT use gb_Library_get_target define gb_Extension_add_library -$(call gb_Extension_add_file,$(1),$(call gb_Library_get_runtime_filename,$(2)),\ - $(call gb_Library_get_target,$(2)),\ - $(gb_Helper_OUTDIRLIBDIR)/$(call gb_Library_get_runtime_filename,$(2))) +$(call gb_ExtensionTarget_add_library,$(1),$(2)) + endef define gb_Extension_add_libraries -$(foreach lib,$(2),$(call gb_Extension_add_library,$(1),$(lib))) +$(call gb_ExtensionTarget_add_libraries,$(1),$(2)) + endef # add an executable from the solver define gb_Extension_add_executable -$(call gb_Extension_add_file,$(1),$(notdir $(call gb_Executable_get_target,$(2))),\ - $(call gb_Executable_get_target,$(2)),\ - $(call gb_Executable_get_target,$(2))) +$(call gb_ExtensionTarget_add_executable,$(1),$(2)) + endef define gb_Extension_add_executables -$(foreach exe,$(2),$(call gb_Extension_add_executable,$(1),$(exe))) +$(call gb_ExtensionTarget_add_executables,$(1),$(2)) + endef # localize .properties file -# source file is copied to $(WORKDIR) define gb_Extension_localize_properties -$(call gb_Extension_get_target,$(1)) : FILES += $(2) -ifneq ($(strip $(gb_WITH_LANG)),) -$(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(subst -,_,$(gb_Extension_LANGS)),$(subst en_US,$(lang),$(2))) -$(call gb_Extension_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf -$(call gb_Extension_get_rootdir,$(1))/$(2) : $$(SDF) -endif -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) -$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) \ - $(gb_Extension_PROPMERGETARGET) - $$(call gb_Output_announce,$(2),$(true),PRP,3) - mkdir -p $$(dir $$@) && \ - cp -f $$< $$@ \ - $(if $(strip $(gb_WITH_LANG)),&& $(gb_Extension_PROPMERGECOMMAND) -i $$@ -m $$(SDF)) +$(call gb_ExtensionTarget_localize_properties,$(1),$(2),$(3)) endef # localize extension help define gb_Extension_localize_help -ifneq ($(strip $(gb_WITH_LANG)),) -$(call gb_Extension_get_target,$(1)) : FILES += $(foreach lang,$(gb_Extension_LANGS),$(subst lang,$(lang),$(2))) -$(foreach lang,$(gb_Extension_LANGS),$(call gb_Extension_localize_help_onelang,$(1),$(subst lang,$(lang),$(2)),$(3),$(lang))) -endif +$(call gb_ExtensionTarget_localize_help,$(1),$(2),$(3)) + +endef + +define gb_Extension_use_package +$(call gb_ExtensionTarget_use_package,$(1),$(2)) endef -define gb_Extension_localize_help_onelang -$(call gb_Extension_get_target,$(1)) : $(call gb_Extension_get_rootdir,$(1))/$(2) -$(call gb_Extension_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(subst $(WORKDIR)/CustomTarget,,$(dir $(3))))localize.sdf -$(call gb_Extension_get_rootdir,$(1))/$(2) : $$(SDF) -$(call gb_Extension_get_rootdir,$(1))/$(2) : $(gb_Extension_HELPEXTARGET) -$(call gb_Extension_get_rootdir,$(1))/$(2) : $(3) - $$(call gb_Output_announce,$(2),$(true),XHP,3) - mkdir -p $$(dir $$@) && \ - $(gb_Extension_HELPEXCOMMAND) -i $$< -o $$@ -l $(4) -m $$(SDF) +define gb_Extension_use_packages +$(call gb_ExtensionTarget_use_packages,$(1),$(2)) endef @@ -226,19 +112,9 @@ $$(call gb_Output_error,\ gb_Extension_add_package_dependency: use gb_Extension_use_package instead.) endef -define gb_Extension_use_package -$(call gb_Extension_get_target,$(1)) : $(call gb_Package_get_target,$(2)) - -endef - define gb_Extension_add_package_dependencies $$(call gb_Output_error,\ gb_Extension_add_package_dependencies: use gb_Extension_use_packages instead.) endef -define gb_Extension_use_packages -$(foreach package,$(2),$(call gb_Extension_use_package,$(1),$(package))) - -endef - # vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk new file mode 100644 index 0000000..599fbb9 --- /dev/null +++ b/solenv/gbuild/ExtensionTarget.mk @@ -0,0 +1,231 @@ +# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*- +# +# Version: MPL 1.1 / GPLv3+ / LGPLv3+ +# +# The contents of this file are subject to the Mozilla Public License Version +# 1.1 (the "License"); you may not use this file except in compliance with +# the License or as specified alternatively below. You may obtain a copy of +# the License at http://www.mozilla.org/MPL/ +# +# Software distributed under the License is distributed on an "AS IS" basis, +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License +# for the specific language governing rights and limitations under the +# License. +# +# Major Contributor(s): +# Copyright (C) 2011 Matúš Kukan <matus.ku...@gmail.com> +# +# All Rights Reserved. +# +# For minor contributions see the git repository. +# +# Alternatively, the contents of this file may be used under the terms of +# either the GNU General Public License Version 3 or later (the "GPLv3+"), or +# the GNU Lesser General Public License Version 3 or later (the "LGPLv3+"), +# in which case the provisions of the GPLv3+ or the LGPLv3+ are applicable +# instead of those above. + +# ExtensionTarget class + +gb_ExtensionTarget_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q) +ifeq ($(GUI),WNT) +gb_ExtensionTarget_LICENSEFILE := license.txt +else +gb_ExtensionTarget_LICENSEFILE := LICENSE +endif +gb_ExtensionTarget_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex) +gb_ExtensionTarget_XRMEXCOMMAND := \ + $(gb_Helper_set_ld_path) $(gb_ExtensionTarget_XRMEXTARGET) +# propmerge is a perl script +gb_ExtensionTarget_PROPMERGETARGET := $(OUTDIR_FOR_BUILD)/bin/propmerge +gb_ExtensionTarget_PROPMERGECOMMAND := \ + $(PERL) $(gb_ExtensionTarget_PROPMERGETARGET) +gb_ExtensionTarget_HELPEXTARGET := $(call gb_Executable_get_target_for_build,helpex) +gb_ExtensionTarget_HELPEXCOMMAND := \ + $(gb_Helper_set_ld_path) $(gb_ExtensionTarget_HELPEXTARGET) +# does not contain en-US because it is special cased in gb_ExtensionTarget_ExtensionTarget +gb_ExtensionTarget_LANGS := $(filter-out en-US,$(gb_WITH_LANG)) + +# Substitute platform or copy if no platform has been set +define gb_ExtensionTarget__subst_platform +$(if $(PLATFORM),\ + sed \ + -e 's/@PLATFORM@/$(PLATFORM)/' \ + -e 's/@EXEC_EXTENSION@/$(gb_Executable_EXT)/' \ + -e 's/@SHARED_EXTENSION@/$(gb_Library_DLLEXT)/' \ + $(1) > $(2),\ + cp -f $(1) $(2)) +endef + +# remove extension directory in workdir and oxt file in workdir +$(call gb_ExtensionTarget_get_clean_target,%) : + $(call gb_Output_announce,$*,$(false),OXT,3) + $(call gb_Helper_abbreviate_dirs,\ + rm -f -r $(call gb_ExtensionTarget_get_workdir,$*) && \ + rm -f $(call gb_ExtensionTarget_get_target,$*) \ + ) + +ifeq ($(strip $(gb_WITH_LANG)),) +$(call gb_ExtensionTarget_get_workdir,%)/description.xml : + $(call gb_Output_announce,$*/description.xml,$(true),CPY,3) + $(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(call gb_ExtensionTarget_get_workdir,$*) && \ + cp -f $(LOCATION)/description.xml $@) +else +$(call gb_ExtensionTarget_get_workdir,%)/description.xml : $(gb_ExtensionTarget_XRMEXTARGET) + $(call gb_Output_announce,$*/description.xml,$(true),XRM,3) + $(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(call gb_ExtensionTarget_get_workdir,$*) && \ + $(gb_ExtensionTarget_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_ExtensionTarget_get_target,%) : \ + $(call gb_ExtensionTarget_get_workdir,%)/description.xml + $(call gb_Output_announce,$*,$(true),OXT,3) + $(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(call gb_ExtensionTarget_get_rootdir,$*)/META-INF \ + $(call gb_ExtensionTarget_get_rootdir,$*)/registration && \ + $(call gb_ExtensionTarget__subst_platform,$(call gb_ExtensionTarget_get_workdir,$*)/description.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/description.xml) && \ + $(call gb_ExtensionTarget__subst_platform,$(LOCATION)/manifest.xml,$(call gb_ExtensionTarget_get_rootdir,$*)/META-INF/manifest.xml) && \ + cp -f $(OUTDIR)/bin/osl/$(gb_ExtensionTarget_LICENSEFILE) $(call gb_ExtensionTarget_get_rootdir,$*)/registration && \ + $(if $(gb_WITH_LANG),cp $(foreach lang,$(gb_ExtensionTarget_LANGS),$(call gb_ExtensionTarget_get_workdir,$*)/description-$(lang).txt) $(call gb_ExtensionTarget_get_rootdir,$*) &&) \ + cd $(call gb_ExtensionTarget_get_rootdir,$*) && \ + $(gb_ExtensionTarget_ZIPCOMMAND) -rX --filesync \ + $(call gb_ExtensionTarget_get_target,$*) \ + $(FILES)) + +# TODO: needs dependency on $(OUTDIR)/bin/osl/$(gb_ExtensionTarget_LICENSEFILE) once readlicense_oo will be gbuildized +# or just another simpler solution + +# set file list and location of manifest and description files +# register target and clean target +# add deliverable +# add dependency for outdir target to workdir target (pattern rule for delivery is in Package.mk) +define gb_ExtensionTarget_ExtensionTarget +$(call gb_ExtensionTarget_get_target,$(1)) : FILES := META-INF description.xml registration +$(call gb_ExtensionTarget_get_target,$(1)) : LOCATION := $(SRCDIR)/$(2) +$(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := +$(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2))) +$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml +ifneq ($(strip $(gb_WITH_LANG)),) +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(gb_ExtensionTarget_LANGS),description-$(lang).txt) +$(call gb_ExtensionTarget_get_target,$(1)) : SDF := $(gb_SDFLOCATION)/$(2)/localize.sdf +$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $$(SDF) +endif +$(call gb_ExtensionTarget_add_file,$(1),description-en-US.txt,$(SRCDIR)/$(2)/description-en-US.txt) + +endef + +# Set platform. +# +# Only use this if the extension is platform-dependent. +define gb_ExtensionTarget_set_platform +$(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(2) + +endef + +# adding a file creates a dependency to it +# file is copied to $(WORKDIR) +# $(3) is the target of the copied file, and $(4) can be used to override that +# with a different actual file, which is needed in gb_ExtensionTarget_add_library +# to make it work on Windows where the DLL doesn't have a gbuild target... +define gb_ExtensionTarget_add_file +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2) +$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) + mkdir -p $$(dir $$@) && \ + cp -f $(if $(4),$(4),$(3)) $$@ + +endef + +# Add several files at once +# +# This function avoids the need to specify each file's name twice. The +# files are added directly under specified path in the extension, +# without any subpath. If no path is specified, they are added directly +# to the root dir of the extension. +define gb_ExtensionTarget_add_files +$(foreach file,$(3),$(call gb_ExtensionTarget_add_file,$(1),$(if $(strip $(2)),$(strip $(2))/)$(notdir $(file)),$(file))) + +endef + +# add a library from the solver; DO NOT use gb_Library_get_target +define gb_ExtensionTarget_add_library +$(call gb_ExtensionTarget_add_file,$(1),$(call gb_Library_get_runtime_filename,$(2)),\ + $(call gb_Library_get_target,$(2)),\ + $(gb_Helper_OUTDIRLIBDIR)/$(call gb_Library_get_runtime_filename,$(2))) +endef + +define gb_ExtensionTarget_add_libraries +$(foreach lib,$(2),$(call gb_ExtensionTarget_add_library,$(1),$(lib))) +endef + +# add an executable from the solver +define gb_ExtensionTarget_add_executable +$(call gb_ExtensionTarget_add_file,$(1),$(notdir $(call gb_Executable_get_target,$(2))),\ + $(call gb_Executable_get_target,$(2)),\ + $(call gb_Executable_get_target,$(2))) +endef + +define gb_ExtensionTarget_add_executables +$(foreach exe,$(2),$(call gb_ExtensionTarget_add_executable,$(1),$(exe))) +endef + +# localize .properties file +# source file is copied to $(WORKDIR) +define gb_ExtensionTarget_localize_properties +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(2) +ifneq ($(strip $(gb_WITH_LANG)),) +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(subst -,_,$(gb_ExtensionTarget_LANGS)),$(subst en_US,$(lang),$(2))) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $$(SDF) +endif +$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \ + $(gb_ExtensionTarget_PROPMERGETARGET) + $$(call gb_Output_announce,$(2),$(true),PRP,3) + mkdir -p $$(dir $$@) && \ + cp -f $$< $$@ \ + $(if $(strip $(gb_WITH_LANG)),&& $(gb_ExtensionTarget_PROPMERGECOMMAND) -i $$@ -m $$(SDF)) + +endef + +# localize extension help +define gb_ExtensionTarget_localize_help +ifneq ($(strip $(gb_WITH_LANG)),) +$(call gb_ExtensionTarget_get_target,$(1)) : FILES += $(foreach lang,$(gb_ExtensionTarget_LANGS),$(subst lang,$(lang),$(2))) +$(foreach lang,$(gb_ExtensionTarget_LANGS),$(call gb_ExtensionTarget_localize_help_onelang,$(1),$(subst lang,$(lang),$(2)),$(3),$(lang))) +endif + +endef + +define gb_ExtensionTarget_localize_help_onelang +$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(subst $(WORKDIR)/CustomTarget,,$(dir $(3))))localize.sdf +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $$(SDF) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(gb_ExtensionTarget_HELPEXTARGET) +$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) + $$(call gb_Output_announce,$(2),$(true),XHP,3) + mkdir -p $$(dir $$@) && \ + $(gb_ExtensionTarget_HELPEXCOMMAND) -i $$< -o $$@ -l $(4) -m $$(SDF) + +endef + +define gb_ExtensionTarget_use_package +$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_Package_get_target,$(2)) + +endef + +define gb_ExtensionTarget_use_packages +$(foreach package,$(2),$(call gb_ExtensionTarget_use_package,$(1),$(package))) + +endef + +# vim: set noet sw=4 ts=4: diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk index 60290af..7822e2c 100644 --- a/solenv/gbuild/TargetLocations.mk +++ b/solenv/gbuild/TargetLocations.mk @@ -31,7 +31,7 @@ gb_ComponentTarget_get_outdir_target = $(OUTDIR)/xml/component/$(1).component gb_Executable_get_target = $(OUTDIR)/bin/$(1)$(gb_Executable_EXT) gb_Executable_get_target_for_build = $(OUTDIR_FOR_BUILD)/bin/$(1)$(gb_Executable_EXT_for_build) -gb_Extension_get_outdir_target = $(OUTDIR)/bin/$(1).oxt +gb_Extension_get_target = $(OUTDIR)/bin/$(1).oxt gb_Pagein_get_outdir_target = $(OUTDIR)/bin/pagein-$(1) gb_PackagePart_get_destinations = \ $(OUTDIR)/bin \ @@ -88,9 +88,9 @@ gb_CxxObject_get_target = $(WORKDIR)/CxxObject/$(1).o gb_GenCxxObject_get_target = $(WORKDIR)/GenCxxObject/$(1).o gb_Executable_get_external_headers_target = $(WORKDIR)/ExternalHeaders/Executable/$(1) gb_Executable_get_headers_target = $(WORKDIR)/Headers/Executable/$(1) -gb_Extension_get_target = $(WORKDIR)/Extension/$(1).oxt -gb_Extension_get_rootdir = $(WORKDIR)/Extension/$(1)/root -gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1) +gb_ExtensionTarget_get_target = $(WORKDIR)/ExtensionTarget/$(1).oxt +gb_ExtensionTarget_get_rootdir = $(WORKDIR)/ExtensionTarget/$(1)/root +gb_ExtensionTarget_get_workdir = $(WORKDIR)/ExtensionTarget/$(1) gb_ExternalLib_get_workdir = $(WORKDIR)/ExternalLib/$(1) gb_ExternalLib_get_builddir = $(WORKDIR)/ExternalLib/$(1)/build gb_ExternalLib_get_target = $(WORKDIR)/ExternalLib/$(1).done @@ -192,7 +192,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ AllLangResTarget \ ComponentTarget \ ComponentsTarget \ - Extension \ + ExtensionTarget \ InstallModule \ InstallModuleTarget \ InstallScriptTarget \ @@ -235,6 +235,7 @@ $(eval $(call gb_Helper_make_clean_targets,\ $(eval $(call gb_Helper_make_outdir_clean_targets,\ Executable \ + Extension \ InstallScript \ InternalUnoApi \ Library \ diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk index c5adb50..a77f57e 100644 --- a/solenv/gbuild/gbuild.mk +++ b/solenv/gbuild/gbuild.mk @@ -320,6 +320,7 @@ include $(foreach class, \ InternalUnoApi \ Zip \ Configuration \ + ExtensionTarget \ Extension \ InstallModuleTarget \ InstallModule \
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits