2011-11-28 09:21:43 +00:00
|
|
|
class Babl < Formula
|
2015-05-19 00:00:59 +00:00
|
|
|
desc "Dynamic, any-to-any, pixel format translation library"
|
2014-10-26 00:01:28 +00:00
|
|
|
homepage "http://www.gegl.org/babl/"
|
2017-02-01 01:40:03 +00:00
|
|
|
url "https://download.gimp.org/pub/babl/0.1/babl-0.1.24.tar.bz2"
|
|
|
|
mirror "https://mirrors.kernel.org/debian/pool/main/b/babl/babl_0.1.24.orig.tar.bz2"
|
|
|
|
sha256 "472bf1acdde5bf076e6d86f3004eea4e9b007b1377ab305ebddec99994f29d0b"
|
2014-10-26 00:01:28 +00:00
|
|
|
|
2014-10-26 11:36:18 +00:00
|
|
|
bottle do
|
2017-02-01 03:45:17 +00:00
|
|
|
sha256 "59dbdde4e0b9163f0ea4454633081afd6857ba4a41210c1b2d5220645396b783" => :sierra
|
|
|
|
sha256 "c57ea02e61a81516ae316b306676f4c81c4f1f894fcd888d69331eea2e1f498a" => :el_capitan
|
|
|
|
sha256 "49ed1ceef9c136ddbe1ad1dfc8a3fcc5d8aa2262fdfaa39d20e055e20201b6e3" => :yosemite
|
2014-10-26 11:36:18 +00:00
|
|
|
end
|
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
head do
|
|
|
|
# Use Github instead of GNOME's git. The latter is unreliable.
|
|
|
|
url "https://github.com/GNOME/babl.git"
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2014-10-26 00:01:28 +00:00
|
|
|
depends_on "automake" => :build
|
|
|
|
depends_on "autoconf" => :build
|
|
|
|
depends_on "libtool" => :build
|
|
|
|
end
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2015-06-27 07:01:59 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
|
2016-02-17 05:30:36 +00:00
|
|
|
def install
|
2014-10-26 00:01:28 +00:00
|
|
|
system "./autogen.sh" if build.head?
|
2012-03-11 02:09:15 +00:00
|
|
|
system "./configure", "--disable-dependency-tracking",
|
|
|
|
"--prefix=#{prefix}"
|
2014-10-26 00:01:28 +00:00
|
|
|
system "make", "install"
|
2011-11-28 09:21:43 +00:00
|
|
|
end
|
2014-10-26 11:36:18 +00:00
|
|
|
|
2015-06-27 07:01:59 +00:00
|
|
|
test do
|
|
|
|
(testpath/"test.c").write <<-EOS.undent
|
|
|
|
#include <babl/babl.h>
|
|
|
|
int main() {
|
|
|
|
babl_init();
|
|
|
|
const Babl *srgb = babl_format ("R'G'B' u8");
|
|
|
|
const Babl *lab = babl_format ("CIE Lab float");
|
|
|
|
const Babl *rgb_to_lab_fish = babl_fish (srgb, lab);
|
|
|
|
babl_exit();
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
EOS
|
|
|
|
system ENV.cc, "-I#{include}/babl-0.1", "-L#{lib}", "-lbabl-0.1", testpath/"test.c", "-o", "test"
|
|
|
|
system testpath/"test"
|
|
|
|
end
|
|
|
|
end
|