Skip to content

Commit

Permalink
[freetype] update to 2.11.0 (#19284)
Browse files Browse the repository at this point in the history
* [freetype] update to 2.11.0

* add version files
  • Loading branch information
autoantwort authored Aug 30, 2021
1 parent c0bc5e1 commit dd6fd59
Show file tree
Hide file tree
Showing 10 changed files with 103 additions and 118 deletions.
32 changes: 0 additions & 32 deletions ports/freetype/0001-Fix-install-command.patch

This file was deleted.

21 changes: 0 additions & 21 deletions ports/freetype/CONTROL

This file was deleted.

53 changes: 24 additions & 29 deletions ports/freetype/brotli-static.patch
Original file line number Diff line number Diff line change
@@ -1,29 +1,24 @@
diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake
index 7c484c7df..0bd49b825 100644
--- a/builds/cmake/FindBrotliDec.cmake
+++ b/builds/cmake/FindBrotliDec.cmake
@@ -34,14 +34,22 @@ find_path(BROTLIDEC_INCLUDE_DIRS
PATH_SUFFIXES brotli)

find_library(BROTLIDEC_LIBRARIES
- NAMES brotlidec
+ NAMES brotlidec brotlidec-static
HINTS ${PC_BROTLIDEC_LIBDIR}
${PC_BROTLIDEC_LIBRARY_DIRS})

+find_library(BROTLICOMMON_LIBRARIES
+ NAMES brotlicommon-static
+ HINTS ${PC_BROTLIDEC_LIBDIR}
+ ${PC_BROTLIDEC_LIBRARY_DIRS})
+
+if(BROTLICOMMON_LIBRARIES)
+ set(BROTLIDEC_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES})
+endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
- brotlidec
+ BrotliDec
REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
FOUND_VAR BROTLIDEC_FOUND
VERSION_VAR BROTLIDEC_VERSION)
diff --git a/builds/cmake/FindBrotliDec.cmake b/builds/cmake/FindBrotliDec.cmake
index 46356b1fd..ed4cc2409 100644
--- a/builds/cmake/FindBrotliDec.cmake
+++ b/builds/cmake/FindBrotliDec.cmake
@@ -35,10 +35,18 @@ find_path(BROTLIDEC_INCLUDE_DIRS
PATH_SUFFIXES brotli)

find_library(BROTLIDEC_LIBRARIES
- NAMES brotlidec
+ NAMES brotlidec brotlidec-static
HINTS ${PC_BROTLIDEC_LIBDIR}
${PC_BROTLIDEC_LIBRARY_DIRS})

+find_library(BROTLICOMMON_LIBRARIES
+ NAMES brotlicommon-static
+ HINTS ${PC_BROTLIDEC_LIBDIR}
+ ${PC_BROTLIDEC_LIBRARY_DIRS})
+
+if(BROTLICOMMON_LIBRARIES)
+ set(BROTLIDEC_LIBRARIES ${BROTLIDEC_LIBRARIES} ${BROTLICOMMON_LIBRARIES})
+endif()

include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
13 changes: 13 additions & 0 deletions ports/freetype/fix-bzip2-pc.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb1b9a0f2..53d0bfc68 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,7 +503,7 @@ endif ()
if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
- list(APPEND PKG_CONFIG_LIBS_PRIVATE "-lbz2")
+ list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
endif ()
if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
9 changes: 4 additions & 5 deletions ports/freetype/fix-exports.patch
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2314c79..994c602 100644
index cb1b9a0f2..edca5d579 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -446,7 +446,7 @@ endif ()
set(PKG_CONFIG_REQUIRED_PRIVATE "")
@@ -496,7 +496,7 @@ set(PKG_CONFIG_REQUIRED_PRIVATE "")
set(PKG_CONFIG_LIBS_PRIVATE "")

if (ZLIB_FOUND)
- target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
+ target_link_libraries(freetype PRIVATE ZLIB::ZLIB)
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
endif ()
@@ -560,12 +560,26 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
@@ -596,12 +596,25 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
install(
EXPORT freetype-targets
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
Expand All @@ -22,7 +22,6 @@ index 2314c79..994c602 100644
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
COMPONENT headers)
+
+
+ if(ZLIB_FOUND)
+ file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/freetype-config.cmake"
+[[include(CMakeFindDependencyMacro)
Expand Down
20 changes: 0 additions & 20 deletions ports/freetype/pkgconfig.patch

This file was deleted.

18 changes: 8 additions & 10 deletions ports/freetype/portfile.cmake
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
set(FT_VERSION 2.10.4)
set(FT_VERSION 2.11.0)

vcpkg_from_sourceforge(
OUT_SOURCE_PATH SOURCE_PATH
REPO freetype/freetype2
REF ${FT_VERSION}
FILENAME freetype-${FT_VERSION}.tar.xz
SHA512 827cda734aa6b537a8bcb247549b72bc1e082a5b32ab8d3cccb7cc26d5f6ee087c19ce34544fa388a1eb4ecaf97600dbabc3e10e950f2ba692617fee7081518f
SHA512 bf1991f3c382832586be1d21ae73c20840ee8546807ba60d0eb0215134545656c0c8de488f27357d4a4f6497d7cb540998cda98ec59061a3e640036fb209147d
PATCHES
0001-Fix-install-command.patch
0003-Fix-UWP.patch
pkgconfig.patch
fix-bzip2-pc.patch # we have a bzip2 file that we can use - https://gitlab.freedesktop.org/freetype/freetype/-/commit/b2aeca5fda870751f3c9d645e0dca4c80fa1ae5a
brotli-static.patch
fix-exports.patch
)
Expand All @@ -27,17 +26,16 @@ vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
brotli CMAKE_DISABLE_FIND_PACKAGE_BrotliDec
)

vcpkg_configure_cmake(
SOURCE_PATH ${SOURCE_PATH}
PREFER_NINJA
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
-DCMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=ON
${FEATURE_OPTIONS}
)

vcpkg_install_cmake()
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_fixup_cmake_targets(CONFIG_PATH lib/cmake/freetype)
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/freetype)

# Rename for easy usage (VS integration; CMake and autotools will not care)
file(RENAME ${CURRENT_PACKAGES_DIR}/include/freetype2/freetype ${CURRENT_PACKAGES_DIR}/include/freetype)
Expand Down Expand Up @@ -100,4 +98,4 @@ file(COPY
${SOURCE_PATH}/docs/GPLv2.TXT
DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT}
)
file(INSTALL ${SOURCE_PATH}/docs/LICENSE.TXT DESTINATION ${CURRENT_PACKAGES_DIR}/share/${PORT} RENAME copyright)
file(INSTALL "${SOURCE_PATH}/LICENSE.TXT" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)
48 changes: 48 additions & 0 deletions ports/freetype/vcpkg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"name": "freetype",
"version-semver": "2.11.0",
"description": "A library to render fonts.",
"homepage": "https://www.freetype.org/",
"dependencies": [
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"default-features": [
"brotli",
"bzip2",
"png",
"zlib"
],
"features": {
"brotli": {
"description": "Support decompression of WOFF2 streams",
"dependencies": [
"brotli"
]
},
"bzip2": {
"description": "Support bzip2 compressed fonts.",
"dependencies": [
"bzip2"
]
},
"png": {
"description": "Support PNG compressed OpenType embedded bitmaps.",
"dependencies": [
"libpng"
]
},
"zlib": {
"description": "Use zlib instead of internal library for DEFLATE",
"dependencies": [
"zlib"
]
}
}
}
2 changes: 1 addition & 1 deletion versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -2149,7 +2149,7 @@
"port-version": 1
},
"freetype": {
"baseline": "2.10.4",
"baseline": "2.11.0",
"port-version": 0
},
"freetype-gl": {
Expand Down
5 changes: 5 additions & 0 deletions versions/f-/freetype.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "6814e10440bcdc58c4bd29a0373d2f902783ba54",
"version-semver": "2.11.0",
"port-version": 0
},
{
"git-tree": "dabcba1d5153c796480c50c459ef045b5db8d2a4",
"version-string": "2.10.4",
Expand Down

0 comments on commit dd6fd59

Please sign in to comment.