From 33212d8acc48fa43de571441ce11da35e51a3c4a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 3 Jan 2024 12:45:14 +0200 Subject: [PATCH] aedi: add xdelta target, version 3.1.0 --- aedi/target/__init__.py | 1 + aedi/target/tool_tier2.py | 26 ++++++++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/aedi/target/__init__.py b/aedi/target/__init__.py index abd2ee83..27f50599 100644 --- a/aedi/target/__init__.py +++ b/aedi/target/__init__.py @@ -135,6 +135,7 @@ def targets(): RizinTarget(), SeverZipTarget(), UnrarTarget(), + XdeltaTarget(), XzTarget(), ZipTarget(), diff --git a/aedi/target/tool_tier2.py b/aedi/target/tool_tier2.py index cccbbdbb..89c2bf14 100644 --- a/aedi/target/tool_tier2.py +++ b/aedi/target/tool_tier2.py @@ -262,6 +262,32 @@ class UnrarTarget(base.MakeTarget): return state.has_source_file('rar.hpp') +class XdeltaTarget(base.ConfigureMakeDependencyTarget): + # Depends on autoconf, automake, and (optionally) xz + def __init__(self, name='xdelta'): + super().__init__(name) + self.src_root = 'xdelta3' + + def prepare_source(self, state: BuildState): + state.download_source( + 'https://github.com/jmacd/xdelta/archive/refs/tags/v3.1.0.tar.gz', + '7515cf5378fca287a57f4e2fee1094aabc79569cfe60d91e06021a8fd7bae29d') + + def detect(self, state: BuildState) -> bool: + return state.has_source_file('xdelta3/xdelta3.h') + + def configure(self, state: BuildState): + # Invoke MakeTarget.configure() explicitly to create symlinks needed for autoconf + base.MakeTarget.configure(self, state) + + # Generate configure script with autoconf + work_path = state.build_path / self.src_root + subprocess.run(('autoreconf', '--install'), check=True, cwd=work_path, env=state.environment) + + # Run generated configure script + super().configure(state) + + class XzTarget(base.CMakeStaticDependencyTarget): def __init__(self, name='xz'): super().__init__(name)