aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Neumann <30894796+Neumann-A@users.noreply.github.com>2021-04-09 18:50:00 +0200
committerGitHub <noreply@github.com>2021-04-09 09:50:00 -0700
commit5c19a00f26a40fa08f667de48a83ae4617ba0f86 (patch)
tree8ef4434e1c6da9931c1b0ee8206e09b6b6f0392b
parent4a03e7456939043161cebebab3ead59443cd3d21 (diff)
downloadvcpkg-5c19a00f26a40fa08f667de48a83ae4617ba0f86.tar.gz
vcpkg-5c19a00f26a40fa08f667de48a83ae4617ba0f86.zip
[hunspell] switch to make to enable build of hunspell tools (#17148)
* [hunspell] switch to make to enable build of hunspell tools * version stuff
-rw-r--r--ports/hunspell/CMakeLists.txt159
-rw-r--r--ports/hunspell/CONTROL8
-rw-r--r--ports/hunspell/config.h.in35
-rw-r--r--ports/hunspell/portfile.cmake37
-rw-r--r--ports/hunspell/vcpkg.json22
-rw-r--r--versions/baseline.json2
-rw-r--r--versions/h-/hunspell.json5
7 files changed, 50 insertions, 218 deletions
diff --git a/ports/hunspell/CMakeLists.txt b/ports/hunspell/CMakeLists.txt
deleted file mode 100644
index dd3715a10..000000000
--- a/ports/hunspell/CMakeLists.txt
+++ /dev/null
@@ -1,159 +0,0 @@
-cmake_minimum_required(VERSION 3.0)
-project(hunspell)
-
-#get hunspell version
-file(STRINGS "configure.ac" CONFIGURE_AC_INIT REGEX "AC_INIT\\(\\[hunspell\\],\\[.*\\].*" )
-string(REGEX REPLACE "AC_INIT\\(\\[.*\\],\\[([0-9]+\\.[0-9]+\\.[0-9]+)\\].*" "\\1" VERSION ${CONFIGURE_AC_INIT})
-message(STATUS "Hunspell version: ${VERSION}")
-
-option(BUILD_SHARED_LIBS "Build shared libs" OFF)
-option(ENABLE_NLS "Define if translation of program messages to the user's native language is requested" OFF)
-option(HUNSPELL_WARNING_ON "Define if you need warning messages" OFF)
-
-if(NOT BUILD_SHARED_LIBS)
- add_definitions(-DHUNSPELL_STATIC)
-endif()
-
-if(MSVC)
- add_definitions(-D_CRT_SECURE_NO_WARNINGS)
-endif()
-
-include_directories("src/hunspell")
-include_directories("src/parsers")
-
-#libhunspell
-set(LIBHUNSPELL_SRCS
- src/hunspell/affentry.cxx
- src/hunspell/affixmgr.cxx
- src/hunspell/csutil.cxx
- src/hunspell/hashmgr.cxx
- src/hunspell/hunspell.cxx
- src/hunspell/suggestmgr.cxx
- src/hunspell/phonet.cxx
- src/hunspell/filemgr.cxx
- src/hunspell/hunzip.cxx
- src/hunspell/replist.cxx
- src/hunspell/affentry.hxx
- src/hunspell/htypes.hxx
- src/hunspell/affixmgr.hxx
- src/hunspell/csutil.hxx
- src/hunspell/atypes.hxx
- src/hunspell/suggestmgr.hxx
- src/hunspell/baseaffix.hxx
- src/hunspell/hashmgr.hxx
- src/hunspell/langnum.hxx
- src/hunspell/phonet.hxx
- src/hunspell/filemgr.hxx
- src/hunspell/hunzip.hxx
- src/hunspell/replist.hxx
-)
-
-set(LIBHUNSPELL_HDRS
- src/hunspell/hunspell.hxx
- src/hunspell/hunspell.h
- src/hunspell/hunvisapi.h
- src/hunspell/w_char.hxx
- src/hunspell/atypes.hxx
- src/hunspell/csutil.hxx
- src/hunspell/htypes.hxx
-)
-
-#hunspell/libhunspell
-add_library(libhunspell ${LIBHUNSPELL_HDRS} ${LIBHUNSPELL_SRCS})
-
-#Avoid automatically added lib prefix 'lib' for hunspell
-set_target_properties(libhunspell PROPERTIES PREFIX "")
-
-target_compile_definitions(libhunspell PRIVATE -DBUILDING_LIBHUNSPELL)
-install(TARGETS libhunspell
- ARCHIVE DESTINATION lib
- LIBRARY DESTINATION lib
- RUNTIME DESTINATION bin
-)
-
-#parsers/libparsers
-set(LIBPARSERS_SRCS
- src/parsers/firstparser.cxx
- src/parsers/xmlparser.cxx
- src/parsers/latexparser.cxx
- src/parsers/manparser.cxx
- src/parsers/textparser.cxx
- src/parsers/htmlparser.cxx
- src/parsers/odfparser.cxx
-)
-add_library(libparsers OBJECT ${LIBPARSERS_SRCS})
-
-#parsers/testparser
-set(TESTPARSER_SRCS
- src/parsers/firstparser.cxx
- src/parsers/firstparser.hxx
- src/parsers/xmlparser.cxx
- src/parsers/xmlparser.hxx
- src/parsers/latexparser.cxx
- src/parsers/latexparser.hxx
- src/parsers/manparser.cxx
- src/parsers/manparser.hxx
- src/parsers/testparser.cxx
- src/parsers/textparser.cxx
- src/parsers/textparser.hxx
- src/parsers/htmlparser.cxx
- src/parsers/htmlparser.hxx
- src/parsers/odfparser.hxx
- src/parsers/odfparser.cxx
-)
-
-if(NOT CMAKE_SYSTEM_NAME STREQUAL "WindowsStore" AND CMAKE_BUILD_TYPE STREQUAL "Release" AND BUILD_TOOLS)
- add_executable(testparser ${TESTPARSER_SRCS})
- target_link_libraries(testparser libhunspell)
-
- #tools/analyze
- add_executable(analyze "src/tools/analyze.cxx")
- target_link_libraries(analyze libhunspell)
-
- #tools/chmorph
- add_executable(chmorph "src/tools/chmorph.cxx" $<TARGET_OBJECTS:libparsers>)
- target_link_libraries(chmorph libhunspell)
-
- #tools/hunspell
- include(CheckIncludeFile)
- check_include_file("curses.h" HAVE_CURSES_H)
- check_include_file("langinfo.h" HAVE_LANGINFO_CODESET)
- check_include_file("libintl.h" HAVE_LIBINTL_H)
- check_include_file("locale.h" HAVE_LOCALE_H)
- check_include_file("ncursesw/curses.h" HAVE_NCURSESW_H)
- check_include_file("unistd.h" HAVE_UNISTD_H)
- configure_file("config.h.in" "config.h")
-
- add_executable(hunspell "src/tools/hunspell.cxx" $<TARGET_OBJECTS:libparsers>)
- target_include_directories(hunspell PRIVATE "${CMAKE_CURRENT_BINARY_DIR}")
- target_link_libraries(hunspell libhunspell)
-
- #tools/munch
- add_executable(munch "src/tools/munch.cxx")
-
- #tools/unmunch
- add_executable(unmunch "src/tools/unmunch.cxx")
-
- #tools/hzip
- #add_executable(hzip "src/tools/hzip.cxx")
- #target_link_libraries(hzip libhunspell)
-
- #tools/hunzip
- add_executable(hunzip "src/tools/hunzip.cxx")
- target_link_libraries(hunzip libhunspell)
-
- install(
- TARGETS
- hunspell
- testparser
- analyze
- chmorph
- munch
- unmunch
- # hzip
- hunzip
- DESTINATION tools/hunspell
- )
-endif()
-
-install(FILES ${LIBHUNSPELL_HDRS} DESTINATION "include/hunspell/")
diff --git a/ports/hunspell/CONTROL b/ports/hunspell/CONTROL
deleted file mode 100644
index 229d5ca93..000000000
--- a/ports/hunspell/CONTROL
+++ /dev/null
@@ -1,8 +0,0 @@
-Source: hunspell
-Version: 1.7.0
-Port-Version: 2
-Homepage: https://github.com/hunspell/hunspell
-Description: The most popular spellchecking library.
-
-Feature: tools
-Description: Build hunspell tools
diff --git a/ports/hunspell/config.h.in b/ports/hunspell/config.h.in
deleted file mode 100644
index c659d1c52..000000000
--- a/ports/hunspell/config.h.in
+++ /dev/null
@@ -1,35 +0,0 @@
-
-/* Define to 1 if translation of program messages to the user's native language is requested. */
-#cmakedefine ENABLE_NLS 1
-
-/* "Define if you have the <curses.h> header" */
-#cmakedefine HAVE_CURSES_H 1
-
-/* Define if you have the iconv() function. */
-#cmakedefine HAVE_ICONV 1
-
-/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */
-#cmakedefine HAVE_LANGINFO_CODESET 1
-
-/* Define to 1 if you have the <libintl.h> header file. */
-#cmakedefine HAVE_LIBINTL_H 1
-
-/* Define to 1 if you have the <locale.h> header file. */
-#cmakedefine HAVE_LOCALE_H 1
-
-/* "Define if you have the <ncursesw/curses.h> header" */
-#cmakedefine HAVE_NCURSESW_H 1
-
-/* "Define if you have fancy command input editing with Readline" */
-#cmakedefine HAVE_READLINE 1
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#cmakedefine HAVE_UNISTD_H 1
-
-/* Define if you need warning messages */
-#cmakedefine HUNSPELL_WARNING_ON 1
-
-/* Define as const if the declaration of iconv() needs const. */
-#cmakedefine ICONV_CONST const
-
-#cmakedefine VERSION "@VERSION@" \ No newline at end of file
diff --git a/ports/hunspell/portfile.cmake b/ports/hunspell/portfile.cmake
index a1acdfb97..071a52ad2 100644
--- a/ports/hunspell/portfile.cmake
+++ b/ports/hunspell/portfile.cmake
@@ -7,29 +7,36 @@ vcpkg_from_github(
PATCHES 0001_fix_unistd.patch
)
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH})
-file(COPY ${CMAKE_CURRENT_LIST_DIR}/config.h.in DESTINATION ${SOURCE_PATH})
-
-if ("tools" IN_LIST FEATURES AND NOT VCPKG_TARGET_IS_WINDOWS)
- message(FATAL_ERROR "Feature tools is only supported on Windows platforms.")
-endif()
-
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
tools BUILD_TOOLS
)
-vcpkg_configure_cmake(
+if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
+ set(ENV{CFLAGS} "$ENV{CFLAGS} -DHUNSPELL_STATIC")
+ set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -DHUNSPELL_STATIC")
+endif()
+if(NOT "tools" IN_LIST FEATURES) # Building the tools is not possible on windows!
+ file(READ "${SOURCE_PATH}/src/Makefile.am" _contents)
+ string(REPLACE " parsers tools" "" _contents "${_contents}")
+ file(WRITE "${SOURCE_PATH}/src/Makefile.am" "${_contents}")
+endif()
+vcpkg_add_to_path("${CURRENT_HOST_INSTALLED_DIR}/tools/gettext/bin")
+vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
- PREFER_NINJA
- OPTIONS ${FEATURE_OPTIONS}
+ OPTIONS
+ AUTOCONFIG
+ ADDITIONAL_MSYS_PACKAGES gzip
)
-
-vcpkg_install_cmake()
+#install-pkgconfDATA:
+vcpkg_build_make(BUILD_TARGET dist LOGFILE_ROOT build-dist)
+vcpkg_install_make()
vcpkg_copy_pdbs()
+vcpkg_fixup_pkgconfig()
-file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include)
-
-vcpkg_copy_tool_dependencies(${CURRENT_PACKAGES_DIR}/tools/${PORT})
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
+file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug")
+vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
file(INSTALL ${SOURCE_PATH}/COPYING.LESSER DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright-lgpl)
file(INSTALL ${SOURCE_PATH}/COPYING.MPL DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright-mpl)
diff --git a/ports/hunspell/vcpkg.json b/ports/hunspell/vcpkg.json
new file mode 100644
index 000000000..112062df3
--- /dev/null
+++ b/ports/hunspell/vcpkg.json
@@ -0,0 +1,22 @@
+{
+ "name": "hunspell",
+ "version-string": "1.7.0",
+ "port-version": 3,
+ "description": "The most popular spellchecking library.",
+ "homepage": "https://github.com/hunspell/hunspell",
+ "dependencies": [
+ {
+ "name": "gettext",
+ "host": true,
+ "features": [
+ "tools"
+ ]
+ },
+ "libiconv"
+ ],
+ "features": {
+ "tools": {
+ "description": "Build hunspell tools"
+ }
+ }
+}
diff --git a/versions/baseline.json b/versions/baseline.json
index 965dc2b14..a56aa6baf 100644
--- a/versions/baseline.json
+++ b/versions/baseline.json
@@ -2466,7 +2466,7 @@
},
"hunspell": {
"baseline": "1.7.0",
- "port-version": 2
+ "port-version": 3
},
"hwloc": {
"baseline": "2.2.0",
diff --git a/versions/h-/hunspell.json b/versions/h-/hunspell.json
index e74ce46d6..b3f6e505a 100644
--- a/versions/h-/hunspell.json
+++ b/versions/h-/hunspell.json
@@ -1,6 +1,11 @@
{
"versions": [
{
+ "git-tree": "b943abf7281879a8f3ab2c2c14ea5da7cf735dae",
+ "version-string": "1.7.0",
+ "port-version": 3
+ },
+ {
"git-tree": "2d430ba4b4104cdf4f38babf9918c292d7d90b7e",
"version-string": "1.7.0",
"port-version": 2