homebrew-core/Formula/libchamplain.rb

129 lines
4.2 KiB
Ruby

class Libchamplain < Formula
desc "ClutterActor for displaying maps"
homepage "https://wiki.gnome.org/Projects/libchamplain"
url "https://download.gnome.org/sources/libchamplain/0.12/libchamplain-0.12.20.tar.xz"
sha256 "0232b4bfcd130a1c5bda7b6aec266bf2d06e701e8093df1886f1e26bc1ba3066"
license "LGPL-2.1"
revision 3
bottle do
rebuild 1
sha256 cellar: :any, arm64_ventura: "da5655b6623f754f33d3b47d6eee772353f0bbe59a3cd5ebfeed8113aa6e83f5"
sha256 cellar: :any, arm64_big_sur: "4c338a3a4dbeec5732e73a531aecaaf1cb862ed9e87030fc05e2c25ed9a1f585"
sha256 cellar: :any, ventura: "906af9a5b433a6732e4863005961549f3972fb2292d10a10f9146eb14c9ef7ae"
sha256 cellar: :any, monterey: "be1d7594f805bd7c358011a1669f5eb479c04157330cca2434392fc46eaefa9c"
sha256 cellar: :any, big_sur: "492db68c8120ff8435f6d96b87cdc4db83afe2d47b0da7b1bc164bbb60af015b"
sha256 cellar: :any, catalina: "2b4c4d1e01b47b3598b56d92b27a42b944a56c83b73f1e175e6854210dfe465e"
sha256 x86_64_linux: "292cd694f9167c38d48b8aba733960db987135857f6954bfff79908a57878413"
end
# It needs deprecated `cogl` and `clutter`. There isn't a plan to rewrite and homepage says:
# "Starting with GTK4, it is recommended to use libshumate instead of libchamplain"
# Ref: https://wiki.gnome.org/Projects/libchamplain
# Ref: https://gitlab.gnome.org/GNOME/libchamplain/-/issues/50
# Ref: https://gitlab.gnome.org/GNOME/libchamplain/-/issues/52
deprecate! date: "2022-09-21", because: :unmaintained
depends_on "gnome-common" => :build
depends_on "gobject-introspection" => :build
depends_on "meson" => :build
depends_on "ninja" => :build
depends_on "pkg-config" => :build
depends_on "clutter"
depends_on "clutter-gtk"
depends_on "gtk+3"
depends_on "libsoup@2"
depends_on "sqlite" # try to change to uses_from_macos after python is not a dependency
on_linux do
depends_on "vala" => :build
end
def install
mkdir "build" do
system "meson", *std_meson_args, ".."
system "ninja"
system "ninja", "install"
end
end
test do
(testpath/"test.c").write <<~EOS
#include <champlain/champlain.h>
int main(int argc, char *argv[]) {
GType type = champlain_license_get_type();
return 0;
}
EOS
ENV.libxml2
atk = Formula["atk"]
cairo = Formula["cairo"]
clutter = Formula["clutter"]
cogl = Formula["cogl"]
fontconfig = Formula["fontconfig"]
freetype = Formula["freetype"]
gdk_pixbuf = Formula["gdk-pixbuf"]
gettext = Formula["gettext"]
glib = Formula["glib"]
gtkx3 = Formula["gtk+3"]
harfbuzz = Formula["harfbuzz"]
json_glib = Formula["json-glib"]
libepoxy = Formula["libepoxy"]
libpng = Formula["libpng"]
libsoup = Formula["libsoup@2"]
pango = Formula["pango"]
pixman = Formula["pixman"]
flags = %W[
-I#{atk.opt_include}/atk-1.0
-I#{cairo.opt_include}/cairo
-I#{clutter.opt_include}/clutter-1.0
-I#{cogl.opt_include}/cogl
-I#{fontconfig.opt_include}
-I#{freetype.opt_include}/freetype2
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-2.0
-I#{gettext.opt_include}
-I#{glib.opt_include}/gio-unix-2.0/
-I#{glib.opt_include}/glib-2.0
-I#{glib.opt_lib}/glib-2.0/include
-I#{gtkx3.opt_include}/gtk-3.0
-I#{harfbuzz.opt_include}/harfbuzz
-I#{include}/champlain-0.12
-I#{json_glib.opt_include}/json-glib-1.0
-I#{libepoxy.opt_include}
-I#{libpng.opt_include}/libpng16
-I#{libsoup.opt_include}/libsoup-2.4
-I#{pango.opt_include}/pango-1.0
-I#{pixman.opt_include}/pixman-1
-D_REENTRANT
-L#{atk.opt_lib}
-L#{cairo.opt_lib}
-L#{clutter.opt_lib}
-L#{cogl.opt_lib}
-L#{gettext.opt_lib}
-L#{glib.opt_lib}
-L#{json_glib.opt_lib}
-L#{lib}
-L#{pango.opt_lib}
-latk-1.0
-lcairo
-lcairo-gobject
-lchamplain-0.12
-lclutter-1.0
-lcogl
-lcogl-pango
-lcogl-path
-lgio-2.0
-lglib-2.0
-lgmodule-2.0
-lgobject-2.0
-ljson-glib-1.0
-lpango-1.0
-lpangocairo-1.0
]
flags << "-lintl" if OS.mac?
system ENV.cc, "test.c", "-o", "test", *flags
system "./test"
end
end