Add freetype support for harfbuzz.

This commit is contained in:
Vincent Lejeune 2016-10-12 00:53:57 +02:00 committed by vlj
parent f5ff2ef0f3
commit 63a0db0044
4 changed files with 83 additions and 4 deletions

View File

@ -0,0 +1,40 @@
From be3c446b1dd798b835052188813ee4e7cf135a81 Mon Sep 17 00:00:00 2001
From: Vincent Lejeune <vljn.ovi@gmail.com>
Date: Wed, 12 Oct 2016 00:27:35 +0200
Subject: [PATCH] Add an extra path input for Freetype.
---
win32/config-msvc.mak | 3 +++
win32/detectenv-msvc.mak | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak
index e0c6468..1ad0913 100644
--- a/win32/config-msvc.mak
+++ b/win32/config-msvc.mak
@@ -124,6 +124,9 @@ HB_DEFINES = $(HB_DEFINES) /DHAVE_CAIRO=1
# Enable freetype if desired
!if "$(FREETYPE)" == "1"
+HB_CFLAGS = \
+ $(HB_CFLAGS) \
+ /I$(FREETYPE_DIR)
HB_DEFINES = $(HB_DEFINES) /DHAVE_FREETYPE=1
HB_SOURCES = $(HB_SOURCES) $(HB_FT_sources)
HB_HEADERS = $(HB_HEADERS) $(HB_FT_headers)
diff --git a/win32/detectenv-msvc.mak b/win32/detectenv-msvc.mak
index 83d8786..ad67493 100644
--- a/win32/detectenv-msvc.mak
+++ b/win32/detectenv-msvc.mak
@@ -129,7 +129,7 @@ LDFLAGS_ARCH = /machine:x86
!if "$(VALID_CFGSET)" == "TRUE"
CFLAGS = $(CFLAGS_ADD) /W3 /Zi /I.. /I..\src /I. /I$(PREFIX)\include
-LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /DEBUG
+LDFLAGS_BASE = $(LDFLAGS_ARCH) /libpath:$(PREFIX)\lib /libpath:$(VCPKG_LIB_DIR) /DEBUG
!if "$(CFG)" == "debug"
LDFLAGS = $(LDFLAGS_BASE)
--
2.10.0.windows.1

View File

@ -0,0 +1,28 @@
From 2be3a687a3079c3988d718293e4ee5d8fc9797b7 Mon Sep 17 00:00:00 2001
From: vlj <vljn.ovi@gmail.com>
Date: Sat, 8 Oct 2016 21:14:57 +0200
Subject: [PATCH] Set d suffix for debug freetype lib.
---
win32/config-msvc.mak | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/win32/config-msvc.mak b/win32/config-msvc.mak
index 9cc6608..236aef7 100644
--- a/win32/config-msvc.mak
+++ b/win32/config-msvc.mak
@@ -12,7 +12,11 @@ HB_GLIB_LIBS = glib-2.0.lib
HB_GOBJECT_DEP_LIBS = gobject-2.0.lib $(HB_GLIB_LIBS)
# Freetype is needed for building FreeType support and hb-view
+!if "$(CFG)" == "debug"
+FREETYPE_LIB = freetyped.lib
+!else
FREETYPE_LIB = freetype.lib
+!endif
# Cairo is needed for building hb-view
CAIRO_LIB = cairo.lib
--
2.10.0.windows.1

View File

@ -1,3 +1,4 @@
Source: harfbuzz
Version: 1.3.2
Description: HarfBuzz OpenType text shaping engine
Build-depends: Freetype

View File

@ -18,14 +18,24 @@ vcpkg_download_distfile(ARCHIVE
)
vcpkg_extract_source_archive(${ARCHIVE})
vcpkg_apply_patches(
SOURCE_PATH ${SOURCE_PATH}
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Add-an-extra-path-input-for-Freetype.patch"
PATCHES "${CMAKE_CURRENT_LIST_DIR}/0001-Set-d-suffix-for-debug-freetype-lib.patch"
)
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)
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f Makefile.vc CFG=debug
COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} VCPKG_LIB_DIR=${FREETYPE_LIB_DIR_DBG}
WORKING_DIRECTORY ${SOURCE_PATH}/win32/
LOGNAME nmake-build-${TARGET_TRIPLET}-debug
)
vcpkg_execute_required_process(
COMMAND ${NMAKE} -f Makefile.vc CFG=release
COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 FREETYPE_DIR=${FREETYPE_INCLUDE_DIR} VCPKG_LIB_DIR=${FREETYPE_LIB_DIR_REL}
WORKING_DIRECTORY ${SOURCE_PATH}/win32/
LOGNAME nmake-build-${TARGET_TRIPLET}-release
)
@ -33,7 +43,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 PREFIX=${NATIVE_PACKAGES_DIR_DBG} install
COMMAND ${NMAKE} -f Makefile.vc CFG=debug FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_DBG} install
WORKING_DIRECTORY ${SOURCE_PATH}/win32/
LOGNAME nmake-install-${TARGET_TRIPLET}-debug
)
@ -42,7 +52,7 @@ 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 PREFIX=${NATIVE_PACKAGES_DIR_REL} install
COMMAND ${NMAKE} -f Makefile.vc CFG=release FREETYPE=1 PREFIX=${NATIVE_PACKAGES_DIR_REL} install
WORKING_DIRECTORY ${SOURCE_PATH}/win32/
LOGNAME nmake-install-${TARGET_TRIPLET}-release
)