2010-03-04 01:02:22 +00:00
|
|
|
require 'formula'
|
|
|
|
|
2011-03-10 05:11:03 +00:00
|
|
|
class Zbar < Formula
|
2010-03-04 01:02:22 +00:00
|
|
|
homepage 'http://zbar.sourceforge.net'
|
2012-12-16 20:08:12 +00:00
|
|
|
url 'http://downloads.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2'
|
2012-09-03 18:33:56 +00:00
|
|
|
sha1 '273b47c26788faba4325baecc34063e27a012963'
|
2010-03-04 01:02:22 +00:00
|
|
|
|
2013-02-07 03:52:38 +00:00
|
|
|
depends_on :x11 => :optional
|
2010-09-19 17:21:57 +00:00
|
|
|
depends_on 'pkg-config' => :build
|
2010-03-04 01:02:22 +00:00
|
|
|
depends_on 'jpeg'
|
|
|
|
depends_on 'imagemagick'
|
|
|
|
depends_on 'ufraw'
|
|
|
|
|
2013-04-18 20:52:52 +00:00
|
|
|
def patches
|
|
|
|
# fix JPEG handling using patch from
|
|
|
|
# http://sourceforge.net/p/zbar/discussion/664596/thread/58b8d79b#8f67
|
|
|
|
# already applied upstream but not present in the 0.10 release
|
|
|
|
DATA
|
|
|
|
end
|
|
|
|
|
2010-03-04 01:02:22 +00:00
|
|
|
def install
|
2013-02-07 03:52:38 +00:00
|
|
|
args = %W[
|
|
|
|
--disable-dependency-tracking
|
|
|
|
--prefix=#{prefix}
|
|
|
|
--without-python
|
|
|
|
--without-qt
|
|
|
|
--disable-video
|
|
|
|
--without-gtk
|
|
|
|
]
|
|
|
|
|
|
|
|
if build.with? 'x11'
|
|
|
|
args << '--with-x'
|
|
|
|
else
|
|
|
|
args << '--without-x'
|
|
|
|
end
|
|
|
|
|
|
|
|
system "./configure", *args
|
2010-03-04 01:02:22 +00:00
|
|
|
system "make install"
|
|
|
|
end
|
|
|
|
end
|
2013-04-18 20:52:52 +00:00
|
|
|
|
|
|
|
__END__
|
|
|
|
diff --git a/zbar/jpeg.c b/zbar/jpeg.c
|
|
|
|
index fb566f4..d1c1fb2 100644
|
|
|
|
--- a/zbar/jpeg.c
|
|
|
|
+++ b/zbar/jpeg.c
|
|
|
|
@@ -79,8 +79,15 @@ int fill_input_buffer (j_decompress_ptr cinfo)
|
|
|
|
void skip_input_data (j_decompress_ptr cinfo,
|
|
|
|
long num_bytes)
|
|
|
|
{
|
|
|
|
- cinfo->src->next_input_byte = NULL;
|
|
|
|
- cinfo->src->bytes_in_buffer = 0;
|
|
|
|
+ if (num_bytes > 0) {
|
|
|
|
+ if (num_bytes < cinfo->src->bytes_in_buffer) {
|
|
|
|
+ cinfo->src->next_input_byte += num_bytes;
|
|
|
|
+ cinfo->src->bytes_in_buffer -= num_bytes;
|
|
|
|
+ }
|
|
|
|
+ else {
|
|
|
|
+ fill_input_buffer(cinfo);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
}
|
|
|
|
|
|
|
|
void term_source (j_decompress_ptr cinfo)
|