53 lines
1.7 KiB
Ruby
53 lines
1.7 KiB
Ruby
class Babl < Formula
|
|
desc "Dynamic, any-to-any, pixel format translation library"
|
|
homepage "http://www.gegl.org/babl/"
|
|
url "https://download.gimp.org/pub/babl/0.1/babl-0.1.80.tar.xz"
|
|
sha256 "f75ccc39af42585099bcb4731071dc5316b7542c5e232f63e278cd1ea2c04f8e"
|
|
license "LGPL-3.0"
|
|
# Use GitHub instead of GNOME's git. The latter is unreliable.
|
|
head "https://github.com/GNOME/babl.git"
|
|
|
|
livecheck do
|
|
url "https://download.gimp.org/pub/babl/0.1/"
|
|
regex(/href=.*?babl[._-]v?(\d+(?:\.\d+)*)\.t/i)
|
|
end
|
|
|
|
bottle do
|
|
sha256 "1ee23d8d10b4d302534a0bbcbef29d9d132b369c93927fad502a4c18248fb5a4" => :catalina
|
|
sha256 "123339d245f11cdf1b46d1bc433fe080b4c83ebca98b15ddcc5fc26989a0acfd" => :mojave
|
|
sha256 "8c7f2364960a45e4058f621941feb6014b8a5ce76447b8f22bc94e8e05c33710" => :high_sierra
|
|
end
|
|
|
|
depends_on "glib" => :build # for gobject-introspection
|
|
depends_on "gobject-introspection" => :build
|
|
depends_on "meson" => :build
|
|
depends_on "ninja" => :build
|
|
depends_on "pkg-config" => :build
|
|
depends_on "vala" => :build
|
|
depends_on "little-cms2"
|
|
|
|
def install
|
|
mkdir "build" do
|
|
system "meson", *std_meson_args, "-Dwith-docs=false", ".."
|
|
system "ninja", "-v"
|
|
system "ninja", "install", "-v"
|
|
end
|
|
end
|
|
|
|
test do
|
|
(testpath/"test.c").write <<~EOS
|
|
#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
|