homebrew-core/Formula/osm-gps-map.rb

102 lines
3.5 KiB
Ruby

class OsmGpsMap < Formula
desc "GTK+ library to embed OpenStreetMap maps"
homepage "https://github.com/nzjrs/osm-gps-map"
url "https://github.com/nzjrs/osm-gps-map/releases/download/1.2.0/osm-gps-map-1.2.0.tar.gz"
sha256 "ddec11449f37b5dffb4bca134d024623897c6140af1f9981a8acc512dbf6a7a5"
license "GPL-2.0-or-later"
revision 1
bottle do
rebuild 1
sha256 arm64_ventura: "cb2a486b55c1d892e15850c581795642594be622c74bccdf7b68399d05c45c2c"
sha256 arm64_big_sur: "69c8b2b22877a14f14d04d3f40a890f6b092b992bcb86270c1f82ff79f54ae50"
sha256 ventura: "42936a83f068fc0b03ea5925b0c8016bce98a7f9a043ec9306b52c8205ca8d8d"
sha256 monterey: "322015ebc1b2ce52d40d2db2d27662f639725bd474aca83b1af9238abccb903e"
sha256 big_sur: "5e88cd60732ed86ec019f82a136d3445af500893435b804f68c41d25fe8de72c"
sha256 catalina: "3bd120a4480aaf535f90b4660a3029682adf413eca6243c5a69e15856be192fb"
sha256 cellar: :any_skip_relocation, x86_64_linux: "1a70b74c033694c33f50fdd6190676cf47deb46e7ed0425e5be4e085fbc3c357"
end
head do
url "https://github.com/nzjrs/osm-gps-map.git", branch: "master"
depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "gnome-common" => :build
depends_on "gtk-doc" => :build
depends_on "libtool" => :build
end
depends_on "gobject-introspection" => :build
depends_on "pkg-config" => :build
depends_on "gdk-pixbuf"
depends_on "glib"
depends_on "gtk+3"
depends_on "libsoup@2"
patch do
url "https://raw.githubusercontent.com/Homebrew/formula-patches/03cf8088210822aa2c1ab544ed58ea04c897d9c4/libtool/configure-big_sur.diff"
sha256 "35acd6aebc19843f1a2b3a63e880baceb0f5278ab1ace661e57a502d9d78c93c"
end
def install
system "./autogen.sh" if build.head?
system "./configure", "--disable-debug", "--disable-dependency-tracking",
"--disable-silent-rules", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <osm-gps-map.h>
int main(int argc, char *argv[]) {
OsmGpsMap *map;
gtk_init (&argc, &argv);
map = g_object_new (OSM_TYPE_GPS_MAP, NULL);
return 0;
}
EOS
atk = Formula["atk"]
cairo = Formula["cairo"]
glib = Formula["glib"]
gdk_pixbuf = Formula["gdk-pixbuf"]
gtkx3 = Formula["gtk+3"]
harfbuzz = Formula["harfbuzz"]
pango = Formula["pango"]
flags = %W[
-I#{atk.opt_include}/atk-1.0
-I#{cairo.opt_include}/cairo
-I#{gdk_pixbuf.opt_include}/gdk-pixbuf-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#{pango.opt_include}/pango-1.0
-I#{include}/osmgpsmap-1.0
-D_REENTRANT
-L#{atk.opt_lib}
-L#{cairo.opt_lib}
-L#{gdk_pixbuf.opt_lib}
-L#{glib.opt_lib}
-L#{gtkx3.opt_lib}
-L#{lib}
-L#{pango.opt_lib}
-latk-1.0
-lcairo
-lgdk-3
-lgdk_pixbuf-2.0
-lglib-2.0
-lgtk-3
-lgobject-2.0
-lpango-1.0
-losmgpsmap-1.0
]
system ENV.cc, "test.c", "-o", "test", *flags
# (test:40601): Gtk-WARNING **: 23:06:24.466: cannot open display
return if OS.linux? && ENV["HOMEBREW_GITHUB_ACTIONS"]
system "./test"
end
end