[vlc-commits] contrib: harfbuzz: Create pkg-config buildfile with CMake buildsystem
David Fuhrmann
git at videolan.org
Sun May 27 23:26:48 CEST 2018
vlc/vlc-3.0 | branch: master | David Fuhrmann <dfuhrmann at videolan.org> | Sun May 27 12:29:03 2018 +0200| [142c029da7fd153165b2ff82860399186f49d329] | committer: Jean-Baptiste Kempf
contrib: harfbuzz: Create pkg-config buildfile with CMake buildsystem
This creates a new pkgconfig template, unfortunately the configure-
based template cannnot be used.
(cherry picked from commit eed98c815bd28020c856d65b83602bbd8c067e3e)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
> http://git.videolan.org/gitweb.cgi/vlc/vlc-3.0.git/?a=commit;h=142c029da7fd153165b2ff82860399186f49d329
---
.../harfbuzz/harfbuzz-create-pkgconfig-file.patch | 58 ++++++++++++++++++++++
contrib/src/harfbuzz/rules.mak | 1 +
2 files changed, 59 insertions(+)
diff --git a/contrib/src/harfbuzz/harfbuzz-create-pkgconfig-file.patch b/contrib/src/harfbuzz/harfbuzz-create-pkgconfig-file.patch
new file mode 100644
index 0000000000..52aff8ddff
--- /dev/null
+++ b/contrib/src/harfbuzz/harfbuzz-create-pkgconfig-file.patch
@@ -0,0 +1,58 @@
+--- harfbuzz/CMakeLists.txt.old 2018-05-27 12:03:25.000000000 +0200
++++ harfbuzz/CMakeLists.txt 2018-05-27 12:02:45.000000000 +0200
+@@ -385,18 +385,21 @@ if (APPLE AND HB_HAVE_CORETEXT)
+ find_library(CORETEXT_FRAMEWORK CoreText)
+ if (CORETEXT_FRAMEWORK)
+ list(APPEND THIRD_PARTY_LIBS ${CORETEXT_FRAMEWORK})
++ set(FRAMEWORK_FLAGS "${FRAMEWORK_FLAGS} -framework CoreText")
+ endif (CORETEXT_FRAMEWORK)
+ mark_as_advanced(CORETEXT_FRAMEWORK)
+
+ find_library(COREFOUNDATION_FRAMEWORK CoreFoundation)
+ if (COREFOUNDATION_FRAMEWORK)
+ list(APPEND THIRD_PARTY_LIBS ${COREFOUNDATION_FRAMEWORK})
++ set(FRAMEWORK_FLAGS "${FRAMEWORK_FLAGS} -framework CoreFoundation")
+ endif (COREFOUNDATION_FRAMEWORK)
+ mark_as_advanced(COREFOUNDATION_FRAMEWORK)
+
+ find_library(COREGRAPHICS_FRAMEWORK CoreGraphics)
+ if (COREGRAPHICS_FRAMEWORK)
+ list(APPEND THIRD_PARTY_LIBS ${COREGRAPHICS_FRAMEWORK})
++ set(FRAMEWORK_FLAGS "${FRAMEWORK_FLAGS} -framework CoreGraphics")
+ endif (COREGRAPHICS_FRAMEWORK)
+ mark_as_advanced(COREGRAPHICS_FRAMEWORK)
+ endif ()
+@@ -561,6 +564,18 @@ endif ()
+ add_library(harfbuzz ${project_sources} ${project_extra_sources} ${project_headers})
+ target_link_libraries(harfbuzz ${THIRD_PARTY_LIBS})
+
++## harfbuzz pc file
++foreach(LIB ${THIRD_PARTY_LIBS})
++ if(NOT IS_ABSOLUTE ${LIB})
++ set(PRIVATE_LIBS "${PRIVATE_LIBS} -l${LIB}")
++ endif()
++endforeach()
++
++set(PRIVATE_LIBS "${PRIVATE_LIBS} ${FRAMEWORK_FLAGS}")
++configure_file("harfbuzz-cmake.pc.in" "harfbuzz.pc" @ONLY)
++install(FILES "${CMAKE_CURRENT_BINARY_DIR}/harfbuzz.pc"
++ DESTINATION "${CMAKE_INSTALL_PREFIX}/lib/pkgconfig")
++
+ ## Define harfbuzz-subset library
+ add_library(harfbuzz-subset ${subset_project_sources} ${subset_project_headers})
+ add_dependencies(harfbuzz-subset harfbuzz)
+--- /dev/null 2018-05-27 12:22:37.000000000 +0200
++++ harfbuzz/harfbuzz-cmake.pc.in 2018-05-27 12:24:00.000000000 +0200
+@@ -0,0 +1,12 @@
++prefix=@CMAKE_INSTALL_PREFIX@
++exec_prefix=${prefix}
++libdir=${prefix}/lib
++includedir=${prefix}/include
++
++Name: harfbuzz
++Description: HarfBuzz text shaping library
++Version: @HB_VERSION@
++
++Libs: -L${libdir} -lharfbuzz -lm @PRIVATE_LIBS@
++Requires.private:
++Cflags: -I${includedir}/harfbuzz
diff --git a/contrib/src/harfbuzz/rules.mak b/contrib/src/harfbuzz/rules.mak
index c65b8d1172..c8695afdae 100644
--- a/contrib/src/harfbuzz/rules.mak
+++ b/contrib/src/harfbuzz/rules.mak
@@ -18,6 +18,7 @@ harfbuzz: harfbuzz-$(HARFBUZZ_VERSION).tar.bz2 .sum-harfbuzz
$(APPLY) $(SRC)/harfbuzz/harfbuzz-clang.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-fix-freetype-detect.patch
$(APPLY) $(SRC)/harfbuzz/harfbuzz-fix-coretext-detection.patch
+ $(APPLY) $(SRC)/harfbuzz/harfbuzz-create-pkgconfig-file.patch
$(MOVE)
DEPS_harfbuzz = freetype2 $(DEPS_freetype2)
More information about the vlc-commits
mailing list