Skip to content
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

harfbuzz: update to 10.2.0 #2018

Merged
merged 2 commits into from
Jan 12, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 25 additions & 10 deletions thirdparty/harfbuzz/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,6 @@ list(APPEND PATCH_CMD COMMAND ${ISED} "/^#line/d"
src/hb-buffer-deserialize-text-unicode.hh
)

# We've apparently hit a weird corner-case w/ XText where GCC/STL atomics *sometimes* horribly blow up on an ARM1136JF-S CPU w/ GCC 7.5 & up...
# c.f., https://github.com/koreader/koreader/issues/5780 & https://github.com/koreader/koreader/issues/6024
# NOTE: Our initial approach was to only disable atomics in a very dirty manner, which only helped with the first issue.
# This, on the other hand, appears to help with both.
if(LEGACY OR POCKETBOOK)
list(APPEND PATCH_CMD COMMAND ${ISED} "/^#define HB_CONFIG_HH\$/{p$<SEMICOLON>s//#define HB_NO_MT/}" src/hb-config.hh)
endif()

list(APPEND CFG_CMD COMMAND
${MESON_SETUP} --default-library=$<IF:$<BOOL:${MONOLIBTIC}>,static,shared>
-Dfreetype=enabled
Expand All @@ -34,6 +26,29 @@ list(APPEND CFG_CMD COMMAND
${SOURCE_DIR}
)

set(DEFINES
HB_DISABLE_DEPRECATED
HB_NO_BUFFER_MESSAGE
HB_NO_BUFFER_SERIALIZE
HB_NO_COLOR
HB_NO_LAYOUT_COLLECT_GLYPHS
HB_NO_LAYOUT_RARELY_USED
HB_NO_LAYOUT_UNUSED
HB_NO_META
HB_NO_PAINT
HB_NO_STYLE
)

# We've apparently hit a weird corner-case w/ XText where GCC/STL atomics *sometimes* horribly blow up on an ARM1136JF-S CPU w/ GCC 7.5 & up...
# c.f., https://github.com/koreader/koreader/issues/5780 & https://github.com/koreader/koreader/issues/6024
# NOTE: Our initial approach was to only disable atomics in a very dirty manner, which only helped with the first issue.
# This, on the other hand, appears to help with both.
if(LEGACY OR POCKETBOOK)
list(APPEND DEFINES HB_NO_MT)
endif()

list(APPEND CFG_CMD COMMAND sh -c "printf '#define %s\\n' \"$@\" >>config.h" -- ${DEFINES})

list(APPEND BUILD_CMD COMMAND ninja)

list(APPEND INSTALL_CMD COMMAND ${MESON_INSTALL})
Expand All @@ -47,8 +62,8 @@ if(NOT MONOLIBTIC)
endif()

external_project(
DOWNLOAD URL 75969de59a3e09f7a7fb34dbbacb3b68
https://github.com/harfbuzz/harfbuzz/releases/download/10.1.0/harfbuzz-10.1.0.tar.xz
DOWNLOAD URL f68c05409f18b4a044d71628548aacd9
https://github.com/harfbuzz/harfbuzz/releases/download/10.2.0/harfbuzz-10.2.0.tar.xz
PATCH_FILES ${PATCH_FILES}
PATCH_COMMAND ${PATCH_CMD}
CONFIGURE_COMMAND ${CFG_CMD}
Expand Down
3 changes: 2 additions & 1 deletion thirdparty/harfbuzz/android.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
diff --git a/src/hb.hh b/src/hb.hh
index fe466fe1..d728bb99 100644
--- a/src/hb.hh
+++ b/src/hb.hh
@@ -487,6 +487,10 @@ static int HB_UNUSED _hb_errno = 0;
@@ -500,6 +500,10 @@ static int HB_UNUSED _hb_errno = 0;
#define HB_NO_SETLOCALE 1
#endif

Expand Down
10 changes: 6 additions & 4 deletions thirdparty/harfbuzz/no-subset.patch
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
--- i/src/meson.build
+++ w/src/meson.build
@@ -609,7 +609,7 @@
diff --git a/src/meson.build b/src/meson.build
index b9daabf0..b5a04745 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -620,7 +620,7 @@ defs_list += [harfbuzz_subset_def]

libharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources,
include_directories: incconfig,
Expand All @@ -9,7 +11,7 @@
link_with: [libharfbuzz],
cpp_args: cpp_args + extra_hb_cpp_args,
soversion: hb_so_version,
@@ -620,7 +620,7 @@
@@ -631,7 +631,7 @@ libharfbuzz_subset = library('harfbuzz-subset', hb_subset_sources,
)

custom_target('harfbuzz-subset.cc',
Expand Down