homebrew-core/Formula/cairomm@1.14.rb

80 lines
2.4 KiB
Ruby

class CairommAT114 < Formula
desc "Vector graphics library with cross-device output support"
homepage "https://cairographics.org/cairomm/"
url "https://cairographics.org/releases/cairomm-1.14.2.tar.xz"
sha256 "0126b9cc295dc36bc9c0860d5b720cb5469fd78d5620c8f10cc5f0c07b928de3"
license "LGPL-2.0-or-later"
livecheck do
url "https://cairographics.org/releases/?C=M&O=D"
regex(/href=.*?cairomm[._-]v?(1\.14\.\d*[02468](?:\.\d+)*)\.t/i)
end
bottle do
cellar :any
sha256 "ac3ed3d2ba79498f26005046e61a835978c4c8ca0ca6435d39b405d2bc39535b" => :big_sur
sha256 "89fc4b03efa9136f5a828959c3263b36dfb209d303b62192d57d6d6aed4058ef" => :catalina
sha256 "b9eff4d0aca913e713ee870137962be2a44c498936f1c915e459eb95002e60ef" => :mojave
end
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "libpng"
depends_on "libsigc++@2"
def install
ENV.cxx11
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"test.cpp").write <<~EOS
#include <cairomm/cairomm.h>
int main(int argc, char *argv[])
{
Cairo::RefPtr<Cairo::ImageSurface> surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 600, 400);
Cairo::RefPtr<Cairo::Context> cr = Cairo::Context::create(surface);
return 0;
}
EOS
cairo = Formula["cairo"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gettext = Formula["gettext"]
glib = Formula["glib"]
libpng = Formula["libpng"]
libsigcxx = Formula["libsigc++@2"]
pixman = Formula["pixman"]
flags = %W[
-I#{cairo.opt_include}/cairo
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gettext.opt_include}
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{include}/cairomm-1.0
-I#{libpng.opt_include}/libpng16
-I#{libsigcxx.opt_include}/sigc++-2.0
-I#{libsigcxx.opt_lib}/sigc++-2.0/include
-I#{lib}/cairomm-1.0/include
-I#{pixman.opt_include}/pixman-1
-L#{cairo.opt_lib}
-L#{libsigcxx.opt_lib}
-L#{lib}
-lcairo
-lcairomm-1.0
-lsigc-2.0
]
system ENV.cxx, "-std=c++11", "test.cpp", "-o", "test", *flags
system "./test"
end
end