[Libreoffice-commits] core.git: 2 commits - instsetoo_native/util Makefile.in odk/CustomTarget_check.mk odk/CustomTarget_doxygen.mk odk/GeneratedPackage_cpp_docs.mk odk/Module_odk.mk odk/Zip_cppdocs.mk scp2/source solenv/gbuild

David Tardon dtardon at redhat.com
Sat May 4 07:42:26 PDT 2013


 Makefile.in                             |    1 
 instsetoo_native/util/openoffice.lst.in |    8 +-
 odk/CustomTarget_check.mk               |    2 
 odk/CustomTarget_doxygen.mk             |   14 ++--
 odk/GeneratedPackage_cpp_docs.mk        |   16 ++++
 odk/Module_odk.mk                       |    2 
 odk/Zip_cppdocs.mk                      |   20 -----
 scp2/source/sdkoo/sdkoo.scp             |    6 -
 solenv/gbuild/GeneratedPackage.mk       |  111 ++++++++++++++++++++++++++++++++
 solenv/gbuild/TargetLocations.mk        |    2 
 solenv/gbuild/gbuild.mk                 |    1 
 11 files changed, 147 insertions(+), 36 deletions(-)

New commits:
commit ffa50f643c9bed8a6c5970ba72712a1d68d186a6
Author: David Tardon <dtardon at redhat.com>
Date:   Sat May 4 13:57:06 2013 +0200

    install cpp docs using filelist
    
    Change-Id: I93176653935b6ccfd4181e6086444fbe7475f2b0
    Reviewed-on: https://gerrit.libreoffice.org/3775
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/odk/CustomTarget_check.mk b/odk/CustomTarget_check.mk
index 6660525..74415a2 100644
--- a/odk/CustomTarget_check.mk
+++ b/odk/CustomTarget_check.mk
@@ -28,7 +28,7 @@ odk_PLATFORM := $(if $(filter WNT,$(OS)),\
 
 $(call gb_CustomTarget_get_workdir,odk/check)/checkbin : \
 		$(SRCDIR)/odk/util/check.pl \
-		$(if $(DOXYGEN),$(call gb_CustomTarget_get_target,odk/odkcommon/docs/cpp)) \
+		$(if $(DOXYGEN),$(call gb_GeneratedPackage_get_target,odk_cpp_docs)) \
 		$(call gb_Package_get_target,odk_bin) \
 		$(if $(filter WNT,$(OS)),$(call gb_Package_get_target,odk_cli)) \
 		$(call gb_Package_get_target,odk_config) \
diff --git a/odk/CustomTarget_doxygen.mk b/odk/CustomTarget_doxygen.mk
index bddb0f3..6558193 100644
--- a/odk/CustomTarget_doxygen.mk
+++ b/odk/CustomTarget_doxygen.mk
@@ -7,7 +7,7 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_CustomTarget_CustomTarget,odk/odkcommon/docs/cpp))
+$(eval $(call gb_CustomTarget_CustomTarget,odk/docs/cpp))
 
 CPPDOCREFNAME := "$(PRODUCTNAME) $(PRODUCTVERSION) SDK C/C++ API Reference"
 
@@ -29,17 +29,17 @@ DOXY_INPUT := $(SRCDIR)/odk/pack/gendocu/main.dox $(SRCDIR)/include/sal/log-area
 	$(addprefix $(INSTDIR)/$(gb_Package_SDKDIRNAME)/include/,$(odk_INCDIRLIST) $(odk_INCFILELIST))
 DOXY_INPUT := $(if $(filter WNT,$(OS)),$(shell cygpath -u $(DOXY_INPUT)),$(DOXY_INPUT))
 DOXY_WORKDIR := $(if $(filter WNT,$(OS)),\
-	$(shell cygpath -u $(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/ref),\
-	$(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/ref)
+	$(shell cygpath -u $(call gb_CustomTarget_get_workdir,odk/docs/cpp)/ref),\
+	$(call gb_CustomTarget_get_workdir,odk/docs/cpp)/ref)
 DOXY_STRIP_PATH := $(if $(filter WNT,$(OS)),$(shell cygpath -u $(OUTDIR)/inc),$(OUTDIR)/inc)
 
 
-$(eval $(call gb_CustomTarget_register_targets,odk/odkcommon/docs/cpp,\
+$(eval $(call gb_CustomTarget_register_targets,odk/docs/cpp,\
 	Doxyfile \
 	doxygen.log \
 ))
 
-$(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/Doxyfile : $(SRCDIR)/odk/pack/gendocu/Doxyfile
+$(call gb_CustomTarget_get_workdir,odk/docs/cpp)/Doxyfile : $(SRCDIR)/odk/pack/gendocu/Doxyfile
 	$(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),SED,1)
 	sed -e 's!^INPUT = %$$!INPUT = $(DOXY_INPUT)!' \
 		-e 's!^OUTPUT_DIRECTORY = %$$!OUTPUT_DIRECTORY = $(DOXY_WORKDIR)!' \
@@ -49,8 +49,8 @@ $(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/Doxyfile : $(SRCDIR)/
 		-e 's!^STRIP_FROM_PATH = %$$!STRIP_FROM_PATH = $(DOXY_STRIP_PATH)!' \
 		$< > $@
 
-$(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/doxygen.log : \
-		$(call gb_CustomTarget_get_workdir,odk/odkcommon/docs/cpp)/Doxyfile \
+$(call gb_CustomTarget_get_workdir,odk/docs/cpp)/doxygen.log : \
+		$(call gb_CustomTarget_get_workdir,odk/docs/cpp)/Doxyfile \
 		$(SRCDIR)/include/sal/log-areas.dox \
 		$(SRCDIR)/odk/pack/gendocu/main.dox \
 		$(call gb_PackageSet_get_target,odk_headers)
diff --git a/odk/Zip_cppdocs.mk b/odk/GeneratedPackage_cpp_docs.mk
similarity index 54%
rename from odk/Zip_cppdocs.mk
rename to odk/GeneratedPackage_cpp_docs.mk
index 1f86757..313980f 100644
--- a/odk/Zip_cppdocs.mk
+++ b/odk/GeneratedPackage_cpp_docs.mk
@@ -7,14 +7,10 @@
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 #
 
-$(eval $(call gb_Zip_Zip,cppdocs,$(call gb_CustomTarget_get_workdir,odk/odkcommon)))
+$(eval $(call gb_GeneratedPackage_GeneratedPackage,odk_cpp_docs,$(call gb_CustomTarget_get_workdir,odk/docs/cpp)))
 
-$(eval $(call gb_Zip_add_files,cppdocs,\
-	docs/cpp/ref \
-))
+$(eval $(call gb_GeneratedPackage_use_customtarget,odk_cpp_docs,odk/docs/cpp))
 
-$(eval $(call gb_Zip_add_commandoptions,cppdocs,-r))
-
-$(call gb_Zip_get_target,cppdocs) : $(call gb_CustomTarget_get_target,odk/odkcommon/docs/cpp)
+$(eval $(call gb_GeneratedPackage_add_dir,odk_cpp_docs,$(gb_Package_SDKDIRNAME)/docs/cpp/ref,ref))
 
 # vim: set noet sw=4 ts=4:
diff --git a/odk/Module_odk.mk b/odk/Module_odk.mk
index aab0539..f7cc777 100644
--- a/odk/Module_odk.mk
+++ b/odk/Module_odk.mk
@@ -13,7 +13,7 @@ $(eval $(call gb_Module_add_targets,odk,\
 	$(if $(filter WNT,$(OS)),Package_cli) \
 	$(if $(DOXYGEN),\
 		CustomTarget_doxygen \
-		Zip_cppdocs \
+		GeneratedPackage_cpp_docs \
 	) \
 	CustomTarget_html \
 	CustomTarget_settings \
diff --git a/scp2/source/sdkoo/sdkoo.scp b/scp2/source/sdkoo/sdkoo.scp
index 868aed0..652b73c 100644
--- a/scp2/source/sdkoo/sdkoo.scp
+++ b/scp2/source/sdkoo/sdkoo.scp
@@ -227,9 +227,9 @@ End
 #if defined(DOXYGEN)
 File gid_File_Zip_cppdocs
     TXT_FILE_BODY;
-    Dir = gid_Dir_Basis_Sdk;
-    Name = "cppdocs.zip";
-    Styles = (ARCHIVE,USE_INTERNAL_RIGHTS);
+    Dir = FILELIST_SDK_DIR;
+    Name = "odk_cpp_docs.filelist";
+    Styles = (FILELIST,USE_INTERNAL_RIGHTS);
 End
 #endif
 
commit 0fd330ec4db4c75e08976a72f1c846b1bcf68594
Author: David Tardon <dtardon at redhat.com>
Date:   Sat May 4 13:21:33 2013 +0200

    gbuild: add Package equiv. for copying whole dirs
    
    This is in preparation for using doxygen to generate IDL docs. Because
    the file names generated by doxygen are essentially random, it is not
    possible to use a Package to deliver them. And we really do not want to
    go back to using Zip, as unpacking slows the installation down.
    
    Change-Id: I5f4aa6bf10c6aab30a5b1870e04dca723c123317
    Reviewed-on: https://gerrit.libreoffice.org/3774
    Reviewed-by: David Tardon <dtardon at redhat.com>
    Tested-by: David Tardon <dtardon at redhat.com>

diff --git a/Makefile.in b/Makefile.in
index 892a369..74b53aa 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -108,6 +108,7 @@ gbuild_TARGETS := AllLangHelp \
 	Extension \
 	ExternalPackage \
 	ExternalProject \
+	GeneratedPackage \
 	InstallModule \
 	InstallScript \
 	InternalUnoApi \
diff --git a/instsetoo_native/util/openoffice.lst.in b/instsetoo_native/util/openoffice.lst.in
index ffef5c7..52e9c2a 100644
--- a/instsetoo_native/util/openoffice.lst.in
+++ b/instsetoo_native/util/openoffice.lst.in
@@ -82,7 +82,7 @@ LibreOffice
         downloadname    LibreOffice_{productversion}_{os}_install_{languages}
         langpackdownloadname    LibreOffice_{productversion}_languagepack_{os}_install_{languages}
         helppackdownloadname    LibreOffice_{productversion}_helppack_{os}_install_{languages}
-        include         {solarenvpath}/{os}/loader2,.,{localpath}/bin,{solarpath}/bin.{minor}/ooowoure,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor}/desktop-integration/{pkgtype},{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice,{solarpath}/pck.{minor},{solarpath}/xml.{minor}/office/instance,{solarpath}/xml.{minor},../../external/common,{solarenvpath}/{os}/OOo_external,{filelistpath}/PackageSet,{filelistpath}/Package
+        include         {solarenvpath}/{os}/loader2,.,{localpath}/bin,{solarpath}/bin.{minor}/ooowoure,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor}/desktop-integration/{pkgtype},{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice,{solarpath}/pck.{minor},{solarpath}/xml.{minor}/office/instance,{solarpath}/xml.{minor},../../external/common,{solarenvpath}/{os}/OOo_external,{filelistpath}/PackageSet,{filelistpath}/Package,{filelistpath}/GeneratedPackage
     }
 }
 
@@ -138,7 +138,7 @@ LibreOffice_Dev
         downloadname    LibreOfficeDev_{productversion}_{os}_install_{languages}
         langpackdownloadname    LibreOfficeDev_{productversion}_languagepack_{os}_install_{languages}
         helppackdownloadname    LibreOfficeDev_{productversion}_helppack_{os}_install_{languages}
-        include         {solarenvpath}/{os}/loader2,.,{localpath}/bin/dev,{localpath}/bin,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor}/desktop-integration/{pkgtype},{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice_dev,{solarpath}/pck.{minor}/openoffice,{solarpath}/pck.{minor},{solarpath}/xml.{minor}/office/instance,{solarpath}/xml.{minor},../../external/common,{solarenvpath}/{os}/OOo_external,{filelistpath}/PackageSet,{filelistpath}/Package
+        include         {solarenvpath}/{os}/loader2,.,{localpath}/bin/dev,{localpath}/bin,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor}/desktop-integration/{pkgtype},{solarpath}/bin.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor}/openoffice_dev,{solarpath}/pck.{minor}/openoffice,{solarpath}/pck.{minor},{solarpath}/xml.{minor}/office/instance,{solarpath}/xml.{minor},../../external/common,{solarenvpath}/{os}/OOo_external,{filelistpath}/PackageSet,{filelistpath}/Package,{filelistpath}/GeneratedPackage
     }
 }
 
@@ -177,7 +177,7 @@ LibreOffice_SDK
         active 1
         compression 5
         script sdkoo
-        include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/sdkoo,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor},{solarpath}/filelists.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarenvpath}/{os}/MS,{filelistpath}/PackageSet,{filelistpath}/Package
+        include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/sdkoo,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor},{solarpath}/filelists.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarenvpath}/{os}/MS,{filelistpath}/PackageSet,{filelistpath}/Package,{filelistpath}/GeneratedPackage
     }
 }
 
@@ -223,7 +223,7 @@ LibreOffice_Dev_SDK
         active 1
         compression 5
         script sdkoo
-        include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/sdkoo,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor},{solarpath}/filelists.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarenvpath}/{os}/MS,{filelistpath}/PackageSet,{filelistpath}/Package
+        include {solarenvpath}/{os}/loader2,{solarpath}/bin.{minor}/sdkoo,{solarpath}/bin.{minor}/osl,{solarpath}/bin.{minor},{solarpath}/filelists.{minor},{solarpath}/lib.{minor},{solarpath}/pck.{minor},{solarenvpath}/{os}/MS,{filelistpath}/PackageSet,{filelistpath}/Package,{filelistpath}/GeneratedPackage
     }
 }
 
diff --git a/solenv/gbuild/GeneratedPackage.mk b/solenv/gbuild/GeneratedPackage.mk
new file mode 100644
index 0000000..91714e9
--- /dev/null
+++ b/solenv/gbuild/GeneratedPackage.mk
@@ -0,0 +1,111 @@
+# -*- 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/.
+#
+
+# class GeneratedPackage
+
+# Enables to deliver whole directories (of generated files) to $(INSTDIR).
+#
+# GeneratedPackage shall be used as a substitution for Package when the
+# names of the produced files are not known in advance (in older times,
+# we used Zip in these places). It shall only be used to deliver files
+# for installation.
+#
+# If you know the filenames in advance, use Package. Laziness is not an
+# excuse.
+
+gb_GeneratedPackage__get_srcdir = $(lastword $(subst :, ,$(1)))
+gb_GeneratedPackage__get_destdir = $(firstword $(subst :, ,$(1)))
+
+define gb_GeneratedPackage__command_cp
+mkdir -p $(dir $(INSTDIR)/$(2)) && \
+cp -r $(PACKAGE_SOURCEDIR)/$(1) $(INSTDIR)/$(2)
+endef
+
+define gb_GeneratedPackage__command
+$(call gb_Output_announce,$(2),$(true),GPK,2)
+$(call gb_Helper_abbreviate_dirs,\
+	rm -rf $(addprefix $(INSTDIR)/,$(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair)))) && \
+	$(foreach pair,$(PACKAGE_DIRS),\
+		$(call gb_GeneratedPackage__command_cp,$(call gb_GeneratedPackage__get_srcdir,$(pair)),$(call gb_GeneratedPackage__get_destdir,$(pair))) &&) \
+	find \
+		$(addprefix $(INSTDIR)/,$(foreach pair,$(PACKAGE_DIRS),$(call gb_GeneratedPackage__get_destdir,$(pair)))) \
+		\( -type f -o -type l \) -print \
+		> $(1) \
+)
+endef
+
+define gb_GeneratedPackage__check_dirs
+$(if $(PACKAGE_DIRS),,$(call gb_Ouput_error,no dirs were added))
+$(foreach pair,$(PACKAGE_DIRS),\
+	$(if $(wildcard $(PACKAGE_SOURCEDIR)/$(call gb_GeneratedPackage__get_srcdir,$(pair))),,\
+		$(call gb_Output_error,source dir $(call gb_GeneratedPackage__get_srcdir,$(pair)) does not exist) \
+	) \
+)
+
+endef
+
+$(dir $(call gb_GeneratedPackage_get_target,%)).dir :
+	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(dir $(call gb_GeneratedPackage_get_target,%))%.dir :
+	$(if $(wildcard $(dir $@)),,mkdir -p $(dir $@))
+
+$(call gb_GeneratedPackage_get_target,%) :
+	$(call gb_GeneratedPackage__check_dirs,$*)
+	$(call gb_GeneratedPackage__command,$@,$*)
+
+.PHONY : $(call gb_GeneratedPackage_get_clean_target,%)
+$(call gb_GeneratedPackage_get_clean_target,%) :
+	$(call gb_Output_announce,$*,$(false),GPK,2)
+	rm -rf $(call gb_GeneratedPackage_get_target,$*) $(addprefix $(INSTDIR)/,$(PACKAGE_DIRS))
+
+# Create a generated package.
+#
+# gb_GeneratedPackage_GeneratedPackage package srcdir
+define gb_GeneratedPackage_GeneratedPackage
+$(call gb_GeneratedPackage_get_target,$(1)) : PACKAGE_DIRS :=
+$(call gb_GeneratedPackage_get_target,$(1)) : PACKAGE_SOURCEDIR := $(2)
+$(call gb_GeneratedPackage_get_clean_target,$(1)) : PACKAGE_DIRS :=
+
+$(call gb_GeneratedPackage_get_target,$(1)) : $(gb_Module_CURRENTMAKEFILE)
+$(call gb_GeneratedPackage_get_target,$(1)) :| $(dir $(call gb_GeneratedPackage_get_target,$(1))).dir
+
+$$(eval $$(call gb_Module_register_target,$(call gb_GeneratedPackage_get_target,$(1)),$(call gb_GeneratedPackage_get_clean_target,$(1))))
+$(call gb_Helper_make_userfriendly_targets,$(1),GeneratedPackage)
+
+endef
+
+# Depend on a custom target.
+#
+# gb_GeneratedPackage_use_customtarget package custom-target
+define gb_GeneratedPackage_use_customtarget
+$(call gb_GeneratedPackage_get_target,$(1)) : $(call gb_CustomTarget_get_target,$(2))
+
+endef
+
+# Depend on an unpacked tarball.
+#
+# gb_GeneratedPackage_use_unpacked package unpacked
+define gb_GeneratedPackage_use_unpacked
+$(call gb_GeneratedPackage_get_target,$(1)) : $(call gb_UnpackedTarball_get_target,$(2))
+
+endef
+
+# Add a dir to the package.
+#
+# The srcdir will be copied to $(INSTDIR) as destdir.
+#
+# gb_GeneratedPackage_add_dir package destdir srcdir
+define gb_GeneratedPackage_add_dir
+$(call gb_GeneratedPackage_get_target,$(1)) : PACKAGE_DIRS += $(strip $(2)):$(strip $(3))
+$(call gb_GeneratedPackage_get_clean_target,$(1)) : PACKAGE_DIRS += $(2)
+
+endef
+
+# vim: set noet sw=4 ts=4:
diff --git a/solenv/gbuild/TargetLocations.mk b/solenv/gbuild/TargetLocations.mk
index 727e582..a66e11e 100644
--- a/solenv/gbuild/TargetLocations.mk
+++ b/solenv/gbuild/TargetLocations.mk
@@ -117,6 +117,7 @@ gb_ExternalProject_get_statedir = $(WORKDIR)/ExternalProject/$(1)
 gb_ExternalProject_get_preparation_target = $(WORKDIR)/ExternalProject/$(1).prepare
 gb_ExternalProject_get_state_target = $(WORKDIR)/ExternalProject/$(1)/$(2)
 gb_ExternalProject_get_target = $(WORKDIR)/ExternalProject/$(1).done
+gb_GeneratedPackage_get_target = $(WORKDIR)/GeneratedPackage/$(1).filelist
 gb_HelpIndexTarget_get_target = $(WORKDIR)/HelpIndexTarget/$(1).done
 gb_HelpJarTarget_get_target = $(WORKDIR)/HelpJarTarget/$(1).done
 gb_HelpLinkTarget_get_preparation_target = $(WORKDIR)/HelpLinkTarget/$(1).prepare
@@ -269,6 +270,7 @@ $(eval $(call gb_Helper_make_clean_targets,\
 	Dictionary \
 	ExternalPackage \
 	ExtensionTarget \
+	GeneratedPackage \
 	HelpTarget \
 	HelpIndexTarget \
 	HelpJarTarget \
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 50bba72..a72591a 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -346,6 +346,7 @@ include $(foreach class, \
 	AutoInstallLibs \
 	Postprocess \
 	PackageSet \
+	GeneratedPackage \
 ,$(GBUILDDIR)/$(class).mk)
 
 $(eval $(call gb_Helper_process_executable_registrations))


More information about the Libreoffice-commits mailing list