2018-10-22 19:00:49 +08:00
|
|
|
vcpkg_from_github(
|
|
|
|
OUT_SOURCE_PATH SOURCE_PATH
|
|
|
|
REPO hunspell/hunspell
|
2022-08-26 01:59:30 +08:00
|
|
|
REF v1.7.1
|
|
|
|
SHA512 472249309aecbbc58a025445781268867173e0651a6147f29644975ad65af043a1e2fbe91f2094934526889c7f9944739dc0a5f0d25328a77d22db1fd8f055ec
|
2018-10-22 19:00:49 +08:00
|
|
|
HEAD_REF master
|
2022-01-24 11:28:27 +08:00
|
|
|
PATCHES
|
2021-06-10 06:28:21 +08:00
|
|
|
0001_fix_unistd.patch
|
|
|
|
0002-disable-test.patch
|
|
|
|
0003-fix-win-build.patch
|
2022-02-08 04:13:11 +08:00
|
|
|
0004-add-win-arm64.patch
|
2022-08-26 01:59:30 +08:00
|
|
|
0005-autotools-subdirs.patch
|
2022-11-25 17:09:42 +08:00
|
|
|
0006-remove-gm.patch # https://github.com/hunspell/hunspell/pull/890
|
2017-07-25 08:12:30 +08:00
|
|
|
)
|
|
|
|
|
2022-08-26 01:59:30 +08:00
|
|
|
file(REMOVE "${SOURCE_PATH}/README") #README is a symlink
|
|
|
|
configure_file("${SOURCE_PATH}/README.md" "${SOURCE_PATH}/README" COPYONLY)
|
2020-04-04 01:28:02 +08:00
|
|
|
|
2021-06-10 06:28:21 +08:00
|
|
|
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
|
|
|
|
#architecture detection
|
|
|
|
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "x86")
|
|
|
|
set(HUNSPELL_ARCH Win32)
|
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "x64")
|
|
|
|
set(HUNSPELL_ARCH x64)
|
2022-02-08 04:13:11 +08:00
|
|
|
elseif(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm64")
|
|
|
|
set(HUNSPELL_ARCH ARM64)
|
2021-06-10 06:28:21 +08:00
|
|
|
else()
|
|
|
|
message(FATAL_ERROR "unsupported architecture")
|
|
|
|
endif()
|
2022-01-24 11:28:27 +08:00
|
|
|
|
2022-08-26 01:59:30 +08:00
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
|
2021-06-10 06:28:21 +08:00
|
|
|
set(HUNSPELL_CONFIGURATION _dll)
|
|
|
|
else()
|
2022-08-26 01:59:30 +08:00
|
|
|
set(HUNSPELL_CONFIGURATION "")
|
2021-06-10 06:28:21 +08:00
|
|
|
endif()
|
2022-01-24 11:28:27 +08:00
|
|
|
|
2021-06-10 06:28:21 +08:00
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
set(HSP_TARGET hunspell)
|
|
|
|
else()
|
|
|
|
set(HSP_TARGET libhunspell)
|
|
|
|
endif()
|
2022-01-24 11:28:27 +08:00
|
|
|
|
2021-06-10 06:28:21 +08:00
|
|
|
vcpkg_install_msbuild(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
PROJECT_SUBPATH "msvc/Hunspell.sln"
|
|
|
|
INCLUDES_SUBPATH src/hunspell
|
|
|
|
PLATFORM ${HUNSPELL_ARCH}
|
|
|
|
RELEASE_CONFIGURATION Release${HUNSPELL_CONFIGURATION}
|
|
|
|
DEBUG_CONFIGURATION Debug${HUNSPELL_CONFIGURATION}
|
|
|
|
ALLOW_ROOT_INCLUDES
|
|
|
|
)
|
2022-08-26 01:59:30 +08:00
|
|
|
vcpkg_copy_pdbs()
|
|
|
|
|
|
|
|
set(HUNSPELL_EXPORT_HDR "${CURRENT_PACKAGES_DIR}/include/hunvisapi.h")
|
|
|
|
|
2021-06-10 06:28:21 +08:00
|
|
|
else()
|
|
|
|
if(VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
|
|
|
set(ENV{CFLAGS} "$ENV{CFLAGS} -DHUNSPELL_STATIC")
|
|
|
|
set(ENV{CXXFLAGS} "$ENV{CXXFLAGS} -DHUNSPELL_STATIC")
|
|
|
|
endif()
|
2022-08-26 01:59:30 +08:00
|
|
|
vcpkg_list(SET options)
|
|
|
|
if("tools" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "--enable-tools")
|
|
|
|
endif()
|
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
vcpkg_list(APPEND options "--enable-nls")
|
|
|
|
else()
|
|
|
|
set(ENV{AUTOPOINT} true) # true, the program
|
|
|
|
vcpkg_list(APPEND options "--disable-nls")
|
2021-06-10 06:28:21 +08:00
|
|
|
endif()
|
|
|
|
vcpkg_configure_make(
|
2022-08-26 01:59:30 +08:00
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
2021-06-10 06:28:21 +08:00
|
|
|
AUTOCONFIG
|
|
|
|
ADDITIONAL_MSYS_PACKAGES gzip
|
2022-08-26 01:59:30 +08:00
|
|
|
OPTIONS
|
|
|
|
${options}
|
|
|
|
OPTIONS_DEBUG
|
|
|
|
--disable-tools
|
2021-06-10 06:28:21 +08:00
|
|
|
)
|
2022-08-26 01:59:30 +08:00
|
|
|
if("nls" IN_LIST FEATURES)
|
|
|
|
vcpkg_build_make(BUILD_TARGET dist LOGFILE_ROOT build-dist)
|
|
|
|
endif()
|
2021-06-10 06:28:21 +08:00
|
|
|
vcpkg_install_make()
|
2022-01-24 11:28:27 +08:00
|
|
|
|
2021-06-10 06:28:21 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
|
|
vcpkg_fixup_pkgconfig()
|
2022-08-26 01:59:30 +08:00
|
|
|
|
|
|
|
set(HUNSPELL_EXPORT_HDR "${CURRENT_PACKAGES_DIR}/include/hunspell/hunvisapi.h")
|
2021-04-10 00:50:00 +08:00
|
|
|
endif()
|
2017-07-25 08:12:30 +08:00
|
|
|
|
2021-08-05 11:05:18 +08:00
|
|
|
if (VCPKG_LIBRARY_LINKAGE STREQUAL "static")
|
2022-08-26 01:59:30 +08:00
|
|
|
vcpkg_replace_string("${HUNSPELL_EXPORT_HDR}" "#if defined(HUNSPELL_STATIC)" "#if 1")
|
2021-08-05 11:05:18 +08:00
|
|
|
endif()
|
|
|
|
|
2021-04-10 00:50:00 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
2017-07-25 08:12:30 +08:00
|
|
|
|
2022-08-26 01:59:30 +08:00
|
|
|
vcpkg_install_copyright(
|
|
|
|
COMMENT "Hunspell is licensed under LGPL/GPL/MPL tri-license."
|
|
|
|
FILE_LIST
|
|
|
|
"${SOURCE_PATH}/license.hunspell"
|
|
|
|
"${SOURCE_PATH}/license.myspell"
|
|
|
|
"${SOURCE_PATH}/COPYING.MPL"
|
|
|
|
"${SOURCE_PATH}/COPYING"
|
|
|
|
"${SOURCE_PATH}/COPYING.LESSER"
|
|
|
|
)
|