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-06-27 07:01:59 +00:00
|
|
|
url "http://download.gimp.org/pub/babl/0.1/babl-0.1.12.tar.bz2"
|
|
|
|
mirror "https://mirrors.kernel.org/debian/pool/main/b/babl/babl_0.1.12.orig.tar.bz2"
|
|
|
|
sha256 "2f802b7f1a17b72c10bf0fe1e69b7a888cf7ce62b7cf1537b030f7f88d55a407"
|
2014-10-26 00:01:28 +00:00
|
|
|
|
2014-10-26 11:36:18 +00:00
|
|
|
bottle do
|
2015-09-24 19:47:42 +00:00
|
|
|
sha256 "b839dc910c873b14e2c86466f3d3894c4349b8755a4231cad78e60ed85f7b4dd" => :el_capitan
|
2015-06-28 08:36:33 +00:00
|
|
|
sha256 "db81183522e6d338475e43c2bed097b0ab5706eb24cc68c1889a673ca529e743" => :yosemite
|
|
|
|
sha256 "8782f771f5efa9cbc5dcf09815b4cb078647477f56b2110e5c67517adeb5c8e3" => :mavericks
|
|
|
|
sha256 "6e4ba55b1698c2edb1a006fbaa1bcaa72a8fc65007d86e21e022116a42a1bcae" => :mountain_lion
|
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
|