Skip to content

Commit 44dd6c9

Browse files
committed
fix: build harfbuzz for portable subtitles
1 parent 2626c5b commit 44dd6c9

2 files changed

Lines changed: 56 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 54 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ permissions:
1818
env:
1919
FFMPEG_VERSION: ${{ inputs.ffmpeg_version || 'master' }}
2020
X265_VERSION: "4.1"
21+
HARFBUZZ_VERSION: "8.5.0"
2122

2223
jobs:
2324
build-macos-arm:
@@ -43,7 +44,7 @@ jobs:
4344
- name: Install build tools
4445
run: |
4546
brew update
46-
brew install automake cmake libtool nasm pkg-config yasm
47+
brew install automake cmake libtool meson ninja nasm pkg-config yasm
4748
4849
- name: Build x264
4950
run: |
@@ -222,6 +223,31 @@ jobs:
222223
env:
223224
PKG_CONFIG_PATH: ${{ github.workspace }}/ffmpeg_install/lib/pkgconfig
224225

226+
- name: Build HarfBuzz
227+
run: |
228+
cd $BUILD_DIR
229+
curl -L -o harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${{ env.HARFBUZZ_VERSION }}/harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz
230+
tar -xf harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz
231+
cd harfbuzz-${{ env.HARFBUZZ_VERSION }}
232+
meson setup build \
233+
--prefix=$INSTALL_DIR \
234+
--default-library=static \
235+
-Dglib=disabled \
236+
-Dgobject=disabled \
237+
-Dfreetype=disabled \
238+
-Dcairo=disabled \
239+
-Dchafa=disabled \
240+
-Dicu=disabled \
241+
-Dgraphite=disabled \
242+
-Dintrospection=disabled \
243+
-Ddocs=disabled \
244+
-Dtests=disabled \
245+
-Dutilities=disabled
246+
meson compile -C build
247+
meson install -C build
248+
env:
249+
PKG_CONFIG_PATH: ${{ github.workspace }}/ffmpeg_install/lib/pkgconfig
250+
225251
- name: Build freetype
226252
run: |
227253
cd $BUILD_DIR
@@ -267,7 +293,6 @@ jobs:
267293
--disable-shared \
268294
--with-pic \
269295
--disable-fontconfig \
270-
--disable-harfbuzz \
271296
--disable-require-system-font-provider
272297
make -j$(sysctl -n hw.ncpu)
273298
make install
@@ -394,7 +419,7 @@ jobs:
394419
- name: Install build tools
395420
run: |
396421
brew update
397-
brew install automake cmake libtool nasm pkg-config yasm
422+
brew install automake cmake libtool meson ninja nasm pkg-config yasm
398423
399424
- name: Build x264
400425
run: |
@@ -573,6 +598,31 @@ jobs:
573598
env:
574599
PKG_CONFIG_PATH: ${{ github.workspace }}/ffmpeg_install/lib/pkgconfig
575600

601+
- name: Build HarfBuzz
602+
run: |
603+
cd $BUILD_DIR
604+
curl -L -o harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz https://github.com/harfbuzz/harfbuzz/releases/download/${{ env.HARFBUZZ_VERSION }}/harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz
605+
tar -xf harfbuzz-${{ env.HARFBUZZ_VERSION }}.tar.xz
606+
cd harfbuzz-${{ env.HARFBUZZ_VERSION }}
607+
meson setup build \
608+
--prefix=$INSTALL_DIR \
609+
--default-library=static \
610+
-Dglib=disabled \
611+
-Dgobject=disabled \
612+
-Dfreetype=disabled \
613+
-Dcairo=disabled \
614+
-Dchafa=disabled \
615+
-Dicu=disabled \
616+
-Dgraphite=disabled \
617+
-Dintrospection=disabled \
618+
-Ddocs=disabled \
619+
-Dtests=disabled \
620+
-Dutilities=disabled
621+
meson compile -C build
622+
meson install -C build
623+
env:
624+
PKG_CONFIG_PATH: ${{ github.workspace }}/ffmpeg_install/lib/pkgconfig
625+
576626
- name: Build freetype
577627
run: |
578628
cd $BUILD_DIR
@@ -618,7 +668,6 @@ jobs:
618668
--disable-shared \
619669
--with-pic \
620670
--disable-fontconfig \
621-
--disable-harfbuzz \
622671
--disable-require-system-font-provider
623672
make -j$(sysctl -n hw.ncpu)
624673
make install
@@ -770,6 +819,7 @@ jobs:
770819
- libmp3lame (MP3 audio)
771820
- libvorbis (Vorbis audio)
772821
- libwebp (WebP images)
822+
- HarfBuzz (Text shaping)
773823
- libfreetype (Font rendering)
774824
- libfribidi (Bidi text)
775825
- libass (Subtitles)

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ Download from [Releases](https://github.com/vanloctech/ffmpeg-macos/releases).
2121
- **libmp3lame** - MP3 audio encoder
2222
- **libvorbis** - Vorbis audio encoder
2323
- **libwebp** - WebP image encoder
24+
- **HarfBuzz** - Text shaping for subtitle rendering
2425
- **libfreetype** - Font rendering
2526
- **libfribidi** - Unicode bidirectional text
2627
- **libass** - ASS/SSA subtitle rendering
@@ -76,6 +77,7 @@ The included codecs have their own licenses:
7677
- libmp3lame: LGPL
7778
- libvorbis: BSD
7879
- libwebp: BSD
80+
- HarfBuzz: MIT
7981
- freetype: FTL/GPL
8082
- fribidi: LGPL
8183
- libass: ISC

0 commit comments

Comments
 (0)