diff --git a/ports/harfbuzz/0001-fix-uwp-build.patch b/ports/harfbuzz/0001-fix-uwp-build.patch new file mode 100644 index 000000000..532ce668e --- /dev/null +++ b/ports/harfbuzz/0001-fix-uwp-build.patch @@ -0,0 +1,15 @@ +diff --git "a/harfbuzz-1.4.6/src/hb-ft.cc" "b/harfbuzz-1.4.6/src/hb-ft.cc" +index 48d6a0ef..f4ce6608 100644 +--- "a/harfbuzz-1.4.6/src/hb-ft.cc" ++++ "b/harfbuzz-1.4.6/src/hb-ft.cc" +@@ -31,6 +31,10 @@ + + #include "hb-ft.h" + ++#if defined(WINAPI_FAMILY) && (WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP) ++#define generic GenericFromFreeTypeLibrary ++#endif ++ + #include "hb-font-private.hh" + + #include "hb-cache-private.hh" // Maybe use in the future? diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 6ebe28f37..cff52498a 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.4.6 +Version: 1.4.6-1 Description: HarfBuzz OpenType text shaping engine -Build-Depends: freetype, glib +Build-Depends: freetype, glib [x86], glib [x64] diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 8c77d1efe..367d12246 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -7,13 +7,26 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) +vcpkg_apply_patches( + SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/ + PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-fix-uwp-build.patch" +) + +if(VCPKG_TARGET_ARCHITECTURE STREQUAL "arm") + SET(HAVE_GLIB "OFF") + SET(BUILTIN_UCDN "ON") +else() + SET(HAVE_GLIB "ON") + SET(BUILTIN_UCDN "OFF") +endif() + vcpkg_configure_cmake( SOURCE_PATH ${SOURCE_PATH} PREFER_NINJA OPTIONS -DHB_HAVE_FREETYPE=ON - -DHB_HAVE_GLIB=ON - -DHB_BUILTIN_UCDN=OFF + -DHB_HAVE_GLIB=${HAVE_GLIB} + -DHB_BUILTIN_UCDN=${BUILTIN_UCDN} OPTIONS_DEBUG -DSKIP_INSTALL_HEADERS=ON )