Commit bb42afbda084b0ac5b017f454fd1b262a94805dd

Tim-Philipp Müller 2021-01-17T15:50:08

[meson] Add subproject fallbacks for 'libpng' and 'zlib'. * subprojects/libpng.wrap, subprojects/zlib.wrap: New files. * meson.build: Updated.

diff --git a/ChangeLog b/ChangeLog
index 5b0aab4..c0e2511 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2021-03-07  Tim-Philipp Müller  <tim@centricular.com>
+
+	[meson] Add subproject fallbacks for 'libpng' and 'zlib'.
+
+	* subprojects/libpng.wrap, subprojects/zlib.wrap: New files.
+
+	* meson.build: Updated.
+
 2021-03-07  Xavier Claessens  <xavier.claessens@collabora.com>
 
 	[meson] Make it work with Windows.
diff --git a/meson.build b/meson.build
index 93b4894..c398456 100644
--- a/meson.build
+++ b/meson.build
@@ -229,8 +229,7 @@ ftoption_command = process_header_command
 
 
 # GZip support
-zlib_dep = dependency('zlib', required: get_option('zlib'),
-  fallback: ['zlib', 'zlib_dep'])
+zlib_dep = dependency('zlib', required: get_option('zlib'), fallback: 'zlib')
 if zlib_dep.found()
   ftoption_command += [
     '--enable=FT_CONFIG_OPTION_USE_ZLIB',
@@ -251,7 +250,7 @@ if bzip2_dep.found()
 endif
 
 # PNG support
-libpng_dep = dependency('libpng', required: get_option('png'))
+libpng_dep = dependency('libpng', required: get_option('png'), fallback: 'libpng')
 if libpng_dep.found()
   ftoption_command += ['--enable=FT_CONFIG_OPTION_USE_PNG']
   ft2_deps += [libpng_dep]
diff --git a/subprojects/libpng.wrap b/subprojects/libpng.wrap
new file mode 100644
index 0000000..599045b
--- /dev/null
+++ b/subprojects/libpng.wrap
@@ -0,0 +1,11 @@
+[wrap-file]
+directory = libpng-1.6.37
+source_url = https://github.com/glennrp/libpng/archive/v1.6.37.tar.gz
+source_filename = libpng-1.6.37.tar.gz
+source_hash = ca74a0dace179a8422187671aee97dd3892b53e168627145271cad5b5ac81307
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/libpng/1.6.37/3/get_zip
+patch_filename = libpng-1.6.37-3-wrap.zip
+patch_hash = 6c9f32fd9150b3a96ab89be52af664e32207e10aa9f5fb9aa015989ee2dd7100
+
+[provide]
+libpng = libpng_dep
diff --git a/subprojects/zlib.wrap b/subprojects/zlib.wrap
new file mode 100644
index 0000000..ce20fb0
--- /dev/null
+++ b/subprojects/zlib.wrap
@@ -0,0 +1,12 @@
+[wrap-file]
+directory = zlib-1.2.11
+source_url = http://zlib.net/fossils/zlib-1.2.11.tar.gz
+source_filename = zlib-1.2.11.tar.gz
+source_hash = c3e5e9fdd5004dcb542feda5ee4f0ff0744628baf8ed2dd5d66f8ca1197cb1a1
+patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.11/5/get_zip
+patch_filename = zlib-1.2.11-5-wrap.zip
+patch_hash = 728c8e24acbc2e6682fbd950fec39e2fc77528af361adb87259f8a8511434004
+
+[provide]
+zlib = zlib_dep
+