From d9f8ee2465ab59829beb15b91f7236a847955f57 Mon Sep 17 00:00:00 2001 From: Hoildkv <42310255+xq114@users.noreply.github.com> Date: Sun, 21 Aug 2022 16:24:54 +0800 Subject: [PATCH] add liblas (#1426) * update openblas * add liblas * add patch * fix1 * fix2 * fix3 * fix4 --- packages/l/liblas/patches/1.8.1/header.patch | 55 ++++++++++++++++++++ packages/l/liblas/xmake.lua | 41 +++++++++++++++ packages/o/openblas/xmake.lua | 3 ++ 3 files changed, 99 insertions(+) create mode 100644 packages/l/liblas/patches/1.8.1/header.patch create mode 100644 packages/l/liblas/xmake.lua diff --git a/packages/l/liblas/patches/1.8.1/header.patch b/packages/l/liblas/patches/1.8.1/header.patch new file mode 100644 index 000000000..4725a6ceb --- /dev/null +++ b/packages/l/liblas/patches/1.8.1/header.patch @@ -0,0 +1,55 @@ +diff --git a/include/liblas/detail/binary.hpp b/include/liblas/detail/binary.hpp +index d3116a1..ab20e06 100644 +--- a/include/liblas/detail/binary.hpp ++++ b/include/liblas/detail/binary.hpp +@@ -17,6 +17,8 @@ + #ifndef LIBLAS_DETAIL_BINARY_HPP_INCLUDED + #define LIBLAS_DETAIL_BINARY_HPP_INCLUDED + ++#include ++ + #include + #include + #include +@@ -25,7 +27,6 @@ + + #include + #include +-#include + #include + + #if CHAR_BIT != 8 +@@ -43,7 +44,7 @@ namespace detail { namespace binary { + struct big_endian_tag {}; + struct little_endian_tag {}; + +-#ifdef BOOST_BIG_ENDIAN ++#ifdef LIBLAS_BIG_ENDIAN + typedef big_endian_tag native_endian_tag; + #else + typedef little_endian_tag native_endian_tag; +diff --git a/src/c_api.cpp b/src/c_api.cpp +index a70fe74..e8be785 100644 +--- a/src/c_api.cpp ++++ b/src/c_api.cpp +@@ -96,6 +96,7 @@ using namespace liblas; + #endif + + #include ++#include + + bool IsReprojectionTransform(liblas::TransformPtr const& p) + { +diff --git a/src/header.cpp b/src/header.cpp +index 9987ce1..a5c8f7d 100644 +--- a/src/header.cpp ++++ b/src/header.cpp +@@ -54,7 +54,7 @@ + // boost + #include + #include +- ++#include + //std + #include + #include diff --git a/packages/l/liblas/xmake.lua b/packages/l/liblas/xmake.lua new file mode 100644 index 000000000..391779828 --- /dev/null +++ b/packages/l/liblas/xmake.lua @@ -0,0 +1,41 @@ +package("liblas") + + set_homepage("https://liblas.org/index.html") + set_description("libLAS - LAS 1.0/1.1/1.2 ASPRS LiDAR data translation toolset") + set_license("BSD-3-Clause") + + add_urls("http://download.osgeo.org/liblas/libLAS-$(version).tar.bz2") + add_versions("1.8.1", "9adb4a98c63b461ed2bc82e214ae522cbd809cff578f28511122efe6c7ea4e76") + + add_patches("1.8.1", path.join(os.scriptdir(), "patches", "1.8.1", "header.patch"), "fde1c186e78472f4eb8902f28b51b18a8b40166379c710b43f89323aac7c3afd") + + add_deps("cmake", "libgeotiff") + add_deps("boost", {configs = {program_options = true, + thread = true, + system = true, + iostreams = true, + filesystem = true}}) + on_install("windows", "macosx", "linux", function (package) + io.replace("CMakeLists.txt", "JPEG", "PROJ", {plain = true}) + io.replace("src/CMakeLists.txt", "${GDAL_LIBRARY}", "${PROJ_LIBRARIES}", {plain = true}) + local configs = {"-DWITH_TESTS=OFF", "-DWITH_LASZIP=OFF", "-DWITH_GDAL=OFF", "-DBUILD_OSGEO4W=OFF", "-DBoost_USE_STATIC_LIBS=ON"} + 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")) + if package:is_plat("windows") then + table.insert(configs, "-DBoost_USE_STATIC_RUNTIME=" .. (package:config("vs_runtime"):startswith("MT") and "ON" or "OFF")) + end + import("package.tools.cmake").install(package, configs) + end) + + on_test(function (package) + assert(package:check_cxxsnippets({test = [[ + #include + #include + void test() { + std::ifstream ifs; + ifs.open("file.las", std::ios::in | std::ios::binary); + liblas::ReaderFactory f; + liblas::Reader reader = f.CreateWithStream(ifs); + } + ]]}, {configs = {languages = "c++11"}})) + end) diff --git a/packages/o/openblas/xmake.lua b/packages/o/openblas/xmake.lua index 9ef2b6e69..8e514dc0d 100644 --- a/packages/o/openblas/xmake.lua +++ b/packages/o/openblas/xmake.lua @@ -14,6 +14,7 @@ package("openblas") add_versions("0.3.18", "767757039c354b6625c497a856c362546c1b1e7400278ffb40e3b9bf731f3b27") add_versions("0.3.19", "d85b09d80bbb40442d608fa60353ccec5f112cebeccd805c0e139057e26d1795") add_versions("0.3.20", "cacfb8563e2a98260e35a09c92fd3b7383a9cd1367444edfa1b46cb0225ee9c3") + add_versions("0.3.21", "ecf1853ce92696fb8531c941c50e983ea8fa673c118a87298a075c045d52a3ca") elseif is_arch("x86") then add_urls("https://github.com/xianyi/OpenBLAS/releases/download/v$(version)/OpenBLAS-$(version)-x86.zip") add_versions("0.3.15", "bcde933737b477813eaac290de5cb8756d3b42199e8ef5f44b23ae5f06fe0834") @@ -21,6 +22,7 @@ package("openblas") add_versions("0.3.18", "c24ecd6e5f561de3861bf714b35e0957a27ee0e03ab4d2867d08377892daf66e") add_versions("0.3.19", "478cbaeb9364b4681a7c982626e637a5a936514a45e12b6f0caddbcb9483b795") add_versions("0.3.20", "0ee249246af7ce2fd66f86cb9350f5f5a7b97496b9b997bfd0680048dd194158") + add_versions("0.3.21", "936416a0fec5506af9cf040c9de5c7edbd0ff18b53431799d1a43e47f9eba64e") end add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) @@ -33,6 +35,7 @@ package("openblas") add_versions("0.3.18", "1632c1e8cca62d8bed064b37747e331a1796fc46f688626337362bf0d16aeadb") add_versions("0.3.19", "947f51bfe50c2a0749304fbe373e00e7637600b0a47b78a51382aeb30ca08562") add_versions("0.3.20", "8495c9affc536253648e942908e88e097f2ec7753ede55aca52e5dead3029e3c") + add_versions("0.3.21", "f36ba3d7a60e7c8bcc54cd9aaa9b1223dd42eaf02c811791c37e8ca707c241ca") add_configs("fortran", {description = "Compile with fortran enabled.", default = is_plat("linux"), type = "boolean"}) add_configs("openmp", {description = "Compile with OpenMP enabled.", default = not is_plat("macosx"), type = "boolean"})