From d370fae3793dbac81a4a286b0106157b4763a08d Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 23 Aug 2023 12:26:30 +0300 Subject: [PATCH] aedi: move webp to tier 1 --- aedi/target/__init__.py | 2 +- aedi/target/library_tier1.py | 27 +++++++++++++++++++++++++++ aedi/target/library_tier3.py | 27 --------------------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/aedi/target/__init__.py b/aedi/target/__init__.py index a43ebec4..50e1c593 100644 --- a/aedi/target/__init__.py +++ b/aedi/target/__init__.py @@ -71,6 +71,7 @@ def targets(): SndFileTarget(), VorbisTarget(), VpxTarget(), + WebpTarget(), ZlibNgTarget(), ZMusicTarget(), @@ -108,7 +109,6 @@ def targets(): Sdl2TtfTarget(), SfmlTarget(), TiffTarget(), - WebpTarget(), WxWidgetsTarget(), ZstdTarget(), diff --git a/aedi/target/library_tier1.py b/aedi/target/library_tier1.py index ee464c26..602f3155 100644 --- a/aedi/target/library_tier1.py +++ b/aedi/target/library_tier1.py @@ -478,6 +478,33 @@ class VpxTarget(base.ConfigureMakeDependencyTarget): self.update_text_file(state.build_path / 'vpx_config.c', clean_build_config) +class WebpTarget(base.CMakeStaticDependencyTarget): + def __init__(self, name='webp'): + super().__init__(name) + + def prepare_source(self, state: BuildState): + state.download_source( + 'https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz', + '7656532f837af5f4cec3ff6bafe552c044dc39bf453587bd5b77450802f4aee6', + patches='webp-fix-cmake') + + def configure(self, state: BuildState): + option_suffices = ( + 'ANIM_UTILS', 'CWEBP', 'DWEBP', 'EXTRAS', 'GIF2WEBP', 'IMG2WEBP', 'LIBWEBPMUX', 'VWEBP', 'WEBPINFO', + ) + + for suffix in option_suffices: + state.options[f'WEBP_BUILD_{suffix}'] = 'NO' + + super().configure(state) + + def post_build(self, state: BuildState): + super().post_build(state) + + shutil.copytree(state.install_path / 'share/WebP/cmake', state.install_path / 'lib/cmake/WebP') + self.keep_module_target(state, 'WebP::webp') + + class ZlibNgTarget(base.CMakeStaticDependencyTarget): def __init__(self, name='zlib-ng'): super().__init__(name) diff --git a/aedi/target/library_tier3.py b/aedi/target/library_tier3.py index b4fb604e..447d1d3f 100644 --- a/aedi/target/library_tier3.py +++ b/aedi/target/library_tier3.py @@ -354,33 +354,6 @@ class TiffTarget(base.CMakeStaticDependencyTarget): return line -class WebpTarget(base.CMakeStaticDependencyTarget): - def __init__(self, name='webp'): - super().__init__(name) - - def prepare_source(self, state: BuildState): - state.download_source( - 'https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.2.2.tar.gz', - '7656532f837af5f4cec3ff6bafe552c044dc39bf453587bd5b77450802f4aee6', - patches='webp-fix-cmake') - - def configure(self, state: BuildState): - option_suffices = ( - 'ANIM_UTILS', 'CWEBP', 'DWEBP', 'EXTRAS', 'GIF2WEBP', 'IMG2WEBP', 'LIBWEBPMUX', 'VWEBP', 'WEBPINFO', - ) - - for suffix in option_suffices: - state.options[f'WEBP_BUILD_{suffix}'] = 'NO' - - super().configure(state) - - def post_build(self, state: BuildState): - super().post_build(state) - - shutil.copytree(state.install_path / 'share/WebP/cmake', state.install_path / 'lib/cmake/WebP') - self.keep_module_target(state, 'WebP::webp') - - class WxWidgetsTarget(base.CMakeStaticDependencyTarget): def __init__(self, name='wxwidgets'): super().__init__(name)