From ce124328a04684821e580dffac780ad9e8fcc10f Mon Sep 17 00:00:00 2001 From: Mark Collins Date: Tue, 8 Aug 2023 09:54:03 +0000 Subject: [PATCH] freedreno+meson: Add lua+libarchive+libxml from Meson WrapDB These dependencies are required for building freedreno tools but on platforms such as Android, these aren't included and would need to be built from source. The easiest way to do this was using the Meson WrapDB. Additionally, warnings were added when these deps are missing as the decode tools will silently not be built otherwise. Signed-off-by: Mark Collins Part-of: --- src/freedreno/decode/meson.build | 6 ++++++ src/freedreno/meson.build | 8 +++++--- subprojects/libarchive.wrap | 13 +++++++++++++ subprojects/libxml2.wrap | 13 +++++++++++++ subprojects/lua.wrap | 14 ++++++++++++++ 5 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 subprojects/libarchive.wrap create mode 100644 subprojects/libxml2.wrap create mode 100644 subprojects/lua.wrap diff --git a/src/freedreno/decode/meson.build b/src/freedreno/decode/meson.build index 6a093c6d0df..062798fe654 100644 --- a/src/freedreno/decode/meson.build +++ b/src/freedreno/decode/meson.build @@ -137,6 +137,8 @@ if dep_libarchive.found() build_by_default: with_tools.contains('freedreno'), install: install_fd_decode_tools, ) +else + warning('libarchive not found, not building replay or rddecompiler') endif if dep_lua.found() and dep_libarchive.found() @@ -197,6 +199,8 @@ if dep_lua.found() and dep_libarchive.found() endforeach endif +else + warning('lua or libarchive not found, not building cffdump') endif crashdec = executable( @@ -289,4 +293,6 @@ if dep_libarchive.found() build_by_default: with_tools.contains('freedreno'), install: false, ) +else + warning('libarchive not found, not building pgmdump') endif diff --git a/src/freedreno/meson.build b/src/freedreno/meson.build index 77621cfbeb2..de8dacc9a71 100644 --- a/src/freedreno/meson.build +++ b/src/freedreno/meson.build @@ -27,14 +27,14 @@ rnn_path = rnn_src_path + ':' + get_option('prefix') + '/' + rnn_install_path # TODO: use multi-argument dependency() in meson 0.60 foreach lua : ['lua54', 'lua53', 'lua52', 'lua'] - dep_lua = dependency(lua, required: false, version: '>=5.2') + dep_lua = dependency(lua, required: false, fallback : ['lua', 'lua_dep'], version: '>=5.2') if dep_lua.found() break endif endforeach -dep_libarchive = dependency('libarchive', required: false) -dep_libxml2 = dependency('libxml-2.0', required: false) +dep_libarchive = dependency('libarchive', fallback : ['libarchive', 'libarchive_dep'], required: false) +dep_libxml2 = dependency('libxml-2.0', fallback: ['libxml2', 'libxml2_dep'], required: false) prog_gzip = find_program('gzip', required: false) install_fd_decode_tools = dep_libxml2.found() and prog_gzip.found() and \ @@ -62,6 +62,8 @@ if dep_libxml2.found() and with_tools.contains('freedreno') subdir('rnn') subdir('decode') subdir('afuc') +elif with_tools.contains('freedreno') + message('libxml2 not found, skipping tools that depend on it') endif if with_tools.contains('drm-shim') diff --git a/subprojects/libarchive.wrap b/subprojects/libarchive.wrap new file mode 100644 index 00000000000..a989d5b6410 --- /dev/null +++ b/subprojects/libarchive.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = libarchive-3.7.1 +source_url = https://github.com/libarchive/libarchive/releases/download/v3.7.1/libarchive-3.7.1.tar.xz +source_filename = libarchive-3.7.1.tar.xz +source_hash = b17403ce670ff18d8e06fea05a9ea9accf70678c88f1b9392a2e29b51127895f +patch_filename = libarchive_3.7.1-2_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/libarchive_3.7.1-2/get_patch +patch_hash = ada92958fa10655ca0f710ecb7ec3db7751644d76001d5d36b352115399b1eef +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/libarchive_3.7.1-2/libarchive-3.7.1.tar.xz +wrapdb_version = 3.7.1-2 + +[provide] +libarchive = libarchive_dep diff --git a/subprojects/libxml2.wrap b/subprojects/libxml2.wrap new file mode 100644 index 00000000000..67f72349527 --- /dev/null +++ b/subprojects/libxml2.wrap @@ -0,0 +1,13 @@ +[wrap-file] +directory = libxml2-2.11.4 +source_url = https://download.gnome.org/sources/libxml2/2.11/libxml2-2.11.4.tar.xz +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/libxml2_2.11.4-1/libxml2-2.11.4.tar.xz +source_filename = libxml2-2.11.4.tar.xz +source_hash = 737e1d7f8ab3f139729ca13a2494fd17bf30ddb4b7a427cf336252cab57f57f7 +patch_filename = libxml2_2.11.4-1_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/libxml2_2.11.4-1/get_patch +patch_hash = 31867206881a6ec8f2338972775c9c9155aaf8c8a7d680331ae62ea231c9622e +wrapdb_version = 2.11.4-1 + +[provide] +libxml-2.0 = libxml2_dep diff --git a/subprojects/lua.wrap b/subprojects/lua.wrap new file mode 100644 index 00000000000..7e9f90c10c8 --- /dev/null +++ b/subprojects/lua.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = lua-5.4.6 +source_url = https://www.lua.org/ftp/lua-5.4.6.tar.gz +source_filename = lua-5.4.6.tar.gz +source_hash = 7d5ea1b9cb6aa0b59ca3dde1c6adcb57ef83a1ba8e5432c0ecd06bf439b3ad88 +patch_filename = lua_5.4.6-2_patch.zip +patch_url = https://wrapdb.mesonbuild.com/v2/lua_5.4.6-2/get_patch +patch_hash = a218f93461b1d9ba9367506f3198815f84ee25e2e4b50894679004aee9cb46f2 +source_fallback_url = https://github.com/mesonbuild/wrapdb/releases/download/lua_5.4.6-2/lua-5.4.6.tar.gz +wrapdb_version = 5.4.6-2 + +[provide] +lua-5.4 = lua_dep +lua = lua_dep