diff --git a/ports/lastools/build-tools.diff b/ports/lastools/build-tools.diff new file mode 100644 index 0000000000..9fe07c636e --- /dev/null +++ b/ports/lastools/build-tools.diff @@ -0,0 +1,15 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 6a0ea6e..9e119c5 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -16,7 +16,10 @@ if (BUILD_SHARED_LIBS AND UNIX AND NOT APPLE) + endif() + + add_subdirectory(LASlib/src) ++option(BUILD_TOOLS "" OFF) ++if(BUILD_TOOLS) + add_subdirectory(src) ++endif() + if (EXISTS src_full) + add_subdirectory(src_full) + endif() diff --git a/ports/lastools/fix_install_paths_lastools.patch b/ports/lastools/fix_install_paths_lastools.patch index 8021ed480f..9f5d97355f 100644 --- a/ports/lastools/fix_install_paths_lastools.patch +++ b/ports/lastools/fix_install_paths_lastools.patch @@ -1,26 +1,23 @@ -diff --git a/LASlib/src/CMakeLists.txt b/LASlib/src/CMakeLists.txt -index 1b170bf..408628c 100644 ---- a/LASlib/src/CMakeLists.txt -+++ b/LASlib/src/CMakeLists.txt -@@ -99,17 +99,9 @@ if(MSVC) - ) - endif() - -+install(TARGETS LASlib EXPORT laslib-targets -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}) - install(FILES ${LAS_INCLUDES} DESTINATION include/LASlib) - --if (MSVC) -- foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) -- install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib/${OUTPUTCONFIG} DESTINATION lib/LASlib) -- endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) --else() -- install(TARGETS LASlib EXPORT laslib-targets -- ARCHIVE DESTINATION lib/LASlib -- LIBRARY DESTINATION lib/LASlib -- RUNTIME DESTINATION lib/LASlib) -- install(EXPORT laslib-targets DESTINATION lib/cmake/LASlib) -- install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION lib/cmake/LASlib) --endif(MSVC) -+install(EXPORT laslib-targets DESTINATION share/lastools/LASlib) -+install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION share/lastools/LASlib) +diff --git a/LASlib/src/CMakeLists.txt b/LASlib/src/CMakeLists.txt +index 51dca48..97a25c4 100644 +--- a/LASlib/src/CMakeLists.txt ++++ b/LASlib/src/CMakeLists.txt +@@ -104,15 +104,13 @@ endif() + + install(FILES ${LAS_INCLUDES} DESTINATION include/LASlib) + +-if (MSVC) ++if (0) + foreach( OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES} ) + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/../lib/${OUTPUTCONFIG} DESTINATION lib/LASlib) + endforeach( OUTPUTCONFIG CMAKE_CONFIGURATION_TYPES ) + else() + install(TARGETS LASlib EXPORT laslib-targets +- ARCHIVE DESTINATION lib/LASlib +- LIBRARY DESTINATION lib/LASlib +- RUNTIME DESTINATION lib/LASlib) ++ ) + install(EXPORT laslib-targets DESTINATION lib/cmake/LASlib) + install(FILES ${CMAKE_SOURCE_DIR}/LASlib/src/laslib-config.cmake DESTINATION lib/cmake/LASlib) +-endif(MSVC) ++endif(0) diff --git a/ports/lastools/insecure-fprintf.diff b/ports/lastools/insecure-fprintf.diff new file mode 100644 index 0000000000..d4fa536f49 --- /dev/null +++ b/ports/lastools/insecure-fprintf.diff @@ -0,0 +1,28 @@ +diff --git a/LASzip/src/lasmessage.cpp b/LASzip/src/lasmessage.cpp +index c39d13a..e7d70cd 100644 +--- a/LASzip/src/lasmessage.cpp ++++ b/LASzip/src/lasmessage.cpp +@@ -139,8 +139,8 @@ void las_default_message_handler(LAS_MESSAGE_TYPE type, const char* msg, void* u + if (!prefix.empty()) + { + format_message(message, (unsigned)prefix.size()); +- fprintf(stderr, prefix.c_str()); +- fprintf(stderr, message.c_str()); ++ fputs(prefix.c_str(), stderr); ++ fputs(message.c_str(), stderr); + } + else + { +diff --git a/src/geoprojectionconverter.cpp b/src/geoprojectionconverter.cpp +index 1e3298d..6a80699 100644 +--- a/src/geoprojectionconverter.cpp ++++ b/src/geoprojectionconverter.cpp +@@ -4366,7 +4366,7 @@ bool GeoProjectionConverter::set_VerticalCSTypeGeoKey(short value, char* descrip + // this is where the name ends + line[run] = '\0'; + } +- if (description) sprintf(description, name); ++ if (description) sprintf(description, "%s", name); + run++; + // skip two commas + while (line[run] != ',') run++; diff --git a/ports/lastools/portfile.cmake b/ports/lastools/portfile.cmake index 6004591d18..ebd16f215e 100644 --- a/ports/lastools/portfile.cmake +++ b/ports/lastools/portfile.cmake @@ -1,33 +1,37 @@ -if (VCPKG_CMAKE_SYSTEM_NAME STREQUAL "WindowsStore") - message(FATAL_ERROR "${PORT} doesn't currently support UWP.") -endif() - -vcpkg_check_linkage(ONLY_STATIC_LIBRARY) - vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO LAStools/LAStools - REF 2bbbfa918df01b7f364d176610e9785bceb4d5de - SHA512 3744aa9e50150261cc3a52272a4cdeafdb4f678a6f6a986a9549c2efead6b4c69bc3d9a6f9f302140ce363d6da965e47b63c0310364307e9caa82c86f75a509f + REF "v${VERSION}" + SHA512 cb150562b09c5a79df1e2c730481ceda340f235e1efb7824564d1f95a9981eada087af06bc3907a777a55d315a1521fb8a09249f2aeefd9e40e6c783b9c7a11c HEAD_REF master PATCHES - "fix_install_paths_lastools.patch" - "fix_include_directories_lastools.patch" + fix_install_paths_lastools.patch + fix_include_directories_lastools.patch + build-tools.diff + insecure-fprintf.diff + signed-char.diff +) + +vcpkg_check_features(OUT_FEATURE_OPTIONS options + FEATURES + tools BUILD_TOOLS ) vcpkg_cmake_configure( SOURCE_PATH "${SOURCE_PATH}" + OPTIONS + ${options} + OPTIONS_DEBUG + -DBUILD_TOOLS=OFF ) - vcpkg_cmake_install() +vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/LASlib PACKAGE_NAME laslib) -vcpkg_cmake_config_fixup(PACKAGE_NAME LASlib CONFIG_PATH share/lastools/LASlib) +if(BUILD_TOOLS) + vcpkg_copy_tools(TOOL_NAMES las2las64 las2txt64 lascopcindex64 lasdiff64 lasindex64 lasinfo64 lasmerge64 lasprecision64 laszip64 txt2las64 AUTO_CLEAN) +endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -if(VCPKG_LIBRARY_LINKAGE STREQUAL static) - file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/bin" "${CURRENT_PACKAGES_DIR}/debug/bin") -endif() file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") -# Handle copyright -vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt") +vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt" "${SOURCE_PATH}/COPYING.txt") diff --git a/ports/lastools/signed-char.diff b/ports/lastools/signed-char.diff new file mode 100644 index 0000000000..f0006ac6a5 --- /dev/null +++ b/ports/lastools/signed-char.diff @@ -0,0 +1,13 @@ +diff --git a/src/las2txt.cpp b/src/las2txt.cpp +index 7c8a841..196ec65 100644 +--- a/src/las2txt.cpp ++++ b/src/las2txt.cpp +@@ -570,7 +570,7 @@ enum extended_flags{HSV = -1, HSL = -2, HSV255 = -3, HSL255 = -4}; + static void parse_extended_flags(char *parse_string) + { + const char *extended_flags[] = {"(HSV)", "(HSL)", "(hsv)", "(hsl)"}; +- const char replacement_codes[] = {HSV255, HSL255, HSV, HSL}; ++ const signed char replacement_codes[] = {HSV255, HSL255, HSV, HSL}; + I32 nflags = (I32)(sizeof(extended_flags) / sizeof(char*)); + + for (I32 i = 0; i < nflags; i++) diff --git a/ports/lastools/vcpkg.json b/ports/lastools/vcpkg.json index f82307dc1f..b3ae07c911 100644 --- a/ports/lastools/vcpkg.json +++ b/ports/lastools/vcpkg.json @@ -1,7 +1,6 @@ { "name": "lastools", - "version": "2.0.2+20230206", - "port-version": 1, + "version": "2.0.3", "description": "LAStools: award-winning software for efficient LiDAR processing (with LASzip)", "homepage": "https://github.com/LAStools/LAStools", "supports": "!uwp", @@ -14,5 +13,10 @@ "name": "vcpkg-cmake-config", "host": true } - ] + ], + "features": { + "tools": { + "description": "Build tools" + } + } } diff --git a/versions/baseline.json b/versions/baseline.json index 8e7703cd58..13098749c3 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -4137,8 +4137,8 @@ "port-version": 6 }, "lastools": { - "baseline": "2.0.2+20230206", - "port-version": 1 + "baseline": "2.0.3", + "port-version": 0 }, "laszip": { "baseline": "3.4.4", diff --git a/versions/l-/lastools.json b/versions/l-/lastools.json index ef2ae236c8..298abfb166 100644 --- a/versions/l-/lastools.json +++ b/versions/l-/lastools.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "ef0c4018e358e6adb7835f43588e759537401811", + "version": "2.0.3", + "port-version": 0 + }, { "git-tree": "c8eec220c3958c88af0050876e69d8b7f5d3d945", "version": "2.0.2+20230206",