summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2013-10-31 00:15:51 +0100
committerMichael Stahl <mstahl@redhat.com>2013-10-31 10:42:24 +0100
commit704451d95d7b1c32f0e623bde5b4de4236ff9579 (patch)
tree9fb2fd2466d93104302c7e3adea44e8447f8ac4b /solenv
parentc7c0da47e15957e8ab8674551fdaebc35998e9f0 (diff)
gbuild: add ExtensionPackage class
Change-Id: I65ca50ccc512e35a5b95c2482f3a8833d1a7294b
Diffstat (limited to 'solenv')
-rw-r--r--solenv/gbuild/ExtensionPackage.mk53
-rw-r--r--solenv/gbuild/TargetLocations.mk3
-rw-r--r--solenv/gbuild/gbuild.mk1
3 files changed, 57 insertions, 0 deletions
diff --git a/solenv/gbuild/ExtensionPackage.mk b/solenv/gbuild/ExtensionPackage.mk
new file mode 100644
index 000000000000..34a9bd418fb3
--- /dev/null
+++ b/solenv/gbuild/ExtensionPackage.mk
@@ -0,0 +1,53 @@
+# -*- 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/.
+#
+
+# ExtensionPackage class
+#
+# Unpacks a binary .oxt file into the instdir extension directory and
+# writes a file-list.
+
+$(call gb_ExtensionPackage_get_clean_target,%) :
+ $(call gb_Output_announce,$*,$(false),OXP,3)
+ $(call gb_Helper_abbreviate_dirs,\
+ rm -rf $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
+ $(call gb_ExtensionPackage_get_target,$*))
+
+$(call gb_ExtensionPackage_get_preparation_target,%) :
+ mkdir -p $(dir $@) && touch $@
+
+$(call gb_ExtensionPackage_get_target,%) :
+ $(call gb_Output_announce,$*,$(true),OXP,3)
+ $(call gb_Helper_abbreviate_dirs,\
+ mkdir -p $(dir $@) \
+ && rm -rf $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
+ && unzip -q $(ZIPFILE) -d $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$* \
+ && zipinfo -1 $(ZIPFILE) | grep -v '/$$' \
+ | sed s+^+$(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/$*/+ > $@)
+
+# call gb_ExtensionPackage_ExtensionPackage,package,oxt
+define gb_ExtensionPackage_ExtensionPackage
+$(call gb_ExtensionPackage_get_target,$(1)) : ZIPFILE := $(2)
+$(call gb_ExtensionPackage_get_target,$(1)) : $(2)
+$(2) :| $(call gb_ExtensionPackage_get_preparation_target,$(1))
+$(call gb_ExtensionPackage_get_target,$(1)) :| \
+ $(INSTROOT)/$(LIBO_SHARE_FOLDER)/extensions/.dir
+
+$$(eval $$(call gb_Module_register_target,$(call gb_ExtensionPackage_get_target,$(1)),$(call gb_ExtensionPackage_get_clean_target,$(1))))
+$(call gb_Helper_make_userfriendly_targets,$(1),ExtensionPackage)
+
+endef
+
+# call gb_ExtensionPackage_use_external_project,package,externalproject
+define gb_ExtensionPackage_use_external_project
+$(call gb_ExtensionPackage_get_preparation_target,$(1)) : \
+ $(call gb_ExternalProject_get_target,$(2))
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 90f9decdab08..8504e549685a 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -84,6 +84,8 @@ gb_Executable_get_runtime_target = $(WORKDIR_FOR_BUILD)/Executable/$(1).run
gb_Extension_get_target = $(WORKDIR)/Extension/$(1).oxt
gb_Extension_get_rootdir = $(WORKDIR)/Extension/$(1)/root
gb_Extension_get_workdir = $(WORKDIR)/Extension/$(1)
+gb_ExtensionPackage_get_target = $(WORKDIR)/ExtensionPackage/$(1).filelist
+gb_ExtensionPackage_get_preparation_target = $(WORKDIR)/ExtensionPackage/$(1).prepare
gb_ExternalPackage_get_target = $(WORKDIR)/ExternalPackage/$(1)
gb_ExternalProject_get_statedir = $(WORKDIR)/ExternalProject/$(1)
gb_ExternalProject_get_preparation_target = $(WORKDIR)/ExternalProject/$(1).prepare
@@ -255,6 +257,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
Executable \
ExternalPackage \
Extension \
+ ExtensionPackage \
Gallery \
GeneratedPackage \
HelpTarget \
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 425a6995710b..b7f2db535ae3 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -320,6 +320,7 @@ include $(foreach class, \
HelpTarget \
AllLangHelp \
Extension \
+ ExtensionPackage \
Dictionary \
InstallModuleTarget \
InstallModule \