From 1865b61c40aaf3a6adb142204a410c86f7488af5 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Sat, 20 Aug 2022 20:26:10 +0800 Subject: [PATCH] add libgeotiff (#1425) --- packages/l/libgeotiff/xmake.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 packages/l/libgeotiff/xmake.lua diff --git a/packages/l/libgeotiff/xmake.lua b/packages/l/libgeotiff/xmake.lua new file mode 100644 index 000000000..deddffce5 --- /dev/null +++ b/packages/l/libgeotiff/xmake.lua @@ -0,0 +1,24 @@ +package("libgeotiff") + + set_homepage("https://github.com/OSGeo/libgeotiff") + set_description("Libgeotiff is an open source library for reading and writing GeoTIFF information tags") + set_license("MIT") + + add_urls("https://download.osgeo.org/geotiff/libgeotiff/libgeotiff-$(version).tar.gz") + add_versions("1.7.1", "05ab1347aaa471fc97347d8d4269ff0c00f30fa666d956baba37948ec87e55d6") + + add_configs("utils", {description = "Choose if GeoTIFF utilities should be built", default = false, type = "boolean"}) + + add_deps("cmake", "libtiff") + add_deps("proj", {configs = {tiff = true}}) + on_install("windows", "macosx", "linux", function (package) + local configs = {"-DHAVE_TIFFOPEN=1", "-DHAVE_TIFFMERGEFIELDINFO=1"} + table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) + table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) + table.insert(configs, "-DWITH_UTILITIES=" .. (package:config("utils") and "ON" or "OFF")) + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:has_cfuncs("GTIFNew", {includes = "geotiff.h"})) + end)