diff options
author | CoprDistGit <infra@openeuler.org> | 2023-09-20 11:17:42 +0000 |
---|---|---|
committer | CoprDistGit <infra@openeuler.org> | 2023-09-20 11:17:42 +0000 |
commit | e2ab3c3fc1131020c02df50dc2ecf4e8c454c0ab (patch) | |
tree | 60ab00f87d59bb0c7d2c863b65d2c5ccfd8774c6 | |
parent | 5b94c33165b2b247e6929598a643bfee776d397c (diff) |
automatic import of libreoffice
-rw-r--r-- | .gitignore | 16 | ||||
-rw-r--r-- | 0001-Revert-java-9-changes.patch | 470 | ||||
-rw-r--r-- | Add-riscv64-support.diff | 1972 | ||||
-rw-r--r-- | boost-1.81-locale.patch | 41 | ||||
-rw-r--r-- | install-with-hardlinks.diff | 13 | ||||
-rw-r--r-- | libreoffice-7.4.2.3.tar.xz | 3 | ||||
-rw-r--r-- | libreoffice-7.4.2.3.tar.xz.asc | 3 | ||||
-rw-r--r-- | libreoffice-help-7.4.2.3.tar.xz | 3 | ||||
-rw-r--r-- | libreoffice-help-7.4.2.3.tar.xz.asc | 3 | ||||
-rw-r--r-- | libreoffice-no-destdircheck.patch | 27 | ||||
-rw-r--r-- | libreoffice-translations-7.4.2.3.tar.xz | 3 | ||||
-rw-r--r-- | libreoffice-translations-7.4.2.3.tar.xz.asc | 3 | ||||
-rw-r--r-- | libreoffice.spec | 1303 | ||||
-rw-r--r-- | mediawiki-no-broken-help.diff | 9 | ||||
-rw-r--r-- | nlpsolver-no-broken-help.diff | 12 | ||||
-rw-r--r-- | pdfium-5058.tar.bz2 | 3 | ||||
-rw-r--r-- | skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz | 3 | ||||
-rw-r--r-- | sources | 16 |
18 files changed, 3903 insertions, 0 deletions
@@ -0,0 +1,16 @@ +/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip +/185d60944ea767075d27247c3162b3bc-unowinreg.dll +/1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt +/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip +/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip +/8249374c274932a21846fa7629c2aa9b-officeotron-0.7.4-master.jar +/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2 +/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip +/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt +/dragonbox-1.1.0.tar.gz +/dtoa-20180411.tgz +/gpgme-1.13.1.tar.bz2 +/libassuan-2.5.3.tar.bz2 +/libcmis-0.5.2.tar.xz +/libgpg-error-1.37.tar.bz2 +/odfvalidator-0.9.0-RC2-SNAPSHOT-jar-with-dependencies-2726ab578664434a545f8379a01a9faffac0ae73.jar diff --git a/0001-Revert-java-9-changes.patch b/0001-Revert-java-9-changes.patch new file mode 100644 index 0000000..67829aa --- /dev/null +++ b/0001-Revert-java-9-changes.patch @@ -0,0 +1,470 @@ +From 702c015e4127de65a4d8ab8a665bf6af6518ef4a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Fridrich=20=C5=A0trba?= <fridrich.strba@bluewin.ch> +Date: Tue, 30 Mar 2021 16:43:17 +0200 +Subject: [PATCH 1/2] Revert java 9 changes + +Change-Id: I09f046f54b107b53c86f76a39553bd11ef03d9f6 +--- + configure.ac | 45 +++++-- + jvmfwk/CustomTarget_jreproperties.mk | 2 +- + ridljar/Jar_libreoffice.mk | 8 +- + ridljar/Jar_unoloader.mk | 11 +- + ridljar/source/libreoffice/module-info.java | 142 -------------------- + ridljar/source/unoloader/module-info.java | 12 -- + solenv/gbuild/Jar.mk | 14 +- + solenv/gbuild/JavaClassSet.mk | 39 +----- + solenv/gbuild/gbuild.mk | 2 - + 9 files changed, 43 insertions(+), 232 deletions(-) + delete mode 100644 ridljar/source/libreoffice/module-info.java + delete mode 100644 ridljar/source/unoloader/module-info.java + +diff --git a/configure.ac b/configure.ac +index f4850a8cb2dc..c2df878df1d7 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -2313,7 +2313,7 @@ AC_ARG_WITH(linker-hash-style, + + AC_ARG_WITH(jdk-home, + AS_HELP_STRING([--with-jdk-home=<absolute path to JDK home>], +- [If you have installed JDK 9 or later on your system please supply the ++ [If you have installed JDK 8 or later on your system please supply the + path here. Note that this is not the location of the java command but the + location of the entire distribution. In case of cross-compiling, this + is the JDK of the host os. Use --with-build-platform-configure-options +@@ -8089,7 +8097,24 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then + elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "BEA"` -gt 0; then + AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac]) + elif test `$JAVAINTERPRETER -version 2>&1 | $AWK '{ print }' | $GREP -c "IBM"` -gt 0; then +- AC_MSG_ERROR([No valid check available. Please check the block for your desired java in configure.ac]) ++ JDK=ibm ++ ++ dnl IBM JDK specific tests ++ _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED s/[[-A-Za-z]]*//` ++ _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` ++ ++ if test "$_jdk_ver" -lt 10800; then ++ AC_MSG_ERROR([IBM JDK is too old, you need at least 8]) ++ fi ++ ++ AC_MSG_RESULT([found (IBM JDK $_jdk)]) ++ ++ if test "$with_jdk_home" = ""; then ++ AC_MSG_ERROR([In order to successfully build LibreOffice using the IBM JDK, ++you must use the "--with-jdk-home" configure option explicitly]) ++ fi ++ ++ JAVA_HOME=$with_jdk_home + else + JDK=sun + +@@ -8097,10 +8122,10 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then + _jdk=`$JAVAINTERPRETER -version 2>&1 | $AWK -F'"' '{ print \$2 }' | $SED '/^$/d' | $SED s/[[-A-Za-z]]*//` + _jdk_ver=`echo "$_jdk" | $AWK -F. '{ print (($1 * 100) + $2) * 100 + $3;}'` + +- if test "$_jdk_ver" -lt 10900; then +- AC_MSG_ERROR([JDK is too old, you need at least 9 ($_jdk_ver < 10900)]) ++ if test "$_jdk_ver" -lt 10800; then ++ AC_MSG_ERROR([JDK is too old, you need at least 8]) + fi +- if test "$_jdk_ver" -gt 10900; then ++ if test "$_jdk_ver" -gt 10800; then + JAVA_CLASSPATH_NOT_SET=TRUE + fi + +@@ -8116,7 +8141,7 @@ if test "$ENABLE_JAVA" != "" -a "$cross_compiling" != "yes"; then + JAVACFLAGS=-J-Xmx128M + fi + else +- AC_MSG_ERROR([Java not found. You need at least JDK 9]) ++ AC_MSG_ERROR([Java not found. You need at least JDK 8]) + fi + else + if test -z "$ENABLE_JAVA"; then +diff --git a/jvmfwk/CustomTarget_jreproperties.mk b/jvmfwk/CustomTarget_jreproperties.mk +index da509dbff5ac..ac8f7c053373 100644 +--- a/jvmfwk/CustomTarget_jreproperties.mk ++++ b/jvmfwk/CustomTarget_jreproperties.mk +@@ -17,7 +17,7 @@ $(call gb_CustomTarget_get_workdir,jvmfwk/jreproperties)/JREProperties.class : \ + $(call gb_Output_announce,$(subst $(WORKDIR)/,,$@),$(true),JCS,1) + $(call gb_Trace_StartRange,$(subst $(WORKDIR)/,,$@),JCS) + $(call gb_Helper_abbreviate_dirs, \ +- cd $(dir $@) && $(call gb_JavaClassSet_JAVACCOMMAND,$(JAVA_TARGET_VER)) $(gb_JavaClassSet_JAVACDEBUG) -d $(dir $@) $^) ++ cd $(dir $@) && $(gb_JavaClassSet_JAVACCOMMAND) $(gb_JavaClassSet_JAVACDEBUG) -d $(dir $@) $^) + $(call gb_Trace_EndRange,$(subst $(WORKDIR)/,,$@),JCS) + + # vim:set shiftwidth=4 tabstop=4 noexpandtab: +diff --git a/ridljar/Jar_libreoffice.mk b/ridljar/Jar_libreoffice.mk +index d34ae3f5ebda..4d0f5ef2545f 100644 +--- a/ridljar/Jar_libreoffice.mk ++++ b/ridljar/Jar_libreoffice.mk +@@ -7,7 +7,7 @@ + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + +-$(eval $(call gb_Jar_Jar,libreoffice,org.libreoffice.uno)) ++$(eval $(call gb_Jar_Jar,libreoffice)) + + $(eval $(call gb_Jar_use_customtargets,libreoffice,\ + ridljar/javamaker \ +@@ -27,15 +27,9 @@ $(eval $(call gb_Jar_add_manifest_classpath,libreoffice, \ + $(if $(filter MACOSX,$(OS)),../../Frameworks/,../) \ + )) + +-# ugly: the module-info.class is manually added here since it's not in "com" dir + $(eval $(call gb_Jar_add_packagedirs,libreoffice,\ + $(call gb_CustomTarget_get_workdir,ridljar/javamaker)/com \ + $(call gb_CustomTarget_get_workdir,unoil/javamaker)/com \ +- $(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,libreoffice))/module-info.class \ +-)) +- +-$(eval $(call gb_Jar_add_sourcefiles_java9,libreoffice,\ +- ridljar/source/libreoffice/module-info \ + )) + + $(eval $(call gb_Jar_add_sourcefiles,libreoffice,\ +diff --git a/ridljar/Jar_unoloader.mk b/ridljar/Jar_unoloader.mk +index 2acf20b5b289..50b32e8f0f88 100644 +--- a/ridljar/Jar_unoloader.mk ++++ b/ridljar/Jar_unoloader.mk +@@ -7,21 +7,12 @@ + # file, You can obtain one at http://mozilla.org/MPL/2.0/. + # + +-$(eval $(call gb_Jar_Jar,unoloader,org.libreoffice.unoloader)) ++$(eval $(call gb_Jar_Jar,unoloader)) + + $(eval $(call gb_Jar_set_packageroot,unoloader,com)) + + $(eval $(call gb_Jar_set_manifest,unoloader,$(SRCDIR)/ridljar/source/unoloader/com/sun/star/lib/unoloader/manifest)) + +-# the module-info.class is manually added here since it's not in "com" dir +-$(eval $(call gb_Jar_add_packagedirs,unoloader,\ +- $(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,unoloader))/module-info.class \ +-)) +- +-$(eval $(call gb_Jar_add_sourcefiles_java9,unoloader,\ +- ridljar/source/unoloader/module-info \ +-)) +- + $(eval $(call gb_Jar_add_sourcefiles,unoloader,\ + ridljar/source/unoloader/com/sun/star/lib/unoloader/UnoClassLoader \ + ridljar/source/unoloader/com/sun/star/lib/unoloader/UnoLoader \ +diff --git a/ridljar/source/libreoffice/module-info.java b/ridljar/source/libreoffice/module-info.java +deleted file mode 100644 +index 8d24c7ccb13c..000000000000 +--- a/ridljar/source/libreoffice/module-info.java ++++ /dev/null +@@ -1,142 +0,0 @@ +-/* +- * 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/. +- */ +- +-module org.libreoffice.uno +-{ +- requires org.libreoffice.unoloader; +- +- exports com.sun.star.accessibility; +- exports com.sun.star.animations; +- exports com.sun.star.auth; +- exports com.sun.star.awt; +- exports com.sun.star.awt.grid; +- exports com.sun.star.awt.tab; +- exports com.sun.star.awt.tree; +- exports com.sun.star.beans; +- exports com.sun.star.bridge; +- exports com.sun.star.bridge.oleautomation; +- exports com.sun.star.chart; +- exports com.sun.star.chart2; +- exports com.sun.star.chart2.data; +- exports com.sun.star.comp.bridgefactory; +- exports com.sun.star.comp.connections; +- exports com.sun.star.comp.helper; +- exports com.sun.star.comp.loader; +- exports com.sun.star.comp.servicemanager; +- exports com.sun.star.comp.urlresolver; +- exports com.sun.star.configuration; +- exports com.sun.star.configuration.backend; +- exports com.sun.star.connection; +- exports com.sun.star.container; +- exports com.sun.star.cui; +- exports com.sun.star.datatransfer; +- exports com.sun.star.datatransfer.clipboard; +- exports com.sun.star.datatransfer.dnd; +- exports com.sun.star.deployment; +- exports com.sun.star.deployment.test; +- exports com.sun.star.deployment.ui; +- exports com.sun.star.document; +- exports com.sun.star.drawing; +- exports com.sun.star.drawing.framework; +- exports com.sun.star.embed; +- exports com.sun.star.form; +- exports com.sun.star.form.binding; +- exports com.sun.star.form.control; +- exports com.sun.star.form.runtime; +- exports com.sun.star.form.submission; +- exports com.sun.star.form.validation; +- exports com.sun.star.formula; +- exports com.sun.star.frame; +- exports com.sun.star.frame.status; +- exports com.sun.star.gallery; +- exports com.sun.star.geometry; +- exports com.sun.star.graphic; +- exports com.sun.star.i18n; +- exports com.sun.star.inspection; +- exports com.sun.star.io; +- exports com.sun.star.java; +- exports com.sun.star.lang; +- exports com.sun.star.ldap; +- exports com.sun.star.lib.connections.pipe; +- exports com.sun.star.lib.connections.socket; +- exports com.sun.star.lib.uno; +- exports com.sun.star.lib.uno.adapter; +- exports com.sun.star.lib.uno.bridges.java_remote; +- exports com.sun.star.lib.uno.environments.java; +- exports com.sun.star.lib.uno.environments.remote; +- exports com.sun.star.lib.uno.helper; +- exports com.sun.star.lib.uno.protocols.urp; +- exports com.sun.star.lib.uno.typedesc; +- exports com.sun.star.lib.uno.typeinfo; +- exports com.sun.star.lib.util; +- exports com.sun.star.linguistic2; +- exports com.sun.star.loader; +- exports com.sun.star.logging; +- exports com.sun.star.mail; +- exports com.sun.star.media; +- exports com.sun.star.mozilla; +- exports com.sun.star.office; +- exports com.sun.star.packages; +- exports com.sun.star.packages.manifest; +- exports com.sun.star.packages.zip; +- exports com.sun.star.presentation; +- exports com.sun.star.qa; +- exports com.sun.star.rdf; +- exports com.sun.star.reflection; +- exports com.sun.star.registry; +- exports com.sun.star.rendering; +- exports com.sun.star.report; +- exports com.sun.star.report.inspection; +- exports com.sun.star.report.meta; +- exports com.sun.star.resource; +- exports com.sun.star.scanner; +- exports com.sun.star.script; +- exports com.sun.star.script.browse; +- exports com.sun.star.script.provider; +- exports com.sun.star.script.vba; +- exports com.sun.star.sdb; +- exports com.sun.star.sdb.application; +- exports com.sun.star.sdb.tools; +- exports com.sun.star.sdbc; +- exports com.sun.star.sdbcx; +- exports com.sun.star.security; +- exports com.sun.star.setup; +- exports com.sun.star.sheet; +- exports com.sun.star.sheet.opencl; +- exports com.sun.star.smarttags; +- exports com.sun.star.style; +- exports com.sun.star.svg; +- exports com.sun.star.system; +- exports com.sun.star.table; +- exports com.sun.star.task; +- exports com.sun.star.text; +- exports com.sun.star.text.textfield; +- exports com.sun.star.tiledrendering; +- exports com.sun.star.ucb; +- exports com.sun.star.ui; +- exports com.sun.star.ui.dialogs; +- exports com.sun.star.ui.test; +- exports com.sun.star.uno; +- exports com.sun.star.uri; +- exports com.sun.star.util; +- exports com.sun.star.view; +- exports com.sun.star.xforms; +- exports com.sun.star.xml; +- exports com.sun.star.xml.crypto; +- exports com.sun.star.xml.crypto.sax; +- exports com.sun.star.xml.csax; +- exports com.sun.star.xml.dom; +- exports com.sun.star.xml.dom.events; +- exports com.sun.star.xml.dom.views; +- exports com.sun.star.xml.input; +- exports com.sun.star.xml.sax; +- exports com.sun.star.xml.wrapper; +- exports com.sun.star.xml.xpath; +- exports com.sun.star.xml.xslt; +- exports com.sun.star.xsd; +-} +diff --git a/ridljar/source/unoloader/module-info.java b/ridljar/source/unoloader/module-info.java +deleted file mode 100644 +index 6eed39c96df4..000000000000 +--- a/ridljar/source/unoloader/module-info.java ++++ /dev/null +@@ -1,12 +0,0 @@ +-/* +- * 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/. +- */ +- +-module org.libreoffice.unoloader +-{ +- exports com.sun.star.lib.unoloader; +-} +diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk +index 9592fbbad6a6..3fa40e03c754 100644 +--- a/solenv/gbuild/Jar.mk ++++ b/solenv/gbuild/Jar.mk +@@ -94,7 +94,6 @@ endef + # creates a class set and a dependency to it + # registers target and clean target + # adds jar files to DeliverLogTarget +-# call gb_Jar_Jar,jarname,java9modulename + define gb_Jar_Jar + ifeq (,$$(findstring $(1),$$(gb_Jar_KNOWN))) + $$(eval $$(call gb_Output_info,Currently known jars are: $(sort $(gb_Jar_KNOWN)),ALL)) +@@ -107,7 +106,7 @@ $(call gb_Jar_get_target,$(1)) : PACKAGEDIRS := + $(call gb_Jar_get_target,$(1)) : PACKAGEFILES := + $(call gb_Jar_get_target,$(1)) : \ + $(call gb_JavaClassSet_get_target,$(call gb_Jar_get_classsetname,$(1))) +-$(call gb_JavaClassSet_JavaClassSet,$(call gb_Jar_get_classsetname,$(1)),$(2)) ++$(call gb_JavaClassSet_JavaClassSet,$(call gb_Jar_get_classsetname,$(1))) + $(eval $(call gb_Module_register_target,$(call gb_Jar_get_target,$(1)),$(call gb_Jar_get_clean_target,$(1)))) + $(call gb_Helper_make_userfriendly_targets,$(1),Jar,$(call gb_Jar_get_target,$(1))) + +@@ -122,12 +121,6 @@ $(call gb_JavaClassSet_add_sourcefile,$(call gb_Jar_get_classsetname,$(1)),$(2)) + + endef + +-define gb_Jar_add_sourcefile_java9 +-$(call gb_JavaClassSet_add_sourcefile_java9,$(call gb_Jar_get_classsetname,$(1)),$(2)) +- +-endef +- +- + # PACKAGEROOTS is the list of all root folders created by the JavaClassSet to pack into the jar (without META-INF as this is added automatically) + define gb_Jar_set_packageroot + $(call gb_Jar_get_target,$(1)) : PACKAGEROOTS := $(2) +@@ -166,11 +159,6 @@ $(foreach sourcefile,$(2),$(call gb_Jar_add_sourcefile,$(1),$(sourcefile))) + + endef + +-define gb_Jar_add_sourcefiles_java9 +-$(foreach sourcefile,$(2),$(call gb_Jar_add_sourcefile_java9,$(1),$(sourcefile))) +- +-endef +- + define gb_Jar_add_generated_sourcefile + $(call gb_JavaClassSet_add_generated_sourcefile,$(call gb_Jar_get_classsetname,$(1)),$(2)) + +diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk +index 39887dee6e5b..dc7d02e8904a 100644 +--- a/solenv/gbuild/JavaClassSet.mk ++++ b/solenv/gbuild/JavaClassSet.mk +@@ -17,11 +17,10 @@ + # the License at http://www.apache.org/licenses/LICENSE-2.0 . + # + +-gb_JavaClassSet_JAVACCOMMAND = $(ICECREAM_RUN) $(JAVACOMPILER) $(JAVACFLAGS) \ ++gb_JavaClassSet_JAVACCOMMAND := $(ICECREAM_RUN) $(JAVACOMPILER) $(JAVAFLAGS) \ + -encoding utf8 \ +- --release $(1) \ ++ -source $(JAVA_SOURCE_VER) -target $(JAVA_TARGET_VER) \ + $(if $(JAVA_CLASSPATH_NOT_SET),-Xlint:-options) +- + gb_JavaClassSet_JAVACDEBUG := + + # Enforces correct dependency order for possibly generated stuff: +@@ -32,35 +31,19 @@ ifneq ($(gb_DEBUGLEVEL),0) + gb_JavaClassSet_JAVACDEBUG := -g + endif + +-# $(PACKAGEDIRS) inherited from Jar -- assumption is the last part of the path +-# is top-level java package directory +-# for Java 9 modules, invoke javac another time, with --patch-module so that +-# it finds all the class files for whose packages the module-info contains a +-# declaration + define gb_JavaClassSet__command + $(call gb_Helper_abbreviate_dirs,\ + mkdir -p $(dir $(1)) && \ + $(if $(filter-out $(JARDEPS),$(4)), \ + rm -rf $(call gb_JavaClassSet_get_classdir,$(2))/* && \ + RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ +- $(filter-out $(JARDEPS) $(T_JAVA9FILES),$(4))) && \ +- $(if $(3),$(call gb_JavaClassSet_JAVACCOMMAND,$(JAVA_TARGET_VER)) \ ++ $(filter-out $(JARDEPS),$(4))) && \ ++ $(if $(3),$(gb_JavaClassSet_JAVACCOMMAND) \ + $(gb_JavaClassSet_JAVACDEBUG) \ + -classpath "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \ + -d $(call gb_JavaClassSet_get_classdir,$(2)) \ + @$$RESPONSEFILE &&) \ + rm -f $$RESPONSEFILE &&) \ +- $(if $(T_MODULENAME),\ +- RESPONSEFILE=$(call var2file,$(shell $(gb_MKTEMP)),500,\ +- $(T_JAVA9FILES)) && \ +- $(if $(3),$(call gb_JavaClassSet_JAVACCOMMAND,9) \ +- $(gb_JavaClassSet_JAVACDEBUG) \ +- -classpath "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \ +- --module-path "$(T_CP)$(gb_CLASSPATHSEP)$(call gb_JavaClassSet_get_classdir,$(2))" \ +- $(if $(T_MODULENAME),--patch-module $(T_MODULENAME)="$(subst $(WHITESPACE),$(gb_CLASSPATHSEP),$(strip $(dir $(PACKAGEDIRS))))") \ +- -d $(call gb_JavaClassSet_get_classdir,$(2)) \ +- @$$RESPONSEFILE &&) \ +- rm -f $$RESPONSEFILE &&) \ + touch $(1)) + + endef +@@ -81,7 +64,6 @@ $(call gb_JavaClassSet_get_preparation_target,%) : + mkdir -p $(dir $@) && touch $@ + + # depend on makefile to enforce a rebuild if files are removed from the classset +-# call gb_JavaClassSet_JavaClassSet,csname,java9modulename + define gb_JavaClassSet_JavaClassSet + $(call gb_JavaClassSet_get_target,$(1)) : \ + $(gb_Module_CURRENTMAKEFILE) \ +@@ -89,8 +71,6 @@ $(call gb_JavaClassSet_get_target,$(1)) : \ + $(call gb_JavaClassSet_get_target,$(1)) : JARDEPS := \ + $(gb_Module_CURRENTMAKEFILE) \ + $(call gb_JavaClassSet_get_preparation_target,$(1)) +-$(call gb_JavaClassSet_get_target,$(1)) : T_MODULENAME := $(2) +-$(call gb_JavaClassSet_get_target,$(1)) : T_JAVA9FILES := + + endef + +@@ -112,17 +92,6 @@ $(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile,$(1),$(sourcefil + + endef + +-define gb_JavaClassSet_add_sourcefile_java9 +-$(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_sourcefile,$(2)) +-$(call gb_JavaClassSet_get_target,$(1)) : T_JAVA9FILES += $(call gb_JavaClassSet__get_sourcefile,$(2)) +- +-endef +- +-define gb_JavaClassSet_add_sourcefiles_java9 +-$(foreach sourcefile,$(2),$(call gb_JavaClassSet_add_sourcefile_java9,$(1),$(sourcefile))) +- +-endef +- + define gb_JavaClassSet_add_generated_sourcefile + $(call gb_JavaClassSet_get_target,$(1)) : $(call gb_JavaClassSet__get_generated_sourcefile,$(2)) + $(call gb_JavaClassSet__get_generated_sourcefile,$(2)) :| $(call gb_JavaClassSet_get_preparation_target,$(1)) +diff --git a/solenv/gbuild/gbuild.mk b/solenv/gbuild/gbuild.mk +index 86ed3d32a376..da6a3d700864 100644 +--- a/solenv/gbuild/gbuild.mk ++++ b/solenv/gbuild/gbuild.mk +@@ -62,8 +62,6 @@ COMMA :=, + OPEN_PAREN :=( + CLOSE_PAREN :=) + +-gb_SPACE:=$(gb_SPACE) $(gb_SPACE) +- + gb_VERBOSE := $(verbose) + + include $(GBUILDDIR)/Helper.mk +-- +2.30.2 + diff --git a/Add-riscv64-support.diff b/Add-riscv64-support.diff new file mode 100644 index 0000000..73bec66 --- /dev/null +++ b/Add-riscv64-support.diff @@ -0,0 +1,1972 @@ +From 3eff92b5c9c66570ffc5ce4b0337ca902ec595c9 Mon Sep 17 00:00:00 2001 +From: Sakura286 <sakura286@outlook.com> +Date: Tue, 26 Jul 2022 02:18:23 +0000 +Subject: [PATCH] Add riscv64 support + + 1. Configure gbuild + 2. Add UNO Bridge for riscv64 + +Till now base function works well on riscv64. Test on Debian, +Gentoo and openEuler. + +Credits: + + - Heiher <r@hev.cc> and Stephan Bergmann <sbergman@redhat.com> + The riscv64 bridge implementation refers to mips64 and + AArch64 bridges. + - Bo Yu <tsu.yubo@gmail.com> configures gbuild for riscv64. + - WANG Xuerui <xen0n@gentoo.org> provides lots of guiding tips. + +Change-Id: Ifad3b0de8b2c9e7328627ed03396bbd45a9c71e4 +--- + +diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk +index e2de3c167..27e1249f3 100644 +--- a/bridges/Library_cpp_uno.mk ++++ b/bridges/Library_cpp_uno.mk +@@ -114,6 +114,15 @@ bridge_noopt_objects := cpp2uno uno2cpp + bridge_exception_objects := except + endif + ++else ifeq ($(CPUNAME),RISCV64) ++ ++ifneq ($(filter LINUX,$(OS)),) ++bridges_SELECTED_BRIDGE := gcc3_linux_riscv64 ++bridge_asm_objects := call ++bridge_noopt_objects := cpp2uno uno2cpp ++bridge_exception_objects := except ++endif ++ + else ifeq ($(CPUNAME),POWERPC) + + ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD,$(OS)),) +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/call.hxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/call.hxx +new file mode 100644 +index 000000000..dc84d56b8 +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/call.hxx +@@ -0,0 +1,35 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * 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 . ++ */ ++ ++#pragma once ++ ++#include <sal/config.h> ++ ++#include <sal/types.h> ++ ++namespace { ++ ++ extern "C" typelib_TypeClass cpp_vtable_call( ++ sal_Int32 nFunctionIndex, sal_Int32 nVtableOffset, ++ void ** gpreg, void ** fpreg, void ** ovrflw, ++ sal_uInt64 * pRegisterReturn /* space for register return */ ); ++ ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/call.s b/bridges/source/cpp_uno/gcc3_linux_riscv64/call.s +new file mode 100644 +index 000000000..2bddfc1dc +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/call.s +@@ -0,0 +1,72 @@ ++/* ++ * 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 . ++ */ ++// https://cgit.freedesktop.org/libreoffice/core/tree/bridges/source/cpp_uno/gcc3_linux_mips64/call.s ++ ++ .text ++ .align 2 ++ .global privateSnippetExecutor ++ .hidden privateSnippetExecutor ++ .type privateSnippetExecutor, %function ++privateSnippetExecutor: ++ .cfi_startproc ++ addi sp,sp,-160 ++ .cfi_def_cfa_offset 160 ++ sd ra,152(sp) ++ .cfi_offset 1, -8 ++ fsd fa0,80(sp) ++ fsd fa1,88(sp) ++ fsd fa2,96(sp) ++ fsd fa3,104(sp) ++ fsd fa4,112(sp) ++ fsd fa5,120(sp) ++ fsd fa6,128(sp) ++ fsd fa7,136(sp) ++ sd a0,16(sp) ++ sd a1,24(sp) ++ sd a2,32(sp) ++ sd a3,40(sp) ++ sd a4,48(sp) ++ sd a5,56(sp) ++ sd a6,64(sp) ++ sd a7,72(sp) ++ // a0 = functionIndex ++ // a1 = vtableOffset ++ // a2 = gpreg ++ // a3 = fpreg ++ // a4 = overflw ++ // a5 = pRegisterReturn ++ add a0,t4,zero ++ add a1,t5,zero ++ addi a2,sp,16 ++ addi a3,sp,80 ++ addi a4,sp,160 ++ add a5,sp,zero ++ // jump to cpp_vtable_call ++ jalr ra,t6,0 ++ ld a0,0(sp) ++ ld a1,8(sp) ++ fld fa0,0(sp) ++ fld fa1,8(sp) ++ ld ra,152(sp) ++ .cfi_restore 1 ++ addi sp,sp,160 ++ .cfi_def_cfa_offset 0 ++ jalr zero,ra,0 ++ .cfi_endproc ++ .size privateSnippetExecutor, .-privateSnippetExecutor ++ .section .note.GNU-stack, "", @progbits +\ No newline at end of file +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx +new file mode 100644 +index 000000000..a66a694dd +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/cpp2uno.cxx +@@ -0,0 +1,723 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * 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 . ++ */ ++#include <com/sun/star/uno/genfunc.hxx> ++#include <sal/log.hxx> ++#include <typelib/typedescription.hxx> ++#include <uno/data.h> ++#include <osl/endian.h> ++#include "bridge.hxx" ++#include "cppinterfaceproxy.hxx" ++#include "types.hxx" ++#include "vtablefactory.hxx" ++#include "call.hxx" ++#include "share.hxx" ++ ++#include <stdio.h> ++#include <string.h> ++ ++using namespace com::sun::star::uno; ++ ++//#define BRDEBUG ++ ++#ifdef BRDEBUG ++#include <rtl/strbuf.hxx> ++#include <rtl/ustrbuf.hxx> ++using namespace ::std; ++using namespace ::osl; ++using namespace ::rtl; ++#endif ++ ++namespace CPPU_CURRENT_NAMESPACE ++{ ++ bool is_complex_struct(const typelib_TypeDescription * type) ++ { ++ const typelib_CompoundTypeDescription * p ++ = reinterpret_cast< const typelib_CompoundTypeDescription * >(type); ++ for (sal_Int32 i = 0; i < p->nMembers; ++i) ++ { ++ if (p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_STRUCT || ++ p->ppTypeRefs[i]->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * t = 0; ++ TYPELIB_DANGER_GET(&t, p->ppTypeRefs[i]); ++ bool b = is_complex_struct(t); ++ TYPELIB_DANGER_RELEASE(t); ++ if (b) { ++ return true; ++ } ++ } ++ else if (!bridges::cpp_uno::shared::isSimpleType(p->ppTypeRefs[i]->eTypeClass)) ++ return true; ++ } ++ if (p->pBaseTypeDescription != 0) ++ return is_complex_struct(&p->pBaseTypeDescription->aBase); ++ return false; ++ } ++ ++ bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ) ++ { ++ if (bridges::cpp_uno::shared::isSimpleType(pTypeRef)) ++ return false; ++ else if (pTypeRef->eTypeClass == typelib_TypeClass_STRUCT || ++ pTypeRef->eTypeClass == typelib_TypeClass_EXCEPTION) ++ { ++ typelib_TypeDescription * pTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef ); ++ ++ //A Composite Type not larger than 16 bytes is returned in up to two GPRs ++ bool bRet = pTypeDescr->nSize > 16 || is_complex_struct(pTypeDescr); ++ ++ TYPELIB_DANGER_RELEASE( pTypeDescr ); ++ return bRet; ++ } ++ return true; ++ } ++} ++ ++namespace ++{ ++ ++ static typelib_TypeClass cpp2uno_call( ++ bridges::cpp_uno::shared::CppInterfaceProxy * pThis, ++ const typelib_TypeDescription * pMemberTypeDescr, ++ typelib_TypeDescriptionReference * pReturnTypeRef, // 0 indicates void return ++ sal_Int32 nParams, typelib_MethodParameter * pParams, ++ void ** gpreg, void ** fpreg, void ** ovrflw, ++ sal_uInt64 * pRegisterReturn /* space for register return */ ) ++ { ++ /* Most MIPS ABIs view the arguments as a struct, of which the ++ first N words go in registers and the rest go on the stack. If I < N, the ++ With word might go in With integer argument register or the With ++ floating-point one. For these ABIs, we only need to remember the number ++ of words passed so far. We are interested only in n64 ABI,so it is the ++ case. ++ */ ++ unsigned int nREG = 0; ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:begin\n"); ++#endif ++ // return ++ typelib_TypeDescription * pReturnTypeDescr = 0; ++ if (pReturnTypeRef) ++ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); ++ ++ void * pUnoReturn = 0; ++ void * pCppReturn = 0; // complex return ptr: if != 0 && != pUnoReturn, reconversion need ++ ++ if (pReturnTypeDescr) ++ { ++ if (CPPU_CURRENT_NAMESPACE::return_in_hidden_param( pReturnTypeRef ) ) ++ { ++ pCppReturn = gpreg[nREG]; // complex return via ptr (pCppReturn) ++ nREG++; ++ ++ pUnoReturn = ( bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr ) ++ ? alloca( pReturnTypeDescr->nSize ) ++ : pCppReturn); // direct way ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:complexreturn\n"); ++#endif ++ } ++ else ++ { ++ pUnoReturn = pRegisterReturn; // direct way for simple types ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:simplereturn\n"); ++#endif ++ } ++ } ++ ++ // pop this ++ nREG++; ++ ++ // stack space ++ static_assert(sizeof(void *) == sizeof(sal_Int64), "### unexpected size!"); ++ // parameters ++ void ** pUnoArgs = (void **)alloca( 4 * sizeof(void *) * nParams ); ++ void ** pCppArgs = pUnoArgs + nParams; ++ // indices of values this have to be converted (interface conversion cpp<=>uno) ++ sal_Int32 * pTempIndices = (sal_Int32 *)(pUnoArgs + (2 * nParams)); ++ // type descriptions for reconversions ++ typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pUnoArgs + (3 * nParams)); ++ ++ sal_Int32 nTempIndices = 0; ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:nParams=%d\n", nParams); ++#endif ++ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) ++ { ++ const typelib_MethodParameter & rParam = pParams[nPos]; ++ ++ typelib_TypeDescription * pParamTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); ++ ++ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) // value ++ { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:Param %u, type %u\n", nPos, pParamTypeDescr->eTypeClass); ++#endif ++ switch (pParamTypeDescr->eTypeClass) ++ { ++ case typelib_TypeClass_FLOAT: ++ case typelib_TypeClass_DOUBLE: ++ if (nREG < MAX_FP_REGS) { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:fpr=%p\n", fpreg[nREG]); ++#endif ++ pCppArgs[nPos] = &(fpreg[nREG]); ++ pUnoArgs[nPos] = &(fpreg[nREG]); ++ } else { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:fpr=%p\n", ovrflw[nREG - MAX_FP_REGS]); ++#endif ++ pCppArgs[nPos] = &(ovrflw[nREG - MAX_FP_REGS]); ++ pUnoArgs[nPos] = &(ovrflw[nREG - MAX_FP_REGS]); ++ } ++ nREG++; ++ break; ++ ++ ++ default: ++ if (nREG < MAX_GP_REGS) { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:gpr=%p\n", gpreg[nREG]); ++#endif ++ pCppArgs[nPos] = &(gpreg[nREG]); ++ pUnoArgs[nPos] = &(gpreg[nREG]); ++ } else { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:gpr=%p\n", ovrflw[nREG - MAX_GP_REGS]); ++#endif ++ pCppArgs[nPos] = &(ovrflw[nREG - MAX_GP_REGS]); ++ pUnoArgs[nPos] = &(ovrflw[nREG - MAX_GP_REGS]); ++ } ++ nREG++; ++ break; ++ ++ } ++ // no longer needed ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ else // ptr to complex value | ref ++ { ++#ifdef BRDEBUG ++ fprintf(stdout,"cpp2uno_call:ptr|ref\n"); ++#endif ++ void *pCppStack; ++ if (nREG < MAX_GP_REGS) { ++ pCppArgs[nPos] = pCppStack = gpreg[nREG]; ++ } else { ++ pCppArgs[nPos] = pCppStack = ovrflw[nREG - MAX_GP_REGS]; ++ } ++ nREG++; ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:pCppStack=%p\n", pCppStack); ++#endif ++ ++ if (! rParam.bIn) // is pure out ++ { ++ // uno out is unconstructed mem! ++ pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ); ++ pTempIndices[nTempIndices] = nPos; ++ // will be released at reconversion ++ ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr; ++ } ++ // is in/inout ++ else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) ++ { ++ uno_copyAndConvertData( pUnoArgs[nPos] = alloca( pParamTypeDescr->nSize ), ++ pCppStack, pParamTypeDescr, ++ pThis->getBridge()->getCpp2Uno() ); ++ pTempIndices[nTempIndices] = nPos; // has to be reconverted ++ // will be released at reconversion ++ ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr; ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:related to interface,%p,%d,pUnoargs[%d]=%p\n", ++ pCppStack, pParamTypeDescr->nSize, nPos, pUnoArgs[nPos]); ++#endif ++ } ++ else // direct way ++ { ++ pUnoArgs[nPos] = pCppStack; ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call:direct,pUnoArgs[%d]=%p\n", nPos, pUnoArgs[nPos]); ++#endif ++ // no longer needed ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ } ++ } ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call2,%p,unoargs=%p\n", pThis->getUnoI()->pDispatcher, pUnoArgs); ++#endif ++ ++ // ExceptionHolder ++ uno_Any aUnoExc; // Any will be constructed by callee ++ uno_Any * pUnoExc = &aUnoExc; ++ ++ // invoke uno dispatch call ++ (*pThis->getUnoI()->pDispatcher)( pThis->getUnoI(), pMemberTypeDescr, pUnoReturn, pUnoArgs, &pUnoExc ); ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp2uno_call2,after dispatch\n"); ++#endif ++ ++ // in case an exception occurred... ++ if (pUnoExc) ++ { ++ fflush(stdout); ++ // destruct temporary in/inout params ++ for ( ; nTempIndices--; ) ++ { ++ sal_Int32 nIndex = pTempIndices[nTempIndices]; ++ ++ if (pParams[nIndex].bIn) // is in/inout => was constructed ++ uno_destructData( pUnoArgs[nIndex], ppTempParamTypeDescr[nTempIndices], 0 ); ++ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] ); ++ } ++ if (pReturnTypeDescr) ++ TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); ++ ++ CPPU_CURRENT_NAMESPACE::raiseException( &aUnoExc, pThis->getBridge()->getUno2Cpp() ); ++ // has to destruct the any ++ // is here for dummy ++ return typelib_TypeClass_VOID; ++ } ++ else // else no exception occurred... ++ { ++ // temporary params ++ for ( ; nTempIndices--; ) ++ { ++ sal_Int32 nIndex = pTempIndices[nTempIndices]; ++ typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices]; ++ ++ if (pParams[nIndex].bOut) // inout/out ++ { ++ // convert and assign ++ uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); ++ uno_copyAndConvertData( pCppArgs[nIndex], pUnoArgs[nIndex], pParamTypeDescr, ++ pThis->getBridge()->getUno2Cpp() ); ++ } ++ // destroy temp uno param ++ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); ++ ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ // return ++ if (pCppReturn) // has complex return ++ { ++ if (pUnoReturn != pCppReturn) // needs reconversion ++ { ++ uno_copyAndConvertData( pCppReturn, pUnoReturn, pReturnTypeDescr, ++ pThis->getBridge()->getUno2Cpp() ); ++ // destroy temp uno return ++ uno_destructData( pUnoReturn, pReturnTypeDescr, 0 ); ++ } ++ // complex return ptr is set to return reg ++ *(void **)pRegisterReturn = pCppReturn; ++ } ++ if (pReturnTypeDescr) ++ { ++ typelib_TypeClass eRet = (typelib_TypeClass)pReturnTypeDescr->eTypeClass; ++ TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); ++ return eRet; ++ } ++ else ++ return typelib_TypeClass_VOID; ++ } ++ } ++ ++ ++ /** ++ * is called on incoming vtable calls ++ * (called by asm snippets) ++ */ ++ typelib_TypeClass cpp_vtable_call( ++ sal_Int32 nFunctionIndex, ++ sal_Int32 nVtableOffset, ++ void ** gpreg, void ** fpreg, void ** ovrflw, ++ sal_uInt64 * pRegisterReturn /* space for register return */ ) ++ { ++ static_assert( sizeof(sal_Int64)==sizeof(void *), "### unexpected!" ); ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "in cpp_vtable_call nFunctionIndex is %d\n", nFunctionIndex); ++ fprintf(stdout, "in cpp_vtable_call nVtableOffset is %d\n", nVtableOffset); ++ fprintf(stdout, "in cpp_vtable_call gp=%p, fp=%p, ov=%p\n", gpreg, fpreg, ovrflw); ++#endif ++ ++ // gpreg: [ret *], this, [other gpr params] ++ // fpreg: [fpr params] ++ // ovrflw: [gpr or fpr params (properly aligned)] ++ void * pThis; ++ if (nFunctionIndex & 0x80000000 ) ++ { ++ nFunctionIndex &= 0x7fffffff; ++ pThis = gpreg[1]; ++ } ++ else ++ { ++ pThis = gpreg[0]; ++ } ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call, pThis=%p, nFunctionIndex=%d, nVtableOffset=%d\n", ++ pThis, nFunctionIndex, nVtableOffset); ++#endif ++ ++ pThis = static_cast< char * >(pThis) - nVtableOffset; ++ bridges::cpp_uno::shared::CppInterfaceProxy * pCppI = ++ bridges::cpp_uno::shared::CppInterfaceProxy::castInterfaceToProxy( pThis ); ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call, pCppI=%p\n", pCppI); ++#endif ++ ++ typelib_InterfaceTypeDescription * pTypeDescr = pCppI->getTypeDescr(); ++ ++ if (nFunctionIndex >= pTypeDescr->nMapFunctionIndexToMemberIndex) ++ { ++ SAL_WARN( ++ "bridges", ++ "illegal " << OUString::unacquired(&pTypeDescr->aBase.pTypeName) ++ << " vtable index " << nFunctionIndex << "/" ++ << pTypeDescr->nMapFunctionIndexToMemberIndex); ++ throw RuntimeException( ++ ("illegal " + OUString::unacquired(&pTypeDescr->aBase.pTypeName) ++ + " vtable index " + OUString::number(nFunctionIndex) + "/" ++ + OUString::number(pTypeDescr->nMapFunctionIndexToMemberIndex)), ++ (XInterface *)pThis); ++ } ++ ++ // determine called method ++ sal_Int32 nMemberPos = pTypeDescr->pMapFunctionIndexToMemberIndex[nFunctionIndex]; ++ assert(nMemberPos < pTypeDescr->nAllMembers); ++ ++ TypeDescription aMemberDescr( pTypeDescr->ppAllMembers[nMemberPos] ); ++ ++#ifdef BRDEBUG ++ //OString cstr( OUStringToOString( aMemberDescr.get()->pTypeName, RTL_TEXTENCODING_ASCII_US ) ); ++ //fprintf(stdout, "calling %s, nFunctionIndex=%d\n", cstr.getStr(), nFunctionIndex ); ++#endif ++ typelib_TypeClass eRet; ++ switch (aMemberDescr.get()->eTypeClass) ++ { ++ case typelib_TypeClass_INTERFACE_ATTRIBUTE: ++ { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call interface attribute\n"); ++#endif ++ typelib_TypeDescriptionReference *pAttrTypeRef = ++ reinterpret_cast<typelib_InterfaceAttributeTypeDescription *>( aMemberDescr.get() )->pAttributeTypeRef; ++ ++ if (pTypeDescr->pMapMemberIndexToFunctionIndex[nMemberPos] == nFunctionIndex) ++ { ++ // is GET method ++ eRet = cpp2uno_call( pCppI, aMemberDescr.get(), pAttrTypeRef, ++ 0, 0, // no params ++ gpreg, fpreg, ovrflw, pRegisterReturn ); ++ } ++ else ++ { ++ // is SET method ++ typelib_MethodParameter aParam; ++ aParam.pTypeRef = pAttrTypeRef; ++ aParam.bIn = sal_True; ++ aParam.bOut = sal_False; ++ ++ eRet = cpp2uno_call( pCppI, aMemberDescr.get(), ++ 0, // indicates void return ++ 1, &aParam, ++ gpreg, fpreg, ovrflw, pRegisterReturn ); ++ } ++ break; ++ } ++ case typelib_TypeClass_INTERFACE_METHOD: ++ { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call interface method\n"); ++#endif ++ // is METHOD ++ switch (nFunctionIndex) ++ { ++ case 1: // acquire() ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call method acquire\n"); ++#endif ++ pCppI->acquireProxy(); // non virtual call! ++ eRet = typelib_TypeClass_VOID; ++ break; ++ case 2: // release() ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call method release\n"); ++#endif ++ pCppI->releaseProxy(); // non virtual call! ++ eRet = typelib_TypeClass_VOID; ++ break; ++ case 0: // queryInterface() opt ++ { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call method query interface opt\n"); ++#endif ++ typelib_TypeDescription * pTD = 0; ++ TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( gpreg[2] )->getTypeLibType() ); ++ if (pTD) ++ { ++ XInterface * pInterface = 0; ++ (*pCppI->getBridge()->getCppEnv()->getRegisteredInterface) ++ ( pCppI->getBridge()->getCppEnv(), ++ (void **)&pInterface, ++ pCppI->getOid().pData, ++ reinterpret_cast<typelib_InterfaceTypeDescription *>( pTD ) ); ++ ++ if (pInterface) ++ { ++ ::uno_any_construct( reinterpret_cast< uno_Any * >( gpreg[0] ), ++ &pInterface, pTD, cpp_acquire ); ++ ++ pInterface->release(); ++ TYPELIB_DANGER_RELEASE( pTD ); ++ ++ reinterpret_cast<void **>( pRegisterReturn )[0] = gpreg[0]; ++ eRet = typelib_TypeClass_ANY; ++ break; ++ } ++ TYPELIB_DANGER_RELEASE( pTD ); ++ } ++ } // else perform queryInterface() ++ default: ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call method query interface\n"); ++#endif ++ typelib_InterfaceMethodTypeDescription *pMethodTD = ++ reinterpret_cast<typelib_InterfaceMethodTypeDescription *>( aMemberDescr.get() ); ++ ++ eRet = cpp2uno_call( pCppI, aMemberDescr.get(), ++ pMethodTD->pReturnTypeRef, ++ pMethodTD->nParams, ++ pMethodTD->pParams, ++ gpreg, fpreg, ovrflw, pRegisterReturn ); ++ } ++ break; ++ } ++ default: ++ { ++#ifdef BRDEBUG ++ fprintf(stdout, "cpp_vtable_call no member\n"); ++#endif ++ throw RuntimeException( "no member description found!", (XInterface *)pThis ); ++ } ++ } ++ ++ return eRet; ++ } ++ ++ extern "C" void privateSnippetExecutor( ... ); ++ ++ int const codeSnippetSize = 0x6c; ++ ++ unsigned char * codeSnippet( unsigned char * code, ++ sal_Int32 functionIndex, sal_Int32 vtableOffset, ++ bool bHasHiddenParam ) ++ { ++#ifdef BRDEBUG ++ fprintf(stdout,"in codeSnippet functionIndex is %d\n", functionIndex); ++ fprintf(stdout,"in codeSnippet vtableOffset is %d\n", vtableOffset); ++ fprintf(stdout,"in codeSnippet privateSnippetExecutor is %lx\n", (unsigned long)privateSnippetExecutor); ++ fprintf(stdout,"in codeSnippet cpp_vtable_call is %lx\n", (unsigned long)cpp_vtable_call); ++ ++ fflush(stdout); ++#endif ++ ++ if ( bHasHiddenParam ) ++ functionIndex |= 0x80000000; ++ ++ unsigned int * p = (unsigned int *) code; ++ ++ assert((((unsigned long)code) & 0x3) == 0 ); //aligned to 4 otherwise a mistake ++ ++ /* generate this code */ ++ /* ++ # load functionIndex to t4 ++ 00000eb7 lui t4,0x0 ++ 000eee93 ori t4,t4,0x0 ++ # load privateSnippetExecutor to t0 ++ 000002b7 lui t0,0x0 ++ 02429293 slli t0,t0,36 ++ 00000337 lui t1,0x0 ++ 01431313 slli t1,t1,20 ++ 0062e2b3 or t0,t0,t1 ++ 00000337 lui t1,0x0 ++ 00431313 slli t1,t1,4 ++ 0062e2b3 or t0,t0,t1 ++ 00000337 lui t1,0x0 ++ 00c35313 srli t1,t1,12 ++ 0062e2b3 or t0,t0,t1 ++ # load cpp_vtable_call to t6 ++ 00000fb7 lui t6,0x0 ++ 024f9f93 slli t6,t6,36 ++ 00000337 lui t1,0x0 ++ 01431313 slli t1,t1,20 ++ 006fefb3 or t6,t6,t1 ++ 00000337 lui t1,0x0 ++ 00431313 slli t1,t1,4 ++ 006fefb3 or t6,t6,t1 ++ 00000337 lui t1,0x0 ++ 00c35313 srli t1,t1,12 ++ 006fefb3 or t6,t6,t1 ++ # load vtableOffset to t5 ++ 00000f37 lui t5,0x0 ++ 000f6f13 ori t5,t5,0x0 ++ # jump to privateSnippetExecutor ++ 00028067 jalr zero,t0,0x0 ++ */ ++ ++ * p++ = 0x00000eb7 | ((functionIndex) & 0xfffff000); ++ * p++ = 0x000eee93 | ((functionIndex << 20 ) & 0xfff00000); ++ ++ // load privateSnippetExecutor to t0 ++ unsigned long functionEntry = ((unsigned long)privateSnippetExecutor); ++ * p++ = 0x000002b7 | ((functionEntry >> 36) & 0x000000000ffff000); ++ * p++ = 0x02429293; ++ * p++ = 0x00000337 | ((functionEntry >> 20) & 0x000000000ffff000); ++ * p++ = 0x01431313; ++ * p++ = 0x0062e2b3; ++ * p++ = 0x00000337 | ((functionEntry >> 4) & 0x000000000ffff000); ++ * p++ = 0x00431313; ++ * p++ = 0x0062e2b3; ++ * p++ = 0x00000337 | ((functionEntry << 12) & 0x000000000ffff000); ++ * p++ = 0x00c35313; ++ * p++ = 0x0062e2b3; ++ // load cpp_vtable_call to t6 ++ functionEntry = (unsigned long) cpp_vtable_call; ++ * p++ = 0x00000fb7 | ((functionEntry >> 36) & 0x000000000ffff000); ++ * p++ = 0x024f9f93; ++ * p++ = 0x00000337 | ((functionEntry >> 20) & 0x000000000ffff000); ++ * p++ = 0x01431313; ++ * p++ = 0x006fefb3; ++ * p++ = 0x00000337 | ((functionEntry >> 4) & 0x000000000ffff000); ++ * p++ = 0x00431313; ++ * p++ = 0x006fefb3; ++ * p++ = 0x00000337 | ((functionEntry << 12) & 0x000000000ffff000); ++ * p++ = 0x00c35313; ++ * p++ = 0x006fefb3; ++ // load vtableOffset to t5 ++ * p++ = 0x00000f37 | ((vtableOffset) & 0xfffff000); ++ * p++ = 0x000f6f13 | ((vtableOffset << 20 ) & 0xfff00000); ++ // jump to privateSnippetExecutor ++ * p++ = 0x00028067; ++ return (code + codeSnippetSize); ++ ++ } ++ ++} ++ ++ ++void bridges::cpp_uno::shared::VtableFactory::flushCode(unsigned char const *bptr, unsigned char const *eptr) ++{ ++ asm volatile( ++ "fence"::: ++ ); ++} ++ ++struct bridges::cpp_uno::shared::VtableFactory::Slot { void * fn; }; ++ ++bridges::cpp_uno::shared::VtableFactory::Slot * ++bridges::cpp_uno::shared::VtableFactory::mapBlockToVtable(void * block) ++{ ++ return static_cast< Slot * >(block) + 2; ++} ++ ++ ++std::size_t bridges::cpp_uno::shared::VtableFactory::getBlockSize( ++ sal_Int32 slotCount) ++{ ++ return (slotCount + 2) * sizeof (Slot) + slotCount * codeSnippetSize; ++} ++ ++bridges::cpp_uno::shared::VtableFactory::Slot * ++bridges::cpp_uno::shared::VtableFactory::initializeBlock( ++ void * block, sal_Int32 slotCount, sal_Int32, ++ typelib_InterfaceTypeDescription *) ++{ ++ Slot * slots = mapBlockToVtable(block); ++ slots[-2].fn = 0; //null ++ slots[-1].fn = 0; //destructor ++ return slots + slotCount; ++} ++ ++unsigned char * bridges::cpp_uno::shared::VtableFactory::addLocalFunctions( ++ Slot ** slots, unsigned char * code, sal_PtrDiff writetoexecdiff, ++ typelib_InterfaceTypeDescription const * type, sal_Int32 functionOffset, ++ sal_Int32 functionCount, sal_Int32 vtableOffset) ++{ ++ (*slots) -= functionCount; ++ Slot * s = *slots; ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "in addLocalFunctions functionOffset is %d\n", functionOffset); ++ fprintf(stdout, "in addLocalFunctions vtableOffset is %d\n", vtableOffset); ++ fprintf(stdout, "nMembers=%d\n", type->nMembers); ++ fflush(stdout); ++#endif ++ ++ for (sal_Int32 i = 0; i < type->nMembers; ++i) { ++ typelib_TypeDescription * member = 0; ++ TYPELIB_DANGER_GET(&member, type->ppMembers[i]); ++ assert(member != 0); ++ switch (member->eTypeClass) { ++ case typelib_TypeClass_INTERFACE_ATTRIBUTE: ++ // Getter: ++ (s++)->fn = code + writetoexecdiff; ++ code = codeSnippet( ++ code, functionOffset++, vtableOffset, ++ CPPU_CURRENT_NAMESPACE::return_in_hidden_param( ++ reinterpret_cast< ++ typelib_InterfaceAttributeTypeDescription * >( ++ member)->pAttributeTypeRef)); ++ ++ // Setter: ++ if (!reinterpret_cast< ++ typelib_InterfaceAttributeTypeDescription * >( ++ member)->bReadOnly) ++ { ++ (s++)->fn = code + writetoexecdiff; ++ code = codeSnippet(code, functionOffset++, vtableOffset, false); ++ } ++ break; ++ ++ case typelib_TypeClass_INTERFACE_METHOD: ++ (s++)->fn = code + writetoexecdiff; ++ code = codeSnippet( ++ code, functionOffset++, vtableOffset, ++ CPPU_CURRENT_NAMESPACE::return_in_hidden_param( ++ reinterpret_cast< ++ typelib_InterfaceMethodTypeDescription * >( ++ member)->pReturnTypeRef)); ++ break; ++ ++ default: ++ assert(false); ++ break; ++ } ++ TYPELIB_DANGER_RELEASE(member); ++ } ++ return code; ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/except.cxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/except.cxx +new file mode 100644 +index 000000000..dbc371742 +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/except.cxx +@@ -0,0 +1,299 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * 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 . ++ */ ++#include <stdio.h> ++#include <string.h> ++#include <dlfcn.h> ++#include <cxxabi.h> ++#include <rtl/strbuf.hxx> ++#include <rtl/ustrbuf.hxx> ++#include <sal/log.hxx> ++#include <osl/mutex.hxx> ++ ++#include <com/sun/star/uno/genfunc.hxx> ++#include <typelib/typedescription.hxx> ++#include <uno/any2.h> ++ ++#include <unordered_map> ++#include "share.hxx" ++ ++using namespace ::std; ++using namespace ::osl; ++using namespace ::com::sun::star::uno; ++using namespace ::__cxxabiv1; ++ ++//#define BRIDGES_DEBUG ++ ++namespace CPPU_CURRENT_NAMESPACE ++{ ++ ++void dummy_can_throw_anything( char const * ) ++{ ++} ++ ++static OUString toUNOname( char const * p ) ++{ ++#if defined BRIDGES_DEBUG ++ char const * start = p; ++#endif ++ ++ // example: N3com3sun4star4lang24IllegalArgumentExceptionE ++ ++ OUStringBuffer buf( 64 ); ++ assert( 'N' == *p ); ++ ++p; // skip N ++ ++ while ('E' != *p) ++ { ++ // read chars count ++ long n = (*p++ - '0'); ++ while ('0' <= *p && '9' >= *p) ++ { ++ n *= 10; ++ n += (*p++ - '0'); ++ } ++ buf.appendAscii( p, n ); ++ p += n; ++ if ('E' != *p) ++ buf.append( '.' ); ++ } ++ ++#if defined BRIDGES_DEBUG ++ OUString ret( buf.makeStringAndClear() ); ++ OString c_ret( OUStringToOString( ret, RTL_TEXTENCODING_ASCII_US ) ); ++ fprintf( stderr, "> toUNOname(): %s => %s\n", start, c_ret.getStr() ); ++ return ret; ++#else ++ return buf.makeStringAndClear(); ++#endif ++} ++ ++class RTTI ++{ ++ typedef std::unordered_map< OUString, type_info * > t_rtti_map; ++ ++ Mutex m_mutex; ++ t_rtti_map m_rttis; ++ t_rtti_map m_generatedRttis; ++ ++ void * m_hApp; ++ ++public: ++ RTTI(); ++ ~RTTI(); ++ ++ type_info * getRTTI( typelib_CompoundTypeDescription * ); ++}; ++ ++RTTI::RTTI() ++ : m_hApp( dlopen( 0, RTLD_LAZY ) ) ++{ ++} ++ ++RTTI::~RTTI() ++{ ++ dlclose( m_hApp ); ++} ++ ++ ++type_info * RTTI::getRTTI( typelib_CompoundTypeDescription *pTypeDescr ) ++{ ++ type_info * rtti; ++ ++ OUString const & unoName = *(OUString const *)&pTypeDescr->aBase.pTypeName; ++ ++ MutexGuard guard( m_mutex ); ++ t_rtti_map::const_iterator iRttiFind( m_rttis.find( unoName ) ); ++ if (iRttiFind == m_rttis.end()) ++ { ++ // RTTI symbol ++ OStringBuffer buf( 64 ); ++ buf.append( "_ZTIN" ); ++ sal_Int32 index = 0; ++ do ++ { ++ OUString token( unoName.getToken( 0, '.', index ) ); ++ buf.append( token.getLength() ); ++ OString c_token( OUStringToOString( token, RTL_TEXTENCODING_ASCII_US ) ); ++ buf.append( c_token ); ++ } ++ while (index >= 0); ++ buf.append( 'E' ); ++ ++ OString symName( buf.makeStringAndClear() ); ++ rtti = (type_info *)dlsym( m_hApp, symName.getStr() ); ++ ++ if (rtti) ++ { ++ pair< t_rtti_map::iterator, bool > insertion( ++ m_rttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); ++ assert(insertion.second && "### inserting new rtti failed?!"); ++ } ++ else ++ { ++ // try to lookup the symbol in the generated rtti map ++ t_rtti_map::const_iterator iFind( m_generatedRttis.find( unoName ) ); ++ if (iFind == m_generatedRttis.end()) ++ { ++ // we must generate it ! ++ // symbol and rtti-name is nearly identical, ++ // the symbol is prefixed with _ZTI ++ char const * rttiName = symName.getStr() +4; ++#if defined BRIDGES_DEBUG ++ fprintf( stderr,"generated rtti for %s\n", rttiName ); ++#endif ++ if (pTypeDescr->pBaseTypeDescription) ++ { ++ // ensure availability of base ++ type_info * base_rtti = getRTTI( ++ (typelib_CompoundTypeDescription *)pTypeDescr->pBaseTypeDescription ); ++ rtti = new __si_class_type_info( ++ strdup( rttiName ), (__class_type_info *)base_rtti ); ++ } ++ else ++ { ++ // this class has no base class ++ rtti = new __class_type_info( strdup( rttiName ) ); ++ } ++ ++ pair< t_rtti_map::iterator, bool > insertion( ++ m_generatedRttis.insert( t_rtti_map::value_type( unoName, rtti ) ) ); ++ assert(insertion.second && "### inserting new generated rtti failed?!"); ++ } ++ else // taking already generated rtti ++ { ++ rtti = iFind->second; ++ } ++ } ++ } ++ else ++ { ++ rtti = iRttiFind->second; ++ } ++ ++ return rtti; ++} ++ ++ ++static void deleteException( void * pExc ) ++{ ++#if defined BRIDGES_DEBUG ++ fprintf( stderr, "in deleteException: pExc = %p\n",pExc ); ++#endif ++ __cxa_exception const * header = ((__cxa_exception const *)pExc - 1); ++ typelib_TypeDescription * pTD = 0; ++ OUString unoName( toUNOname( header->exceptionType->name() ) ); ++ ::typelib_typedescription_getByName( &pTD, unoName.pData ); ++ assert(pTD && "### unknown exception type! leaving out destruction => leaking!!!"); ++ if (pTD) ++ { ++ ::uno_destructData( pExc, pTD, cpp_release ); ++ ::typelib_typedescription_release( pTD ); ++ } ++} ++ ++ ++ ++//extern "C" { ++// void __cxa_throw(void* ex, void* info, void (*dest)(void*)) { ::abort(); } ++//} ++ ++ ++void raiseException( uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ) ++{ ++#if defined BRIDGES_DEBUG ++ OString cstr( ++ OUStringToOString( ++ OUString::unacquired( &pUnoExc->pType->pTypeName ), ++ RTL_TEXTENCODING_ASCII_US ) ); ++ fprintf( stderr, "> uno exception occurred: %s\n", cstr.getStr() ); ++#endif ++ void * pCppExc; ++ type_info * rtti; ++ ++ { ++ // construct cpp exception object ++ typelib_TypeDescription * pTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pTypeDescr, pUnoExc->pType ); ++ assert(pTypeDescr); ++ if (! pTypeDescr) ++ { ++ throw RuntimeException( ++ OUString("cannot get typedescription for type ") + ++ OUString::unacquired( &pUnoExc->pType->pTypeName ) ); ++ } ++ ++ pCppExc = __cxa_allocate_exception( pTypeDescr->nSize ); ++ ::uno_copyAndConvertData( pCppExc, pUnoExc->pData, pTypeDescr, pUno2Cpp ); ++ ++ // destruct uno exception ++ ::uno_any_destruct( pUnoExc, 0 ); ++ // avoiding locked counts ++ static RTTI rtti_data; ++ rtti = (type_info*)rtti_data.getRTTI((typelib_CompoundTypeDescription*)pTypeDescr); ++ TYPELIB_DANGER_RELEASE( pTypeDescr ); ++ assert(rtti && "### no rtti for throwing exception!"); ++ if (! rtti) ++ { ++ throw RuntimeException( ++ OUString("no rtti for type ") + ++ OUString::unacquired( &pUnoExc->pType->pTypeName ) ); ++ } ++ } ++ __cxa_throw( pCppExc, rtti, deleteException ); ++} ++ ++void fillUnoException(uno_Any * pUnoExc, uno_Mapping * pCpp2Uno) ++{ ++ __cxa_exception * header = __cxa_get_globals()->caughtExceptions; ++ if (! header) ++ { ++ RuntimeException aRE( "no exception header!" ); ++ Type const & rType = cppu::UnoType<decltype(aRE)>::get(); ++ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); ++ SAL_WARN("bridges", aRE.Message); ++ return; ++ } ++ ++ std::type_info *exceptionType = __cxa_current_exception_type(); ++ ++ typelib_TypeDescription * pExcTypeDescr = 0; ++ OUString unoName( toUNOname( exceptionType->name() ) ); ++#if defined BRIDGES_DEBUG ++ OString cstr_unoName( OUStringToOString( unoName, RTL_TEXTENCODING_ASCII_US ) ); ++ fprintf( stderr, "> c++ exception occurred: %s\n", cstr_unoName.getStr() ); ++#endif ++ typelib_typedescription_getByName( &pExcTypeDescr, unoName.pData ); ++ if (0 == pExcTypeDescr) ++ { ++ RuntimeException aRE( OUString("exception type not found: ") + unoName ); ++ Type const & rType = cppu::UnoType<decltype(aRE)>::get(); ++ uno_type_any_constructAndConvert( pUnoExc, &aRE, rType.getTypeLibType(), pCpp2Uno ); ++ SAL_WARN("bridges", aRE.Message); ++ } ++ else ++ { ++ // construct uno exception any ++ uno_any_constructAndConvert( pUnoExc, header->adjustedPtr, pExcTypeDescr, pCpp2Uno ); ++ typelib_typedescription_release( pExcTypeDescr ); ++ } ++} ++ ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/share.hxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/share.hxx +new file mode 100644 +index 000000000..ee2235e4f +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/share.hxx +@@ -0,0 +1,89 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * 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 . ++ */ ++#pragma once ++ ++#include "uno/mapping.h" ++ ++#include <typeinfo> ++#include <exception> ++#include <cstddef> ++ ++#define MAX_GP_REGS (8) ++#define MAX_FP_REGS (8) ++ ++namespace CPPU_CURRENT_NAMESPACE ++{ ++ ++ void dummy_can_throw_anything( char const * ); ++ ++ ++// ----- following decl from libstdc++-v3/libsupc++/unwind-cxx.h and unwind.h ++ ++struct _Unwind_Exception ++{ ++ unsigned exception_class __attribute__((__mode__(__DI__))); ++ void * exception_cleanup; ++ unsigned private_1 __attribute__((__mode__(__word__))); ++ unsigned private_2 __attribute__((__mode__(__word__))); ++} __attribute__((__aligned__)); ++ ++struct __cxa_exception ++{ ++ std::type_info *exceptionType; ++ void (*exceptionDestructor)(void *); ++ ++ void (*unexpectedHandler)(); // std::unexpected_handler dropped from C++17 ++ std::terminate_handler terminateHandler; ++ ++ __cxa_exception *nextException; ++ ++ int handlerCount; ++ ++ int handlerSwitchValue; ++ const unsigned char *actionRecord; ++ const unsigned char *languageSpecificData; ++ void *catchTemp; ++ void *adjustedPtr; ++ ++ _Unwind_Exception unwindHeader; ++}; ++ ++extern "C" void *__cxa_allocate_exception( ++ std::size_t thrown_size ) throw(); ++extern "C" void __cxa_throw ( ++ void *thrown_exception, std::type_info *tinfo, void (*dest) (void *) ) __attribute__((noreturn)); ++ ++struct __cxa_eh_globals ++{ ++ __cxa_exception *caughtExceptions; ++ unsigned int uncaughtExceptions; ++}; ++ ++extern "C" __cxa_eh_globals *__cxa_get_globals () throw(); ++extern "C" std::type_info *__cxa_current_exception_type() throw(); ++ ++void raiseException( ++ uno_Any * pUnoExc, uno_Mapping * pUno2Cpp ); ++ ++void fillUnoException(uno_Any *, uno_Mapping * pCpp2Uno); ++ ++bool return_in_hidden_param( typelib_TypeDescriptionReference *pTypeRef ); ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/bridges/source/cpp_uno/gcc3_linux_riscv64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_riscv64/uno2cpp.cxx +new file mode 100644 +index 000000000..444448098 +--- /dev/null ++++ b/bridges/source/cpp_uno/gcc3_linux_riscv64/uno2cpp.cxx +@@ -0,0 +1,593 @@ ++/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ ++/* ++ * 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 . ++ */ ++ ++#include <sal/config.h> ++ ++#include <exception> ++#include <malloc.h> ++#include <cstring> ++#include <typeinfo> ++ ++#include <com/sun/star/uno/Exception.hpp> ++#include <com/sun/star/uno/RuntimeException.hpp> ++#include <com/sun/star/uno/genfunc.hxx> ++#include <o3tl/runtimetooustring.hxx> ++#include <uno/data.h> ++ ++#include "bridge.hxx" ++#include "types.hxx" ++#include "unointerfaceproxy.hxx" ++#include "vtables.hxx" ++ ++#include "share.hxx" ++ ++//#define BRDEBUG ++#ifdef BRDEBUG ++#include <stdio.h> ++#endif ++ ++#define INSERT_FLOAT_DOUBLE( pSV, nr, pFPR, pDS ) \ ++ if ( nr < MAX_FP_REGS ) \ ++ pFPR[nr++] = *reinterpret_cast<double *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_uInt64 *>( pSV ); // verbatim! ++ ++#define INSERT_INT64( pSV, nr, pGPR, pDS ) \ ++ if ( nr < MAX_GP_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast<sal_Int64 *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_Int64 *>( pSV ); ++ ++#define INSERT_INT32( pSV, nr, pGPR, pDS ) \ ++ if ( nr < MAX_GP_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast<sal_Int32 *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_Int32 *>( pSV ); ++ ++#define INSERT_INT16( pSV, nr, pGPR, pDS ) \ ++ if ( nr < MAX_GP_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast<sal_Int16 *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_Int16 *>( pSV ); ++ ++#define INSERT_UINT16( pSV, nr, pGPR, pDS ) \ ++ if ( nr < MAX_GP_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast<sal_uInt16 *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_uInt16 *>( pSV ); ++ ++#define INSERT_INT8( pSV, nr, pGPR, pDS ) \ ++ if ( nr < MAX_GP_REGS ) \ ++ pGPR[nr++] = *reinterpret_cast<sal_Int8 *>( pSV ); \ ++ else \ ++ *pDS++ = *reinterpret_cast<sal_Int8 *>( pSV ); ++ ++using namespace ::com::sun::star::uno; ++ ++namespace ++{ ++ ++ bool isReturnInFPR(const typelib_TypeDescription * pTypeDescr, sal_uInt32 & nSize) ++ { ++ const typelib_CompoundTypeDescription *p = ++ reinterpret_cast<const typelib_CompoundTypeDescription*>( pTypeDescr ); ++ ++ for (sal_Int32 i = 0; i < p->nMembers; ++i) ++ { ++ typelib_TypeDescriptionReference *pTypeInStruct = p->ppTypeRefs[ i ]; ++ ++ switch (pTypeInStruct->eTypeClass) ++ { ++ case typelib_TypeClass_STRUCT: ++ case typelib_TypeClass_EXCEPTION: ++ { ++ typelib_TypeDescription * t = 0; ++ TYPELIB_DANGER_GET(&t, pTypeInStruct); ++ bool isFPR = isReturnInFPR(t, nSize); ++ TYPELIB_DANGER_RELEASE(t); ++ if (!isFPR) ++ return false; ++ } ++ break; ++ case typelib_TypeClass_FLOAT: ++ case typelib_TypeClass_DOUBLE: ++ if (nSize >= 16) ++ return false; ++ nSize += 8; ++ break; ++ default: ++ return false; ++ } ++ } ++ return true; ++ } ++ ++ void fillReturn(const typelib_TypeDescription * pTypeDescr, ++ sal_Int64 * gret, double * fret, void * pRegisterReturn) ++ { ++ sal_uInt32 nSize = 0; ++ if (isReturnInFPR(pTypeDescr, nSize)) ++ { ++ reinterpret_cast<double *>( pRegisterReturn )[0] = fret[0]; ++ reinterpret_cast<double *>( pRegisterReturn )[1] = fret[1]; ++ } ++ else ++ { ++ reinterpret_cast<sal_Int64 *>( pRegisterReturn )[0] = gret[0]; ++ reinterpret_cast<sal_Int64 *>( pRegisterReturn )[1] = gret[1]; ++ } ++ } ++ ++ static void callVirtualMethod( ++ void * pAdjustedThisPtr, ++ sal_Int32 nVtableIndex, ++ void * pRegisterReturn, ++ typelib_TypeDescriptionReference * pReturnTypeRef, ++ bool bSimpleReturn, ++ sal_uInt64 *pStack, ++ sal_uInt32 nStack, ++ sal_uInt64 *pGPR, ++ double *pFPR, ++ sal_uInt32 nREG) ++ { ++ // Should not happen, but... ++ static_assert(MAX_GP_REGS == MAX_FP_REGS, "must be the same size"); ++ if ( nREG > MAX_GP_REGS ) ++ nREG = MAX_GP_REGS; ++ ++ // Get pointer to method ++ sal_uInt64 pMethod = *((sal_uInt64 *)pAdjustedThisPtr); ++ pMethod += 8 * nVtableIndex; ++ void *mfunc = (void *) *((sal_uInt64 *)pMethod); ++#ifdef BRDEBUG ++ fprintf(stdout, "calling function %p\n", mfunc); ++#endif ++ ++ // Load parameters to stack, if necessary ++ sal_uInt64* pCallStack = NULL; ++ if ( nStack ) ++ { ++ // 16-bytes aligned ++ sal_uInt32 nStackBytes = ( ( nStack + 1 ) >> 1 ) * 16; ++ pCallStack = (sal_uInt64 *) __builtin_alloca( nStackBytes ); ++ std::memcpy( pCallStack, pStack, nStackBytes ); ++ } ++ ++ sal_Int64 gret[2]; ++ double fret[2]; ++ asm volatile ( ++ //".set push \n\t" ++ //".set riscv64 \n\t" ++ // Fill the general purpose registers ++ "ld a0, 0(%[gpr]) \n\t" ++ "ld a1, 8(%[gpr]) \n\t" ++ "ld a2, 16(%[gpr]) \n\t" ++ "ld a3, 24(%[gpr]) \n\t" ++ "ld a4, 32(%[gpr]) \n\t" ++ "ld a5, 40(%[gpr]) \n\t" ++ "ld a6, 48(%[gpr]) \n\t" ++ "ld a7, 56(%[gpr]) \n\t" ++ // Fill the floating pointer registers ++ "fld fa0, 0(%[fpr]) \n\t" ++ "fld fa1, 8(%[fpr]) \n\t" ++ "fld fa2, 16(%[fpr]) \n\t" ++ "fld fa3, 24(%[fpr]) \n\t" ++ "fld fa4, 32(%[fpr]) \n\t" ++ "fld fa5, 40(%[fpr]) \n\t" ++ "fld fa6, 48(%[fpr]) \n\t" ++ "fld fa7, 56(%[fpr]) \n\t" ++ // Perform the call ++ "jalr ra,%[mfunc],0 \n\t" ++ // Fill the return values ++ "add %[gret1], a0,zero \n\t" ++ "add %[gret2], a1,zero \n\t" ++ "fcvt.d.l ft7,zero \n\t" ++ "fadd.d %[fret1], fa0,ft7 \n\t" ++ "fadd.d %[fret2], fa1,ft7 \n\t" ++ //".set pop \n\t" ++ :[gret1]"=r"(gret[0]), [gret2]"=r"(gret[1]), ++ [fret1]"=f"(fret[0]), [fret2]"=f"(fret[1]) ++ :[gpr]"r"(pGPR), [fpr]"r"(pFPR), [mfunc]"r"(mfunc), ++ [stack]"m"(pCallStack) // dummy input to prevent the compiler from optimizing the alloca out ++ :"a0", "a1", "a2", "a3", "a4", "a5", "a6","a7", ++ "ra", ++ "fa0", "fa1", "fa2", "fa3", "fa4", "fa5", "fa6","fa7", "memory", ++ "ft7" ++ ); ++ ++ switch (pReturnTypeRef->eTypeClass) ++ { ++ case typelib_TypeClass_HYPER: ++ case typelib_TypeClass_UNSIGNED_HYPER: ++ case typelib_TypeClass_LONG: ++ case typelib_TypeClass_UNSIGNED_LONG: ++ case typelib_TypeClass_ENUM: ++ case typelib_TypeClass_CHAR: ++ case typelib_TypeClass_SHORT: ++ case typelib_TypeClass_UNSIGNED_SHORT: ++ case typelib_TypeClass_BOOLEAN: ++ case typelib_TypeClass_BYTE: ++ *reinterpret_cast<sal_Int64 *>( pRegisterReturn ) = gret[0]; ++ break; ++ case typelib_TypeClass_FLOAT: ++ case typelib_TypeClass_DOUBLE: ++ *reinterpret_cast<double *>( pRegisterReturn ) = fret[0]; ++ break; ++ case typelib_TypeClass_STRUCT: ++ case typelib_TypeClass_EXCEPTION: ++ { ++ sal_Int32 const nRetSize = pReturnTypeRef->pType->nSize; ++ if (bSimpleReturn && nRetSize <= 16 && nRetSize > 0) ++ { ++ typelib_TypeDescription * pTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pTypeDescr, pReturnTypeRef ); ++ fillReturn(pTypeDescr, gret, fret, pRegisterReturn); ++ TYPELIB_DANGER_RELEASE( pTypeDescr ); ++ } ++ break; ++ } ++ default: ++#ifdef BRDEBUG ++ fprintf(stdout,"unhandled return type %u\n", pReturnTypeRef->eTypeClass); ++#endif ++ break; ++ } ++ } ++ ++ ++ static void cpp_call( ++ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis, ++ bridges::cpp_uno::shared::VtableSlot aVtableSlot, ++ typelib_TypeDescriptionReference * pReturnTypeRef, ++ sal_Int32 nParams, typelib_MethodParameter * pParams, ++ void * pUnoReturn, void * pUnoArgs[], uno_Any ** ppUnoExc ) ++ { ++ // max space for: [complex ret ptr], values|ptr ... ++ sal_uInt64 *pStack = (sal_uInt64 *)__builtin_alloca( ((nParams+3) * sizeof(sal_Int64)) ); ++ sal_uInt64 *pStackStart = pStack; ++ ++ sal_uInt64 pGPR[MAX_GP_REGS]; ++ double pFPR[MAX_FP_REGS]; ++ sal_uInt32 nREG = 0; ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "in cpp_call\n"); ++#endif ++ ++ // return ++ typelib_TypeDescription * pReturnTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pReturnTypeDescr, pReturnTypeRef ); ++ assert(pReturnTypeDescr); ++ ++ void * pCppReturn = 0; // if != 0 && != pUnoReturn, needs reconversion ++ ++ bool bSimpleReturn = true; ++ if (pReturnTypeDescr) ++ { ++ if ( CPPU_CURRENT_NAMESPACE::return_in_hidden_param( pReturnTypeRef ) ) ++ { ++ bSimpleReturn = false; ++ // complex return via ptr ++ pCppReturn = bridges::cpp_uno::shared::relatesToInterfaceType( pReturnTypeDescr )? ++ __builtin_alloca( pReturnTypeDescr->nSize ) : pUnoReturn; ++ INSERT_INT64( &pCppReturn, nREG, pGPR, pStack ); ++ } ++ else ++ { ++ pCppReturn = pUnoReturn; // direct way for simple types ++ } ++ } ++ ++ // push this ++ void* pAdjustedThisPtr = reinterpret_cast< void **>( pThis->getCppI() ) + aVtableSlot.offset; ++ INSERT_INT64( &pAdjustedThisPtr, nREG, pGPR, pStack ); ++ ++ // args ++ void ** pCppArgs = (void **)alloca( 3 * sizeof(void *) * nParams ); ++ // indices of values this have to be converted (interface conversion cpp<=>uno) ++ sal_Int32 * pTempIndices = (sal_Int32 *)(pCppArgs + nParams); ++ // type descriptions for reconversions ++ typelib_TypeDescription ** ppTempParamTypeDescr = (typelib_TypeDescription **)(pCppArgs + (2 * nParams)); ++ ++ sal_Int32 nTempIndices = 0; ++ ++ for ( sal_Int32 nPos = 0; nPos < nParams; ++nPos ) ++ { ++ const typelib_MethodParameter & rParam = pParams[nPos]; ++ typelib_TypeDescription * pParamTypeDescr = 0; ++ TYPELIB_DANGER_GET( &pParamTypeDescr, rParam.pTypeRef ); ++ ++ if (!rParam.bOut && bridges::cpp_uno::shared::isSimpleType( pParamTypeDescr )) ++ { ++ uno_copyAndConvertData( pCppArgs[nPos] = alloca( 8 ), pUnoArgs[nPos], pParamTypeDescr, ++ pThis->getBridge()->getUno2Cpp() ); ++ ++ switch (pParamTypeDescr->eTypeClass) ++ { ++ case typelib_TypeClass_LONG: ++ case typelib_TypeClass_UNSIGNED_LONG: ++ case typelib_TypeClass_ENUM: ++ INSERT_INT32( pCppArgs[nPos], nREG, pGPR, pStack ); ++ break; ++ case typelib_TypeClass_CHAR: ++ case typelib_TypeClass_SHORT: ++ INSERT_INT16( pCppArgs[nPos], nREG, pGPR, pStack ); ++ break; ++ case typelib_TypeClass_UNSIGNED_SHORT: ++ INSERT_UINT16( pCppArgs[nPos], nREG, pGPR, pStack ); ++ break; ++ case typelib_TypeClass_BOOLEAN: ++ case typelib_TypeClass_BYTE: ++ INSERT_INT8( pCppArgs[nPos], nREG, pGPR, pStack ); ++ break; ++ case typelib_TypeClass_FLOAT: ++ case typelib_TypeClass_DOUBLE: ++ INSERT_FLOAT_DOUBLE( pCppArgs[nPos], nREG, pFPR, pStack ); ++ break; ++ case typelib_TypeClass_HYPER: ++ case typelib_TypeClass_UNSIGNED_HYPER: ++ INSERT_INT64( pCppArgs[nPos], nREG, pGPR, pStack ); ++ break; ++ default: ++ break; ++ } ++ ++ // no longer needed ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ else // ptr to complex value | ref ++ { ++ if (! rParam.bIn) // is pure out ++ { ++ // cpp out is constructed mem, uno out is not! ++ uno_constructData( ++ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), ++ pParamTypeDescr ); ++ pTempIndices[nTempIndices] = nPos; // default constructed for cpp call ++ // will be released at reconversion ++ ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr; ++ } ++ // is in/inout ++ else if (bridges::cpp_uno::shared::relatesToInterfaceType( pParamTypeDescr )) ++ { ++ uno_copyAndConvertData( ++ pCppArgs[nPos] = alloca( pParamTypeDescr->nSize ), ++ pUnoArgs[nPos], pParamTypeDescr, pThis->getBridge()->getUno2Cpp() ); ++ ++ pTempIndices[nTempIndices] = nPos; // has to be reconverted ++ // will be released at reconversion ++ ppTempParamTypeDescr[nTempIndices++] = pParamTypeDescr; ++ } ++ else // direct way ++ { ++ pCppArgs[nPos] = pUnoArgs[nPos]; ++ // no longer needed ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ INSERT_INT64( &(pCppArgs[nPos]), nREG, pGPR, pStack ); ++ } ++ } ++ ++ try ++ { ++ try { ++ callVirtualMethod( ++ pAdjustedThisPtr, aVtableSlot.index, ++ pCppReturn, pReturnTypeRef, bSimpleReturn, ++ pStackStart, ( pStack - pStackStart ), ++ pGPR, pFPR, nREG); ++ } catch (css::uno::Exception &) { ++ throw; ++ } catch (std::exception & e) { ++ throw css::uno::RuntimeException( ++ "C++ code threw " + o3tl::runtimeToOUString(typeid(e).name()) + ": " ++ + o3tl::runtimeToOUString(e.what())); ++ } catch (...) { ++ throw css::uno::RuntimeException("C++ code threw unknown exception"); ++ } ++ // NO exception occurred... ++ *ppUnoExc = 0; ++ ++ // reconvert temporary params ++ for ( ; nTempIndices--; ) ++ { ++ sal_Int32 nIndex = pTempIndices[nTempIndices]; ++ typelib_TypeDescription * pParamTypeDescr = ppTempParamTypeDescr[nTempIndices]; ++ ++ if (pParams[nIndex].bIn) ++ { ++ if (pParams[nIndex].bOut) // inout ++ { ++ uno_destructData( pUnoArgs[nIndex], pParamTypeDescr, 0 ); // destroy uno value ++ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, ++ pThis->getBridge()->getCpp2Uno() ); ++ } ++ } ++ else // pure out ++ { ++ uno_copyAndConvertData( pUnoArgs[nIndex], pCppArgs[nIndex], pParamTypeDescr, ++ pThis->getBridge()->getCpp2Uno() ); ++ } ++ // destroy temp cpp param => cpp: every param was constructed ++ uno_destructData( pCppArgs[nIndex], pParamTypeDescr, cpp_release ); ++ ++ TYPELIB_DANGER_RELEASE( pParamTypeDescr ); ++ } ++ // return value ++ if (pCppReturn && pUnoReturn != pCppReturn) ++ { ++ uno_copyAndConvertData( pUnoReturn, pCppReturn, pReturnTypeDescr, ++ pThis->getBridge()->getCpp2Uno() ); ++ uno_destructData( pCppReturn, pReturnTypeDescr, cpp_release ); ++ } ++ } ++ catch (...) ++ { ++ // fill uno exception ++ CPPU_CURRENT_NAMESPACE::fillUnoException(*ppUnoExc, pThis->getBridge()->getCpp2Uno()); ++ ++ // temporary params ++ for ( ; nTempIndices--; ) ++ { ++ sal_Int32 nIndex = pTempIndices[nTempIndices]; ++ // destroy temp cpp param => cpp: every param was constructed ++ uno_destructData( pCppArgs[nIndex], ppTempParamTypeDescr[nTempIndices], cpp_release ); ++ TYPELIB_DANGER_RELEASE( ppTempParamTypeDescr[nTempIndices] ); ++ } ++ // return type ++ if (pReturnTypeDescr) ++ TYPELIB_DANGER_RELEASE( pReturnTypeDescr ); ++ } ++ } ++ ++} ++ ++ ++namespace bridges::cpp_uno::shared { ++ ++void unoInterfaceProxyDispatch( ++ uno_Interface * pUnoI, const typelib_TypeDescription * pMemberDescr, ++ void * pReturn, void * pArgs[], uno_Any ** ppException ) ++{ ++ // is my surrogate ++ bridges::cpp_uno::shared::UnoInterfaceProxy * pThis ++ = static_cast< bridges::cpp_uno::shared::UnoInterfaceProxy *> (pUnoI); ++ //typelib_InterfaceTypeDescription * pTypeDescr = pThis->pTypeDescr; ++ ++#ifdef BRDEBUG ++ fprintf(stdout, "in dispatch\n"); ++#endif ++ ++ switch (pMemberDescr->eTypeClass) ++ { ++ case typelib_TypeClass_INTERFACE_ATTRIBUTE: ++ { ++ ++ VtableSlot aVtableSlot( ++ getVtableSlot( ++ reinterpret_cast< ++ typelib_InterfaceAttributeTypeDescription const * >( ++ pMemberDescr))); ++ ++ if (pReturn) ++ { ++ // dependent dispatch ++ cpp_call( ++ pThis, aVtableSlot, ++ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef, ++ 0, 0, // no params ++ pReturn, pArgs, ppException ); ++ } ++ else ++ { ++ // is SET ++ typelib_MethodParameter aParam; ++ aParam.pTypeRef = ++ ((typelib_InterfaceAttributeTypeDescription *)pMemberDescr)->pAttributeTypeRef; ++ aParam.bIn = sal_True; ++ aParam.bOut = sal_False; ++ ++ typelib_TypeDescriptionReference * pReturnTypeRef = 0; ++ OUString aVoidName("void"); ++ typelib_typedescriptionreference_new( ++ &pReturnTypeRef, typelib_TypeClass_VOID, aVoidName.pData ); ++ ++ // dependent dispatch ++ aVtableSlot.index += 1; //get then set method ++ cpp_call( ++ pThis, aVtableSlot, ++ pReturnTypeRef, ++ 1, &aParam, ++ pReturn, pArgs, ppException ); ++ ++ typelib_typedescriptionreference_release( pReturnTypeRef ); ++ } ++ ++ break; ++ } ++ case typelib_TypeClass_INTERFACE_METHOD: ++ { ++ ++ VtableSlot aVtableSlot( ++ getVtableSlot( ++ reinterpret_cast< ++ typelib_InterfaceMethodTypeDescription const * >( ++ pMemberDescr))); ++ switch (aVtableSlot.index) ++ { ++ // standard calls ++ case 1: // acquire uno interface ++ (*pUnoI->acquire)( pUnoI ); ++ *ppException = 0; ++ break; ++ case 2: // release uno interface ++ (*pUnoI->release)( pUnoI ); ++ *ppException = 0; ++ break; ++ case 0: // queryInterface() opt ++ { ++ typelib_TypeDescription * pTD = 0; ++ TYPELIB_DANGER_GET( &pTD, reinterpret_cast< Type * >( pArgs[0] )->getTypeLibType() ); ++ if (pTD) ++ { ++ uno_Interface * pInterface = 0; ++ (*pThis->pBridge->getUnoEnv()->getRegisteredInterface)(pThis->pBridge->getUnoEnv(), ++ (void **)&pInterface, pThis->oid.pData, ++ (typelib_InterfaceTypeDescription *)pTD ); ++ ++ if (pInterface) ++ { ++ ::uno_any_construct( ++ reinterpret_cast< uno_Any * >( pReturn ), ++ &pInterface, pTD, 0 ); ++ (*pInterface->release)( pInterface ); ++ TYPELIB_DANGER_RELEASE( pTD ); ++ *ppException = 0; ++ break; ++ } ++ TYPELIB_DANGER_RELEASE( pTD ); ++ } ++ } // else perform queryInterface() ++ default: ++ // dependent dispatch ++ cpp_call( ++ pThis, aVtableSlot, ++ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pReturnTypeRef, ++ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->nParams, ++ ((typelib_InterfaceMethodTypeDescription *)pMemberDescr)->pParams, ++ pReturn, pArgs, ppException ); ++ } ++ break; ++ } ++ default: ++ { ++ ::com::sun::star::uno::RuntimeException aExc( ++ "illegal member type description!", ++ ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); ++ ++ Type const & rExcType = cppu::UnoType<decltype(aExc)>::get(); ++ // binary identical null reference ++ ::uno_type_any_construct( *ppException, &aExc, rExcType.getTypeLibType(), 0 ); ++ } ++ } ++} ++ ++} ++ ++/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ +diff --git a/configure.ac b/configure.ac +index 08f077bd0..73789f027 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -5188,6 +5188,12 @@ linux-gnu*|linux-musl*) + EPM_FLAGS="-a mipsel" + PLATFORMID=linux_mips_el + ;; ++ riscv64) ++ CPUNAME=RISCV64 ++ RTL_ARCH=RISCV64 ++ EPM_FLAGS="-a riscv64" ++ PLATFORMID=linux_riscv64 ++ ;; + m68k) + CPUNAME=M68K + RTL_ARCH=M68K +@@ -8571,7 +8577,7 @@ if test "$ENABLE_JAVA" != ""; then + JAVAINTERPRETER=`win_short_path_for_make "$JAVAINTERPRETER"` + elif test "$cross_compiling" != "yes"; then + case $CPUNAME in +- AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64) ++ AARCH64|AXP|X86_64|HPPA|IA64|POWERPC64|S390X|SPARC64|GODSON64|RISCV64) + if test -f "$JAVAINTERPRETER" -a "`$JAVAINTERPRETER -version 2>&1 | $GREP -i 64-bit`" = "" >/dev/null; then + AC_MSG_WARN([You are building 64-bit binaries but the JDK $JAVAINTERPRETER is 32-bit]) + AC_MSG_ERROR([You should pass the --with-jdk-home option pointing to a 64-bit JDK]) +@@ -12857,7 +12863,7 @@ AC_SUBST(RHINO_JAR) + # platforms there. + supports_multilib= + case "$host_cpu" in +-x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el) ++x86_64 | powerpc64 | powerpc64le | s390x | aarch64 | mips64 | mips64el | riscv64) + if test "$SAL_TYPES_SIZEOFLONG" = "8"; then + supports_multilib="yes" + fi +diff --git a/jvmfwk/inc/vendorbase.hxx b/jvmfwk/inc/vendorbase.hxx +index 779fc8f7a..ef6072076 100644 +--- a/jvmfwk/inc/vendorbase.hxx ++++ b/jvmfwk/inc/vendorbase.hxx +@@ -59,6 +59,8 @@ OpenJDK at least, but probably not true for Lemotes JDK */ + #else + #define JFW_PLUGIN_ARCH "mips64el" + #endif ++#elif defined RISCV64 ++#define JFW_PLUGIN_ARCH "riscv64" + #elif defined S390X + #define JFW_PLUGIN_ARCH "s390x" + #elif defined S390 +diff --git a/m4/ax_boost_base.m4 b/m4/ax_boost_base.m4 +index 94909a52f..e605311c8 100644 +--- a/m4/ax_boost_base.m4 ++++ b/m4/ax_boost_base.m4 +@@ -91,7 +91,7 @@ if test "x$want_boost" = "xyes"; then + dnl are found, e.g. when only header-only libraries are installed! + libsubdirs="lib" + ax_arch=`uname -m` +- if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = ppc64le -o $ax_arch = s390x -o $ax_arch = sparc64 -o $ax_arch = aarch64; then ++ if test $ax_arch = x86_64 -o $ax_arch = ppc64 -o $ax_arch = ppc64le -o $ax_arch = s390x -o $ax_arch = sparc64 -o $ax_arch = aarch64 -o $ax_arch = riscv64; then + libsubdirs="lib64 lib lib64" + fi + +diff --git a/solenv/gbuild/platform/LINUX_RISCV64_GCC.mk b/solenv/gbuild/platform/LINUX_RISCV64_GCC.mk +new file mode 100644 +index 000000000..9e007101d +--- /dev/null ++++ b/solenv/gbuild/platform/LINUX_RISCV64_GCC.mk +@@ -0,0 +1,15 @@ ++# -*- 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/. ++# ++ ++#please make generic modifications to unxgcc.mk or linux.mk ++gb_COMPILEROPTFLAGS := -Os ++ ++include $(GBUILDDIR)/platform/linux.mk ++ ++# vim: set noet sw=4: diff --git a/boost-1.81-locale.patch b/boost-1.81-locale.patch new file mode 100644 index 0000000..18b2222 --- /dev/null +++ b/boost-1.81-locale.patch @@ -0,0 +1,41 @@ +From 23dcd4339428e4080029ec5ae658e75f01e79a62 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?=C4=90o=C3=A0n=20Tr=E1=BA=A7n=20C=C3=B4ng=20Danh?= + <congdanhqx@gmail.com> +Date: Sun, 27 Nov 2022 18:59:24 +0700 +Subject: [PATCH] i18n: fix build with Boost 1.81.0 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Boost.Locale since 1.81.0 switch to enum classes for facet type [1]. +Switch our resource manager accordingly. + +1: https://github.com/boostorg/locale/commit/e5ed439ea39a4de915e9fb939cca95cae7d9d8d1 + +Change-Id: Ief215363ceb79b2019606b20a7cde55c8df6a042 +Reviewed-on: https://gerrit.libreoffice.org/c/core/+/143343 +Reviewed-by: Heiko Becker <heirecka@exherbo.org> +Tested-by: CaolĂ¡n McNamara <caolanm@redhat.com> +Reviewed-by: CaolĂ¡n McNamara <caolanm@redhat.com> +--- + unotools/source/i18n/resmgr.cxx | 5 +++++ + 1 file changed, 5 insertions(+) + +diff --git a/unotools/source/i18n/resmgr.cxx b/unotools/source/i18n/resmgr.cxx +index ddedf5b9e8a2f..3a71163500624 100644 +--- a/unotools/source/i18n/resmgr.cxx ++++ b/unotools/source/i18n/resmgr.cxx +@@ -127,8 +127,13 @@ namespace Translate + if (aFind != aCache.end()) + return aFind->second; + boost::locale::generator gen; ++#if BOOST_VERSION < 108100 + gen.characters(boost::locale::char_facet); + gen.categories(boost::locale::message_facet | boost::locale::information_facet); ++#else ++ gen.characters(boost::locale::char_facet_t::char_f); ++ gen.categories(boost::locale::category_t::message | boost::locale::category_t::information); ++#endif + #if defined(ANDROID) + OString sPath(OString(lo_get_app_data_dir()) + "/program/resource"); + #else diff --git a/install-with-hardlinks.diff b/install-with-hardlinks.diff new file mode 100644 index 0000000..956f41f --- /dev/null +++ b/install-with-hardlinks.diff @@ -0,0 +1,13 @@ +Index: libreoffice-7.0.0.0.beta2/solenv/bin/modules/installer/worker.pm +=================================================================== +--- libreoffice-7.0.0.0.beta2.orig/solenv/bin/modules/installer/worker.pm ++++ libreoffice-7.0.0.0.beta2/solenv/bin/modules/installer/worker.pm +@@ -347,7 +347,7 @@ sub install_simple ($$$$$$) + `mkdir -p "$destdir$destination"`; + } + else { +- copy ("$sourcepath", "$destdir$destination") || die "Can't copy file: $sourcepath -> $destdir$destination $!"; ++ link ("$sourcepath", "$destdir$destination") || die "Can't hardlink file: $sourcepath -> $destdir$destination $!"; + my $sourcestat = stat($sourcepath); + utime ($sourcestat->atime, $sourcestat->mtime, "$destdir$destination"); + chmod (oct($unixrights), "$destdir$destination") || die "Can't change permissions: $!"; diff --git a/libreoffice-7.4.2.3.tar.xz b/libreoffice-7.4.2.3.tar.xz new file mode 100644 index 0000000..6c62b90 --- /dev/null +++ b/libreoffice-7.4.2.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:82c1ffe02f2ed8ee1451a9f67c35335b27a638db591f9bc539eff86ab14dd95a +size 263628084 diff --git a/libreoffice-7.4.2.3.tar.xz.asc b/libreoffice-7.4.2.3.tar.xz.asc new file mode 100644 index 0000000..dd5be05 --- /dev/null +++ b/libreoffice-7.4.2.3.tar.xz.asc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:44954c34b8642259c86254f7e4217b9228f67fedb305de40481afab42f4aaa9c +size 833 diff --git a/libreoffice-help-7.4.2.3.tar.xz b/libreoffice-help-7.4.2.3.tar.xz new file mode 100644 index 0000000..0141424 --- /dev/null +++ b/libreoffice-help-7.4.2.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:4f9ed5dd9d8b394be442ddb86f57cb78746282d886e0dc35add36e8b34170f5c +size 112593884 diff --git a/libreoffice-help-7.4.2.3.tar.xz.asc b/libreoffice-help-7.4.2.3.tar.xz.asc new file mode 100644 index 0000000..b801444 --- /dev/null +++ b/libreoffice-help-7.4.2.3.tar.xz.asc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:d3aa855ae55851395357c9a5177a8f8038109c09ad16c995e2c0ec931863dd77 +size 833 diff --git a/libreoffice-no-destdircheck.patch b/libreoffice-no-destdircheck.patch new file mode 100644 index 0000000..c9f5f18 --- /dev/null +++ b/libreoffice-no-destdircheck.patch @@ -0,0 +1,27 @@ +diff --git a/bin/distro-install-clean-up b/bin/distro-install-clean-up +index 701c9ffa0972..0d0fc27246ff 100755 +--- a/bin/distro-install-clean-up ++++ b/bin/distro-install-clean-up +@@ -71,22 +71,3 @@ for dir in $DESTDIR$DOCDIR $DESTDIR$INSTALLDIR/sdk/examples ; do + -name "manifest.mf" \) -exec chmod 644 {} \; + fi + done +- +-if test "z$DESTDIR" != "z" ; then +- echo "Checking for DESTDIR inside installed files..." +- found_destdir= +- for file in `find $DESTDIR -type f` ; do +- grep -q "$DESTDIR" $file && echo "$file: includes the string \"$DESTDIR\"" && found_destdir=1 +- done +- if test "z$found_destdir" != "z" ; then +- echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!" +- echo "The path DESTDIR:$DESTDIR was found inside some" +- echo "installed files. It is probably a bug." +- echo +- echo "Especially, if the DESTDIR is set to \$RPM_BUILD_ROOT" +- echo "when creating RPM packages. Even it could be a security hole" +- echo "if the application searches /var/tmp for binaries or" +- echo "config files because the directory is world-writable." +- echo "!!!!!!!!!!!!!!!!!!!!!! WARNING !!!!!!!!!!!!!!!!!!!!!!" +- fi +-fi diff --git a/libreoffice-translations-7.4.2.3.tar.xz b/libreoffice-translations-7.4.2.3.tar.xz new file mode 100644 index 0000000..fb94b42 --- /dev/null +++ b/libreoffice-translations-7.4.2.3.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c8053f863c95c31a83a079bb2eefd9b666ffd59e40c4344098c04a924a54f6e1 +size 199319988 diff --git a/libreoffice-translations-7.4.2.3.tar.xz.asc b/libreoffice-translations-7.4.2.3.tar.xz.asc new file mode 100644 index 0000000..99ca883 --- /dev/null +++ b/libreoffice-translations-7.4.2.3.tar.xz.asc @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:87921f30439bc8b63b459cd29418d546d744efac8d0f8b537fd2f9cf0b6f1ef7 +size 833 diff --git a/libreoffice.spec b/libreoffice.spec new file mode 100644 index 0000000..43717b2 --- /dev/null +++ b/libreoffice.spec @@ -0,0 +1,1303 @@ +# extensions +%define numbertext_version 0.9.5 +# Urls +%define external_url https://dev-www.libreoffice.org/src/ +%define tarball_url https://dev-builds.libreoffice.org/pre-releases/src/ +# LTO needs newer toolchain stack only +%bcond_with lto +%bcond_without system_gpgme +%bcond_with firebird +Name: libreoffice +Version: 7.4.2.3 +Release: 3 +Summary: A Free Office Suite (Framework) +License: LGPL-3.0-or-later AND MPL-2.0+ +Group: Productivity/Office/Suite +URL: https://www.documentfoundation.org/ +Source0: %{tarball_url}/libreoffice-%{version}.tar.xz +Source1: %{tarball_url}/libreoffice-%{version}.tar.xz.asc +Source2: %{tarball_url}/libreoffice-help-%{version}.tar.xz +Source3: %{tarball_url}/libreoffice-help-%{version}.tar.xz.asc +Source4: %{tarball_url}/libreoffice-translations-%{version}.tar.xz +Source5: %{tarball_url}/libreoffice-translations-%{version}.tar.xz.asc +# prebuilt extensions +Source402: %{external_url}/b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_%{numbertext_version}.oxt +# used extensions sources +Source450: %{external_url}/1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt +Source452: %{external_url}/90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2 +# GPGME bundle list +Source1000: %{external_url}/gpgme-1.13.1.tar.bz2 +Source1001: %{external_url}/libgpg-error-1.37.tar.bz2 +Source1002: %{external_url}/libassuan-2.5.3.tar.bz2 +# Internal bundled stuff we can't remove +# To build this we would pull cygwin; not worth it +Source2001: https://dev-www.libreoffice.org/extern/185d60944ea767075d27247c3162b3bc-unowinreg.dll +# hsqldb simply does not work with new system version, but luckily we migrate to firebird +Source2002: %{external_url}/17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip +# Heavily patched and not possible to use system one +Source2003: %{external_url}/798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip +Source2004: %{external_url}/35c94d2df8893241173de1d16b6034c0-swingExSrc.zip +# Needed for wiki-published and always taken as bundled +Source2005: %{external_url}/a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip +# Needed for integration tests +Source2006: https://dev-www.libreoffice.org/extern/8249374c274932a21846fa7629c2aa9b-officeotron-0.7.4-master.jar +Source2007: https://dev-www.libreoffice.org/extern/odfvalidator-0.9.0-RC2-SNAPSHOT-jar-with-dependencies-2726ab578664434a545f8379a01a9faffac0ae73.jar +# PDFium is bundled everywhere +Source2008: %{external_url}/pdfium-5058.tar.bz2 +# Single C file with patches from LO +Source2009: %{external_url}/dtoa-20180411.tgz +# Skia is part of chromium and bundled everywhere as by google only way is monorepo way +Source2010: %{external_url}/skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz +Source2012: %{external_url}/libcmis-0.5.2.tar.xz +Source2013: %{external_url}/dragonbox-1.1.0.tar.gz +# do not use the broken help; unopkg complained about it when registering extensions +# FIXME: the right fix is to compile the help and produce the .db_, .ht_, and other files +Patch2: nlpsolver-no-broken-help.diff +Patch3: mediawiki-no-broken-help.diff +# Build with java 8 +Patch101: 0001-Revert-java-9-changes.patch +Patch202: boost-1.81-locale.patch +# try to save space by using hardlinks +Patch990: install-with-hardlinks.diff +# save time by relying on rpm check rather than doing stupid find+grep +Patch991: libreoffice-no-destdircheck.patch +Patch999: Add-riscv64-support.diff +BuildRequires: %{name}-share-linker +BuildRequires: ant +BuildRequires: autoconf +BuildRequires: gawk +BuildRequires: bison +BuildRequires: bsh +BuildRequires: apache-commons-logging +BuildRequires: cups-devel +BuildRequires: curl-devel +BuildRequires: dejavu-fonts +BuildRequires: doxygen >= 1.8.4 +BuildRequires: flex >= 2.6.0 +BuildRequires: flute +BuildRequires: fontforge +BuildRequires: glm-devel +BuildRequires: abseil-cpp-devel +BuildRequires: google-crosextra-carlito-fonts +BuildRequires: gperf >= 3.1 +BuildRequires: graphviz +BuildRequires: hyphen-devel +BuildRequires: junit +BuildRequires: libbase +BuildRequires: cppunit-devel >= 1.14.0 +BuildRequires: liberation-fonts +BuildRequires: libexif +BuildRequires: libfonts +BuildRequires: libformula +BuildRequires: libjpeg-devel +BuildRequires: openjpeg2-devel +BuildRequires: libwebp-devel +BuildRequires: liblayout +BuildRequires: libloader +BuildRequires: librepository +BuildRequires: libserializer +BuildRequires: libtool-ltdl-devel +BuildRequires: lpsolve-devel +BuildRequires: make +BuildRequires: openldap-devel +BuildRequires: pentaho-libxml +BuildRequires: pentaho-reporting-flow-engine +BuildRequires: pkgconfig +BuildRequires: python3-lxml +BuildRequires: sac +BuildRequires: ucpp +BuildRequires: unixODBC-devel +BuildRequires: unzip +BuildRequires: xml-commons-apis +BuildRequires: xz +BuildRequires: zip +BuildRequires: perl(Archive::Zip) +BuildRequires: perl(Digest::MD5) +BuildRequires: pkgconfig(apr-util-1) +BuildRequires: pkgconfig(bluez) +BuildRequires: pkgconfig(dbus-1) >= 0.60 +BuildRequires: pkgconfig(epoxy) >= 1.2 +BuildRequires: pkgconfig(expat) +BuildRequires: pkgconfig(freetype2) +BuildRequires: pkgconfig(gl) +BuildRequires: pkgconfig(glib-2.0) >= 2.40 +BuildRequires: pkgconfig(glu) +BuildRequires: pkgconfig(gobject-introspection-1.0) +BuildRequires: pkgconfig(graphite2) >= 0.9.3 +BuildRequires: pkgconfig(gssrpc) +BuildRequires: pkgconfig(gstreamer-plugins-base-1.0) +BuildRequires: pkgconfig(gtk+-3.0) >= 3.20 +BuildRequires: pkgconfig(harfbuzz) >= 0.9.42 +BuildRequires: pkgconfig(harfbuzz-icu) >= 0.9.42 +BuildRequires: pkgconfig(hunspell) +BuildRequires: pkgconfig(krb5) +BuildRequires: pkgconfig(lcms2) +BuildRequires: pkgconfig(libabw-0.1) +BuildRequires: pkgconfig(libcdr-0.1) >= 0.1 +BuildRequires: pkgconfig(libclucene-core) +BuildRequires: pkgconfig(libe-book-0.1) >= 0.1.2 +BuildRequires: pkgconfig(libeot) >= 0.01 +BuildRequires: pkgconfig(libepubgen-0.1) +BuildRequires: pkgconfig(libetonyek-0.1) >= 0.1.10 +BuildRequires: pkgconfig(libexttextcat) >= 3.4.1 +BuildRequires: pkgconfig(libfreehand-0.1) +BuildRequires: pkgconfig(liblangtag) +BuildRequires: pkgconfig(libmspub-0.1) >= 0.1 +BuildRequires: pkgconfig(libmwaw-0.3) >= 0.3.21 +BuildRequires: pkgconfig(libnumbertext) >= 1.0.6 +BuildRequires: pkgconfig(libodfgen-0.1) >= 0.1.4 +BuildRequires: pkgconfig(liborcus-0.17) +BuildRequires: pkgconfig(libpagemaker-0.0) +BuildRequires: pkgconfig(libpng) +BuildRequires: pkgconfig(libpq) +BuildRequires: pkgconfig(libqxp-0.0) +BuildRequires: pkgconfig(librevenge-0.0) >= 0.0.1 +BuildRequires: pkgconfig(librsvg-2.0) +BuildRequires: pkgconfig(libstaroffice-0.0) >= 0.0.6 +BuildRequires: pkgconfig(libvisio-0.1) >= 0.1 +BuildRequires: pkgconfig(libwpd-0.10) >= 0.10 +BuildRequires: pkgconfig(libwpg-0.3) +BuildRequires: pkgconfig(libwps-0.4) >= 0.4.11 +BuildRequires: pkgconfig(libxml-2.0) +BuildRequires: pkgconfig(libxslt) +BuildRequires: pkgconfig(libzmf-0.0) +BuildRequires: pkgconfig(mdds-2.0) >= 2.0.0 +BuildRequires: pkgconfig(mythes) +BuildRequires: pkgconfig(nspr) >= 4.8 +BuildRequires: pkgconfig(nss) >= 3.9.3 +BuildRequires: pkgconfig(python3) +BuildRequires: pkgconfig(redland) +BuildRequires: pkgconfig(sane-backends) +BuildRequires: pkgconfig(serf-1) >= 1.3.9 +BuildRequires: pkgconfig(xmlsec1-nss) >= 1.2.28 +BuildRequires: pkgconfig(xrandr) +BuildRequires: pkgconfig(xt) +BuildRequires: pkgconfig(zxing) +Requires: liberation-fonts +Requires: libreoffice-branding >= 6.0 +Requires: libreoffice-icon-themes = %{version} +# We need at least english to launch ourselves +Requires: libreoffice-l10n-en = %{version} +Requires: python3 +Recommends: dejavu-fonts +Recommends: google-crosextra-carlito-fonts +Provides: %{name}-draw-extensions = %{version} +Obsoletes: %{name}-draw-extensions < %{version} +Provides: %{name}-impress-extensions = %{version} +Obsoletes: %{name}-impress-extensions < %{version} +Provides: %{name}-base-extensions = %{version} +Obsoletes: %{name}-base-extensions < %{version} +Provides: %{name}-kde = %{version} +Obsoletes: %{name}-kde < %{version} +Provides: %{name}-l10n-prebuild = %{version} +Obsoletes: %{name}-l10n-prebuild < %{version} +Provides: %{name}-mono = %{version} +Obsoletes: %{name}-mono < %{version} +Provides: %{name}-ure = %{version} +Obsoletes: %{name}-ure < %{version} +Provides: %{name}-icon-theme-crystal = %{version} +Obsoletes: %{name}-icon-theme-crystal < %{version} +Provides: %{name}-icon-theme-oxygen = %{version} +Obsoletes: %{name}-icon-theme-oxygen < %{version} +ExclusiveArch: aarch64 %{ix86} x86_64 riscv64 +BuildRequires: boost-devel +BuildRequires: pkgconfig(poppler) pkgconfig(poppler-cpp) +BuildRequires: gcc >= 7 +BuildRequires: gcc-c++ >= 7 +# genbrk binary is required +BuildRequires: icu +BuildRequires: java-11-devel +BuildRequires: Box2D-devel +BuildRequires: mariadb-connector-c-devel +BuildRequires: pkgconfig(icu-i18n) +BuildConflicts: java < 9 +BuildConflicts: java-devel < 9 +BuildConflicts: java-headless < 9 +%if %{with system_gpgme} +BuildRequires: gpgme-devel gpgme-pp +%endif +%if %{with firebird} +BuildRequires: pkgconfig(fbclient) +%endif +Provides: %{name}-kde4 = %{version} +Obsoletes: %{name}-kde4 < %{version} +Provides: %{name}-qt5 = %{version} +Obsoletes: %{name}-qt5 < %{version} + +%description +LibreOffice is a comprehensive office package featuring a word +processor, a spreadsheet, a presentation program, and much more. This +package provides only the basic framework. You have to install the +additional modules to get the required functionality, see packages: + +- libreoffice-base +- libreoffice-calc +- libreoffice-draw +- libreoffice-impress +- libreoffice-math +- libreoffice-writer + +Some optional features are provided by extra packages, for example: + +- libreoffice-mailmerge +- libreoffice-filters +- libreoffice-qt5 +- libreoffice-gnome + +Non-English localizations are provided by extra packages as well, for +example: + +- libreoffice-l10n-de +- libreoffice-l10n-fr +- libreoffice-l10n-it + +%package branding-upstream +Summary: Original Branding for LibreOffice +Group: Productivity/Office/Suite +Supplements: libreoffice +Conflicts: libreoffice-branding +Provides: libreoffice-branding = %{version} +BuildArch: noarch + +%description branding-upstream +This package includes the original branding for the LibreOffice office suite. + +%package icon-themes +Summary: LibreOffice Icon Themes +Group: Productivity/Office/Suite +Requires(post): %{name}-share-linker +Requires(postun):%{name}-share-linker +Supplements: libreoffice +Provides: %{name}-icon-theme-breeze = %{version} +Obsoletes: %{name}-icon-theme-breeze < %{version} +Provides: %{name}-icon-theme-galaxy = %{version} +Obsoletes: %{name}-icon-theme-galaxy < %{version} +Provides: %{name}-icon-theme-hicontrast = %{version} +Obsoletes: %{name}-icon-theme-hicontrast < %{version} +Provides: %{name}-icon-theme-sifr = %{version} +Obsoletes: %{name}-icon-theme-sifr < %{version} +Provides: %{name}-icon-theme-tango = %{version} +Obsoletes: %{name}-icon-theme-tango < %{version} +BuildArch: noarch + +%description icon-themes +This package provides all of the LibreOffice icon themes. + +%package glade +Summary: Support for creating LibreOffice dialogs in glade +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +BuildArch: noarch + +%description glade +%{name}-glade contains a catalog of LibreOffice-specific widgets for +glade and ui-previewer tool to check the visual appearance of dialogs. + +%package gdb-pretty-printers +Summary: Additional support for debugging with gdb +Group: Productivity/Office/Suite +Requires: gdb +Requires: libreoffice = %{version} +Requires: python3-six +Supplements: libreoffice-debuginfo = %{version} +BuildArch: noarch + +%description gdb-pretty-printers +This package provides gdb pretty printers for package %{name}. + +%package base +Summary: LibreOffice Base +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Requires: pentaho-reporting-flow-engine +Supplements: %{name} +Obsoletes: %{name}-base-drivers-mysql +# default database connector +%if %{with firebird} +Requires: %{name}-base-drivers-firebird +%else +Requires: jre >= 1.8 +%endif + +%description base +This module allows you to manage databases, create queries and reports +to track and manage your information by using LibreOffice office +suite. + +%package calc +Summary: LibreOffice Calc +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description calc +This module allows you to perform calculation, analyze information and +manage lists in spreadsheets by using LibreOffice office suite. + +%package draw +Summary: LibreOffice Draw +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description draw +This module allows you to create and edit drawings, flow charts, and +logos by using LibreOffice office suite. + +%package math +Summary: LibreOffice Math +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description math +This module allows you to create and edit scientific formulas and +equations by using LibreOffice office suite. + +%package impress +Summary: LibreOffice Impress +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description impress +This module allows you to create and edit presentations for slideshows, +meeting and Web pages by using LibreOffice office suite. + +%package writer +Summary: LibreOffice Writer and Web +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description writer +This module allows you to create and edit text and graphics in letters, +reports, documents and Web pages by using LibreOffice office suite. + +%package base-drivers-postgresql +Summary: PostgreSQL Database Driver for LibreOffice +Group: Productivity/Office/Suite +Requires: postgresql + +%description base-drivers-postgresql +This package allows to access PostgreSQL databases from LibreOffice Base. + +%package base-drivers-firebird +Summary: Firebird Database Driver for LibreOffice +Group: Productivity/Office/Suite +Requires: firebird + +%description base-drivers-firebird +This package allows to access Firebird databeses from LibreOffice Base. + +%package filters-optional +Summary: Additional Import and Export Filters for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name}-calc = %{version} +Requires: %{name}-draw = %{version} +Requires: %{name}-impress = %{version} +Requires: %{name}-math = %{version} +Requires: %{name}-writer = %{version} +Supplements: %{name} + +%description filters-optional +This package includes some additional import and export filters for +LibreOffice: +- AportisDoc (Palm) +- Pocket Excel +- Pocket Word +- DocBook +- XHTML + +%package mailmerge +Summary: Mail Merge Functionality for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name}-pyuno = %{version} +Supplements: %{name} + +%description mailmerge +This module allows you to create form letters or send E-mail messages +to many recipients using LibreOffice office suite. + +%package pyuno +Summary: Python UNO Bridge for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: %{name} + +%description pyuno +The Python-UNO bridge allows to use the standard LibreOffice API +from the well known Python scripting language. It can be used to +develop UNO components in python, thus python UNO components may be run +within the LibreOffice process and can be called from Java, C++ or +the built in StarBasic scripting language. You can create and invoke +scripts with the office scripting framework (OOo 2.0 and later) with +it. For example, it is used for the mail merge functionality. + +You can find the more information at +http://udk.openoffice.org/python/python-bridge.html + +%package librelogo +Summary: LibreLogo scripting language +Group: Productivity/Office/Suite +Requires: %{name}-pyuno = %{version} +Requires: %{name}-writer = %{version} + +%description librelogo +Enables LibreLogo scripting in Writer. LibreLogo is a Logo-like +programming language with interactive vectorgraphics for education and +DTP. + +%package gnome +Summary: GNOME Extensions for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name} = %{version} + +%description gnome +This package contains some GNOME extensions and GTK2 interface for LibreOffice. + +%package gtk3 +Summary: Gtk3 interface for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name}-gnome = %{version} +Supplements: (libreoffice and gnome-session) +Supplements: (libreoffice and mate-session-manager) +Supplements: (libreoffice and xfce4-session) + +%description gtk3 +This package contains Gtk3 interface rendering option for LibreOffice. + +%package qt5 +Summary: Qt5/KDE Frameworks interface for LibreOffice +Group: Productivity/Office/Suite +Requires: %{name} = %{version} +Supplements: packageand(libreoffice:plasma5-workspace) +Provides: %{name}-kde4 = %{version} +Obsoletes: %{name}-kde4 < %{version} + +%description qt5 +This package contains Qt5/KDE Frameworks interface rendering options for LibreOffice. + +%package sdk +Summary: LibreOffice SDK +Group: Documentation/HTML +Requires: %{name} = %{version} +Requires: gcc-c++ +Requires: make +Requires: ucpp +Requires: zip +Recommends: java-devel >= 9.0 +Provides: libreoffice-ure-devel = %{version} +Obsoletes: libreoffice-ure-devel < %{version} + +%description sdk +This package contains the files needed to build plugins/add-ons for +LibreOffice. It includes header files, IDL files, needed build +tools, etc. + +The documentation is in the package libreoffice-sdk-doc + +%package sdk-doc +Summary: LibreOffice SDK Documentation +Group: Development/Libraries/Other +Suggests: %{name}-sdk = %{version} +Enhances: %{name}-sdk = %{version} +Provides: libreoffice-ure-devel-doc = %{version} +Obsoletes: libreoffice-ure-devel-doc < %{version} + +%description sdk-doc +This package includes documentation and examples for the LibreOffice +Software Development Kit (SDK). + +%package calc-extensions +Summary: LibreOffice Calc Extensions +Group: Productivity/Office/Suite +Requires: libreoffice-calc = %{version} +# pyuno is needed for the numbertext extension +Requires: libreoffice-pyuno = %{version} +Requires(pre): libreoffice = %{version} +# the watchWindow extension is written in java +Requires: jre >= 1.8 + +%description calc-extensions +This package provides extensions for LibreOffice Calc: + +- Convert Text to Number +- New Functions NUMBERTEXT and MONEYTEXT +- Solver for Nonlinear Programming + +%package writer-extensions +Summary: LibreOffice Writer Extensions +Group: Productivity/Office/Suite +Requires: libreoffice-writer = %{version} +Requires(pre): libreoffice = %{version} +# the wiki extension is written in java +Requires: jre >= 1.8 + +%description writer-extensions +This package provides extensions for LibreOffice Writer: + +- MediaWiki Publisher + +%package -n libreofficekit +Summary: A library providing access to LibreOffice functionality +Group: Productivity/Office/Suite +Requires: %{name} = %{version} + +%description -n libreofficekit +LibreOfficeKit can be used to access LibreOffice functionality +through C/C++, without any need to use UNO. + +%package -n libreofficekit-devel +Summary: Development files for libreofficekit +Group: Productivity/Office/Suite +Requires: libreofficekit = %{version} + +%description -n libreofficekit-devel +The libreofficekit-devel package contains libraries and header files for +developing applications that use libreofficekit. + +# Symlink autocorr files for various conversion items +%define make_autocorr_aliases(l:) \ +%{?-l: \ +for lang in %{*}; do \ + ln -sf acor_%{-l*}.dat %{buildroot}%{_libdir}/%{name}/share/autocorr/acor_$lang.dat \ +done \ +} \ +%{!?-l:%{error:-l must be present}} +# Symlinking macro for /usr/lib64 and /usr/share packing +# As argument takes name of the package +%define _link_noarch_files() \ +%posttrans %{1} \ +rpm -ql %{name}-%{1} > %{_datadir}/libreoffice/%{1}_list.txt || true \ +if [ -f %{_datadir}/libreoffice/%{1}_list.txt ] ; then \ + %{_bindir}/libreoffice-share-linker %{_datadir}/libreoffice/%{1}_list.txt || true \ +fi \ +\ +%postun %{1} \ +if [ "$1" = "0" -a -f %{_datadir}/libreoffice/%{1}_list.txt -a -x %{_bindir}/libreoffice-share-linker ]; then \ + %{_bindir}/libreoffice-share-linker --unlink %{_datadir}/libreoffice/%{1}_list.txt || true \ + rm -f %{_datadir}/libreoffice/%{1}_list.txt 2> /dev/null || true \ +fi \ +%{nil} +# Crazy magic for the auto help/lang generating. +%define _langpack_common(g:l:j:) \ +%if "%{-l*}" != "en-US" \ +%dir %{_datadir}/libreoffice/program/resource \ +%dir %{_datadir}/libreoffice/program/resource/%{-g:%{-g*}}%{!-g:%{-l*}} \ +%dir %{_datadir}/libreoffice/program/resource/%{-g:%{-g*}}%{!-g:%{-l*}}/LC_MESSAGES \ +%{_datadir}/%{name}/program/resource/%{-g:%{-g*}}%{!-g:%{-l*}}/LC_MESSAGES/*.mo \ +%endif \ +%dir %{_datadir}/%{name}/share/registry \ +%dir %{_datadir}/%{name}/share/registry/res \ +%{_datadir}/%{name}/share/registry/Langpack-%{-l*}.xcd \ +%if "%{-l*}" != "en-US" \ +%{_datadir}/%{name}/share/registry/res/registry_%{-l*}.xcd \ +%endif \ +%{_datadir}/%{name}/share/registry/res/fcfg_langpack_%{-l*}.xcd \ +%dir %{_datadir}/%{name}/share/wizards \ +%{_datadir}/%{name}/share/wizards/resources_%{-j:%{-j*}}%{!-j:%{-l*}}.properties \ +%{nil} +# Defines a language pack subpackage. +# +# It's necessary to define language code (-l) and language name (-n). +# Additionally, it's possible +# * to require autocorr, hunspell, hyphen or mythes package or font for +# given language, +# * to obsolete openoffice.org-langpack package, +# * to provide libreoffice-langpack-loc package, where loc is glibc +# locale--this is necessary for yum to pick it automatically, +# * to require other, unrelated, packages, +# * to specify file serving as file list. +# For these, lower case character argument takes an argument specifying +# language, upper case character argument uses language from -l. +# +# All remaining arguments are considered to be files and added to the file +# list. +# +# c: additional config file (just the name stem) +# E the package does not contain any files (i.e., has empty filelist) +# i: additional language added to this package +# L: internal (LibreOffice) language code, used in file names +# l: language code, e.g., cs +# g: glibc/java locale +# j: java locale +# k: glibc locale for the additional language -i +# o: java locale for the additional language -i +# Mm: hunspell dependency +# n: language name, e.g., Czech +# p: Provides: of libreoffice-l10n +# q: Provides: of libreoffice-l10n if one provide is not enough +# r: comma-separated list of additional requires +# S:s: script classification (cjk, ctl). -S is only a marker, as it does +# not add any .xcd into the package (the file does not exist for at +# least one CTL-using locale, si) +# T has help files +# Xx: has autotext definitions +# +# Example: +# libreoffice-l10n-cs: langpack for Czech lang. Requiring myspell-cs_CZ: +# %%langpack -l cs -n Czech -m cs_CZ +%define langpack(c:Ei:g:j:k:L:l:Mm:n:o:p:q:r:S:s:TXx:) \ +%define project LibreOffice \ +%define lang %{-l:%{-l*}}%{!-l:%{error:Language code not defined}} \ +%define _langpack_lang %{-L:%{-L*}}%{!-L:%{lang}} \ +%define pkgname l10n-%{lang} \ +%define langname %{-n:%{-n*}}%{!-n:%{error:Language name not defined}} \ +\ +%package %{pkgname} \ +Summary: %{langname} localization files for %{project} \ +Group: Productivity/Office/Suite \ +Requires: %{name} = %{version} \ +Requires: %{name}-share-linker \ +Provides: locale(libreoffice:%{lang}) \ +BuildArch: noarch \ +%{-m:Requires: hunspell-%{-m*}}%{!-m:%{-M:Requires: hunspell-%{lang}}} \ +%{-r:Requires: %{-r*}} \ +%{-p: \ +Provides: %{name}-l10n-%{-p*} = %{version} \ +Obsoletes: %{name}-l10n-%{-p*} < %{version} \ +} \ +%{-q: \ +Provides: %{name}-l10n-%{-q*} = %{version} \ +Obsoletes: %{name}-l10n-%{-q*} < %{version} \ +} \ +Provides: %{name}-help-%{lang} = %{version} \ +Obsoletes: %{name}-help-%{lang} < %{version} \ +%{-L: \ +Provides: %{name}-help-%{-L*} = %{version} \ +Obsoletes: %{name}-help-%{-L*} < %{version} \ +} \ +%{-p: \ +Provides: %{name}-help-%{-p*} = %{version} \ +Obsoletes: %{name}-help-%{-p*} < %{version} \ +} \ +%{-q: \ +Provides: %{name}-help-%{-q*} = %{version} \ +Obsoletes: %{name}-help-%{-q*} < %{version} \ +} \ +\ +%description %{pkgname} \ +Provides %{langname} translations and additional resources (help files, etc.) for %{project}. \ +\ +%files %{pkgname} \ +%{-T: \ +%dir %{_datadir}/libreoffice/help/%{_langpack_lang} \ +%{_datadir}/libreoffice/help/%{_langpack_lang}/* \ +%if "%{-L*}" == "en-US" \ +%{_datadir}/libreoffice/help/*.js \ +%{_datadir}/libreoffice/help/*.css \ +%{_datadir}/libreoffice/help/*.html \ +%{_datadir}/libreoffice/help/media* \ +%endif \ +} \ +%{!-E: \ +%define autotextdir %{_datadir}/%{name}/share/autotext \ +%dir %{autotextdir} \ +%{expand:%%_langpack_common -l %{_langpack_lang} %{-g:-g %{-g*}} %{-j:-j %{-j*}}} \ +%{-x:%{autotextdir}/%{-x*}}%{!-x:%{-X:%{autotextdir}/%{_langpack_lang}}} \ +%{-c:%{_datadir}/%{name}/share/registry/%{-c*}.xcd} \ +%{-s:%{_datadir}/%{name}/share/registry/%{-s*}_%{_langpack_lang}.xcd} \ +%{-i:%{expand:%%_langpack_common -l %{-i*} %{-k:-g %{-k*}} %{-o:-j %{-o*}}}} \ +} \ +\ +%{expand:%%_link_noarch_files %{pkgname}} \ +%{nil} +%langpack -l af -n Afrikaans -m af_ZA -X +%langpack -l am -n Amharic -T -X +%langpack -l ar -n Arabic -s ctl -m ar -T -X +%langpack -l as -n Assamese -X +%langpack -l ast -n Asturian -T -X +%langpack -l be -n Belarusian -m be_BY -X +%langpack -l bg -n Bulgarian -X -m bg_BG -T +%langpack -l bn -n Bengali -m bn_BD -T -X +%langpack -l bn_IN -n Bengali_India -T -p bn-IN -m bn_IN -L bn-IN -g bn_IN -j bn_IN -X +%langpack -l bo -n Tibetian -T -s ctl -m bo -X +%langpack -l br -n Breton -m br_FR -X +%langpack -l brx -n Bodo -X +%langpack -l bs -n Bosnian -T -X +%langpack -l ca -n Catalan -M -X -T +%langpack -l ca_valencia -n Valencian -m ca_ES_valencia -T -L ca-valencia -g ca@valencia -j ca_valencia -X +%langpack -l ckb -n Central_Kurdish +%langpack -l cs -n Czech -X -m cs_CZ -T +%langpack -l cy -n Welsh -X +%langpack -l da -n Danish -X -m da_DK -T +%langpack -l de -n German -X -M -T +%langpack -l dgo -n Dogri -X +%langpack -l dsb -n Lower_Sorbian -X +%langpack -l dz -n Dzongkha -s ctl -T -X +%langpack -l el -n Greek -m el_GR -T -X +%langpack -l en -n English -L en-US -X -M -g en_US -T -j en_US +%langpack -l en_GB -n English_GB -M -T -X -L en-GB -g en_GB -j en_GB +%langpack -l en_ZA -n English_ZA -M -T -X -L en-ZA -g en_ZA -j en_ZA +%langpack -l eo -n Esperanto -T -X +%langpack -l es -n Spanish -M -X -T +%langpack -l et -n Estonian -m et_EE -T -X +%langpack -l eu -n Basque -T -X +%langpack -l fa -n Farsi -s ctl -X +%langpack -l fi -n Finnish -r libreoffice-voikko -X -T +%langpack -l fr -n French -X -m fr_FR -T +%langpack -l fur -n Friulian +%langpack -l fy -n Frisian -X +%langpack -l ga -n Irish -X +%langpack -l gd -n Gaelic -m gd_GB -X +%langpack -l gl -n Galician -M -T -X +%langpack -l gu -n Gujarati -s ctl -p gu-IN -m gu_IN -T -X +%langpack -l gug -n Paraguayan_GuaranĂ -M -X +%langpack -l he -n Hebrew -s ctl -m he_IL -T -X +%langpack -l hi -n Hindi -s ctl -p hi-IN -m hi_IN -T -X +%langpack -l hr -n Croatian -m hr_HR -X -T +%langpack -l hsb -n Upper_Sorbian -X +%langpack -l hu -n Hungarian -X -m hu_HU -T +%langpack -l it -n Italian -X -m it_IT -T +%langpack -l id -n Indonesian -T -M -X +%langpack -l is -n Icelandic -T -X -M +%langpack -l ja -n Japanese -s cjk -X -T +%langpack -l ka -n Georgian -T -X +%langpack -l kab -n Kabyle -X +%langpack -l kk -n Kazakh -X +%langpack -l kn -n Kannada -X +%langpack -l km -n Khmer -T -X -s ctl -c ctlseqcheck_km +%langpack -l kmr_Latn -n Kurdish -M -g kmr@latin -L kmr-Latn -j kmr_Latn -X +%langpack -l ko -n Korean -s cjk -X -T +%langpack -l kok -n Konkani -X +%langpack -l ks -n Kashmiri -X +%langpack -l lb -n Luxembourgish -X +%langpack -l lo -n Lao -T -s ctl -m lo_LA -c ctlseqcheck_lo -X +%langpack -l lt -n Lithuanian -m lt_LT -X -T +%langpack -l lv -n Latvian -m lv_LV -T -X +%langpack -l mai -n Maithili -X +%langpack -l mk -n Macedonian -T -X +%langpack -l ml -n Malayalam -X +%langpack -l mn -n Monglolian -X +%langpack -l mni -n Manipuri -X +%langpack -l mr -n Marathi -X +%langpack -l my -n Burnese -s ctl -X +%langpack -l nb -n Bokmal -M -m no -T -X +%langpack -l ne -n Nepali -T -s ctl -m ne_NP -X +%langpack -l nl -n Dutch -X -m nl_NL -T +%langpack -l nn -n Nynorsk -m nn_NO -T -X +%langpack -l nr -n Southern_Ndebele -X +%langpack -l nso -n Northern_Sotho -X +%langpack -l oc -n Occitan -m oc_FR -X +%langpack -l om -n Oromo -T -X +%langpack -l or -n Odia -s ctl -X +%langpack -l pa -n Punjabi -s ctl -L pa-IN -p pa-IN -g pa_IN -j pa_IN -x pa-IN +%langpack -l pl -n Polish -X -m pl_PL -T +%langpack -l pt_BR -n Brazilian_Portuguese -m pt_BR -L pt-BR -p pt-BR -X -g pt_BR -j pt_BR -T +%langpack -l pt_PT -n Portuguese -m pt_PT -L pt -x pt -p pt -q pt-PT -T +%langpack -l ro -n Romanian -M -X -T +%langpack -l ru -n Russian -X -m ru_RU -T +%langpack -l rw -n Kinyarwanda -X +%langpack -l sa_IN -n Sanskrit -L sa-IN -g sa_IN -j sa_IN -x sa-IN +%langpack -l sat -n Santali -X +%langpack -l sd -n Sindhi -X +%langpack -l si -n Sinhalese -S ctl -m si_LK -T -X +%langpack -l sid -n Sidamo -T -X +%langpack -l sk -n Slovak -X -m sk_SK -T +%langpack -l sl -n Slovenian -X -m sl_SI -T +%langpack -l sq -n Albanian -T -m sq_AL -X +%langpack -l sr -n Serbian -i sr-Latn -M -j sr -g sr -k sr@latin -o sr_Latn -x sr-Latn +%langpack -l ss -n Swati -X +%langpack -l st -n Southern_Sotho -X +%langpack -l sv -n Swedish -X -m sv_SE -T +%langpack -l sw_TZ -n Swahili -M -L sw-TZ -g sw_TZ -j sw_TZ -x sw-TZ +%langpack -l szl -n Silesian -X +%langpack -l ta -n Tamil -s ctl -T -X +%langpack -l te -n Telugu -m te_IN -X +%langpack -l tg -n Tajik -T -X +%langpack -l th -n Thai -s ctl -c ctlseqcheck_th -m th_TH -X +%langpack -l tn -n Tswana -X +%langpack -l tr -n Turkish -X -T -m tr_TR +%langpack -l ts -n Tsonga -X +%langpack -l tt -n Tatar -X +%langpack -l ug -n Uyghur -T -X +%langpack -l uk -n Ukrainian -m uk_UA -T -X +%langpack -l uz -n Uzbek -X +%langpack -l vi -n Vietnamese -T -X -M +%langpack -l ve -n Venda -X +%langpack -l vec -n Venetian -X +%langpack -l xh -n Xhosa -X +%langpack -l zh_CN -n Simplified_Chinese -p zh-CN -s cjk -L zh-CN -x zh-CN -q zh-Hans -g zh_CN -j zh_CN -T +%langpack -l zh_TW -n Traditional_Chinese -p zh-TW -s cjk -L zh-TW -x zh-TW -q zh-Hant -g zh_TW -j zh_TW -T +%langpack -l zu -n Zulu -m zu_ZA -X + +%prep +%setup -q -b2 -b4 +%patch2 +%patch3 +%patch202 -p1 +%patch990 -p1 +%patch991 -p1 +%patch999 -p1 + +# Disable some of the failing tests (some are random) +# Following two tests are really flaky +sed -i -e /CppunitTest_dbaccess_hsqldb_test/d dbaccess/Module_dbaccess.mk +sed -i -e s/CppunitTest_dbaccess_RowSetClones// dbaccess/Module_dbaccess.mk +# Fails due to diff caused by fonts +sed -i -e /CppunitTest_sw_rtfimport/d sw/Module_sw.mk +# only due to the above +sed -i -e /CppunitTest_sw_uiwriter/d sw/Module_sw.mk +# The gpg files are not loaded properly +sed -i -e /CPPUNIT_TEST\(testODFEncryptedGPG\)/d xmlsecurity/qa/unit/signing/signing.cxx +# breaks on LTO https://bugs.documentfoundation.org/show_bug.cgi?id=126442 +sed -i -e /CppunitTest_sw_apitests/d sw/Module_sw.mk + +# Do not generate doxygen timestamp +echo "HTML_TIMESTAMP = NO" >> odk/docs/cpp/Doxyfile +echo "HTML_TIMESTAMP = NO" >> odk/docs/idl/Doxyfile + +%build +# Strip lto from %_lto_cflags as the project has --enable-lto option +%define _lto_cflags %{nil} +# do not eat all memory +# make sure that JAVA_HOME is set correctly +if [ -f %{_sysconfdir}/profile.d/alljava.sh ]; then + . %{_sysconfdir}/profile.d/alljava.sh +elif [ -f %{_distconfdir}/profile.d/alljava.sh ]; then + . %{_distconfdir}/profile.d/alljava.sh +else + export JAVA_HOME=/usr/lib/jvm/java-11 +fi +# use RPM_OPT_FLAGS, ... +# remove big debugsymbols as we simply consume too much space +%if %{with lto} +ARCH_FLAGS="`echo %{optflags} -flifetime-dse=1 | sed -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g$/ -g1/g'`" +%else +ARCH_FLAGS="`echo %{optflags} | sed -e 's/^-g /-g1 /g' -e 's/ -g / -g1 /g' -e 's/ -g$/ -g1/g'`" +%endif +CFLAGS="$ARCH_FLAGS" +CXXFLAGS="$ARCH_FLAGS" +export ARCH_FLAGS CFLAGS CXXFLAGS + +# Fake the epoch stuff in generated zip files +export SOURCE_DATE_EPOCH=$(date -d "$(head -n 2 %{_sourcedir}/%{name}.changes | tail -n 1 | cut -d- -f1 )" +%%s) + +# Colada does not have .pc file and configure creator was really lazy +export OPENCOLLADA_CFLAGS='-I/usr/include/COLLADABaseUtils -I/usr/include/COLLADAFramework -I/usr/include/COLLADASaxFrameworkLoader -I/usr/include/GeneratedSaxParser' +export OPENCOLLADA_LIBS='-lOpenCOLLADABaseUtils -lOpenCOLLADAFramework -lOpenCOLLADASaxFrameworkLoader -lGeneratedSaxParser' + +# Set up Google API keys, see http://www.chromium.org/developers/how-tos/api-keys +# Note: For your own distribution, please get your own set of keys. +google_api_key="AIzaSyD1hTe85_a14kr1Ks8T3Ce75rvbR1_Dx7Q" +google_default_client_id="4139804441.apps.googleusercontent.com" +google_default_client_secret="KDTRKEZk2jwT_7CDpcmMA--P" + +# do not run configure in autogen but use macro later +export NOCONFIGURE=yes +./autogen.sh +%configure \ + --with-parallelism=%{_smp_mflags} \ + --enable-eot \ +%if %{with lto} + --enable-lto \ +%endif + --enable-mergelibs \ + --docdir=%{_docdir}/%{name} \ + --with-compat-oowrappers \ + --with-system-headers \ + --with-system-libs \ + --with-system-jars \ + --with-system-ucpp \ + --with-system-dicts \ + --with-system-libpng \ + --without-system-libcmis \ + --without-system-libfixmath \ + --without-system-dragonbox \ + --with-tls=nss \ + --disable-openssl \ + --with-lang=ALL \ + --disable-fetch-external \ + --with-external-tar="$RPM_SOURCE_DIR" \ + --disable-epm \ + --disable-online-update \ + --enable-gstreamer-1-0 \ + --enable-gtk3 \ + --disable-kf5 \ + --disable-qt5 \ + --enable-introspection \ + --with-doxygen \ + --enable-release-build \ + --enable-split-app-modules \ + --enable-split-opt-features \ + --enable-cairo-canvas \ + --enable-largefile \ + --enable-python=system \ + --enable-randr \ + --without-fonts \ + --without-myspell-dicts \ + --with-jdk-home=$JAVA_HOME \ + --with-webdav=serf \ + --with-beanshell-jar=%{_datadir}/java/bsh.jar \ + --with-ant-home=%{_datadir}/ant \ + --with-external-dict-dir=%{_datadir}/hunspell \ + --with-external-hyph-dir=%{_datadir}/hyphen \ + --with-external-thes-dir=%{_datadir}/mythes \ + --with-help=html \ + --without-export-validation \ + --enable-odk \ +%if %{with system_gpgme} + --with-system-gpgmepp \ +%else + --without-system-gpgmepp \ +%endif +%if %{with firebird} + --enable-firebird-sdbc \ +%else + --disable-firebird-sdbc \ +%endif + --enable-evolution2 \ + --enable-dbus \ + --enable-ext-ct2n \ + --enable-ext-nlpsolver \ + --enable-ext-numbertext \ + --enable-ext-wiki-publisher \ + --disable-scripting-beanshell \ + --enable-scripting-javascript \ + --enable-build-opensymbol \ + --disable-ccache \ + --disable-coinmp \ + --enable-symbols \ + --with-gdrive-client-secret="${google_default_client_secret}" \ + --with-gdrive-client-id="${google_default_client_id}" \ +%ifarch riscv64 + --disable-skia +%endif +# no coinormp packages for coinmp + +# just call make here as we added the jobs in configure +make verbose=t build + +%check +export LANG=C.UTF-8 +# Run tests only on x86_64 and aarch64 as they are resource hogs +%ifarch x86_64 aarch64 +# safeguard jarfires that can get magically overriden by the make +mkdir savejar +cp %{buildroot}%{_libdir}/%{name}/program/classes/*.jar savejar/ +make +cp savejar/*.jar %{buildroot}%{_libdir}/%{name}/program/classes/ +%endif + +%install +make verbose=t DESTDIR=%{buildroot} distro-pack-install + +# Do not pollute build log +set +x + +# Split out gtk3 interface to -gtk3 subpackage +grep -v "%{_libdir}/libreoffice/program/libvclplug_gtk3lo.so" file-lists/gnome_list.txt > tmplist +mv tmplist file-lists/gnome_list.txt + +# Remove firebird connector from main package filelist +%if %{with firebird} +grep -v "%{_libdir}/libreoffice/program/libfirebird_sdbclo.so" file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt +%endif + +# Remove the libanimcore from impress and put it to base (needed by draw too) +grep -v "%{_libdir}/libreoffice/program/libanimcorelo.so" file-lists/impress_list.txt > tmplist +mv tmplist file-lists/impress_list.txt +echo "%{_libdir}/libreoffice/program/libanimcorelo.so" >> file-lists/common_list.txt + +################ +# update desktop files +builddir=`pwd` +cd %{buildroot}%{_datadir}/applications +for desktop in * ; do + # relative link is needed + relative_target=`readlink $desktop | sed "s|%{_libdir}|../../%{_lib}|"` + # create the link + ln -sf $relative_target $desktop +done +cd - +################ +# compat stuff for noarch packages +mkdir -p %{buildroot}/%{_datadir}/%{name}/program +echo "%dir %{_libdir}/%{name}" >>file-lists/common_list.txt +echo "%dir %{_datadir}/%{name}" >>file-lists/common_list.txt +echo "%dir %{_datadir}/%{name}/program" >>file-lists/common_list.txt +################ +# helper script for noarch packages +# add missing directories to the file list +for dir in `find %{buildroot}/%{_datadir}/icons/hicolor -type d` ; do + dir=`echo $dir | sed -e "s|%{buildroot}||"` + echo "%dir $dir" >>file-lists/common_list.txt +done + +################################# +# Move split noarch data to share +################################# +for i in %{buildroot}%{_libdir}/%{name}/program/resource/*/*/*.mo \ + %{buildroot}%{_libdir}/%{name}/share/registry/res/fcfg_langpack_*.xcd \ + %{buildroot}%{_libdir}/%{name}/share/registry/res/registry_*.xcd \ + %{buildroot}%{_libdir}/%{name}/share/registry/Langpack-*.xcd \ + %{buildroot}%{_libdir}/%{name}/share/config/images*.zip \ + %{buildroot}%{_libdir}/%{name}/share/registry/{cjk,ctl}_*.xcd \ + %{buildroot}%{_libdir}/%{name}/share/registry/ctlseqcheck_*.xcd \ + %{buildroot}%{_libdir}/%{name}/share/wizards/*.properties \ + ; do + trg="`dirname "$i" | sed 's|%{_libdir}|%{_datadir}|'`" + mkdir -p "$trg" + mv "$i" "$trg" + grep -v "`echo "$i"| sed 's|%{buildroot}||'`" file-lists/common_list.txt > tmplist + mv tmplist file-lists/common_list.txt +done +# help files are luckily in just one folder +mkdir -p %{buildroot}/%{_datadir}/%{name}/help/ +grep -v '%{_libdir}/%{name}/help' file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt +echo "%dir %{_datadir}/%{name}/help" >>file-lists/common_list.txt +mv %{buildroot}/%{_libdir}/%{name}/help/ %{buildroot}/%{_datadir}/%{name}/ +mkdir -p %{buildroot}/%{_libdir}/%{name}/help/ +echo "%dir %{_libdir}/%{name}/help" >>file-lists/common_list.txt +for file in idxcaption.xsl idxcontent.xsl main_transform.xsl ; do + mv "%{buildroot}/%{_datadir}/%{name}/help/$file" "%{buildroot}/%{_libdir}/%{name}/help/$file" + echo "%{_libdir}/%{name}/help/$file" >> file-lists/common_list.txt +done +# autotext is another self contained dir +mkdir -p %{buildroot}/%{_datadir}/%{name}/share/autotext/ +grep -v '%{_libdir}/%{name}/share/autotext' file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt +mv %{buildroot}/%{_libdir}/%{name}/share/autotext/ %{buildroot}/%{_datadir}/%{name}/share/ +# translations of java apps should be in lang pkgs too +grep -v '%{_libdir}/%{name}/share/wizards' file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt +# the sr is dupe of sr_Latn +rm -rf %{buildroot}%{datadir}/%{name}/share/wizards/resources_sr.properties + +################ +# branding split +################ +# create symlinks for all brandings to noarch pkg +mkdir -p %{buildroot}/%{_datadir}/%{name}/program/shell +echo "%{_datadir}/%{name}/program/shell" >> file-lists/branding_upstream.txt +for file in sofficerc \ + intro.png \ + intro-highres.png \ + shell/about.svg \ + shell/logo.svg \ + shell/logo_inverted.svg; do + mv "%{buildroot}%{_libdir}/%{name}/program/$file" "%{buildroot}%{_datadir}/%{name}/program/$file" + ln -sf "%{_datadir}/%{name}/program/$file" "%{buildroot}/%{_libdir}/%{name}/program/$file" + echo "%{_datadir}/%{name}/program/$file" >> file-lists/branding_upstream.txt +done + +# Fix autocorr names for various language mutations +%make_autocorr_aliases -l en-GB en-AG en-AU en-BS en-BW en-BZ en-CA en-DK en-GH en-HK en-IE en-IN en-JM en-NG en-NZ en-SG en-TT +%make_autocorr_aliases -l en-US en-PH +%make_autocorr_aliases -l en-ZA en-NA en-ZW +%make_autocorr_aliases -l af-ZA af-NA +%make_autocorr_aliases -l de de-DE de-AT de-BE de-CH de-LI de-LU +%make_autocorr_aliases -l es es-ES es-AR es-BO es-CL es-CO es-CR es-CU es-DO es-EC es-GT es-HN es-MX es-NI es-PA es-PE es-PR es-PY es-SV es-US es-UY es-VE +%make_autocorr_aliases -l fr fr-FR fr-BE fr-CA fr-CH fr-LU fr-MC +%make_autocorr_aliases -l it it-IT it-CH fur_IT lld_IT sc_IT vec_IT +%make_autocorr_aliases -l nl-NL nl-AW +%make_autocorr_aliases -l sv-SE sv-FI +pushd %{buildroot}%{_libdir}/%{name}/share/autocorr +files="" +for file in acor*.dat; do + files="$files $file" +done +popd +for file in $files; do + echo "%{_libdir}/%{name}/share/autocorr/$file" >> file-lists/common_list.txt +done + +# we don't bother with serbian non-latin autocorr (as the lang logic allows us to dynamically allocate +# just one autotext filler and it does not make sense to have special case just for serbian +rm -r %{buildroot}%{_datadir}/libreoffice/share/autotext/sr/ + +# Install appdata files, so we're shown in gnome-software (and other, future app stores) +install -m 0755 -d %{buildroot}%{_datadir}/metainfo +for appdata in base calc draw impress writer; do + cp sysui/desktop/appstream-appdata/libreoffice-${appdata}.appdata.xml %{buildroot}%{_datadir}/metainfo/libreoffice-${appdata}.appdata.xml + echo "%{_datadir}/metainfo/libreoffice-${appdata}.appdata.xml" >>file-lists/${appdata}_list.txt +done +rm -f %{buildroot}%{_datadir}/metainfo/org.libreoffice.kde.metainfo.xml + +# Remove pointless readmes +rm -rf %{buildroot}%{_libdir}/%{name}/readmes/ + +# Prepare uno path detection, can't be patched in because it breaks tests +echo "import sys, os" > uno.py +echo "sys.path.append('%{_libdir}/%{name}/program')" >> uno.py +echo "os.putenv('URE_BOOTSTRAP', 'vnd.sun.star.pathname:%{_libdir}/libreoffice/program/fundamentalrc')" >> uno.py +cat %{buildroot}%{_libdir}/%{name}/program/uno.py >> uno.py +cp uno.py %{buildroot}%{_libdir}/%{name}/program/uno.py + +# Generate python cache files +%py_byte_compile %{__python3} %{buildroot}/%{_libdir}/libreoffice/program/ +%py_byte_compile %{__python3} %{buildroot}/%{_libdir}/libreoffice/share/extensions/ +%py_byte_compile %{__python3} %{buildroot}/%{_libdir}/libreoffice/share/Scripts/python/ +%py_byte_compile %{__python3} %{buildroot}/%{_libdir}/libreoffice/sdk/examples/python/ +# Move python cache to respective filelist +for i in file-lists/*.txt; do + if [ `cat "${i}" | grep '\.py$' |wc -l` -gt 0 ]; then + cat "${i}" | grep '\.py$' > pyfiles.txt + for j in `cat pyfiles.txt`; do + # python3 has __pycache__ dir while py2 does not + pydir="${j%/*}" + pyname="${j##*/}" + if compgen -G "%{buildroot}${pydir}/__pycache__/${pyname%.*}*.pyc" > /dev/null; then + echo "%dir ${pydir}/__pycache__/" >> "${i}" + echo "${pydir}/__pycache__/${pyname%.*}*.pyc" >> "${i}" + fi + done + fi +done +rm pyfiles.txt + +# Symlink gtk3 libreofficekit to libdir +ln -s %{_libdir}/%{name}/program/liblibreofficekitgtk.so %{buildroot}%{_libdir}/liblibreofficekitgtk.so + +# Libreofficekit headers +mkdir -p %{buildroot}%{_includedir}/LibreOfficeKit/ +install -m 0644 include/LibreOfficeKit/* %{buildroot}%{_includedir}/LibreOfficeKit/ + +# typelib data +mkdir -p %{buildroot}%{_libdir}/girepository-1.0/ +install -m 0644 workdir/CustomTarget/sysui/share/libreoffice/LOKDocView-0.1.typelib %{buildroot}%{_libdir}/girepository-1.0/ +mkdir -p %{buildroot}%{_datadir}/gir-1.0/ +install -m 0644 workdir/CustomTarget/sysui/share/libreoffice/LOKDocView-0.1.gir %{buildroot}%{_datadir}/gir-1.0/ + +# Symlink uno.py and unohelper.py so that python can find them +# This is done after the cache files generating on purpose +mkdir -p %{buildroot}%{python3_sitelib} +ln -s %{_libdir}/libreoffice/program/uno.py %{buildroot}%{python3_sitelib}/uno.py +ln -s %{_libdir}/libreoffice/program/unohelper.py %{buildroot}%{python3_sitelib}/unohelper.py +ln -s %{_libdir}/libreoffice/program/officehelper.py %{buildroot}%{python3_sitelib}/officehelper.py +echo "%{python3_sitelib}/uno.py" >> file-lists/pyuno_list.txt +echo "%{python3_sitelib}/unohelper.py" >> file-lists/pyuno_list.txt +echo "%{python3_sitelib}/officehelper.py" >> file-lists/pyuno_list.txt + +# move glade catalog to system glade dir +install -m 0755 -d %{buildroot}%{_datadir}/glade/catalogs +mv %{buildroot}%{_libdir}/%{name}/share/glade/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade/catalogs +install -m 0755 -d %{buildroot}%{_datadir}/glade3/catalogs +ln -s %{_datadir}/glade/catalogs/libreoffice-catalog.xml %{buildroot}%{_datadir}/glade3/catalogs +grep -v '%{_libdir}/%{name}/share/glade/libreoffice-catalog.xml' file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt + +# install gdb pretty printers +export DESTDIR=%{buildroot} +export SRCDIR="./" +./solenv/bin/install-gdb-printers -a %{_datadir}/gdb/auto-load%{_libdir}/%{name} -c -i %{_libdir}/%{name} -p %{_datadir}/libreoffice/gdb + +# Why would the mysql lib which is only USED by base not be IN THE BASE PACKAGE?!? +grep -v "%{_libdir}/libreoffice/program/libmysqlclo.so" file-lists/common_list.txt > tmplist +mv tmplist file-lists/common_list.txt +echo "%{_libdir}/libreoffice/program/libmysqlclo.so" >> file-lists/base_list.txt + +# Remove empty files +rm %{buildroot}%{_libdir}/libreoffice/share/extensions/*/help/*.done +rm %{buildroot}%{_libdir}/libreoffice/share/extensions/*/help/*/*.ht_ +rm %{buildroot}%{_libdir}/libreoffice/share/extensions/wiki-publisher/help/sa-IN/help.key_ +rm %{buildroot}%{_libdir}/libreoffice/share/extensions/nlpsolver/locale/NLPSolverCommon_en_US.default + +%post +/sbin/ldconfig + +%preun +uno_cache="%{_libdir}/%{name}/share/uno_packages/cache/uno_packages/" +if [ "$1" = "0" ] ; then + test -d "$uno_cache" && rm -rf "$uno_cache"/* +fi +exit 0 + +%postun +/sbin/ldconfig + +%_link_noarch_files icon-themes + +%files -f file-lists/common_list.txt +# ignore helper files for brp-symlink check +%exclude %{_datadir}/%{name}/program/sofficerc +%exclude %{_datadir}/%{name}/program/*.png +%exclude %{_datadir}/%{name}/program/shell/*.svg + +%files -n libreofficekit +%dir %{_libdir}/girepository-1.0 +%{_libdir}/girepository-1.0/LOKDocView-0.1.typelib +%{_libdir}/liblibreofficekitgtk.so +%dir %{_libdir}/libreoffice/share/libreofficekit +%{_libdir}/libreoffice/share/libreofficekit/handle_image_end.png +%{_libdir}/libreoffice/share/libreofficekit/handle_image_middle.png +%{_libdir}/libreoffice/share/libreofficekit/handle_image_start.png + +%files -n libreofficekit-devel +%dir %{_datadir}/gir-1.0 +%{_datadir}/gir-1.0/LOKDocView-0.1.gir +%dir %{_includedir}/LibreOfficeKit +%{_includedir}/LibreOfficeKit/* + +%files glade +%dir %{_datadir}/glade +%dir %{_datadir}/glade/catalogs +%{_datadir}/glade/catalogs/libreoffice-catalog.xml +%dir %{_datadir}/glade3 +%dir %{_datadir}/glade3/catalogs +%{_datadir}/glade3/catalogs/libreoffice-catalog.xml + +%files gdb-pretty-printers +%{_datadir}/gdb/auto-load/%{_libdir}/%{name} +%{_datadir}/libreoffice/gdb + +%files -f file-lists/base_list.txt base + +%files -f file-lists/calc_list.txt calc + +%files -f file-lists/draw_list.txt draw + +%files -f file-lists/math_list.txt math + +%files -f file-lists/impress_list.txt impress + +%files -f file-lists/writer_list.txt writer + +%files -f file-lists/postgresql_list.txt base-drivers-postgresql + +%if %{with firebird} +%files base-drivers-firebird +%{_libdir}/libreoffice/program/libfirebird_sdbclo.so +%endif + +%files -f file-lists/filters_list.txt filters-optional + +%files -f file-lists/mailmerge_list.txt mailmerge + +%files -f file-lists/pyuno_list.txt pyuno +%exclude %{_libdir}/libreoffice/share/Scripts/python/LibreLogo +%exclude %{_libdir}/libreoffice/share/registry/librelogo.xcd + +%files librelogo +%{_libdir}/libreoffice/share/registry/librelogo.xcd +%{_libdir}/libreoffice/share/Scripts/python/LibreLogo + +%files -f file-lists/gnome_list.txt gnome + +%files gtk3 +%{_libdir}/libreoffice/program/libvclplug_gtk3lo.so + +%files -f file-lists/sdk_list.txt sdk +%dir %{_libdir}/libreoffice/sdk/lib + +%files -f file-lists/sdk_doc_list.txt sdk-doc + +%files calc-extensions +%{_libdir}/%{name}/share/extensions/nlpsolver +%{_libdir}/%{name}/share/extensions/numbertext + +%files writer-extensions +%{_libdir}/%{name}/share/extensions/wiki-publisher + +%files icon-themes +%dir %{_datadir}/%{name} +%dir %{_datadir}/%{name}/share +%dir %{_datadir}/%{name}/share/config +%{_datadir}/%{name}/share/config/images_*.zip + +%files -f file-lists/branding_upstream.txt branding-upstream + +%changelog diff --git a/mediawiki-no-broken-help.diff b/mediawiki-no-broken-help.diff new file mode 100644 index 0000000..55f2541 --- /dev/null +++ b/mediawiki-no-broken-help.diff @@ -0,0 +1,9 @@ +--- swext/mediawiki/src/META-INF/manifest.xml.old 2012-03-27 18:22:01.000000000 +0200 ++++ swext/mediawiki/src/META-INF/manifest.xml 2012-03-30 16:56:56.000000000 +0200 +@@ -46,6 +46,4 @@ + manifest:full-path="Types.xcu"/> + <manifest:file-entry manifest:media-type="application/vnd.sun.star.configuration-data" + manifest:full-path="Paths.xcu"/> +- <manifest:file-entry manifest:media-type="application/vnd.sun.star.help" +- manifest:full-path="help"/> + </manifest:manifest> diff --git a/nlpsolver-no-broken-help.diff b/nlpsolver-no-broken-help.diff new file mode 100644 index 0000000..0c2cc2a --- /dev/null +++ b/nlpsolver-no-broken-help.diff @@ -0,0 +1,12 @@ +--- nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/META-INF/manifest.xml.old 2012-03-27 18:22:01.000000000 +0200 ++++ nlpsolver/src/com/sun/star/comp/Calc/NLPSolver/META-INF/manifest.xml 2012-03-30 16:44:37.000000000 +0200 +@@ -2,8 +2,6 @@ + <manifest:manifest xmlns:manifest="http://openoffice.org/2001/manifest"> + <manifest:file-entry manifest:media-type="application/vnd.sun.star.uno-components" + manifest:full-path="components.rdb"/> +- <manifest:file-entry manifest:media-type="application/vnd.sun.star.help" +- manifest:full-path="help"/> + <manifest:file-entry manifest:media-type="application/vnd.sun.star.package-bundle-description" + manifest:full-path="description/extensiondescription.txt"/> + </manifest:manifest> +\ No newline at end of file diff --git a/pdfium-5058.tar.bz2 b/pdfium-5058.tar.bz2 new file mode 100644 index 0000000..a6a76dd --- /dev/null +++ b/pdfium-5058.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:eaf4ce9fad32b5d951c524139df23119b66c67720057defb97acab2dfb2582ac +size 9771391 diff --git a/skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz b/skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz new file mode 100644 index 0000000..1ff2b05 --- /dev/null +++ b/skia-m103-b301ff025004c9cd82816c86c547588e6c24b466.tar.xz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c094a6247e44104beaaa0d00c825beb6baf1a8e532dc22214747495317a65bd9 +size 11079112 @@ -0,0 +1,16 @@ +17410483b5b5f267aa18b7e00b65e6e0 17410483b5b5f267aa18b7e00b65e6e0-hsqldb_1_8_0.zip +185d60944ea767075d27247c3162b3bc 185d60944ea767075d27247c3162b3bc-unowinreg.dll +1f467e5bb703f12cbbb09d5cf67ecf4a 1f467e5bb703f12cbbb09d5cf67ecf4a-converttexttonumber-1-5-0.oxt +35c94d2df8893241173de1d16b6034c0 35c94d2df8893241173de1d16b6034c0-swingExSrc.zip +798b2ffdc8bcfe7bca2cf92b62caf685 798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip +8249374c274932a21846fa7629c2aa9b 8249374c274932a21846fa7629c2aa9b-officeotron-0.7.4-master.jar +90401bca927835b6fbae4a707ed187c8 90401bca927835b6fbae4a707ed187c8-nlpsolver-0.9.tar.bz2 +a7983f859eafb2677d7ff386a023bc40 a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip +b7cae45ad2c23551fd6ccb8ae2c1f59e b7cae45ad2c23551fd6ccb8ae2c1f59e-numbertext_0.9.5.oxt +0c8ff36198af57d46b1c95f884cbd99e dragonbox-1.1.0.tar.gz +4295bad62b2524793d8a7ba3e7385501 dtoa-20180411.tgz +198f0a908ec3cd8f0ce9a4f3a4489645 gpgme-1.13.1.tar.bz2 +226c504ea78a232224bf3b6846b3adb9 libassuan-2.5.3.tar.bz2 +3653bc54e1bcd17ae09a1a7086daa38b libcmis-0.5.2.tar.xz +729f22d917494fdc4b54fce5aa6547c7 libgpg-error-1.37.tar.bz2 +80e162d2adfd99057d1e0c62c3883364 odfvalidator-0.9.0-RC2-SNAPSHOT-jar-with-dependencies-2726ab578664434a545f8379a01a9faffac0ae73.jar |