[Libreoffice-commits] core.git: Branch 'feature/wasm' - config_host.mk.in external/Module_external.mk RepositoryExternal.mk solenv/bin solenv/gbuild writerperfect/Library_wpftwriter.mk writerperfect/source

Armin Le Grand (Allotropia) (via logerrit) logerrit at kemper.freedesktop.org
Mon May 17 15:44:57 UTC 2021


 RepositoryExternal.mk                                     |    2 
 config_host.mk.in                                         |    1 
 external/Module_external.mk                               |    7 ++-
 solenv/bin/native-code.py                                 |    4 -
 solenv/gbuild/gbuild.mk                                   |    1 
 writerperfect/Library_wpftwriter.mk                       |   20 ++++++++-
 writerperfect/source/writer/wpftwriter.component          |    8 ---
 writerperfect/source/writer/wpftwriter.extended.component |   29 ++++++++++++++
 8 files changed, 58 insertions(+), 14 deletions(-)

New commits:
commit 640d53e1e7c11d15ad7bfa48e0425198c21c3e35
Author:     Armin Le Grand (Allotropia) <Armin.Le.Grand at me.com>
AuthorDate: Mon May 17 17:43:49 2021 +0200
Commit:     Armin Le Grand (Allotropia) <Armin.Le.Grand at me.com>
CommitDate: Mon May 17 17:43:49 2021 +0200

    Wasm optional EPUB removal
    
    Change-Id: Ia7c50b7e66ac2398303c4a26cf169bee94aec57c

diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 8cfd50971a0e..c7c530294aa9 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -1903,6 +1903,7 @@ endef
 gb_ExternalProject__use_epubgen :=
 
 else # !SYSTEM_EPUBGEN
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
 
 define gb_LinkTarget__use_epubgen
 $(call gb_LinkTarget_set_include,$(1),\
@@ -1920,6 +1921,7 @@ $(call gb_ExternalProject_use_external_project,$(1),libepubgen)
 
 endef
 
+endif # ENABLE_WASM_STRIP_EPUB
 endif # SYSTEM_EPUBGEN
 
 ifneq ($(SYSTEM_REVENGE),)
diff --git a/config_host.mk.in b/config_host.mk.in
index 48a55d6b9a2c..0312597f6757 100644
--- a/config_host.mk.in
+++ b/config_host.mk.in
@@ -212,6 +212,7 @@ export ENABLE_WASM_STRIP_CLUCENE=@ENABLE_WASM_STRIP@
 export ENABLE_WASM_STRIP_DBACCESS=@ENABLE_WASM_STRIP@
 export ENABLE_WASM_STRIP_ACCESSIBILITY=@ENABLE_WASM_STRIP@
 export ENABLE_WASM_STRIP_UCPHELP=@ENABLE_WASM_STRIP@
+export ENABLE_WASM_STRIP_EPUB=@ENABLE_WASM_STRIP@
 export ENABLE_WERROR=@ENABLE_WERROR@
 export ENDIANNESS=@ENDIANNESS@
 export EPM=@EPM@
diff --git a/external/Module_external.mk b/external/Module_external.mk
index 6828ad3a0317..6d015590587e 100644
--- a/external/Module_external.mk
+++ b/external/Module_external.mk
@@ -19,6 +19,12 @@ $(eval $(call gb_Module_add_moduledirs,external,\
 ))
 endif
 
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
+$(eval $(call gb_Module_add_moduledirs,external,\
+	$(call gb_Helper_optional,EPUBGEN,libepubgen) \
+))
+endif
+
 $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,XMLSEC,xmlsec) \
 	$(call gb_Helper_optional,ABW,libabw) \
@@ -40,7 +46,6 @@ $(eval $(call gb_Module_add_moduledirs,external,\
 	$(call gb_Helper_optional,EBOOK,libebook) \
 	$(call gb_Helper_optional,EPM,epm) \
 	$(call gb_Helper_optional,EPOXY,epoxy) \
-	$(call gb_Helper_optional,EPUBGEN,libepubgen) \
 	$(call gb_Helper_optional,ETONYEK,libetonyek) \
 	$(call gb_Helper_optional,EXPAT,expat) \
 	$(call gb_Helper_optional,FIREBIRD,firebird) \
diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index a1ea83bf70e5..e8ef67571c7a 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -677,7 +677,7 @@ writer_factory_list = [
 
 writer_constructor_list = [
 # basic/util/sb.component
-    ("com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation","#if HAVE_FEATURE_SCRIPTING"),
+    ("com_sun_star_comp_sfx2_DialogLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
     ("com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
 # filter/source/textfilterdetect/textfd.component
     "com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation",
@@ -698,7 +698,7 @@ writer_constructor_list = [
     "com_sun_star_comp_Writer_RtfFilter_get_implementation",
     "com_sun_star_comp_Writer_WriterFilter_get_implementation",
 # writerperfect/source/writer/wpftwriter.component
-    "com_sun_star_comp_Writer_EPUBExportFilter_get_implementation",
+    ("com_sun_star_comp_Writer_EPUBExportFilter_get_implementation", "#ifndef ENABLE_WASM_STRIP_EPUB"),
     ]
 
 desktop_factory_list = [
diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk
index 017b2e6d600d..beccae4cbbf5 100644
--- a/solenv/gbuild/gbuild.mk
+++ b/solenv/gbuild/gbuild.mk
@@ -233,6 +233,7 @@ gb_GLOBALDEFS += -DENABLE_WASM_STRIP_CLUCENE
 gb_GLOBALDEFS += -DENABLE_WASM_STRIP_DBACCESS
 gb_GLOBALDEFS += -DENABLE_WASM_STRIP_ACCESSIBILITY
 gb_GLOBALDEFS += -DENABLE_WASM_STRIP_UCPHELP
+gb_GLOBALDEFS += -DENABLE_WASM_STRIP_EPUB
 endif
 
 ifeq ($(gb_ENABLE_DBGUTIL),$(true))
diff --git a/writerperfect/Library_wpftwriter.mk b/writerperfect/Library_wpftwriter.mk
index 8993cca31490..516e96770c3c 100644
--- a/writerperfect/Library_wpftwriter.mk
+++ b/writerperfect/Library_wpftwriter.mk
@@ -26,6 +26,10 @@ $(eval $(call gb_Library_set_include,wpftwriter,\
 
 $(eval $(call gb_Library_set_componentfile,wpftwriter,writerperfect/source/writer/wpftwriter))
 
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
+$(eval $(call gb_Library_set_componentfile,wpftwriter,writerperfect/source/writer/wpftwriter.extended))
+endif
+
 $(eval $(call gb_Library_use_sdk_api,wpftwriter))
 
 $(eval $(call gb_Library_use_common_precompiled_header,wpftwriter))
@@ -50,11 +54,16 @@ $(eval $(call gb_Library_use_libraries,wpftwriter,\
 	xo \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
+$(eval $(call gb_Library_use_externals,wpftwriter,\
+	epubgen \
+))
+endif
+
 $(eval $(call gb_Library_use_externals,wpftwriter,\
 	abw \
 	boost_headers \
 	ebook \
-	epubgen \
 	etonyek \
 	icu_headers \
 	icui18n \
@@ -71,13 +80,18 @@ $(eval $(call gb_Library_use_externals,wpftwriter,\
 	zlib \
 ))
 
+ifneq ($(ENABLE_WASM_STRIP_EPUB),TRUE)
 $(eval $(call gb_Library_add_exception_objects,wpftwriter,\
-	writerperfect/source/writer/AbiWordImportFilter \
-	writerperfect/source/writer/EBookImportFilter \
 	writerperfect/source/writer/EPUBExportDialog \
 	writerperfect/source/writer/EPUBExportFilter \
 	writerperfect/source/writer/EPUBExportUIComponent \
 	writerperfect/source/writer/EPUBPackage \
+))
+endif
+
+$(eval $(call gb_Library_add_exception_objects,wpftwriter,\
+	writerperfect/source/writer/AbiWordImportFilter \
+	writerperfect/source/writer/EBookImportFilter \
 	writerperfect/source/writer/MSWorksImportFilter \
 	writerperfect/source/writer/MWAWImportFilter \
 	writerperfect/source/writer/PagesImportFilter \
diff --git a/writerperfect/source/writer/wpftwriter.component b/writerperfect/source/writer/wpftwriter.component
index 8ab436634052..ace6b687363c 100644
--- a/writerperfect/source/writer/wpftwriter.component
+++ b/writerperfect/source/writer/wpftwriter.component
@@ -53,12 +53,4 @@
     <service name="com.sun.star.document.ImportFilter"/>
     <service name="com.sun.star.document.ExtendedTypeDetection"/>
   </implementation>
-  <implementation name="com.sun.star.comp.Writer.EPUBExportFilter"
-      constructor="com_sun_star_comp_Writer_EPUBExportFilter_get_implementation">
-    <service name="com.sun.star.document.ExportFilter"/>
-  </implementation>
-  <implementation name="com.sun.star.comp.Writer.EPUBExportUIComponent"
-      constructor="com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation">
-    <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
-  </implementation>
 </component>
diff --git a/writerperfect/source/writer/wpftwriter.extended.component b/writerperfect/source/writer/wpftwriter.extended.component
new file mode 100644
index 000000000000..fa7ef541dc51
--- /dev/null
+++ b/writerperfect/source/writer/wpftwriter.extended.component
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ *   Licensed to the Apache Software Foundation (ASF) under one or more
+ *   contributor license agreements. See the NOTICE file distributed
+ *   with this work for additional information regarding copyright
+ *   ownership. The ASF licenses this file to you under the Apache
+ *   License, Version 2.0 (the "License"); you may not use this file
+ *   except in compliance with the License. You may obtain a copy of
+ *   the License at http://www.apache.org/licenses/LICENSE-2.0 .
+-->
+<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
+    xmlns="http://openoffice.org/2010/uno-components">
+  <implementation name="com.sun.star.comp.Writer.EPUBExportFilter"
+      constructor="com_sun_star_comp_Writer_EPUBExportFilter_get_implementation">
+    <service name="com.sun.star.document.ExportFilter"/>
+  </implementation>
+  <implementation name="com.sun.star.comp.Writer.EPUBExportUIComponent"
+      constructor="com_sun_star_comp_Writer_EPUBExportUIComponent_get_implementation">
+    <service name="com.sun.star.ui.dialogs.FilterOptionsDialog"/>
+  </implementation>
+</component>


More information about the Libreoffice-commits mailing list