2010-10-22 22:59:50 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Djvulibre < Formula
|
2010-10-22 22:59:50 +00:00
|
|
|
homepage 'http://djvu.sourceforge.net/'
|
2014-05-23 05:02:31 +00:00
|
|
|
|
|
|
|
stable do
|
|
|
|
url 'http://ftp.de.debian.org/debian/pool/main/d/djvulibre/djvulibre_3.5.25.4.orig.tar.gz'
|
|
|
|
sha1 'c7044201703f30df0f1732c54c6544467412811d'
|
|
|
|
# Fixes 10.9 clang/libcxx:
|
|
|
|
# http://sourceforge.net/p/djvu/bugs/236/#ce5c/a7ca
|
|
|
|
# http://sourceforge.net/p/djvu/djvulibre-git/ci/2c904e/
|
|
|
|
patch :DATA
|
|
|
|
end
|
|
|
|
|
|
|
|
head do
|
|
|
|
url 'git://git.code.sf.net/p/djvu/djvulibre-git'
|
|
|
|
end
|
2010-10-22 22:59:50 +00:00
|
|
|
|
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'libtiff'
|
|
|
|
|
|
|
|
def install
|
2012-03-11 03:48:23 +00:00
|
|
|
# Don't build X11 GUI apps, Spotlight Importer or QuickLook plugin
|
2013-08-22 23:18:02 +00:00
|
|
|
system "./configure", "--prefix=#{prefix}", "--disable-desktopfiles"
|
2010-10-22 22:59:50 +00:00
|
|
|
system "make"
|
|
|
|
system "make install"
|
2014-05-23 05:02:31 +00:00
|
|
|
(share/'doc/djvu').install Dir['doc/*']
|
|
|
|
end
|
|
|
|
|
|
|
|
test do
|
|
|
|
%x[#{bin}/djvused -e n #{share}/doc/djvu/lizard2002.djvu].chomp == "2" #should show count of 2 pages
|
2010-10-22 22:59:50 +00:00
|
|
|
end
|
|
|
|
end
|
2014-05-23 05:02:31 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
--- a/libdjvu/atomic.h
|
|
|
|
+++ b/libdjvu/atomic.h
|
|
|
|
@@ -122,7 +122,7 @@
|
|
|
|
static inline int atomicDecrement(int volatile *var) {
|
|
|
|
int ov; __asm__ __volatile__ ("lock; xaddl %0, %1"
|
|
|
|
: "=r" (ov), "=m" (*var) : "0" (-1), "m" (*var) : "cc" );
|
|
|
|
- return ov + 1;
|
|
|
|
+ return ov - 1;
|
|
|
|
}
|
|
|
|
static inline int atomicExchange(int volatile *var, int nv) {
|
|
|
|
int ov; __asm__ __volatile__ ("xchgl %0, %1"
|