1 year ago

#151378

test-img

Jean-Michaël Celerier

Meson / Freetype / Harfbuzz : making Harfbuzz's meson script find freetype in /opt

I am trying to build freetype and harfbuzz. The latter depends on the former. Freetype builds with CMake, which I configured to install it in /opt/ossia-sdk.

I tried this as mentioned in Meson: how to make find_library() works with an unusual path? :

export LIBRARY_PATH=/opt/ossia-sdk/freetype
# also tried:
# export LIBRARY_PATH=/opt/ossia-sdk/freetype/lib
meson build -Dbuildtype=release -Ddefault_library=static -Dglib=disabled -Dgobject=disabled -Dicu=disabled -Ddocs=disabled -Dprefix=/opt/ossia-sdk/harfbuzz 

Yet it still gets my system freetype, which I do not want.

meson-log.txt has the following:

libraries: =/opt/ossia-sdk/freetype/x86_64-pc-linux-gnu/11.1.0/:/opt/ossia-sdk/freetype/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/lib/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/lib/../lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../x86_64-pc-linux-gnu/11.1.0/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../lib/:/lib/x86_64-pc-linux-gnu/11.1.0/:/lib/../lib/:/usr/lib/x86_64-pc-linux-gnu/11.1.0/:/usr/lib/../lib/:/opt/ossia-sdk/freetype/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../../x86_64-pc-linux-gnu/lib/:/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/../../../:/lib/:/usr/lib/

Build lines look like:

Command line:  c++ -I/usr/include/freetype2 -I/usr/include/libpng16 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/sysprof-4 /home/jcelerier/ossia/sdk/Linux/harfbuzz/build/meson-private/tmps978npqc/testfile.cpp -o /home/jcelerier/ossia/sdk/Linux/harfbuzz/build/meson-private/tmps978npqc/output.exe -pthread -O3 -march=x86-64 -mtune=generic -D_FILE_OFFSET_BITS=64 -O0 -fpermissive -std=c++11 -fno-rtti -Wl,--start-group /usr/lib/libfreetype.so -Wl,--end-group 

Any solution must not patch Freetype or harfbuzz's build scripts, I can only call them.

cmake

freetype

pkg-config

meson-build

harfbuzz

0 Answers

Your Answer

Accepted video resources