vcpkg/ports/libunistring/portfile.cmake
Daniel Collins 8288d7ee5d
[libunistring] Add support for building on Windows (#24253)
* [libunistring] Add support for building on Windows

Tweaked the portfile to no longer trigger autotools as it
caused more problems when trying to build for MSVC, so the
old automake patch is no longer needed.

The awk script used in configure should've worked, but seems
to somehow get double-interpolated somewhere along the way in
such a way as to strip out quotes needed in the script, so
put in in a dedicated script.

Added wrappers so the build scripts can use "nm" and "ar" as
if this were a UNIX target.

Fixed compiler output (warnings) getting merged with dumpbin
output and putting garbage into lib/config.h

* [libunistring] Fix non-x64 Windows builds.

* [libunistring] Bump port-version

* vcpkg x-add-version --all

* [libunistring] Mark failure under UWP as expected

* [libunistring] Remove my wrapper scripts in favour of built-in ones.

* vcpkg x-add-version --all

* [libunistring] UWP isn't supported.

* vcpkg x-add-version --all
2022-04-21 14:30:13 -07:00

35 lines
1.3 KiB
CMake

set(LIBUNISTRING_VERSION 0.9.10)
set(LIBUNISTRING_FILENAME libunistring-${LIBUNISTRING_VERSION}.tar.gz)
vcpkg_download_distfile(ARCHIVE
URLS
"https://ftp.gnu.org/gnu/libunistring/${LIBUNISTRING_FILENAME}"
"https://www.mirrorservice.org/sites/ftp.gnu.org/gnu/libunistring/${LIBUNISTRING_FILENAME}"
FILENAME "${LIBUNISTRING_FILENAME}"
SHA512 690082732fbbd47ab4ffbd6f21d85afece0f8e2ded24982f949f4ae52bf0a981b75ea9bc14ab289e0954cde07f31a7a4c2bb65615a8eb5b2bfa65720310b6fc9
)
vcpkg_extract_source_archive_ex(
OUT_SOURCE_PATH SOURCE_PATH
ARCHIVE "${ARCHIVE}"
REF ${LIBUNISTRING_VERSION}
PATCHES libunistring-msys-msvc-build.patch
)
vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
COPY_SOURCE
USE_WRAPPERS
OPTIONS
"--with-libiconv-prefix=${CURRENT_INSTALLED_DIR}"
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share")
# copyright excerpt from README, to cover dual license under "LGPLv3+ or GPLv2".
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/copyright" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING.LIB" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
file(INSTALL "${SOURCE_PATH}/COPYING" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")