summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ct2n/Extension_ct2n.mk7
-rw-r--r--ct2n/UnpackedTarball_ct2n.mk11
-rw-r--r--solenv/gbuild/Dictionary.mk2
-rw-r--r--solenv/gbuild/Extension.mk17
-rw-r--r--solenv/gbuild/ExtensionTarget.mk40
5 files changed, 58 insertions, 19 deletions
diff --git a/ct2n/Extension_ct2n.mk b/ct2n/Extension_ct2n.mk
index 37c31870c3ef..c052cdafa5a4 100644
--- a/ct2n/Extension_ct2n.mk
+++ b/ct2n/Extension_ct2n.mk
@@ -8,13 +8,14 @@
#
$(eval $(call gb_Extension_Extension,ConvertTextToNumber,\
- workdir/$(INPATH_FOR_BUILD)/UnpackedTarball/ConvertTextToNumber))
+ $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber),nodefaults))
CT2N_DIR := $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber)
+$(eval $(call gb_Extension_use_unpacked,ConvertTextToNumber,ConvertTextToNumber))
+
# we have our own LICENSE file; force using it instead of the default one
-$(call gb_ExtensionTarget_get_target,ConvertTextToNumber) : \
- LICENSE := $(CT2N_DIR)/registration/LICENSE
+$(call gb_Extension_set_license,ConvertTextToNumber,$(CT2N_DIR)/registration/COPYING)
$(eval $(call gb_Extension_add_files,ConvertTextToNumber,,\
$(CT2N_DIR)/Addons.xcu \
diff --git a/ct2n/UnpackedTarball_ct2n.mk b/ct2n/UnpackedTarball_ct2n.mk
index 7239d8ac969a..633436caa0bc 100644
--- a/ct2n/UnpackedTarball_ct2n.mk
+++ b/ct2n/UnpackedTarball_ct2n.mk
@@ -11,10 +11,6 @@ $(eval $(call gb_UnpackedTarball_UnpackedTarball,ConvertTextToNumber))
$(eval $(call gb_UnpackedTarball_set_tarball,ConvertTextToNumber,$(CT2N_TARBALL),0))
-# Extension class requires description-en-US.txt file
-$(eval $(call gb_UnpackedTarball_add_file,ConvertTextToNumber,\
- description-en-US.txt,ct2n/description-en-US.txt))
-
$(eval $(call gb_UnpackedTarball_add_patches,ConvertTextToNumber,\
ct2n/ConvertTextToNumber-1.3.2-no-license.patch \
ct2n/ConvertTextToNumber-1.3.2-no-visible-by-default.patch \
@@ -22,12 +18,11 @@ $(eval $(call gb_UnpackedTarball_add_patches,ConvertTextToNumber,\
# adjustments for using Extension class
# 1. manifest.xml is expected in root directory
-# 2. LICENSE file is required, reuse existing COPYING
$(eval $(call gb_UnpackedTarball_set_post_action,ConvertTextToNumber,\
mv $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber)/META-INF/manifest.xml \
- $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber) && \
- mv $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber)/registration/COPYING \
- $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber)/registration/LICENSE \
+ $(call gb_UnpackedTarball_get_dir,ConvertTextToNumber) \
))
+$(eval $(call gb_UnpackedTarball_mark_output_file,ConvertTextToNumber,description.xml))
+
# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/Dictionary.mk b/solenv/gbuild/Dictionary.mk
index c40e376ee8fa..be81ef585bb2 100644
--- a/solenv/gbuild/Dictionary.mk
+++ b/solenv/gbuild/Dictionary.mk
@@ -62,7 +62,7 @@ gb_Dictionary_extensionname = Dictionary/$(1)
#
# gb_Dictionary_Dictionary dictionary srcdir
define gb_Dictionary_Dictionary
-$(call gb_ExtensionTarget_ExtensionTarget,$(call gb_Dictionary_extensionname,$(1)),$(2))
+$(call gb_ExtensionTarget_ExtensionTarget,$(call gb_Dictionary_extensionname,$(1)),$(SRCDIR)/$(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)))
diff --git a/solenv/gbuild/Extension.mk b/solenv/gbuild/Extension.mk
index 281bac89420a..d2f29fce45a2 100644
--- a/solenv/gbuild/Extension.mk
+++ b/solenv/gbuild/Extension.mk
@@ -28,9 +28,11 @@
# Extension class
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_ExtensionTarget_ExtensionTarget,$(1),$(if $(filter nodefaults,$(3)),$(2),$(SRCDIR)/$(2)))
+$(if $(filter nodefaults,$(3)),,\
+ $(call gb_ExtensionTarget_use_default_license,$(1)))
+$(if $(filter nodefaults,$(3)),,\
+ $(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))
@@ -41,6 +43,10 @@ $$(eval $$(call gb_Module_register_target,$(call gb_Extension_get_target,$(1)),$
endef
+define gb_Extension_set_license
+$(call gb_ExtensionTarget_set_license,$(1),$(2))
+endef
+
define gb_Extension_add_file
$(call gb_ExtensionTarget_add_file,$(1),$(2),$(3))
@@ -122,6 +128,11 @@ $(call gb_ExtensionTarget_add_helptreefile,$(1),$(2),$(3),$(4),$(5))
endef
+define gb_Extension_use_unpacked
+$(call gb_ExtensionTarget_use_unpacked,$(1),$(2))
+
+endef
+
define gb_Extension_use_package
$(call gb_ExtensionTarget_use_package,$(1),$(2))
diff --git a/solenv/gbuild/ExtensionTarget.mk b/solenv/gbuild/ExtensionTarget.mk
index eb457856dc56..286e9d79b025 100644
--- a/solenv/gbuild/ExtensionTarget.mk
+++ b/solenv/gbuild/ExtensionTarget.mk
@@ -30,6 +30,8 @@
# platform
# gb_ExtensionTarget_LICENSEFILE_DEFAULT
+gb_ExtensionTarget__get_preparation_target = $(WORKDIR)/ExtensionTarget/$(1).prepare
+
gb_ExtensionTarget_ZIPCOMMAND := zip $(if $(findstring s,$(MAKEFLAGS)),-q)
gb_ExtensionTarget_XRMEXTARGET := $(call gb_Executable_get_target_for_build,xrmex)
gb_ExtensionTarget_XRMEXCOMMAND := \
@@ -79,9 +81,15 @@ $(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,$*) \
+ rm -f $(call gb_ExtensionTarget__get_preparation_target,$*) \
+ $(call gb_ExtensionTarget_get_target,$*) \
)
+# preparation target to delay adding files produced by e.g. UnpackedTarball
+$(call gb_ExtensionTarget__get_preparation_target,%) :
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) && touch $@)
+
ifeq ($(strip $(gb_WITH_LANG)),)
$(call gb_ExtensionTarget_get_workdir,%)/description.xml :
$(call gb_Output_announce,$*/description.xml,$(true),CPY,3)
@@ -126,10 +134,14 @@ 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)
+$(call gb_ExtensionTarget_get_target,$(1)) : LOCATION := $(2)
$(call gb_ExtensionTarget_get_target,$(1)) : PLATFORM := $(PLATFORMID)
$(call gb_ExtensionTarget_get_target,$(1)) : PRJNAME := $(firstword $(subst /, ,$(2)))
-$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(SRCDIR)/$(2)/description.xml
+$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : \
+ $(SRCDIR)/$(2)/description.xml
+$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml :| \
+ $(call gb_ExtensionTarget__get_preparation_target,$(1))
+
ifneq ($(strip $(gb_WITH_LANG)),)
$(call gb_ExtensionTarget_get_target,$(1)) : SDF := $(gb_SDFLOCATION)/$(2)/localize.sdf
$(call gb_ExtensionTarget_get_workdir,$(1))/description.xml : $(gb_SDFLOCATION)/$(2)/localize.sdf
@@ -147,6 +159,14 @@ $(call gb_ExtensionTarget_get_target,$(1)) : $(gb_ExtensionTarget_LICENSEFILE_DE
endef
+define gb_ExtensionTarget_add_license
+$(call gb_ExtensionTarget_get_target,$(1)) : FILES += registration
+$(call gb_ExtensionTarget_get_target,$(1)) : LICENSE := $(2)
+$(call gb_ExtensionTarget_get_target,$(1)) : $(2)
+$(2) :| $(call gb_ExtensionTarget__get_preparation_target,$(1))
+
+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)
@@ -165,6 +185,7 @@ endef
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)
+$(3) :| $(call gb_ExtensionTarget__get_preparation_target,$(1))
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3)
mkdir -p $$(dir $$@) && \
cp -f $(if $(4),$(4),$(3)) $$@
@@ -214,6 +235,8 @@ $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : SDF := $(gb_SDFLOCATION)$(sub
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(gb_SDFLOCATION)$(subst $(SRCDIR),,$(dir $(3)))localize.sdf
endif
$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_ExtensionTarget_get_rootdir,$(1))/$(2)
+$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) \
+ :| $(call gb_ExtensionTarget__get_preparation_target,$(1))
$(call gb_ExtensionTarget_get_rootdir,$(1))/$(2) : $(3) \
$(gb_ExtensionTarget_PROPMERGETARGET)
$$(call gb_Output_announce,$(2),$(true),PRP,3)
@@ -377,12 +400,21 @@ define gb_ExtensionTarget__add_compiled_help_dependency_onelang
$(call gb_ExtensionTarget_get_target,$(1)) : FILES += help/$(2)
$(call gb_ExtensionTarget_get_target,$(1)) : \
$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(2).done
+$(call gb_ExtensionTarget_get_rootdir,$(1))/help/$(2).done \
+ :| $(call gb_ExtensionTarget__get_preparation_target,$(1))
endef
+define gb_ExtensionTarget_use_unpacked
+$(call gb_ExtensionTarget__get_preparation_target,$(1)) \
+ :| $(call gb_UnpackedTarball_get_final_target,$(2))
+
+endef
+
define gb_ExtensionTarget_use_package
-$(call gb_ExtensionTarget_get_target,$(1)) : $(call gb_Package_get_target,$(2))
+$(call gb_ExtensionTarget__get_preparation_target,$(1)) \
+ :| $(call gb_Package_get_target,$(2))
endef