From 1df57b358591a6bf9fa60955a65b8944f20547f2 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:25:24 +0100 Subject: [PATCH 1/4] [harfbuzz] add glib support --- ports/harfbuzz/portfile.cmake | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 911dea8606..83f2679120 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -21,18 +21,31 @@ vcpkg_download_distfile(ARCHIVE ) vcpkg_extract_source_archive(${ARCHIVE}) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" FREETYPE_INCLUDE_DIR) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" FREETYPE_LIB_DIR_DBG) -file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" FREETYPE_LIB_DIR_REL) +file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */") + +# for GObject support, harfbuzz expects glib-mkenums tool (perl script) to be availible in $(PREFIX)/bin +file(COPY ${CURRENT_INSTALLED_DIR}/tools/glib/glib-mkenums DESTINATION ${SOURCE_PATH}/bin) +vcpkg_find_acquire_program(PERL) + +file(TO_NATIVE_PATH "${PERL}" PERL_INTERPRETER) +file(TO_NATIVE_PATH "${SOURCE_PATH}" MKENUMS_TOOL_DIR) + +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/include" INCLUDE_DIR) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/debug/lib" LIB_DIR_DBG) +file(TO_NATIVE_PATH "${VCPKG_ROOT_DIR}/installed/${TARGET_TRIPLET}/lib" LIB_DIR_REL) + +set(DEPENDENCIES FREETYPE=1 GLIB=1 GOBJECT=1) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_DBG} + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_DBG} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-debug ) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} ADDITIONAL_LIB_DIR=${FREETYPE_LIB_DIR_REL} + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} FREETYPE_DIR=${INCLUDE_DIR} ADDITIONAL_LIB_DIR=${LIB_DIR_REL} + PREFIX=${MKENUMS_TOOL_DIR} PERL=${PERL_INTERPRETER} WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-build-${TARGET_TRIPLET}-release ) @@ -40,7 +53,7 @@ vcpkg_execute_required_process( file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}/debug" NATIVE_PACKAGES_DIR_DBG) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_DBG} install + COMMAND ${NMAKE} -f Makefile.vc CFG=debug ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_DBG} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-debug ) @@ -49,11 +62,16 @@ file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/include) file(TO_NATIVE_PATH "${CURRENT_PACKAGES_DIR}" NATIVE_PACKAGES_DIR_REL) vcpkg_execute_required_process( - COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_REL} install + COMMAND ${NMAKE} -f Makefile.vc CFG=release ${DEPENDENCIES} PREFIX=${NATIVE_PACKAGES_DIR_REL} install WORKING_DIRECTORY ${SOURCE_PATH}/win32/ LOGNAME nmake-install-${TARGET_TRIPLET}-release ) +file(GLOB EXECUTABLES + ${CURRENT_PACKAGES_DIR}/bin/*.exe + ${CURRENT_PACKAGES_DIR}/debug/bin/*.exe) +file(REMOVE ${EXECUTABLES}) + # Handle copyright file(COPY ${SOURCE_PATH}/COPYING DESTINATION ${CURRENT_PACKAGES_DIR}/share/harfbuzz) file(RENAME ${CURRENT_PACKAGES_DIR}/share/harfbuzz/COPYING ${CURRENT_PACKAGES_DIR}/share/harfbuzz/copyright) From 95e1f378fdacb537d3f093aafdd8a36a03c7a3b9 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 11:59:48 +0100 Subject: [PATCH 2/4] [harfbuzz] bump version --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index eab88ff114..8624853aae 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4 +Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype From d2ef8f847e56f97ab988c3314c3b064497571955 Mon Sep 17 00:00:00 2001 From: codicodi Date: Thu, 26 Jan 2017 12:24:17 +0100 Subject: [PATCH 3/4] [harfbuzz] list glib as dependency --- ports/harfbuzz/CONTROL | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 8624853aae..526dca3b36 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz Version: 1.3.4-1 Description: HarfBuzz OpenType text shaping engine -Build-Depends: freetype +Build-Depends: freetype, glib From 6a58bee5e4e1277aea4c6f0f3991645abb738bbf Mon Sep 17 00:00:00 2001 From: Robert Schumacher Date: Fri, 27 Jan 2017 19:06:50 -0800 Subject: [PATCH 4/4] [harfbuzz] Uses in-source builds, so we need to clean them every time. --- ports/harfbuzz/CONTROL | 2 +- ports/harfbuzz/portfile.cmake | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ports/harfbuzz/CONTROL b/ports/harfbuzz/CONTROL index 526dca3b36..6a54dc583f 100644 --- a/ports/harfbuzz/CONTROL +++ b/ports/harfbuzz/CONTROL @@ -1,4 +1,4 @@ Source: harfbuzz -Version: 1.3.4-1 +Version: 1.3.4-2 Description: HarfBuzz OpenType text shaping engine Build-Depends: freetype, glib diff --git a/ports/harfbuzz/portfile.cmake b/ports/harfbuzz/portfile.cmake index 83f2679120..ac3252455f 100644 --- a/ports/harfbuzz/portfile.cmake +++ b/ports/harfbuzz/portfile.cmake @@ -11,7 +11,7 @@ if (VCPKG_LIBRARY_LINKAGE STREQUAL static) set(VCPKG_LIBRARY_LINKAGE dynamic) endif() include(vcpkg_common_functions) -set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/src/harfbuzz-1.3.4) +set(SOURCE_PATH ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src/harfbuzz-1.3.4) find_program(NMAKE nmake) vcpkg_download_distfile(ARCHIVE @@ -19,7 +19,9 @@ vcpkg_download_distfile(ARCHIVE FILENAME "harfbuzz-1.3.4.tar.bz2" SHA512 72027ce64d735f1f7ecabcc78ba426d6155cebd564439feb77cefdfc28b00bfd9f6314e6735addaa90cee1d98cf6d2c0b61f77b446ba34e11f7eb7cdfdcd386a ) -vcpkg_extract_source_archive(${ARCHIVE}) +# Harfbuzz only supports in-source builds, so to make sure we get a clean build, we need to re-extract every time +file(REMOVE_RECURSE ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) +vcpkg_extract_source_archive(${ARCHIVE} ${CURRENT_BUILDTREES_DIR}/${TARGET_TRIPLET}-src) file(WRITE ${SOURCE_PATH}/win32/msvc_recommended_pragmas.h "/* I'm expected to exist */")