2011-09-18 03:15:54 +00:00
|
|
|
class Jbigkit < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "JBIG1 data compression standard implementation"
|
2015-04-28 18:15:34 +00:00
|
|
|
homepage "https://www.cl.cam.ac.uk/~mgk25/jbigkit/"
|
|
|
|
url "https://www.cl.cam.ac.uk/~mgk25/jbigkit/download/jbigkit-2.1.tar.gz"
|
|
|
|
mirror "https://mirrors.kernel.org/debian/pool/main/j/jbigkit/jbigkit_2.1.orig.tar.gz"
|
|
|
|
sha256 "de7106b6bfaf495d6865c7dd7ac6ca1381bd12e0d81405ea81e7f2167263d932"
|
|
|
|
|
2015-04-28 23:23:37 +00:00
|
|
|
bottle do
|
|
|
|
cellar :any
|
|
|
|
sha256 "764396342e87b84253aa06f5046f90c778cacca998ce970900cb2fdf1cfdc3fa" => :yosemite
|
|
|
|
sha256 "0ce925915b984307d2e679622138143c5cc5baf832b0a16003fa1e6111a5df9f" => :mavericks
|
|
|
|
sha256 "0afb6297101bc3269f0ebca1590cda66a62cbd90e3fdbec38dc011131711d32b" => :mountain_lion
|
|
|
|
end
|
|
|
|
|
2015-04-28 18:15:34 +00:00
|
|
|
head "https://www.cl.cam.ac.uk/~mgk25/git/jbigkit",
|
|
|
|
:using => :git
|
2011-09-18 03:15:54 +00:00
|
|
|
|
2013-01-26 17:57:12 +00:00
|
|
|
option :universal
|
2015-04-28 18:15:34 +00:00
|
|
|
option "with-check", "Verify the library during install"
|
2011-09-18 03:15:54 +00:00
|
|
|
|
|
|
|
def install
|
|
|
|
# Set for a universal build and patch the Makefile.
|
|
|
|
# There's no configure. It creates a static lib.
|
2013-01-26 17:57:12 +00:00
|
|
|
ENV.universal_binary if build.universal?
|
2012-05-05 21:53:52 +00:00
|
|
|
system "make", "CC=#{ENV.cc}", "CCFLAGS=#{ENV.cflags}"
|
2011-09-18 03:15:54 +00:00
|
|
|
|
2015-04-28 18:15:34 +00:00
|
|
|
if build.with? "check"
|
|
|
|
# It needs j1 to make the tests happen in sequence.
|
|
|
|
ENV.deparallelize
|
|
|
|
system "make", "test"
|
|
|
|
end
|
2011-09-18 03:15:54 +00:00
|
|
|
|
2015-04-28 18:15:34 +00:00
|
|
|
cd "pbmtools" do
|
|
|
|
bin.install %w[pbmtojbg jbgtopbm pbmtojbg85 jbgtopbm85]
|
|
|
|
man1.install %w[pbmtojbg.1 jbgtopbm.1]
|
|
|
|
man5.install %w[pbm.5 pgm.5]
|
2011-09-18 03:15:54 +00:00
|
|
|
end
|
2015-04-28 18:15:34 +00:00
|
|
|
cd "libjbig" do
|
|
|
|
lib.install Dir["lib*.a"]
|
|
|
|
(prefix/"src").install Dir["j*.c", "j*.txt"]
|
|
|
|
include.install Dir["j*.h"]
|
2011-09-18 03:15:54 +00:00
|
|
|
end
|
2015-04-28 18:15:34 +00:00
|
|
|
(share/"jbigkit").install "examples", "contrib"
|
2011-09-18 03:15:54 +00:00
|
|
|
end
|
|
|
|
|
2013-02-02 05:12:41 +00:00
|
|
|
test do
|
2015-04-28 18:15:34 +00:00
|
|
|
system "#{bin}/jbgtopbm #{share}/jbigkit/examples/ccitt7.jbg | #{bin}/pbmtojbg - testoutput.jbg"
|
|
|
|
system "/usr/bin/cmp", share/"jbigkit/examples/ccitt7.jbg", "testoutput.jbg"
|
2011-09-18 03:15:54 +00:00
|
|
|
end
|
|
|
|
end
|