-
Notifications
You must be signed in to change notification settings - Fork 6.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[sdl2-ttf] Update to 2.20.0 #25803
Closed
+170
−99
Closed
[sdl2-ttf] Update to 2.20.0 #25803
Changes from all commits
Commits
Show all changes
45 commits
Select commit
Hold shift + click to select a range
672c834
[sdl2-ttf] update to 2.20.0
FrankXie05 d7d1286
update version
FrankXie05 7ec5153
add license
FrankXie05 114bc14
update version
FrankXie05 34367f3
del unused function
FrankXie05 de94d66
overwrite version
FrankXie05 0fc871e
Fix sdl2-tff
Thomas1664 c108b98
Increase version
Thomas1664 97dfc3c
version
Thomas1664 6aa7cfe
Fix config export/import
Thomas1664 836a366
version
Thomas1664 b4e01be
Fix sdl2pp
Thomas1664 a52e90f
Fix SDL2_ttf import
Thomas1664 1a463c5
Fix sdl2pp
Thomas1664 ac6460e
Try again
Thomas1664 cff364f
...
Thomas1664 c5f4407
shared
Thomas1664 e7e251f
Fix patch
Thomas1664 b0a4919
not win32
Thomas1664 340fcb5
revert
Thomas1664 750fbd6
Fix import name
Thomas1664 58aa8c7
Fix tgui
Thomas1664 54e877b
version
Thomas1664 174ab5b
CR
Thomas1664 7360e5e
version
Thomas1664 5037cc8
CR
Thomas1664 1073151
version
Thomas1664 66e6d96
license
Thomas1664 fc92384
version
Thomas1664 7b65c3f
Merge remote-tracking branch 'origin/main' into pr/FrankXie05/25713
Thomas1664 141799d
Merge branch 'master' into pr/FrankXie05/25713
Thomas1664 ac23f5b
update port version
Thomas1664 b095833
version
Thomas1664 371c512
Fix patch
Thomas1664 e17aa04
version
Thomas1664 dbbbbf6
Fix patch
Thomas1664 4211f2c
version
Thomas1664 50cd5c3
Update patch
Thomas1664 fda587d
version
Thomas1664 34f6e09
Fix tgui
Thomas1664 dc85d62
add feature harfbuzz
Thomas1664 8b750ea
version
Thomas1664 2219f35
Fix feature
Thomas1664 6eb64df
version
Thomas1664 92cca25
Merge branch 'master' into pr/FrankXie05/25713
Thomas1664 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
diff --git a/CMakeLists.txt b/CMakeLists.txt | ||
index a097d5c..ca2881f 100644 | ||
--- a/CMakeLists.txt | ||
+++ b/CMakeLists.txt | ||
@@ -164,6 +164,7 @@ set(PC_REQUIRES) | ||
set(BUILD_SHARED_LIBS OFF) | ||
|
||
if(SDL2TTF_HARFBUZZ) | ||
+ if(0) | ||
if(SDL2TTF_HARFBUZZ_VENDORED) | ||
message(STATUS "${PROJECT_NAME}: Using vendored harfbuzz library") | ||
# HB_BUILD_UTILS variable is used by harfbuzz | ||
@@ -190,11 +191,14 @@ if(SDL2TTF_HARFBUZZ) | ||
find_package(harfbuzz REQUIRED) | ||
list(APPEND PC_REQUIRES harfbuzz) | ||
endif() | ||
+ endif() | ||
+ find_package(harfbuzz REQUIRED) | ||
target_compile_definitions(SDL2_ttf PRIVATE TTF_USE_HARFBUZZ=1) | ||
target_link_libraries(SDL2_ttf PRIVATE harfbuzz::harfbuzz) | ||
endif() | ||
|
||
if(SDL2TTF_FREETYPE) | ||
+ if(0) | ||
if(SDL2TTF_FREETYPE_VENDORED) | ||
message(STATUS "${PROJECT_NAME}: Using vendored freetype library") | ||
# FT_DISABLE_ZLIB variable is used by freetype | ||
@@ -232,7 +236,11 @@ if(SDL2TTF_FREETYPE) | ||
find_package(Freetype REQUIRED) | ||
list(APPEND PC_REQUIRES freetype2) | ||
endif() | ||
+ endif() | ||
+ list(APPEND PC_REQUIRES freetype2) | ||
+ find_package(Freetype REQUIRED) | ||
target_link_libraries(SDL2_ttf PRIVATE Freetype::Freetype) | ||
+ | ||
endif() | ||
|
||
# Restore BUILD_SHARED_LIBS variable | ||
@@ -325,7 +333,7 @@ if(SDL2TTF_INSTALL) | ||
COMPONENT devel | ||
) | ||
|
||
- if(SDL2TTF_BUILD_SHARED_LIBS) | ||
+ if(1) | ||
# Only create a .pc file for a shared SDL2_ttf | ||
set(prefix "${CMAKE_INSTALL_PREFIX}") | ||
set(exec_prefix "\${prefix}") | ||
@@ -352,7 +360,7 @@ if(SDL2TTF_INSTALL) | ||
\"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\" ONLY_IF_DIFFERENT) | ||
file(INSTALL DESTINATION \"\${CMAKE_INSTALL_PREFIX}/${PC_DESTDIR}\" | ||
TYPE FILE | ||
- FILES \"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\")" CONFIG Release) | ||
+ FILES \"${CMAKE_CURRENT_BINARY_DIR}/SDL2_ttf.pc\")") | ||
endif() | ||
|
||
if(SDL2TTF_BUILD_SHARED_LIBS AND (APPLE OR (UNIX AND NOT ANDROID))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,38 @@ | ||
set(VERSION 2.0.15) | ||
set(VERSION 2.20.0) | ||
|
||
vcpkg_download_distfile(ARCHIVE | ||
URLS "https://www.libsdl.org/projects/SDL_ttf/release/SDL2_ttf-${VERSION}.tar.gz" | ||
FILENAME "SDL2_ttf-${VERSION}.tar.gz" | ||
SHA512 30d685932c3dd6f2c94e2778357a5c502f0421374293d7102a64d92f9c7861229bf36bedf51c1a698b296a58c858ca442d97afb908b7df1592fc8d4f8ae8ddfd | ||
vcpkg_from_github( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
REPO libsdl-org/SDL_ttf | ||
REF f5e4828ffc9d3a84f00011fede4446aecb4a685f #v2.20.0 | ||
SHA512 c0d2d6107e5427d9c1353e14cb4b0c3957d28391cfc772f1f972fe3aa8ba9e9dfdfcb64acd317a7836d46b3a50da9597b19a832f0baf5198654acb7b31ab1e6b | ||
HEAD_REF main | ||
PATCHES | ||
fix-find_dependencies.patch | ||
) | ||
|
||
vcpkg_extract_source_archive_ex( | ||
OUT_SOURCE_PATH SOURCE_PATH | ||
ARCHIVE ${ARCHIVE} | ||
REF ${VERSION} | ||
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS | ||
FEATURES | ||
harfbuzz SDL2TTF_HARFBUZZ | ||
) | ||
|
||
file(COPY ${CMAKE_CURRENT_LIST_DIR}/CMakeLists.txt DESTINATION ${SOURCE_PATH}) | ||
vcpkg_cmake_configure( | ||
SOURCE_PATH "${SOURCE_PATH}" | ||
OPTIONS | ||
-DSDL2TTF_SAMPLES=OFF | ||
${FEATURE_OPTIONS} | ||
) | ||
|
||
vcpkg_configure_cmake( | ||
SOURCE_PATH ${SOURCE_PATH} | ||
PREFER_NINJA | ||
OPTIONS_DEBUG | ||
-DSDL_TTF_SKIP_HEADERS=ON) | ||
vcpkg_cmake_install() | ||
if(VCPKG_TARGET_IS_WINDOWS) | ||
vcpkg_cmake_config_fixup(CONFIG_PATH cmake PACKAGE_NAME SDL2_ttf) | ||
else() | ||
vcpkg_cmake_config_fixup(CONFIG_PATH lib/cmake/SDL2_ttf PACKAGE_NAME SDL2_ttf) | ||
endif() | ||
|
||
vcpkg_install_cmake() | ||
vcpkg_copy_pdbs() | ||
vcpkg_fixup_cmake_targets() | ||
vcpkg_fixup_pkgconfig() | ||
|
||
file(REMOVE_RECURSE ${CURRENT_PACKAGES_DIR}/debug/share) | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/include") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/debug/share") | ||
file(REMOVE_RECURSE "${CURRENT_PACKAGES_DIR}/share/licenses") | ||
|
||
file(COPY ${SOURCE_PATH}/COPYING.txt DESTINATION ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf) | ||
file(RENAME ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/COPYING.txt ${CURRENT_PACKAGES_DIR}/share/sdl2-ttf/copyright) | ||
file(INSTALL "${SOURCE_PATH}/LICENSE.txt" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,27 @@ | ||
{ | ||
"name": "sdl2-ttf", | ||
"version-string": "2.0.15", | ||
"port-version": 5, | ||
"version": "2.20.0", | ||
"description": "A library for rendering TrueType fonts with SDL", | ||
"homepage": "https://www.libsdl.org/projects/SDL_ttf/", | ||
"license": "Zlib", | ||
"dependencies": [ | ||
"freetype", | ||
"sdl2" | ||
] | ||
"sdl2", | ||
{ | ||
"name": "vcpkg-cmake", | ||
"host": true | ||
}, | ||
{ | ||
"name": "vcpkg-cmake-config", | ||
"host": true | ||
} | ||
], | ||
"features": { | ||
"harfbuzz": { | ||
"description": "Enable HarfBuzz support", | ||
"dependencies": [ | ||
"harfbuzz" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,35 @@ | ||
diff --git a/src/Backends/SDL/CMakeLists.txt b/src/Backends/SDL/CMakeLists.txt | ||
index d86f11d..1e31e21 100644 | ||
index d86f11d3..42b708d8 100644 | ||
--- a/src/Backends/SDL/CMakeLists.txt | ||
+++ b/src/Backends/SDL/CMakeLists.txt | ||
@@ -1,10 +1,10 @@ | ||
@@ -1,10 +1,14 @@ | ||
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR}/cmake_modules) | ||
|
||
-find_package(SDL2 REQUIRED) | ||
-find_package(SDL2_ttf REQUIRED) | ||
+find_package(SDL2 CONFIG REQUIRED) | ||
+find_package(sdl2-ttf CONFIG REQUIRED) | ||
+find_package(SDL2_ttf CONFIG REQUIRED) | ||
|
||
# Link to SDL and set include and library search directories | ||
-target_link_libraries(tgui PRIVATE SDL2::Core SDL2::TTF) | ||
+target_link_libraries(tgui PRIVATE SDL2::SDL2 SDL2::SDL2_ttf) | ||
+if(TARGET SDL2_ttf::SDL2_ttf) | ||
+ target_link_libraries(tgui PRIVATE SDL2::SDL2 SDL2_ttf::SDL2_ttf) | ||
+else() | ||
+ target_link_libraries(tgui PRIVATE SDL2::SDL2 SDL2_ttf::SDL2_ttf-static) | ||
+endif() | ||
|
||
# Add the backend source files to the library | ||
target_sources(tgui PRIVATE | ||
@@ -19,7 +19,7 @@ target_sources(tgui PRIVATE | ||
@@ -19,7 +23,11 @@ target_sources(tgui PRIVATE | ||
) | ||
|
||
add_library(tgui-sdl-interface INTERFACE) | ||
-target_link_libraries(tgui-sdl-interface INTERFACE SDL2::Core SDL2::TTF SDL2::Main) | ||
+target_link_libraries(tgui-sdl-interface INTERFACE SDL2::SDL2 SDL2::SDL2_ttf SDL2::SDL2main) | ||
+if(BUILD_SHARED_LIBS) | ||
+ target_link_libraries(tgui-sdl-interface INTERFACE SDL2::SDL2 SDL2_ttf::SDL2_ttf SDL2::SDL2main) | ||
+else() | ||
+ target_link_libraries(tgui-sdl-interface INTERFACE SDL2::SDL2 SDL2_ttf::SDL2_ttf-static SDL2::SDL2main) | ||
+endif() | ||
|
||
# Also link to OpenGL or OpenGL ES | ||
if(NOT TGUI_USE_GLES) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# tgui provides CMake targets: | ||
find_package(TGUI CONFIG REQUIRED) | ||
target_link_libraries(main PRIVATE tgui) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The patching can be reduced to the pkg-config stuff by passing
SDL2TTF_VENDORED=OFF
viaOPTIONS
.