homebrew-core/Formula/simple-tiles.rb
2019-06-18 08:24:31 +02:00

45 lines
1.5 KiB
Ruby

class SimpleTiles < Formula
desc "Image generation library for spatial data"
homepage "https://propublica.github.io/simple-tiles/"
url "https://github.com/propublica/simple-tiles/archive/v0.6.1.tar.gz"
sha256 "2391b2f727855de28adfea9fc95d8c7cbaca63c5b86c7286990d8cbbcd640d6f"
revision 4
head "https://github.com/propublica/simple-tiles.git"
bottle do
cellar :any
sha256 "af4f54116a7cde66cca38c63382ba0ef0bffd8e60c96ce90129bc26988dff8eb" => :mojave
sha256 "f8b247eaa74faacc9d7f82f5e4e9fd1ecc380249df3fc16f84981b5d4eb2738b" => :high_sierra
sha256 "e59a10664a5c6f4bd6377cbb3a96fd9b206ad3210331e5edae3017a3f4da1201" => :sierra
end
depends_on "pkg-config" => :build
depends_on "cairo"
depends_on "gdal"
depends_on "pango"
def install
system "./configure", "--prefix=#{prefix}"
system "make", "install"
end
test do
(testpath/"test.c").write <<~EOS
#include <simple-tiles/simple_tiles.h>
int main(){
simplet_map_t *map = simplet_map_new();
simplet_map_free(map);
return 0;
}
EOS
system ENV.cc, "-I#{include}", "-L#{lib}", "-lsimple-tiles",
"-I#{Formula["cairo"].opt_include}/cairo",
"-I#{Formula["gdal"].opt_include}",
"-I#{Formula["glib"].opt_include}/glib-2.0",
"-I#{Formula["glib"].opt_lib}/glib-2.0/include",
"-I#{Formula["pango"].opt_include}/pango-1.0",
"test.c", "-o", "test"
system testpath/"test"
end
end