2010-05-18 19:21:25 +00:00
|
|
|
require 'formula'
|
|
|
|
|
|
|
|
class Leptonica < Formula
|
2011-03-28 00:10:04 +00:00
|
|
|
homepage 'http://www.leptonica.org/'
|
2012-03-11 20:36:14 +00:00
|
|
|
url 'http://www.leptonica.org/source/leptonica-1.68.tar.gz'
|
2011-03-28 00:10:04 +00:00
|
|
|
md5 '5cd7092f9ff2ca7e3f3e73bfcd556403'
|
2010-05-18 19:21:25 +00:00
|
|
|
|
2010-06-18 17:41:48 +00:00
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'libtiff'
|
|
|
|
|
2012-03-11 20:36:14 +00:00
|
|
|
# Leptonica is missing an #include for PNG support
|
|
|
|
# Can be removed in 1.69
|
|
|
|
# http://code.google.com/p/leptonica/issues/detail?id=56
|
2011-10-21 02:46:31 +00:00
|
|
|
def patches
|
2012-03-11 20:36:14 +00:00
|
|
|
DATA
|
2011-10-21 02:46:31 +00:00
|
|
|
end
|
|
|
|
|
2010-05-18 19:21:25 +00:00
|
|
|
def install
|
2011-10-21 02:46:31 +00:00
|
|
|
ENV.x11
|
2012-03-11 20:36:14 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2010-05-18 19:21:25 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2012-03-11 20:36:14 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff -Nurd -x'*~' leptonica-1.68.orig/src/pngio.c leptonica-1.68/src/pngio.c
|
|
|
|
--- leptonica-1.68.orig/src/pngio.c 2011-02-01 00:41:12.000000000 -0500
|
|
|
|
+++ leptonica-1.68/src/pngio.c 2011-07-09 09:17:17.000000000 -0400
|
|
|
|
@@ -108,6 +108,10 @@
|
|
|
|
|
|
|
|
#include "png.h"
|
|
|
|
|
|
|
|
+#ifdef HAVE_LIBZ
|
|
|
|
+#include "zlib.h"
|
|
|
|
+#endif
|
|
|
|
+
|
|
|
|
/* ----------------Set defaults for read/write options ----------------- */
|
|
|
|
/* strip 16 bpp --> 8 bpp on reading png; default is for stripping */
|
|
|
|
static l_int32 var_PNG_STRIP_16_TO_8 = 1;
|