2024-01-09 05:15:52 +08:00
|
|
|
if(NOT VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_ANDROID AND NOT VCPKG_TARGET_IS_IOS)
|
2018-03-12 14:41:51 +08:00
|
|
|
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
2022-03-17 07:22:42 +08:00
|
|
|
file(MAKE_DIRECTORY "${CURRENT_PACKAGES_DIR}/share/iconv")
|
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/iconv")
|
2018-03-12 14:41:51 +08:00
|
|
|
return()
|
|
|
|
endif()
|
|
|
|
|
2016-10-05 10:30:00 +08:00
|
|
|
vcpkg_download_distfile(ARCHIVE
|
2023-03-13 12:07:34 +08:00
|
|
|
URLS "https://ftp.gnu.org/gnu/libiconv/libiconv-${VERSION}.tar.gz"
|
|
|
|
"https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libiconv/libiconv-${VERSION}.tar.gz"
|
|
|
|
FILENAME "libiconv-${VERSION}.tar.gz"
|
2022-06-14 07:27:17 +08:00
|
|
|
SHA512 18a09de2d026da4f2d8b858517b0f26d853b21179cf4fa9a41070b2d140030ad9525637dc4f34fc7f27abca8acdc84c6751dfb1d426e78bf92af4040603ced86
|
2016-10-05 10:30:00 +08:00
|
|
|
)
|
2023-03-13 12:07:34 +08:00
|
|
|
vcpkg_extract_source_archive(SOURCE_PATH
|
2022-06-14 07:27:17 +08:00
|
|
|
ARCHIVE "${ARCHIVE}"
|
2023-03-13 12:07:34 +08:00
|
|
|
SOURCE_BASE "v${VERSION}"
|
2018-12-12 02:17:31 +08:00
|
|
|
PATCHES
|
|
|
|
0002-Config-for-MSVC.patch
|
2020-01-07 06:42:52 +08:00
|
|
|
0003-Add-export.patch
|
2021-07-27 02:07:56 +08:00
|
|
|
0004-ModuleFileName.patch
|
2023-03-13 12:07:34 +08:00
|
|
|
clang-fortify.patch # ported from https://git.savannah.gnu.org/cgit/gnulib.git/commit/?id=522aea1093a598246346b3e1c426505c344fe19a
|
2018-12-12 02:17:31 +08:00
|
|
|
)
|
2016-10-05 10:30:00 +08:00
|
|
|
|
2023-03-13 12:07:34 +08:00
|
|
|
vcpkg_list(SET OPTIONS)
|
2021-01-26 07:52:09 +08:00
|
|
|
if (NOT VCPKG_TARGET_IS_ANDROID)
|
2023-03-13 12:07:34 +08:00
|
|
|
vcpkg_list(APPEND OPTIONS --enable-relocatable)
|
2021-01-26 07:52:09 +08:00
|
|
|
endif()
|
|
|
|
|
2022-04-07 05:02:37 +08:00
|
|
|
vcpkg_configure_make(
|
|
|
|
SOURCE_PATH "${SOURCE_PATH}"
|
|
|
|
DETERMINE_BUILD_TRIPLET
|
|
|
|
USE_WRAPPERS
|
|
|
|
OPTIONS
|
|
|
|
--enable-extra-encodings
|
|
|
|
--without-libiconv-prefix
|
|
|
|
--without-libintl-prefix
|
|
|
|
${OPTIONS}
|
|
|
|
)
|
2020-11-18 01:18:59 +08:00
|
|
|
vcpkg_install_make()
|
2018-03-12 14:41:51 +08:00
|
|
|
|
2018-01-05 12:32:31 +08:00
|
|
|
vcpkg_copy_pdbs()
|
2022-03-17 07:22:42 +08:00
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/bin")
|
|
|
|
vcpkg_copy_tool_dependencies("${CURRENT_PACKAGES_DIR}/tools/${PORT}/debug/bin")
|
2016-10-05 10:30:00 +08:00
|
|
|
|
2022-03-17 07:22:42 +08:00
|
|
|
file(COPY "${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake" DESTINATION "${CURRENT_PACKAGES_DIR}/share/iconv")
|
2020-06-02 08:55:23 +08:00
|
|
|
|
2021-01-25 16:15:40 +08:00
|
|
|
set(VCPKG_POLICY_ALLOW_RESTRICTED_HEADERS enabled)
|
2022-03-17 07:22:42 +08:00
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
|
|
|
|
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/${PORT}") # share contains unneeded doc files
|
|
|
|
|
2022-04-07 05:02:37 +08:00
|
|
|
# Please keep, the default usage is broken
|
|
|
|
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
|
2022-06-14 07:27:17 +08:00
|
|
|
file(READ "${SOURCE_PATH}/COPYING.LIB" copying_lib)
|
|
|
|
file(READ "${SOURCE_PATH}/COPYING" copying_tool)
|
|
|
|
file(WRITE "${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright" "
|
|
|
|
The libiconv and libcharset libraries and their header files are under LGPL,
|
|
|
|
see COPYING.LIB below.
|
|
|
|
|
|
|
|
The iconv program and the documentation are under GPL, see COPYING below.
|
|
|
|
|
|
|
|
# COPYING.LIB
|
|
|
|
|
|
|
|
${copying_lib}
|
|
|
|
|
|
|
|
# COPYING
|
|
|
|
|
|
|
|
${copying_tool}
|
|
|
|
")
|