[djview4] Add patch to build with newer gcc

terjeros terjeros at fedoraproject.org
Mon Oct 3 18:57:43 UTC 2011


commit 0435a1136982de0d9f1030542a3aa3fc7d28e8c2
Author: Terje Røsten <terje.rosten at ntnu.no>
Date:   Mon Oct 3 20:57:22 2011 +0200

    Add patch to build with newer gcc

 djview-4.8-swap.patch |   35 +++++++++++++++++++++++++++++++++++
 djview4.spec          |   11 +++++++++--
 2 files changed, 44 insertions(+), 2 deletions(-)
---
diff --git a/djview-4.8-swap.patch b/djview-4.8-swap.patch
new file mode 100644
index 0000000..828eaaa
--- /dev/null
+++ b/djview-4.8-swap.patch
@@ -0,0 +1,35 @@
+--- djview-4.8/src/qdjvuwidget.cpp~	2011-08-17 16:24:20.000000000 +0200
++++ djview-4.8/src/qdjvuwidget.cpp	2011-10-03 20:48:49.000000000 +0200
+@@ -153,7 +153,7 @@
+ }
+ 
+ template<class T> static inline void 
+-swap(T& x, T& y)
++swapper(T& x, T& y)
+ {
+   T tmp;
+   tmp = x;
+@@ -173,11 +173,11 @@
+       /* Sort v[lo], v[m], v[hi] by insertion */
+       m = (lo+hi)/2;
+       if (v[lo]>v[m])
+-        swap(v[lo],v[m]);
++        swapper(v[lo],v[m]);
+       if (v[m]>v[hi]) {
+-        swap(v[m],v[hi]);
++        swapper(v[m],v[hi]);
+         if (v[lo]>v[m])
+-          swap(v[lo],v[m]);
++          swapper(v[lo],v[m]);
+       }
+       /* Extract pivot, place sentinel */
+       pivot = v[m];
+@@ -191,7 +191,7 @@
+       do ++l; while (v[l]<pivot);
+       do --h; while (v[h]>pivot);
+       if (l < h) { 
+-        swap(v[l],v[h]); 
++        swapper(v[l],v[h]); 
+         goto loop; 
+       }
+       /* Finish up */
diff --git a/djview4.spec b/djview4.spec
index 8d9acd6..0f1093d 100644
--- a/djview4.spec
+++ b/djview4.spec
@@ -1,12 +1,15 @@
 Summary:       DjVu viewer
 Name:          djview4
 Version:       4.8
-Release:       1%{?dist}
+Release:       2%{?dist}
 License:       GPLv2+
 Group:         Applications/Publishing
 URL:           http://djvu.sourceforge.net/djview4.html
 Source:        http://downloads.sourceforge.net/project/djvu/DjView/%{version}/djview-%{version}.tar.gz
-BuildRequires: qt4-devel >= 4.2 djvulibre-devel >= 3.5.19 desktop-file-utils
+Patch0:        djview-4.8-swap.patch
+BuildRequires: qt-devel >= 4.2 
+BuildRequires: desktop-file-utils
+BuildRequires: djvulibre-devel >= 3.5.19 
 BuildRoot:     %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 %description 
@@ -22,6 +25,7 @@ It's based on DjVuLibre and Qt4.
 
 %prep
 %setup -q -n djview-%{version}
+%patch0 -p1
 %{__sed} -i -e '1 d' desktopfiles/djvulibre-djview4.desktop
 
 %build
@@ -69,6 +73,9 @@ fi
 %{_datadir}/icons/hicolor/32x32/apps/djvulibre-%{name}.png
 
 %changelog
+* Mon Oct 03 2011 Terje Rosten <terje.rosten at ntnu.no> - 4.8-2
+- Add patch to build with newer gcc
+
 * Fri Sep 30 2011 Terje Rosten <terje.rosten at ntnu.no> - 4.8-1
 - 4.8
 


More information about the scm-commits mailing list