gbuild: add ExtensionPackage class

Change-Id: I65ca50ccc512e35a5b95c2482f3a8833d1a7294b
This commit is contained in:
Michael Stahl 2013-10-31 00:15:51 +01:00
parent c7c0da47e1
commit 704451d95d
5 changed files with 60 additions and 2 deletions

View file

@ -111,6 +111,7 @@ gbuild_TARGETS := AllLangHelp \
Dictionary \
Executable \
Extension \
ExtensionPackage \
ExternalPackage \
ExternalProject \
GeneratedPackage \

View file

@ -78,7 +78,7 @@ LibreOffice
downloadname LibreOffice_{productversion}_{os}_install_{languages}
langpackdownloadname LibreOffice_{productversion}_languagepack_{os}_install_{languages}
helppackdownloadname LibreOffice_{productversion}_helppack_{os}_install_{languages}
include {solarpath}/bin.{minor}/osl,{installscriptdir},{customtargetpath}/readlicense_oo/readme,{customtargetpath}/sysui/{pkgtype},{customtargetpath}/setup_native,{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarpath}/xml.{minor},{filelistpath}/PackageSet,{filelistpath}/GeneratedPackage,{filelistpath}/Package,{shlxthdlpath},{instdir},{instdir}/ure/lib,{extensionsdir},{packinfopath}
include {solarpath}/bin.{minor}/osl,{installscriptdir},{customtargetpath}/readlicense_oo/readme,{customtargetpath}/sysui/{pkgtype},{customtargetpath}/setup_native,{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarpath}/xml.{minor},{filelistpath}/PackageSet,{filelistpath}/GeneratedPackage,{filelistpath}/Package,{filelistpath}/ExtensionPackage,{shlxthdlpath},{instdir},{instdir}/ure/lib,{extensionsdir},{packinfopath}
}
}
@ -131,7 +131,7 @@ LibreOffice_Dev
downloadname LibreOfficeDev_{productversion}_{os}_install_{languages}
langpackdownloadname LibreOfficeDev_{productversion}_languagepack_{os}_install_{languages}
helppackdownloadname LibreOfficeDev_{productversion}_helppack_{os}_install_{languages}
include {solarpath}/bin.{minor}/osl,{installscriptdir},{customtargetpath}/readlicense_oo/readme,{customtargetpath}/sysui/{pkgtype},{customtargetpath}/setup_native,{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice_dev,{solarpath}/pck.{minor},{solarpath}/xml.{minor},{filelistpath}/PackageSet,{filelistpath}/GeneratedPackage,{filelistpath}/Package,{shlxthdlpath},{instdir},{instdir}/ure/lib,{extensionsdir},{packinfopath}
include {solarpath}/bin.{minor}/osl,{installscriptdir},{customtargetpath}/readlicense_oo/readme,{customtargetpath}/sysui/{pkgtype},{customtargetpath}/setup_native,{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice_dev,{solarpath}/pck.{minor},{solarpath}/xml.{minor},{filelistpath}/PackageSet,{filelistpath}/GeneratedPackage,{filelistpath}/Package,{filelistpath}/ExtensionPackage,{shlxthdlpath},{instdir},{instdir}/ure/lib,{extensionsdir},{packinfopath}
}
}

View file

@ -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:

View file

@ -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 \

View file

@ -320,6 +320,7 @@ include $(foreach class, \
HelpTarget \
AllLangHelp \
Extension \
ExtensionPackage \
Dictionary \
InstallModuleTarget \
InstallModule \