Skip to content
Merged
Show file tree
Hide file tree
Changes from 13 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions ports/libinterpolate/fix-version-detection.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
index 3aea49a..b21d330 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,9 +17,18 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH}
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

if("${libInterpolate_VERSION}" STREQUAL "UNKNOWN")
- message(STATUS "Detecting version number using git...")
- include(macro-git_version)
- git_version(libInterpolate)
+ find_package(Git QUIET)
+ if(Git_FOUND AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/.git")
+ message(STATUS "Detecting version number using git...")
+ include(macro-git_version)
+ git_version(libInterpolate)
+ else()
+ message(STATUS "Git not found or not a git repository. Setting default version.")
+ set(libInterpolate_VERSION "0.0.0" CACHE STRING "Library version number" FORCE)
+ set(libInterpolate_VERSION_MAJOR "0" CACHE INTERNAL "Library major version number")
+ set(libInterpolate_VERSION_MINOR "0" CACHE INTERNAL "Library minor version number")
+ set(libInterpolate_VERSION_PATCH "0" CACHE INTERNAL "Library patch version number")
+ endif()
message(STATUS "Version: ${libInterpolate_VERSION}")
message(STATUS "Version (Full): ${libInterpolate_VERSION_FULL}")
endif()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAICS this patch isn't needed: When libInterpolate_VERSION is passed as an input variable, the section is never entered.
And libInterpolate_VERSION_FULL isn't used anyways.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought that a fallback might be useful. Anyway, removed


29 changes: 29 additions & 0 deletions ports/libinterpolate/portfile.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO CD3/libInterpolate
REF ${VERSION}
SHA512 6d53e1fb3af3067ddd13e491563e8da5af9756efba5a2def486f014c23969633ca73cf43dd2f93047716ebb6565f5e9911b6ab85abef2db3b9faefc26ab3aa59
HEAD_REF master
PATCHES
fix-version-detection.patch
)

set(VCPKG_BUILD_TYPE release) # header-only port

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DBUILD_TESTS=OFF
-DlibInterpolate_VERSION=${VERSION}
)

vcpkg_cmake_install()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/libInterpolate)
vcpkg_fixup_pkgconfig()

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug")

This doesn't exist with VCPKG_BUILD_TYPE release.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed

file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/lib")

file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
file(INSTALL "${SOURCE_PATH}/LICENSE.md" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
configure_file("${CMAKE_CURRENT_LIST_DIR}/usage" "${CURRENT_PACKAGES_DIR}/share/${PORT}/usage" COPYONLY)
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.md")

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, good suggestion. added

4 changes: 4 additions & 0 deletions ports/libinterpolate/usage
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The package libInterpolate is header only and can be used from CMake via:

find_package(libInterpolate CONFIG REQUIRED)
target_link_libraries(main PRIVATE libInterpolate::Interpolate)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This probably mostly identical to the heuristical output?

Suggested change
The package libInterpolate is header only and can be used from CMake via:
find_package(libInterpolate CONFIG REQUIRED)
target_link_libraries(main PRIVATE libInterpolate::Interpolate)
libinterpolate provides CMake targets:
find_package(libInterpolate CONFIG REQUIRED)
target_link_libraries(main PRIVATE libInterpolate::Interpolate)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

35 changes: 35 additions & 0 deletions ports/libinterpolate/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "libinterpolate",
"version": "2.7.1",
"description": "Header-only C++ interpolation library.",
"homepage": "https://github.com/CD3/libInterpolate",
"license": "MIT",
"dependencies": [
"boost-geometry",
"boost-headers",
"boost-lexical-cast",
"boost-mpl",
"boost-program-options",
"boost-range",
"boost-tokenizer",
"boost-type-erasure",
"boost-type-traits",
{
"name": "eigen3",
"host": true,
"version>=": "3.4.0"
},
Comment thread
Niproblema marked this conversation as resolved.
Outdated
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
]
}
4 changes: 4 additions & 0 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4768,6 +4768,10 @@
"baseline": "2023-05-13",
"port-version": 0
},
"libinterpolate": {
"baseline": "2.7.1",
"port-version": 0
},
"libirecovery": {
"baseline": "2023-05-13",
"port-version": 2
Expand Down
9 changes: 9 additions & 0 deletions versions/l-/libinterpolate.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"versions": [
{
"git-tree": "ae153a19d43433e9dccd2f8cc7d8f925e5e9d4ba",
"version": "2.7.1",
"port-version": 0
}
]
}