Hello team,

I've found myself in a situation where I was unable to build freetype using meson. The issue seems to be that I was using a variant of libpng locally built with CMake. As it turns out, with the current build script meson expects certain files to be named libpngconfig.cmake for example but libpng installs them as pngconfig.cmake. Meson is hence not able to recognize them and falls back to the subproject wrap file which doesn't have that issue. However, this does not work for me because I forbid downloading additional packages.

To fix this, I changed the meson build file to include a fallback 'png' library name in addition to the existing 'libpng' (new feature as of meson v0.60.0). With that, I was successfully able to build freetype.

I'd like to contribute my fix to freetype, please find a patch file attached. If you have any question regarding my patch and/or the problem I'm trying to address, please let me know.

Regards
lucebac
diff --git a/meson.build b/meson.build
index 09382fbef..1fb72f188 100644
--- a/meson.build
+++ b/meson.build
@@ -24,7 +24,7 @@
 #
 
 project('freetype2', 'c',
-  meson_version: '>= 0.55.0',
+  meson_version: '>= 0.60.0',
   version: run_command('builds/meson/extract_freetype_version.py',
                        'include/freetype/freetype.h',
                        check: true).stdout().strip(),
@@ -339,7 +339,7 @@ if bzip2_dep.found()
 endif
 
 # PNG support.
-libpng_dep = dependency('libpng',
+libpng_dep = dependency('libpng', 'png',
   required: get_option('png'),
   fallback: 'libpng')
 

Reply via email to