2010-12-18 13:14:07 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Djview4 < Formula
|
2010-12-18 13:14:07 +00:00
|
|
|
homepage 'http://djvu.sourceforge.net/djview4.html'
|
2012-11-25 19:42:57 +00:00
|
|
|
url 'http://sourceforge.net/projects/djvu/files/DjView/4.8/djview-4.8.tar.gz'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '266d207afb63a1ee63eed054190bf88888fda572'
|
2010-12-18 13:14:07 +00:00
|
|
|
|
2011-07-29 23:45:06 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-12-18 13:14:07 +00:00
|
|
|
depends_on 'djvulibre'
|
|
|
|
depends_on 'qt'
|
|
|
|
|
2012-01-29 04:50:15 +00:00
|
|
|
# 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
|
|
|
|
|
2010-12-18 13:14:07 +00:00
|
|
|
def install
|
|
|
|
system "./configure", "--disable-debug",
|
|
|
|
"--prefix=#{prefix}",
|
|
|
|
"--with-x=no",
|
|
|
|
"--disable-desktopfiles"
|
2012-04-02 23:33:50 +00:00
|
|
|
system "make", "CC=#{ENV.cc}", "CXX=#{ENV.cxx}"
|
2011-08-23 02:22:14 +00:00
|
|
|
|
|
|
|
# From the djview4.8 README:
|
2012-11-25 19:42:57 +00:00
|
|
|
# Note3: Do not use command "make install".
|
|
|
|
# Simply copy the application bundle where you want it.
|
2011-08-23 02:22:14 +00:00
|
|
|
prefix.install 'src/djview.app'
|
2010-12-18 13:14:07 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
def caveats; <<-EOS
|
|
|
|
djview.app was installed in:
|
2012-11-25 19:42:57 +00:00
|
|
|
#{opt_prefix}
|
2010-12-18 13:14:07 +00:00
|
|
|
|
|
|
|
To symlink into ~/Applications, you can do:
|
|
|
|
brew linkapps
|
|
|
|
EOS
|
|
|
|
end
|
|
|
|
end
|
2012-01-29 04:50:15 +00:00
|
|
|
|
|
|
|
|
|
|
|
__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 */
|