From a7adc9f91224ba7baf34e8685c299dcbe67e4969 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Wed, 23 Jun 2021 10:14:07 +0300 Subject: [PATCH] aedi: add expat target --- aedi/target/__init__.py | 1 + aedi/target/library_tier2.py | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/aedi/target/__init__.py b/aedi/target/__init__.py index 4b4db4bd..bc4a584a 100644 --- a/aedi/target/__init__.py +++ b/aedi/target/__init__.py @@ -68,6 +68,7 @@ def targets(): # Libraries needed for other targets DumbTarget(), + ExpatTarget(), FmtTarget(), FreeTypeTarget(), FtglTarget(), diff --git a/aedi/target/library_tier2.py b/aedi/target/library_tier2.py index 422bc70e..fba2bcee 100644 --- a/aedi/target/library_tier2.py +++ b/aedi/target/library_tier2.py @@ -41,6 +41,24 @@ class DumbTarget(CMakeStaticDependencyTarget): return 'Libs: -L${libdir} -ldumb\n' if line.startswith('Libs:') else line +class ExpatTarget(CMakeStaticDependencyTarget): + def __init__(self, name='expat'): + super().__init__(name) + + opts = self.options + opts['EXPAT_BUILD_EXAMPLES'] = 'NO' + opts['EXPAT_BUILD_TESTS'] = 'NO' + opts['EXPAT_BUILD_TOOLS'] = 'NO' + + def prepare_source(self, state: BuildState): + state.download_source( + 'https://github.com/libexpat/libexpat/releases/download/R_2_4_1/expat-2.4.1.tar.xz', + 'cf032d0dba9b928636548e32b327a2d66b1aab63c4f4a13dd132c2d1d2f2fb6a') + + def detect(self, state: BuildState) -> bool: + return os.path.exists(state.source + 'expat.pc.in') + + class FmtTarget(CMakeStaticDependencyTarget): def __init__(self, name='fmt'): super().__init__(name)