Files

51 lines
1.6 KiB
Ruby

class Pixman < Formula
bottle do
root_url "https://homebrew.mirror.ygg/bottles"
rebuild 1
sha256 cellar: :any, arm64_sequoia: "86f5fc013d2b22bbe41c1c14661287bf8e8e4c3ac95cd05b08b886d24918fe34"
sha256 cellar: :any, arm64_tahoe: "2b011051909d7f9ad432a76d32c0490f796ad545f7acbd6445356024f0c712e5"
sha256 cellar: :any_skip_relocation, x86_64_linux: "acad642a52a0e39159ba340f1e676c63d014422bf1d90e218ba7397b5873a2d1"
end
desc "Low-level library for pixel manipulation"
homepage "https://cairographics.org/"
url "https://cairographics.org/releases/pixman-0.46.4.tar.gz"
sha256 "d09c44ebc3bd5bee7021c79f922fe8fb2fb57f7320f55e97ff9914d2346a591c"
license "MIT"
compatibility_version 1
livecheck do
url "https://cairographics.org/releases/?C=M&O=D"
regex(/href=.*?pixman[._-]v?(\d+\.\d*[02468](?:\.\d+)*)\.t/i)
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkgconf" => :test
def install
system "meson", "setup", "build", "--default-library=both", *std_meson_args
system "meson", "compile", "-C", "build", "--verbose"
system "meson", "install", "-C", "build"
end
test do
(testpath/"test.c").write <<~C
#include <pixman.h>
int main(int argc, char *argv[])
{
pixman_color_t white = { 0xffff, 0xffff, 0xffff, 0xffff };
pixman_image_t *image = pixman_image_create_solid_fill(&white);
pixman_image_unref(image);
return 0;
}
C
pkgconf_flags = shell_output("pkgconf --cflags --libs pixman-1").chomp.split
system ENV.cc, "test.c", "-o", "test", *pkgconf_flags
system "./test"
end
end