From 3d8b9f4d50435aed9dd1a79c5943e8d9b8af0ba4 Mon Sep 17 00:00:00 2001 From: Tom Schoonjans Date: Tue, 24 Nov 2020 06:47:26 +0000 Subject: [PATCH] cairomm@1.14 1.14.2: new formula --- Aliases/cairomm@1.16 | 1 + Formula/cairomm@1.14.rb | 72 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 120000 Aliases/cairomm@1.16 create mode 100644 Formula/cairomm@1.14.rb diff --git a/Aliases/cairomm@1.16 b/Aliases/cairomm@1.16 new file mode 120000 index 00000000000..457d84fef66 --- /dev/null +++ b/Aliases/cairomm@1.16 @@ -0,0 +1 @@ +../Formula/cairomm.rb \ No newline at end of file diff --git a/Formula/cairomm@1.14.rb b/Formula/cairomm@1.14.rb new file mode 100644 index 00000000000..64996a12b93 --- /dev/null +++ b/Formula/cairomm@1.14.rb @@ -0,0 +1,72 @@ +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?(\d+\.\d*[02468](?:\.\d+)*)\.t/i) + 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 + + int main(int argc, char *argv[]) + { + Cairo::RefPtr surface = Cairo::ImageSurface::create(Cairo::FORMAT_ARGB32, 600, 400); + Cairo::RefPtr 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