extra/libreoffice-still to 6.3.6-2

This commit is contained in:
Kevin Mihelich 2020-07-04 18:51:53 +00:00
parent 32f5931d0b
commit a6e693985b
3 changed files with 418 additions and 3 deletions

View file

@ -20,7 +20,7 @@ pkgbase=libreoffice-still
pkgname=('libreoffice-still-sdk' 'libreoffice-still')
_LOver=6.3.6.2
pkgver=6.3.6
pkgrel=1
pkgrel=2
arch=('x86_64')
license=('LGPL3')
url="https://www.libreoffice.org/"
@ -64,7 +64,9 @@ source=(${_mirror}/libreoffice{,-help,-translations}-${_LOver}.tar.xz{,.asc}
soffice-template.desktop.in
libreoffice-still.sh libreoffice-still.csh
0001-Switch-mdds-to-1.5.0-and-liborcus-to-0.15.0.patch
libreoffice-poppler-0.86.patch)
libreoffice-poppler-0.86.patch
adapt-o3tl-span-to-newer-libstdc++.patch
disable-latest-c++.diff)
noextract=(35c94d2df8893241173de1d16b6034c0-swingExSrc.zip
798b2ffdc8bcfe7bca2cf92b62caf685-rhino1_5R5.zip
a7983f859eafb2677d7ff386a023bc40-xsltml_2.1.2.zip
@ -107,7 +109,9 @@ sha256sums=('c39a4c7bb6e3bea604b0bfb2743492cb908166b464336272dac92c7dcf48af58'
'c1e199f7767a4f42d9a95fc942cda4cf47737c7d67e6f334679c9b2e3e271dc2'
'07c28ff8f5258abfe4338efccbdfb1dd35892bd00a2ed7f53b1fc2263f71a8b6'
'77214ebc425916990ed80e9508572fd1d565412e1f8c2289424457e3d9bcbc79'
'f52ef5d64d7a74ca90bc96614260566720130d91f3764874eac673f6b3336b5e')
'f52ef5d64d7a74ca90bc96614260566720130d91f3764874eac673f6b3336b5e'
'ee182026fe28bb1a1fc86c4a6ead2522e4d611326d65d3b9d6c686a36e073a6e'
'fde9801d839028c1e9ce0403b0ad7625620fe1ee3d54cb439f4651f3ab9b886f')
prepare() {
@ -115,6 +119,14 @@ prepare() {
patch -p1 -i ../libreoffice-poppler-0.86.patch # Fix build with poppler 0.86
# fix build with recent toolchain
# https://cgit.freedesktop.org/libreoffice/core/commit/?h=libreoffice-6-4&id=f0b74640137f07ed74027f98fbf6d1c0d98939bf
# prerequisite: https://cgit.freedesktop.org/libreoffice/core/commit/?id=a9f77e87f3e6ca3333bbb16dec5456f3bf2903b8
patch -Np1 -i ../disable-latest-c++.diff
# https://cgit.freedesktop.org/libreoffice/core/commit/?id=8e6865188242bccb3d8aa857ddc990d72a058d3d
# https://cgit.freedesktop.org/libreoffice/core/commit/?id=6fbfad6b00e8c35346ee59cd32a0d7ccc0d8c19c
patch -Np1 -i ../adapt-o3tl-span-to-newer-libstdc++.patch
# move external sources into place
mkdir "${srcdir}"/ext_sources && pushd "${srcdir}"/ext_sources
for source in "${noextract[@]}"; do

View file

@ -0,0 +1,254 @@
From 99354a1c4b6f56871d50d07421ba1773fce0d928 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Fri, 6 Dec 2019 16:36:01 +0100
Subject: [PATCH 1/2] Adapt o3tl::span to P1872R0
..."span should have size_type, not index_type"
(<http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1872r0.pdf>), as
implemented by libc++ since <https://github.com/llvm/llvm-project/commit/
1466335cf4b2854a0be1defcf279fe50772bad6f> "[libc++][P1872] span should have
size_type, not index_type."
All uses of index_type had been added to mitigate the previous std::span change
from signed (ptrdiff_t) to unsigned (size_t) index_type, see
6ef8420fdbf8dff16de13147c5ab833bc5e01121 "Adapt o3tl::span to updated C++2a
std::span". There is no easy solution to transparently support all three
std::span variants currently out there (signed index_type, unsigned index_type,
unsigned size_type), without causing compilation failures due to
CPPUNIT_ASSERT_EQUAL with arguments of different types, or compiler warnings
about mixed signed/unsigned comparisons. So rule out the oldest std::span
variant (signed index_type) in configure.ac (so that o3tl::span will use its
own hand-rolled code in that case) and simplify the uses of index_type to
std::size_t (as had already been mentioned in
6ef8420fdbf8dff16de13147c5ab833bc5e01121).
Change-Id: I6ddf424ffb7941da3f69ad66fd29ecd35f09afae
Reviewed-on: https://gerrit.libreoffice.org/84652
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 8e6865188242bccb3d8aa857ddc990d72a058d3d)
---
config_host/config_global.h.in | 3 +++
configure.ac | 16 ++++++++++++++++
include/o3tl/span.hxx | 14 ++++++++------
o3tl/qa/test-span.cxx | 7 ++++---
sfx2/source/control/dispatch.cxx | 3 ++-
5 files changed, 33 insertions(+), 10 deletions(-)
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 2e986fbe24b6..0b44ad05373e 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -24,6 +24,9 @@ Any change in this header will cause a rebuild of almost everything.
/* Guaranteed copy elision (C++17), __cpp_guaranteed_copy_elision (C++2a): */
#define HAVE_CPP_GUARANTEED_COPY_ELISION 0
+// Useable C++2a <span>:
+#define HAVE_CPP_SPAN 0
+
/* GCC bug <https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87150> "move ctor wrongly chosen in return
stmt (derived vs. base)": */
#define HAVE_GCC_BUG_87150 0
diff --git a/configure.ac b/configure.ac
index 052782189056..704fff55a7ec 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6760,6 +6760,22 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([
CXXFLAGS=$save_CXXFLAGS
AC_LANG_POP([C++])
+AC_MSG_CHECKING([whether $CXX supports C++2a <span> with unsigned size_type])
+AC_LANG_PUSH([C++])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([
+ #include <span>
+ #include <type_traits>
+ // Don't check size_type directly, as it was called index_type before P1872R0:
+ void f(std::span<int> s) { static_assert(std::is_unsigned_v<decltype(s.size())>); };
+ ])], [
+ AC_DEFINE([HAVE_CPP_SPAN],[1])
+ AC_MSG_RESULT([yes])
+ ], [AC_MSG_RESULT([no])])
+CXXFLAGS=$save_CXXFLAGS
+AC_LANG_POP([C++])
+
AC_MSG_CHECKING([whether $CXX has GCC bug 87150])
AC_LANG_PUSH([C++])
save_CXXFLAGS=$CXXFLAGS
diff --git a/include/o3tl/span.hxx b/include/o3tl/span.hxx
index 1618b86df897..b19d2d847ac7 100644
--- a/include/o3tl/span.hxx
+++ b/include/o3tl/span.hxx
@@ -12,7 +12,9 @@
#include <sal/config.h>
-#if __has_include(<span>)
+#include <config_global.h>
+
+#if HAVE_CPP_SPAN
#include <span>
@@ -40,7 +42,7 @@ public:
using iterator = pointer;
using const_reverse_iterator = std::reverse_iterator<const_iterator>;
using reverse_iterator = std::reverse_iterator<iterator>;
- using index_type = std::size_t;
+ using size_type = std::size_t;
using difference_type = std::ptrdiff_t;
constexpr span() noexcept : data_(nullptr), size_(0) {}
@@ -48,7 +50,7 @@ public:
template<std::size_t N>
constexpr span (T (&a)[N]) noexcept : data_(a), size_(N) {}
- constexpr span (T *a, index_type len) noexcept
+ constexpr span (T *a, size_type len) noexcept
: data_(a), size_(len)
{
// not terribly sure about this, might need to strengthen it
@@ -72,9 +74,9 @@ public:
{ return rbegin(); }
constexpr const_reverse_iterator crend() const noexcept { return rend(); }
- constexpr index_type size() const noexcept { return size_; }
+ constexpr size_type size() const noexcept { return size_; }
- constexpr reference operator [](index_type pos) const {
+ constexpr reference operator [](size_type pos) const {
assert(pos < size());
return data_[pos];
}
@@ -83,7 +85,7 @@ public:
private:
pointer data_;
- index_type size_;
+ size_type size_;
};
} // namespace o3tl
diff --git a/o3tl/qa/test-span.cxx b/o3tl/qa/test-span.cxx
index 7ec67fa7fd91..3cb78ace1db2 100644
--- a/o3tl/qa/test-span.cxx
+++ b/o3tl/qa/test-span.cxx
@@ -9,6 +9,7 @@
#include <sal/config.h>
+#include <cstddef>
#include <utility>
#include <cppunit/TestAssert.h>
@@ -42,7 +43,7 @@ private:
CPPUNIT_ASSERT_EQUAL(3, *v.crbegin());
CPPUNIT_ASSERT_EQUAL(
o3tl::span<int>::difference_type(3), v.crend() - v.crbegin());
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(3), v.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(3), v.size());
CPPUNIT_ASSERT(!v.empty());
CPPUNIT_ASSERT_EQUAL(2, v[1]);
CPPUNIT_ASSERT_EQUAL(1, *v.data());
@@ -52,8 +53,8 @@ private:
o3tl::span<int const> v1( d1 );
o3tl::span<int const> v2( d2 );
std::swap(v1, v2);
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(4), v1.size());
- CPPUNIT_ASSERT_EQUAL(o3tl::span<int>::index_type(2), v2.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(4), v1.size());
+ CPPUNIT_ASSERT_EQUAL(std::size_t(2), v2.size());
}
}
};
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 702e6064f157..c3f3ad60c10c 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -20,6 +20,7 @@
#include <config_features.h>
#include <algorithm>
+#include <cstddef>
#include <deque>
#include <vector>
@@ -1547,7 +1548,7 @@ void SfxDispatcher::SetSlotFilter(SfxSlotFilterState nEnable,
{
#ifdef DBG_UTIL
// Check Array
- for ( o3tl::span<sal_uInt16 const>::index_type n = 1; n < pSIDs.size(); ++n )
+ for ( std::size_t n = 1; n < pSIDs.size(); ++n )
DBG_ASSERT( pSIDs[n] > pSIDs[n-1], "SetSlotFilter: SIDs not sorted" );
#endif
From 3bf38cc5f6d61f43509d8dc500479d66b8233bab Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Sat, 22 Feb 2020 17:29:15 +0100
Subject: [PATCH 2/2] Adapt o3tl::span to removal of std::span::cbegin et al
<https://cplusplus.github.io/LWG/issue3320> "span::cbegin/cend methods produce
different results than std::[ranges::]cbegin/cend", as implemented now in
<https://gcc.gnu.org/git/gitweb.cgi?p=gcc.git;a=commit;
h=247f410b83797a1840573840cc2a539ef9d7f96b> "libstdc++: Remove std::span::cbegin
and std::span::cend (LWG 3320)".
Turns out we only used the removed member functions in o3tl/qa/test-span.cxx.
Change-Id: I6c73797594b4e0e753a88840033d54961e271df5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89261
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
(cherry picked from commit 6fbfad6b00e8c35346ee59cd32a0d7ccc0d8c19c)
---
include/o3tl/span.hxx | 7 -------
o3tl/qa/test-span.cxx | 6 ------
2 files changed, 13 deletions(-)
diff --git a/include/o3tl/span.hxx b/include/o3tl/span.hxx
index b19d2d847ac7..8af8ba846b65 100644
--- a/include/o3tl/span.hxx
+++ b/include/o3tl/span.hxx
@@ -62,18 +62,11 @@ public:
constexpr iterator begin() const noexcept { return data_; }
constexpr iterator end() const noexcept { return begin() + size(); }
- constexpr const_iterator cbegin() const noexcept { return begin(); }
- constexpr const_iterator cend() const noexcept { return end(); }
-
reverse_iterator rbegin() const noexcept
{ return reverse_iterator(end()); }
reverse_iterator rend() const noexcept
{ return reverse_iterator(begin()); }
- constexpr const_reverse_iterator crbegin() const noexcept
- { return rbegin(); }
- constexpr const_reverse_iterator crend() const noexcept { return rend(); }
-
constexpr size_type size() const noexcept { return size_; }
constexpr reference operator [](size_type pos) const {
diff --git a/o3tl/qa/test-span.cxx b/o3tl/qa/test-span.cxx
index 3cb78ace1db2..26eedfc21938 100644
--- a/o3tl/qa/test-span.cxx
+++ b/o3tl/qa/test-span.cxx
@@ -34,15 +34,9 @@ private:
CPPUNIT_ASSERT_EQUAL(1, *v.begin());
CPPUNIT_ASSERT_EQUAL(
o3tl::span<int>::difference_type(3), v.end() - v.begin());
- CPPUNIT_ASSERT_EQUAL(1, *v.cbegin());
- CPPUNIT_ASSERT_EQUAL(
- o3tl::span<int>::difference_type(3), v.cend() - v.cbegin());
CPPUNIT_ASSERT_EQUAL(3, *v.rbegin());
CPPUNIT_ASSERT_EQUAL(
o3tl::span<int>::difference_type(3), v.rend() - v.rbegin());
- CPPUNIT_ASSERT_EQUAL(3, *v.crbegin());
- CPPUNIT_ASSERT_EQUAL(
- o3tl::span<int>::difference_type(3), v.crend() - v.crbegin());
CPPUNIT_ASSERT_EQUAL(std::size_t(3), v.size());
CPPUNIT_ASSERT(!v.empty());
CPPUNIT_ASSERT_EQUAL(2, v[1]);

View file

@ -0,0 +1,149 @@
From a9f77e87f3e6ca3333bbb16dec5456f3bf2903b8 Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Sun, 20 Oct 2019 14:42:56 +0200
Subject: We do not need a C++ GNU dialect
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
1cf7ab61a71d4b7295942ff5c855896e60c15081 "use -std=gnu++0x rather than
-std=c++0x" appears to have started this, but the only rationale it gives is
that it keeps things in sync with GCC's default behavior when no -std= is given.
But it apparently works fine to build with a -std=c++... standard dialect.
This allows to get rid of the check introduced with
50cd28e5728b6a64c1e605567540739ea6ef42ca "Ensure configuration that defines
math_errhandling in <cmath>".
(It kept bothering me to say "I observe this-and-this with -std=c++2a" when what
configure.ac made me actually use was -std=gnu++2a. And truthfully saying
"-std=gnu++2a" would have been a distraction, as what is relevant for such an
observation is most likely the "2a" and not the "gnu" part.)
Change-Id: I7c213a702ffb7df6f4c2c4a421008e30e2712a51
Reviewed-on: https://gerrit.libreoffice.org/81176
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
---
configure.ac | 10 +---------
1 file changed, 1 insertion(+), 9 deletions(-)
(limited to 'configure.ac')
diff --git a/configure.ac b/configure.ac
index 422efbdc7b46..9c8d512be07b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6432,7 +6432,7 @@ CXXFLAGS_CXX11=
if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
- my_flags='-std=gnu++2a -std=c++2a -std=gnu++17 -std=gnu++1z -std=c++17 -std=c++1z'
+ my_flags='-std=c++2a -std=c++17 -std=c++1z'
for flag in $my_flags; do
if test "$COM" = MSC; then
flag="-Xclang $flag"
@@ -6475,7 +6475,6 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <algorithm>
- #include <cmath>
#include <functional>
#include <vector>
@@ -6495,13 +6494,6 @@ elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
void f(std::vector<int> & v, std::function<bool(int, int)> fn) {
std::sort(v.begin(), v.end(), fn);
}
-
- // At least with glibc-headers-2.28-26.fc29.x86_64, when building for Linux x86 32-bit
- // (via -m32) and passed-in CXXFLAGS setting -O1 (or higher; overriding -Os as set in
- // solenv/gbuild/platform/LINUX_INTEL_GCC.mk), std=gnu* would cause math_errhandling to
- // get undef'ed in /usr/include/bits/mathinline.h, while std=c* keeps it defined (as
- // needed by sc/source/core/tool/math.cxx):
- int g() { return math_errhandling; }
]])],[CXXFLAGS_CXX11=$flag $my_float128hack])
AC_LANG_POP([C++])
CXXFLAGS=$save_CXXFLAGS
--
cgit v1.2.1
From f0b74640137f07ed74027f98fbf6d1c0d98939bf Mon Sep 17 00:00:00 2001
From: Stephan Bergmann <sbergman@redhat.com>
Date: Mon, 20 Apr 2020 11:40:24 +0200
Subject: Add --with-latest-c++ to explicitly opt in for
-std=c++20/-std:c++latest
Adaptation of this change to this branch. The point is to avoid
compiling as C++2a as the code for externals has not been patched
properly for that here. Here is the original commit message even if I
assume it is a bit misleading in this branch:
cd472d1d8489f30797f47d3f6dafede28c1feb90 "Compile as C++2a, where available" had
started to unconditionally check for support of -std=c++2a (and later also
-std=c++20) for Clang and GCC, but that can cause occasional issues especially
for Linux distros, see e.g. 55c724b93dfd4c9a1afb10d60fbc2d7a9a66cf61 "replace
boost::bimap in sdext pdfimport" or
<https://bugzilla.redhat.com/show_bug.cgi?id=1818723>
"/usr/include/boost/format/alt_sstream_impl.hpp incompatible with -std=c++20
(std::allocator::allocate hint argument)" (where
677c8de4fa79cd9b278b142013ba7f1c9e4e41c3 "external/boost: Adapt to
std::allocator parts removed in C++20" is not picked up due to
--with-system-boost).
So better require an explicit opt-in via a new --with-latest-c++. And while at
it, also make that enable -std:c++latest for MSVC.
Change-Id: I2d1f03144fad9a7884562e56b1b76cab5eb8f080
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92555
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93204
Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com>
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/93692
Tested-by: Tor Lillqvist <tml@collabora.com>
---
configure.ac | 18 ++++++++++++++++--
1 file changed, 16 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 78080305f3d6..8364138bdc96 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2143,6 +2143,12 @@ libo_FUZZ_ARG_WITH(lxml,
report widget classes and ids.]),
,)
+libo_FUZZ_ARG_WITH(latest-c++,
+ AS_HELP_STRING([--with-latest-c++],
+ [Try to enable the latest features of the C++ compiler, even if they are not yet part of a
+ published standard.]),,
+ [$with_latest_c__=no])
+
dnl ===================================================================
dnl Branding
dnl ===================================================================
@@ -6456,9 +6462,17 @@ dnl ===================================================================
AC_MSG_CHECKING([whether $CXX_BASE supports C++17])
CXXFLAGS_CXX11=
if test "$COM" = MSC -a "$COM_IS_CLANG" != TRUE; then
- CXXFLAGS_CXX11='-std:c++17 -Zc:__cplusplus'
+ if test "$with_latest_c__" = yes; then
+ CXXFLAGS_CXX11=-std:c++latest
+ else
+ CXXFLAGS_CXX11=-std:c++17
+ fi
+ CXXFLAGS_CXX11="$CXXFLAGS_CXX11 -Zc:__cplusplus"
elif test "$GCC" = "yes" -o "$COM_IS_CLANG" = TRUE; then
- my_flags='-std=c++2a -std=c++17 -std=c++1z'
+ my_flags='-std=c++17 -std=c++1z'
+ if test "$with_latest_c__" = yes; then
+ my_flags="-std=gnu++2a -std=c++2a $my_flags"
+ fi
for flag in $my_flags; do
if test "$COM" = MSC; then
flag="-Xclang $flag"
--
cgit v1.2.1