Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vcpkg baseline][nuspell] Add and fix feature tools #24542

Merged
Merged
Show file tree
Hide file tree
Changes from all 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
30 changes: 30 additions & 0 deletions ports/nuspell/fix-tools.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7b54c54..7c6f3a3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -12,7 +12,10 @@ find_package(ICU 60 REQUIRED COMPONENTS uc data)
get_directory_property(subproject PARENT_DIRECTORY)

add_subdirectory(src/nuspell)
+option(BUILD_TOOLS "Build the tools." OFF)
+if (BUILD_TOOLS)
add_subdirectory(src/tools)
+endif()

if (subproject)
# if added as subproject just build Nuspell
diff --git a/src/tools/CMakeLists.txt b/src/tools/CMakeLists.txt
index 3e63610..9be98be 100644
--- a/src/tools/CMakeLists.txt
+++ b/src/tools/CMakeLists.txt
@@ -3,6 +3,10 @@ set_target_properties(nuspell-exe PROPERTIES RUNTIME_OUTPUT_NAME nuspell)
target_compile_definitions(nuspell-exe PRIVATE
PROJECT_VERSION=\"${PROJECT_VERSION}\")
target_link_libraries(nuspell-exe Nuspell::nuspell)
+if (WIN32)
+ find_library(GETOPT_WIN32_LIBRARY getopt)
+ target_link_libraries(nuspell-exe Nuspell::nuspell ${GETOPT_WIN32_LIBRARY})
+endif()
if (BUILD_SHARED_LIBS AND WIN32)
# This should be PRE_LINK (or PRE_BUILD), so Vcpkg's POST_BUILD
# step (see VCPKG_APPLOCAL_DEPS) that copies dll can pick up nuspell.dll
17 changes: 16 additions & 1 deletion ports/nuspell/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,38 @@ vcpkg_from_github(
REF v5.1.0
SHA512 08ce776d224c66ba4bdd8cb22943741f30e8e5ba03396bfef1db598321c9b0f8814dacffcb52287b3b669426c7b08e2c1a40323341a9ff9768a7187002e1d77a
HEAD_REF master
PATCHES fix-tools.patch
)

vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tools BUILD_TOOLS
)

vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${FEATURE_OPTIONS}
-DBUILD_TESTING=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()

vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/nuspell)
vcpkg_fixup_pkgconfig(
# nuspell.pc depends on icu-uc.pc which has -lm specified as private
# library. Ignore this -lm, otherwise this function shows error
# because it can't find this. -lm is part of glibc on Linux.
SYSTEM_LIBRARIES m
)
vcpkg_copy_tools(TOOL_NAMES nuspell AUTO_CLEAN)

if (BUILD_TOOLS)
vcpkg_copy_tools(TOOL_NAMES nuspell AUTO_CLEAN)
endif()

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

file(INSTALL "${SOURCE_PATH}/COPYING.LESSER" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
11 changes: 10 additions & 1 deletion ports/nuspell/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{
"name": "nuspell",
"version-semver": "5.1.0",
"port-version": 1,
"description": [
"Nuspell is a fast and safe spelling checker software program.",
"It is designed for languages with rich morphology and complex word compounding.",
Expand All @@ -18,5 +19,13 @@
"name": "vcpkg-cmake-config",
"host": true
}
]
],
"features": {
"tools": {
"description": "Build tools",
"dependencies": [
"getopt"
]
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -4922,7 +4922,7 @@
},
"nuspell": {
"baseline": "5.1.0",
"port-version": 0
"port-version": 1
},
"nvtt": {
"baseline": "2.1.2",
Expand Down
5 changes: 5 additions & 0 deletions versions/n-/nuspell.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "02475776fc8cc0332efe7e0ea8851872c911de32",
"version-semver": "5.1.0",
"port-version": 1
},
{
"git-tree": "53fb93bbc0d441813026ef171e32d7479ab839f3",
"version-semver": "5.1.0",
Expand Down