From acca474962d8bc714ba555ec0c21b0dabee4e79d Mon Sep 17 00:00:00 2001 From: Kai Pastor Date: Tue, 10 May 2022 20:37:35 +0200 Subject: [PATCH] [lerc] Update to 3.0, move config to unofficial (#24634) * Update to 3.0 * Modernize portfile * Install NOTICE as required by license * Move CMake config to unofficial namespace The target name changed, so old configs would break anyways, without polyfill. The unofficial namespace reflects such risks. * Add include path to CMake config * Update versions --- ports/lerc/create_package.patch | 23 ++++++++------------ ports/lerc/enable_static_build.patch | 16 -------------- ports/lerc/install_lib_to_archive_path.patch | 16 -------------- ports/lerc/portfile.cmake | 20 +++++++---------- ports/lerc/vcpkg.json | 16 +++++++++++--- versions/baseline.json | 4 ++-- versions/l-/lerc.json | 5 +++++ 7 files changed, 37 insertions(+), 63 deletions(-) delete mode 100644 ports/lerc/enable_static_build.patch delete mode 100644 ports/lerc/install_lib_to_archive_path.patch diff --git a/ports/lerc/create_package.patch b/ports/lerc/create_package.patch index 7b06c119ba..166c3f43bc 100644 --- a/ports/lerc/create_package.patch +++ b/ports/lerc/create_package.patch @@ -1,26 +1,21 @@ - CMakeLists.txt | 8 +++++++- - 1 file changed, 7 insertions(+), 1 deletion(-) - diff --git a/CMakeLists.txt b/CMakeLists.txt index e90fcdd..17c79e8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -17,7 +17,7 @@ add_library(LercLib ${SOURCES}) - target_link_libraries (LercLib) +@@ -26,9 +26,16 @@ add_library(LercLib ${SOURCES}) + endif() install( -- TARGETS LercLib -+ TARGETS LercLib EXPORT LercTargets + TARGETS Lerc ++ EXPORT LercTargets LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} -@@ -28,3 +28,9 @@ install( - FILES "include/Lerc_types.h" "include/Lerc_c_api.h" - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} ) -+ ++target_include_directories(Lerc PUBLIC "$") +install(EXPORT LercTargets -+ FILE lercConfig.cmake -+ NAMESPACE Esri:: -+ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/lerc" ++ FILE unofficial-lerc-config.cmake ++ NAMESPACE unofficial::Lerc:: ++ DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/unofficial-lerc" +) diff --git a/ports/lerc/enable_static_build.patch b/ports/lerc/enable_static_build.patch deleted file mode 100644 index 92f0d7852c..0000000000 --- a/ports/lerc/enable_static_build.patch +++ /dev/null @@ -1,16 +0,0 @@ - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index d22ad11..e90fcdd 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -12,7 +12,7 @@ file(GLOB SOURCES - ) - message(${SOURCES}) - --add_library(LercLib SHARED ${SOURCES}) -+add_library(LercLib ${SOURCES}) - - target_link_libraries (LercLib) - diff --git a/ports/lerc/install_lib_to_archive_path.patch b/ports/lerc/install_lib_to_archive_path.patch deleted file mode 100644 index 3262a7ca55..0000000000 --- a/ports/lerc/install_lib_to_archive_path.patch +++ /dev/null @@ -1,16 +0,0 @@ - CMakeLists.txt | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/CMakeLists.txt b/CMakeLists.txt -index ececeed..d22ad11 100644 ---- a/CMakeLists.txt -+++ b/CMakeLists.txt -@@ -20,7 +20,7 @@ install( - TARGETS LercLib - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR} -- ARCHIVE DESTINATION ${CMAKE_INSTALL_BINDIR} -+ ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} - PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) - diff --git a/ports/lerc/portfile.cmake b/ports/lerc/portfile.cmake index 5b3060f434..2b92c7022d 100644 --- a/ports/lerc/portfile.cmake +++ b/ports/lerc/portfile.cmake @@ -1,24 +1,20 @@ vcpkg_from_github( OUT_SOURCE_PATH SOURCE_PATH REPO Esri/lerc - REF v2.2 - SHA512 5ddf1e8f0c123d3c1329e980021e25e6ff9b79c96588115e5b48ba7637f0b2bf3ebb2ab6ebf94cfbde45ea1521f14405f669e23f0b74d9ae8f9b2cf80a908215 + REF v3.0 + SHA512 8e04d890c4d46528641b354ec3f47f2b0563e1740927ac894925a30f7de2b235cb3517ce7e477886bd3eb50ebd6c6e78f22d73d5500877e552d9e684e626293b HEAD_REF master PATCHES - "install_lib_to_archive_path.patch" - "enable_static_build.patch" "create_package.patch" ) -vcpkg_configure_cmake( - SOURCE_PATH ${SOURCE_PATH} - PREFER_NINJA +vcpkg_cmake_configure( + SOURCE_PATH "${SOURCE_PATH}" ) - -vcpkg_install_cmake() -vcpkg_fixup_cmake_targets() +vcpkg_cmake_install() +vcpkg_cmake_config_fixup(PACKAGE_NAME unofficial-lerc) file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") -file(INSTALL ${SOURCE_PATH}/LICENSE DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) - +file(INSTALL "${SOURCE_PATH}/NOTICE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}") +file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) diff --git a/ports/lerc/vcpkg.json b/ports/lerc/vcpkg.json index 6772a248b3..22939ae2f9 100644 --- a/ports/lerc/vcpkg.json +++ b/ports/lerc/vcpkg.json @@ -1,7 +1,17 @@ { "name": "lerc", - "version-string": "2.2", - "port-version": 2, + "version": "3.0", "description": "An open-source image or raster format which supports rapid encoding and decoding for any pixel type", - "homepage": "https://github.com/Esri/lerc" + "homepage": "https://github.com/Esri/lerc", + "license": "Apache-2.0", + "dependencies": [ + { + "name": "vcpkg-cmake", + "host": true + }, + { + "name": "vcpkg-cmake-config", + "host": true + } + ] } diff --git a/versions/baseline.json b/versions/baseline.json index 7155754826..a106b41d4f 100644 --- a/versions/baseline.json +++ b/versions/baseline.json @@ -3369,8 +3369,8 @@ "port-version": 0 }, "lerc": { - "baseline": "2.2", - "port-version": 2 + "baseline": "3.0", + "port-version": 0 }, "lest": { "baseline": "1.35.1", diff --git a/versions/l-/lerc.json b/versions/l-/lerc.json index d414aab0e6..a65b52371a 100644 --- a/versions/l-/lerc.json +++ b/versions/l-/lerc.json @@ -1,5 +1,10 @@ { "versions": [ + { + "git-tree": "3037b9fd610059bc84e89607a3e58aa13641cdd8", + "version": "3.0", + "port-version": 0 + }, { "git-tree": "81c91f19fa142f53370b1a7ecac53fd2ba10aaf6", "version-string": "2.2",