Date: Wednesday, April 26, 2017 @ 10:32:49
  Author: foutrelis
Revision: 294743

Fix build with Qt 5.8

Added:
  lyx/trunk/qt58.patch
Modified:
  lyx/trunk/PKGBUILD

------------+
 PKGBUILD   |   10 +++++++++-
 qt58.patch |   33 +++++++++++++++++++++++++++++++++
 2 files changed, 42 insertions(+), 1 deletion(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD    2017-04-26 10:32:13 UTC (rev 294742)
+++ PKGBUILD    2017-04-26 10:32:49 UTC (rev 294743)
@@ -16,10 +16,18 @@
 license=('GPL')
 backup=('etc/lyx/lyxrc.dist')
 options=('emptydirs')
-source=(ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/$pkgname-$pkgver.tar.xz 
lyxrc.dist)
+source=(ftp://ftp.lyx.org/pub/lyx/stable/2.2.x/$pkgname-$pkgver.tar.xz
+        qt58.patch
+        lyxrc.dist)
 sha1sums=('30f6f24f81a8990261b1dfd9a6196dfe1459abda'
+          'df07c31590afb7004cfd47a93064f172a5bc8f42'
           '56416642cc3da2a13b87b84e6b87c1a239f3d09a')
 
+prepare() {
+  cd "${srcdir}/${pkgname}-${pkgver}"
+  patch -Np1 -i ../qt58.patch
+}
+
 build() {
   cd "${srcdir}/${pkgname}-${pkgver}"
   export CXXFLAGS="$CXXFLAGS -fpermissive"

Added: qt58.patch
===================================================================
--- qt58.patch                          (rev 0)
+++ qt58.patch  2017-04-26 10:32:49 UTC (rev 294743)
@@ -0,0 +1,33 @@
+From 6d375ddeac49ac8c6340398c9797354edca3f5d1 Mon Sep 17 00:00:00 2001
+From: Guillaume Munch <[email protected]>
+Date: Tue, 20 Dec 2016 00:15:58 +0100
+Subject: [PATCH] Fix compilation with Qt5.8dev
+
+---
+ src/frontends/qt4/GuiViewSource.cpp |    9 ++-------
+ 1 files changed, 2 insertions(+), 7 deletions(-)
+
+diff --git a/src/frontends/qt4/GuiViewSource.cpp 
b/src/frontends/qt4/GuiViewSource.cpp
+index 9c0ea1d..fe59387 100644
+--- a/src/frontends/qt4/GuiViewSource.cpp
++++ b/src/frontends/qt4/GuiViewSource.cpp
+@@ -218,14 +218,9 @@ void ViewSourceWidget::updateView(BufferView const * bv)
+       if (changed && !texrow_) {
+               // position-to-row is unavailable
+               // we jump to the first modification
+-              const QChar * oc = old.constData();
+-              const QChar * nc = qcontent.constData();
++              int length = min(old.length(), qcontent.length());
+               int pos = 0;
+-              while (*oc != '\0' && *nc != '\0' && *oc == *nc) {
+-                      ++oc;
+-                      ++nc;
+-                      ++pos;
+-              }
++              for (; pos < length && old.at(pos) == qcontent.at(pos); ++pos) 
{}
+               QTextCursor c = QTextCursor(viewSourceTV->document());
+               //get some space below the cursor
+               c.setPosition(pos);
+-- 
+1.7.1
+

Reply via email to