From ea2a6bb38dfe87ee8a6c45b12240b6d31927af1c Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Fri, 17 Jun 2022 09:43:56 +0300 Subject: [PATCH] aedi: move freeimage to tier 3 --- aedi/target/__init__.py | 2 +- aedi/target/library_tier2.py | 40 ------------------------------------ aedi/target/library_tier3.py | 40 ++++++++++++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/aedi/target/__init__.py b/aedi/target/__init__.py index 6504a8fb..b92f38b7 100644 --- a/aedi/target/__init__.py +++ b/aedi/target/__init__.py @@ -73,7 +73,6 @@ def targets(): DumbTarget(), ExpatTarget(), FmtTarget(), - FreeImageTarget(), FreeTypeTarget(), FtglTarget(), GlewTarget(), @@ -102,6 +101,7 @@ def targets(): ZstdTarget(), # Obsolete libraries without binaries + FreeImageTarget(), WxWidgetsTarget(), # Tools diff --git a/aedi/target/library_tier2.py b/aedi/target/library_tier2.py index 8e16e283..82414159 100644 --- a/aedi/target/library_tier2.py +++ b/aedi/target/library_tier2.py @@ -107,46 +107,6 @@ class FmtTarget(CMakeStaticDependencyTarget): super().configure(state) -class FreeImageTarget(MakeTarget): - def __init__(self, name='freeimage'): - super().__init__(name) - - def prepare_source(self, state: BuildState): - state.download_source( - 'https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.18.0/FreeImage3180.zip', - 'f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd', - patches='freeimage-fix-arm64') - - HEADER_FILE = 'Source/FreeImage.h' - - def detect(self, state: BuildState) -> bool: - return state.has_source_file(self.HEADER_FILE) - - def configure(self, state: BuildState): - super().configure(state) - - # These flags are copied from Makefile.gnu - common_flags = ' -O3 -fPIC -fexceptions -fvisibility=hidden' - - env = state.environment - env['CFLAGS'] += common_flags + ' -std=gnu89 -Wno-implicit-function-declaration' - env['CXXFLAGS'] += common_flags + ' -Wno-ctor-dtor-privacy' - - for option in ('-f', 'Makefile.gnu', 'libfreeimage.a'): - state.options[option] = None - - def post_build(self, state: BuildState): - include_path = state.install_path / 'include' - os.makedirs(include_path, exist_ok=True) - shutil.copy(state.build_path / self.HEADER_FILE, include_path) - - lib_path = state.install_path / 'lib' - os.makedirs(lib_path, exist_ok=True) - shutil.copy(state.build_path / 'libfreeimage.a', lib_path) - - self.write_pc_file(state, version='3.18.0', libs='-lfreeimage -lc++') - - class FreeTypeTarget(CMakeStaticDependencyTarget): def __init__(self, name='freetype'): super().__init__(name) diff --git a/aedi/target/library_tier3.py b/aedi/target/library_tier3.py index ed43b699..c13a011d 100644 --- a/aedi/target/library_tier3.py +++ b/aedi/target/library_tier3.py @@ -19,6 +19,46 @@ from .base import * +class FreeImageTarget(MakeTarget): + def __init__(self, name='freeimage'): + super().__init__(name) + + def prepare_source(self, state: BuildState): + state.download_source( + 'https://downloads.sourceforge.net/project/freeimage/Source%20Distribution/3.18.0/FreeImage3180.zip', + 'f41379682f9ada94ea7b34fe86bf9ee00935a3147be41b6569c9605a53e438fd', + patches='freeimage-fix-arm64') + + HEADER_FILE = 'Source/FreeImage.h' + + def detect(self, state: BuildState) -> bool: + return state.has_source_file(self.HEADER_FILE) + + def configure(self, state: BuildState): + super().configure(state) + + # These flags are copied from Makefile.gnu + common_flags = ' -O3 -fPIC -fexceptions -fvisibility=hidden' + + env = state.environment + env['CFLAGS'] += common_flags + ' -std=gnu89 -Wno-implicit-function-declaration' + env['CXXFLAGS'] += common_flags + ' -Wno-ctor-dtor-privacy' + + for option in ('-f', 'Makefile.gnu', 'libfreeimage.a'): + state.options[option] = None + + def post_build(self, state: BuildState): + include_path = state.install_path / 'include' + os.makedirs(include_path, exist_ok=True) + shutil.copy(state.build_path / self.HEADER_FILE, include_path) + + lib_path = state.install_path / 'lib' + os.makedirs(lib_path, exist_ok=True) + shutil.copy(state.build_path / 'libfreeimage.a', lib_path) + + self.write_pc_file(state, version='3.18.0', libs='-lfreeimage -lc++') + + class WxWidgetsTarget(CMakeStaticDependencyTarget): def __init__(self, name='wxwidgets'): super().__init__(name)