aedi: move freeimage to tier 3

This commit is contained in:
alexey.lysiuk 2022-06-17 09:43:56 +03:00
parent 7ef601d807
commit ea2a6bb38d
3 changed files with 41 additions and 41 deletions

View file

@ -73,7 +73,6 @@ def targets():
DumbTarget(), DumbTarget(),
ExpatTarget(), ExpatTarget(),
FmtTarget(), FmtTarget(),
FreeImageTarget(),
FreeTypeTarget(), FreeTypeTarget(),
FtglTarget(), FtglTarget(),
GlewTarget(), GlewTarget(),
@ -102,6 +101,7 @@ def targets():
ZstdTarget(), ZstdTarget(),
# Obsolete libraries without binaries # Obsolete libraries without binaries
FreeImageTarget(),
WxWidgetsTarget(), WxWidgetsTarget(),
# Tools # Tools

View file

@ -107,46 +107,6 @@ class FmtTarget(CMakeStaticDependencyTarget):
super().configure(state) 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): class FreeTypeTarget(CMakeStaticDependencyTarget):
def __init__(self, name='freetype'): def __init__(self, name='freetype'):
super().__init__(name) super().__init__(name)

View file

@ -19,6 +19,46 @@
from .base import * 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): class WxWidgetsTarget(CMakeStaticDependencyTarget):
def __init__(self, name='wxwidgets'): def __init__(self, name='wxwidgets'):
super().__init__(name) super().__init__(name)