Skip to content

Commit 152bbd3

Browse files
authored
Merge pull request #1922 from x15sr71/fix/utf8proc-include-path
Excellent fix! The `__has_include()` approach is clean and removes the symlink workaround. Verified locally: - Normal build: ✅ - `-system-libs` build: ✅ Merging.
2 parents 434cd39 + a18eaa2 commit 152bbd3

File tree

3 files changed

+6
-9
lines changed

3 files changed

+6
-9
lines changed

docs/CHANGES.TXT

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
0.96.2 (2025-12-26)
22
-------------------
3+
- Fix: Resolve utf8proc header include path when building against system libraries on Linux.
34
- Rebundle Windows version to include required runtime files to process hardcoded subtitles
45
(hardcodex mode).
56
- New: Add optional -system-libs flag to Linux build script for package manager compatibility

linux/build

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ if [ "$USE_SYSTEM_LIBS" = true ]; then
6565

6666
PKG_CFLAGS="$(pkg-config --cflags libpng zlib freetype2 libutf8proc)"
6767
PKG_LIBS="$(pkg-config --libs libpng zlib freetype2 libutf8proc)"
68-
69-
UTF8PROC_COMPAT=""
70-
if [ ! -d /usr/include/utf8proc ] && [ -f /usr/include/utf8proc.h ]; then
71-
mkdir -p ./utf8proc_compat/utf8proc
72-
ln -sf /usr/include/utf8proc.h ./utf8proc_compat/utf8proc/utf8proc.h
73-
UTF8PROC_COMPAT="-I./utf8proc_compat"
74-
fi
7568
fi
7669

7770
BLD_FLAGS="$BLD_FLAGS -std=gnu99 -Wno-write-strings -Wno-pointer-sign -D_FILE_OFFSET_BITS=64 -DVERSION_FILE_PRESENT -DENABLE_OCR -DGPAC_DISABLE_VTT -DGPAC_DISABLE_OD_DUMP -DGPAC_DISABLE_REMOTERY -DNO_GZIP"
@@ -140,7 +133,7 @@ if [ "$USE_SYSTEM_LIBS" = true ]; then
140133
GPAC_CFLAGS="$(pkg-config --cflags --silence-errors gpac)"
141134

142135
BLD_INCLUDE="-I../src -I../src/lib_ccx -I../src/lib_ccx/zvbi -I../src/thirdparty/lib_hash \
143-
$UTF8PROC_COMPAT $PKG_CFLAGS $LEPTONICA_CFLAGS $TESSERACT_CFLAGS $GPAC_CFLAGS"
136+
$PKG_CFLAGS $LEPTONICA_CFLAGS $TESSERACT_CFLAGS $GPAC_CFLAGS"
144137

145138
BLD_SOURCES="../src/ccextractor.c $SRC_CCX $SRC_HASH"
146139
# Preserve FFmpeg libraries if -hardsubx was specified

src/lib_ccx/params.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,11 @@
1313
#include "../lib_hash/sha2.h"
1414
#include <string.h>
1515
#include <stdio.h>
16+
#if __has_include(<utf8proc.h>)
17+
#include <utf8proc.h>
18+
#else
1619
#include <utf8proc/utf8proc.h>
17-
20+
#endif
1821
#ifdef ENABLE_OCR
1922
#include <tesseract/capi.h>
2023
#include <leptonica/allheaders.h>

0 commit comments

Comments
 (0)