From a6fe48f5ea9b1ada6bef5c796955d8ab9c791a4a Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Wed, 12 Feb 2020 18:26:05 +0100 Subject: [PATCH] Adapt to Flatpak-from-RPM build (see ). For one, various paths need to be configured explicitly, as LO's configure would fall back to hardcoded /usr paths instead of the /app paths needed here. For another, it is unclear to me why those three __pycache__ files are not generated, but just not asking to include them should be harmless. Forward-ported from f31, combined cherry-pick of: * bfd5f11376b8c70e5280f6aa307390e0b6246654 "Adapt to Flatpak-from-RPM build" * 385664d08b0e1fa3cde3ea3fc7fa20279a109280 "Hack libreoffice-multiliblauncher.sh for flatpak" * decfe42573aed89586a937a05e5a653b0847afc0 "Fix Flatpak-from-RPM build" * 093c4953a62c12cf0335025c6a9aa9bad0b86cf1 "Fix Flatpak-from-RPM build" * 3d51346db2cf92f63653a76cd534d0a3afe4b0d2 "Fix Flatpak-from-RPM build" * a9e4c56f3282ce801570c890e4b1dee221f2adc2 "Fix flatpak --with-commons-logging-jar" --- libreoffice.spec | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/libreoffice.spec b/libreoffice.spec index e7fb7be..403283d 100644 --- a/libreoffice.spec +++ b/libreoffice.spec @@ -1042,6 +1042,10 @@ autoconf SMP_MFLAGS=%{?_smp_mflags} SMP_MFLAGS=$[${SMP_MFLAGS/-j/}] +%if 0%{?flatpak} +%define flatpakoptions --with-boost-libdir=%{_libdir} --with-beanshell-jar=/app/share/java/bsh.jar --with-commons-logging-jar=/app/share/java/commons-logging.jar --with-flute-jar=/app/share/java/flute.jar --with-jfreereport-jar=/app/share/java/flow-engine.jar --with-libbase-jar=/app/share/java/libbase.jar --with-libfonts-jar=/app/share/java/libfonts.jar --with-libformula-jar=/app/share/java/libformula.jar --with-liblayout-jar=/app/share/java/liblayout.jar --with-libloader-jar=/app/share/java/libloader.jar --with-librepository-jar=/app/share/java/librepository.jar --with-libserializer-jar=/app/share/java/libserializer.jar --with-libxml-jar=/app/share/java/libxml.jar --with-sac-jar=/app/share/java/sac.jar FIREBIRDCONFIG=%{_libdir}/fb_config QT4INC=%{_includedir} +%endif + # TODO: enable coinmp? # avoid running autogen.sh on make touch autogen.lastrun @@ -1079,7 +1083,8 @@ touch autogen.lastrun --with-system-ucpp \ %{distrooptions} \ %{?bundling_options} \ - %{?archoptions} + %{?archoptions} \ + %{?flatpakoptions} ulimit -c unlimited || true @@ -1287,6 +1292,10 @@ chmod a+x unopkg sed -e s/LAUNCHER/soffice/g -e s/BRAND/libreoffice/g %{SOURCE8} > libreoffice chmod a+x libreoffice +%if 0%{?flatpak} +sed -i -e 's|/usr/lib|/app/lib|g' unopkg libreoffice +%endif + # rhbz#499474 provide a /usr/bin/soffice for .recently-used.xbel ln -s %{baseinstdir}/program/soffice soffice # rhbz#499474 provide a /usr/bin/openoffice.org for backwards compat @@ -2054,9 +2063,11 @@ rm -f %{buildroot}%{baseinstdir}/program/classes/smoketest.jar %{libo_python_sitearch}/uno.py* %{libo_python_sitearch}/unohelper.py* %{libo_python_sitearch}/officehelper.py* +%if ! 0%{?flatpak} %{libo_python_sitearch}/__pycache__/uno.cpython-* %{libo_python_sitearch}/__pycache__/unohelper.cpython-* %{libo_python_sitearch}/__pycache__/officehelper.cpython-* +%endif %{baseinstdir}/share/registry/pyuno.xcd %files librelogo