[vlc-commits] contrib: harfbuff: use pkg-config to find freetype
Steve Lhomme
git at videolan.org
Tue May 22 18:36:39 CEST 2018
vlc | branch: master | Steve Lhomme <robux4 at ycbcr.xyz> | Tue May 22 16:05:53 2018 +0200| [de8991f4f16f69f78132d335e04cb91ba213b052] | committer: Steve Lhomme
contrib: harfbuff: use pkg-config to find freetype
It will grab the -lz depedency if needed
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=de8991f4f16f69f78132d335e04cb91ba213b052
---
contrib/src/harfbuzz/Cmake-test.patch | 11 ------
.../harfbuzz/harfbuzz-fix-freetype-detect.patch | 39 ++++++++++++++++++++++
contrib/src/harfbuzz/rules.mak | 2 +-
3 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/contrib/src/harfbuzz/Cmake-test.patch b/contrib/src/harfbuzz/Cmake-test.patch
deleted file mode 100644
index e9bda83b5c..0000000000
--- a/contrib/src/harfbuzz/Cmake-test.patch
+++ /dev/null
@@ -1,11 +0,0 @@
---- harfbuzz/CMakeLists.txt.old 2018-02-28 22:59:53.000000000 +0100
-+++ harfbuzz/CMakeLists.txt 2018-05-18 18:00:47.589767685 +0200
-@@ -272,7 +272,7 @@
- message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix")
- endif ()
-
-- list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES})
-+ list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES} -lz)
- include_directories(AFTER ${FREETYPE_INCLUDE_DIRS})
- add_definitions(-DHAVE_FREETYPE=1)
-
diff --git a/contrib/src/harfbuzz/harfbuzz-fix-freetype-detect.patch b/contrib/src/harfbuzz/harfbuzz-fix-freetype-detect.patch
new file mode 100644
index 0000000000..484dee2aef
--- /dev/null
+++ b/contrib/src/harfbuzz/harfbuzz-fix-freetype-detect.patch
@@ -0,0 +1,39 @@
+--- harfbuzz/CMakeLists.txt.pkg-freetype 2018-05-22 15:42:04.861877600 +0200
++++ harfbuzz/CMakeLists.txt 2018-05-22 15:53:50.808676800 +0200
+@@ -267,6 +267,14 @@ set (subset_project_headers
+
+ ## Find and include needed header folders and libraries
+ if (HB_HAVE_FREETYPE)
++ find_package(PkgConfig)
++ pkg_check_modules(PC_FREETYPE2 QUIET freetype2)
++
++ if (PC_FREETYPE2_FOUND)
++ include_directories(AFTER ${PC_FREETYPE2_STATIC_INCLUDE_DIRS})
++ list(APPEND THIRD_PARTY_LIBS ${PC_FREETYPE2_STATIC_LIBRARIES})
++ add_definitions(${PC_FREETYPE2_STATIC_CFLAGS})
++ else ()
+ include (FindFreetype)
+ if (NOT FREETYPE_FOUND)
+ message(FATAL_ERROR "HB_HAVE_FREETYPE was set, but we failed to find it. Maybe add a CMAKE_PREFIX_PATH= to your Freetype2 install prefix")
+@@ -274,15 +282,17 @@ if (HB_HAVE_FREETYPE)
+
+ list(APPEND THIRD_PARTY_LIBS ${FREETYPE_LIBRARIES} -lz)
+ include_directories(AFTER ${FREETYPE_INCLUDE_DIRS})
+- add_definitions(-DHAVE_FREETYPE=1)
+-
+- list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
+- list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
+
+ # So check_funcs can find its headers
+ set (CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${FREETYPE_INCLUDE_DIRS})
+ set (CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} ${FREETYPE_LIBRARIES})
++ endif ()
+
++ list(APPEND project_sources ${PROJECT_SOURCE_DIR}/src/hb-ft.cc)
++ list(APPEND project_headers ${PROJECT_SOURCE_DIR}/src/hb-ft.h)
++
++ add_definitions(-DHAVE_FREETYPE=1)
++
+ check_funcs(FT_Get_Var_Blend_Coordinates FT_Set_Var_Blend_Coordinates FT_Done_MM_Var)
+ endif ()
+
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index 45cb10d784..259df80c86 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -20,8 +20,8 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.bz2 .sum-harfbuzz
$(UNPACK)
$(APPLY) $(SRC)/harfbuzz/harfbuzz-aarch64.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-clang.patch
- $(APPLY) $(SRC)/harfbuzz/Cmake-test.patch
$(APPLY) $(SRC)/harfbuzz/0001-Skip-using-the-_BitScan-intrinsics-on-mingw.patch
+ $(APPLY) $(SRC)/harfbuzz/harfbuzz-fix-freetype-detect.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
More information about the vlc-commits
mailing list