From c3f6f15c701593c3311740a6a776085d0f51f99a Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 28 Dec 2022 12:47:15 +0200 Subject: [PATCH] aedi: add quasi-glib target --- aedi/target/__init__.py | 1 + aedi/target/library_tier1.py | 17 +++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/aedi/target/__init__.py b/aedi/target/__init__.py index 6d5f34d8..c6e35d7c 100644 --- a/aedi/target/__init__.py +++ b/aedi/target/__init__.py @@ -69,6 +69,7 @@ def targets(): OpenALTarget(), OpusTarget(), PcreTarget(), + QuasiGlibTarget(), SndFileTarget(), VorbisTarget(), VpxTarget(), diff --git a/aedi/target/library_tier1.py b/aedi/target/library_tier1.py index 8795b8a4..6eff8896 100644 --- a/aedi/target/library_tier1.py +++ b/aedi/target/library_tier1.py @@ -507,6 +507,23 @@ class PcreTarget(ConfigureMakeStaticDependencyTarget): self.update_config_script(state.install_path / 'bin/pcre-config') +class QuasiGlibTarget(BuildTarget): + def __init__(self, name='quasi-glib'): + super().__init__(name) + + def build(self, state: BuildState): + lib_path = state.install_path / 'lib' + os.makedirs(lib_path, exist_ok=True) + + commands = ( + (state.cxx_compiler(), '-std=c++11', '-O3', '-c', state.patch_path / f'{self.name}.cpp'), + (state.host() + '-ar', '-crs', lib_path / f'lib{self.name}.a', f'{self.name}.o'), + ) + + for command in commands: + subprocess.run(command, check=True, cwd=state.build_path, env=state.environment) + + class SndFileTarget(CMakeStaticDependencyTarget): def __init__(self, name='sndfile'): super().__init__(name)