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/"
|
2015-12-24 13:07:02 +00:00
|
|
|
url "https://download.gimp.org/pub/babl/0.1/babl-0.1.14.tar.bz2"
|
|
|
|
mirror "https://mirrors.kernel.org/debian/pool/main/b/babl/babl_0.1.14.orig.tar.bz2"
|
|
|
|
sha256 "e6dcb112c8f8f75471823fdcc5a6a65f753b4d0e96e377979ea01a5d6fad7d4f"
|
2014-10-26 00:01:28 +00:00
|
|
|
|
2014-10-26 11:36:18 +00:00
|
|
|
bottle do
|
2015-12-24 14:23:01 +00:00
|
|
|
sha256 "7f5aacab0effd76ebb60e3057f5a620570e2cafa41017617f60b3d666be1e633" => :el_capitan
|
|
|
|
sha256 "dd3073278a5a7f3e584e37cfcd2fb5268a98b3230d16b125aec806a5968668f4" => :yosemite
|
|
|
|
sha256 "060bc343437aeff92ed1f411c4d4e98f5cb0577494eb8e55b2398f398071bf1a" => :mavericks
|
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
|
|
|
|
2012-08-09 05:07:31 +00:00
|
|
|
option :universal
|
2011-11-28 09:21:43 +00:00
|
|
|
|
2015-06-27 07:01:59 +00:00
|
|
|
depends_on "pkg-config" => :build
|
|
|
|
|
2011-11-28 09:21:43 +00:00
|
|
|
def install
|
2012-08-09 05:07:31 +00:00
|
|
|
if build.universal?
|
2011-11-28 09:21:43 +00:00
|
|
|
ENV.universal_binary
|
2015-06-27 07:01:59 +00:00
|
|
|
opoo "Compilation may fail at babl-cpuaccel.c using gcc for a universal build" if ENV.compiler == :gcc
|
2011-11-28 09:21:43 +00:00
|
|
|
end
|
|
|
|
|
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
|