diff options
| -rw-r--r-- | Library/Formula/djview4.rb | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/Library/Formula/djview4.rb b/Library/Formula/djview4.rb index 634c8f155..8968f66c2 100644 --- a/Library/Formula/djview4.rb +++ b/Library/Formula/djview4.rb @@ -9,9 +9,15 @@ class Djview4 < Formula depends_on 'djvulibre' depends_on 'qt' + # Patch for Qt 4.8 compatibility. See: + # https://build.opensuse.org/package/view_file?file=djview4-qt-4.8.patch&package=djvulibre-djview4&project=graphics&rev=8c40ae0f91469bb1af80f36c24516251 + # When updating this formula, check if this patch is still needed. + def patches + DATA + end + def install system "./configure", "--disable-debug", - "--disable-dependency-tracking", "--prefix=#{prefix}", "--with-x=no", "--disable-desktopfiles" @@ -32,3 +38,43 @@ class Djview4 < Formula EOS end end + + +__END__ +Index: djview-4.8/src/qdjvuwidget.cpp +=================================================================== +--- djview-4.8.orig/src/qdjvuwidget.cpp ++++ djview-4.8/src/qdjvuwidget.cpp +@@ -153,7 +153,7 @@ all_numbers(const char *s) + } + + template<class T> static inline void +-swap(T& x, T& y) ++myswap(T& x, T& y) + { + T tmp; + tmp = x; +@@ -173,11 +173,11 @@ ksmallest(T *v, int n, int k) + /* Sort v[lo], v[m], v[hi] by insertion */ + m = (lo+hi)/2; + if (v[lo]>v[m]) +- swap(v[lo],v[m]); ++ myswap(v[lo],v[m]); + if (v[m]>v[hi]) { +- swap(v[m],v[hi]); ++ myswap(v[m],v[hi]); + if (v[lo]>v[m]) +- swap(v[lo],v[m]); ++ myswap(v[lo],v[m]); + } + /* Extract pivot, place sentinel */ + pivot = v[m]; +@@ -191,7 +191,7 @@ ksmallest(T *v, int n, int k) + do ++l; while (v[l]<pivot); + do --h; while (v[h]>pivot); + if (l < h) { +- swap(v[l],v[h]); ++ myswap(v[l],v[h]); + goto loop; + } + /* Finish up */ |
