@@ -3,11 +3,8 @@ set -e -x
33
44cd $( dirname ` readlink -f " $0 " ` )
55
6- # TODO: when freetype is updated, we can look into resolving the circular
7- # dependency between freetype and harfbuzz by using the upcoming freetype
8- # dynamic harfbuzz loading feature.
9- FREETYPE=" freetype-2.13.3"
10- HARFBUZZ_VER=11.3.3
6+ FREETYPE=" freetype-2.14.1"
7+ HARFBUZZ_VER=12.1.0
118HARFBUZZ_NAME=" harfbuzz-$HARFBUZZ_VER "
129
1310curl -sL --retry 10 https://savannah.nongnu.org/download/freetype/${FREETYPE} .tar.gz > ${FREETYPE} .tar.gz
@@ -19,19 +16,24 @@ tar xzf ${FREETYPE}.tar.gz
1916unxz ${HARFBUZZ_NAME} .tar.xz
2017tar xf ${HARFBUZZ_NAME} .tar
2118
22- # freetype and harfbuzz have an infamous circular dependency, which is why
23- # this file is not like the rest of docker_base files
24-
25- # 1. First compile freetype without harfbuzz support
2619cd $FREETYPE
2720
28- ./configure $PG_BASE_CONFIGURE_FLAGS --with-harfbuzz=no
29- make
30- make install # this freetype is not installed to mac cache dir
21+ # For now bzip2 is only used on macOS, on other platforms there are issues with
22+ # it.
23+ if [[ " $OSTYPE " == " darwin" * ]]; then
24+ export PG_FT_BZ2=" -Dbzip2=enabled"
25+ else
26+ export PG_FT_BZ2=" -Dbzip2=disabled"
27+ fi
28+
29+ meson setup _build $PG_BASE_MESON_FLAGS -Dbrotli=enabled -Dharfbuzz=dynamic \
30+ -Dpng=enabled -Dzlib=system $PG_FT_BZ2
31+
32+ meson compile -C _build
33+ meson install -C _build
3134
3235cd ..
3336
34- # 2. Compile harfbuzz with freetype support
3537cd ${HARFBUZZ_NAME}
3638
3739# harfbuzz has a load of optional dependencies but only freetype is important
@@ -46,28 +48,4 @@ meson setup _build $PG_BASE_MESON_FLAGS -Dfreetype=enabled \
4648meson compile -C _build
4749meson install -C _build
4850
49- if [[ " $OSTYPE " == " darwin" * ]]; then
50- # We do a little hack...
51- # When freetype finds harfbuzz with pkg-config, we tell freetype a little
52- # lie that harfbuzz doesn't depend on freetype (even though it does).
53- # This ensures no direct circular dylib link happen.
54- # This is a bit of a brittle hack: This command removes the entire line that
55- # contains "freetype". This is fine for now when the harfbuzz we are
56- # building has no other dependencies
57- sed -i ' ' ' /freetype/d' $PG_DEP_PREFIX /lib/pkgconfig/harfbuzz.pc
58- fi
59-
6051cd ..
61-
62- # 3. Recompile freetype, and this time with harfbuzz support
63- cd $FREETYPE
64-
65- # fully clean previous install
66- make clean
67- if [[ " $OSTYPE " == " darwin" * ]]; then
68- make uninstall
69- fi
70-
71- ./configure $PG_BASE_CONFIGURE_FLAGS --with-harfbuzz=yes
72- make
73- make install
0 commit comments