Skip to content

Commit

Permalink
harfbuzz: update to 10.2.0
Browse files Browse the repository at this point in the history
  • Loading branch information
benoit-pierre committed Jan 12, 2025
1 parent 0c1985d commit b5f4410
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 15 deletions.
24 changes: 14 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,18 @@ list(APPEND CFG_CMD COMMAND
${SOURCE_DIR}
)

set(DEFINES)

# 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 +51,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

0 comments on commit b5f4410

Please sign in to comment.