homebrew-core/Formula/cairomm.rb

71 lines
2.2 KiB
Ruby

class Cairomm < Formula
desc "Vector graphics library with cross-device output support"
homepage "https://cairographics.org/cairomm/"
url "https://cairographics.org/releases/cairomm-1.12.2.tar.gz"
sha256 "45c47fd4d0aa77464a75cdca011143fea3ef795c4753f6e860057da5fb8bd599"
revision 1
bottle do
cellar :any
sha256 "58ce00547bc4f0210b0236b3e3df344b372e801bc129ba32091a5396334af7f8" => :catalina
sha256 "2a77a830256c2da441f636fddbdc2bd4ad390e920fc223b4ea33821ec1265195" => :mojave
sha256 "08a29b621ee8173cb17452f2e7a62adb83a60a65f0758cab545ddc0c53ecf681" => :high_sierra
sha256 "1845ba3e5dd9364551980e16b446620e4088f1fe90517b5af7cd81435b60cc08" => :sierra
end
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "libpng"
depends_on "libsigc++@2"
def install
ENV.cxx11
system "./configure", "--disable-dependency-tracking",
"--prefix=#{prefix}"
system "make", "install"
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