From 2c9d1d5d3d2d60cc9297758eb0d53aa8096ac7f4 Mon Sep 17 00:00:00 2001 From: Xavier Claessens Date: Wed, 13 Nov 2024 09:03:36 -0500 Subject: [PATCH] wrap: Print deprecation warnings when using wrapdb v1 --- docs/markdown/snippets/wrapdbv1.md | 5 +++++ mesonbuild/wrap/wrap.py | 9 +++++++++ 2 files changed, 14 insertions(+) create mode 100644 docs/markdown/snippets/wrapdbv1.md diff --git a/docs/markdown/snippets/wrapdbv1.md b/docs/markdown/snippets/wrapdbv1.md new file mode 100644 index 000000000000..4f0c8478afd1 --- /dev/null +++ b/docs/markdown/snippets/wrapdbv1.md @@ -0,0 +1,5 @@ +## Limited support for WrapDB v1 + +WrapDB v1 has been discontinued for several years, Meson will now print a +deprecation warning if a v1 URL is still being used. Wraps can be updated to +latest version using `meson wrap update` command. diff --git a/mesonbuild/wrap/wrap.py b/mesonbuild/wrap/wrap.py index 7aae1663fd1f..f25372ec995e 100644 --- a/mesonbuild/wrap/wrap.py +++ b/mesonbuild/wrap/wrap.py @@ -213,6 +213,15 @@ def from_wrap_file(filename: str, subproject: SubProject = SubProject('')) -> Pa wrap.original_filename = filename wrap.parse_provide_section(config) + patch_url = values.get('patch_url') + if patch_url and patch_url.startswith('https://wrapdb.mesonbuild.com/v1'): + if name == 'sqlite': + mlog.deprecation('sqlite wrap has been renamed to sqlite3, update using `meson wrap install sqlite3`') + elif name == 'libjpeg': + mlog.deprecation('libjpeg wrap has been renamed to libjpeg-turbo, update using `meson wrap install libjpeg-turbo`') + else: + mlog.deprecation(f'WrapDB v1 is deprecated, updated using `meson wrap update {name}`') + with open(filename, 'r', encoding='utf-8') as file: wrap.wrapfile_hash = hashlib.sha256(file.read().encode('utf-8')).hexdigest()