aedi: add hackrf target

This commit is contained in:
alexey.lysiuk 2025-03-04 13:30:30 +02:00
parent 9d8f61f814
commit 160f243d88
2 changed files with 22 additions and 0 deletions

View file

@ -136,6 +136,7 @@ def targets():
EricWToolsTarget(),
FFmpegTarget(),
GlslangTarget(),
HackRFTarget(),
M4Target(),
P7ZipTarget(),
PbzxTarget(),

View file

@ -181,6 +181,27 @@ class GlslangTarget(base.CMakeStaticDependencyTarget):
os.unlink(lib_cmake_path / entry)
class HackRFTarget(base.CMakeStaticDependencyTarget):
# Depends on fftw and usb
def __init__(self, name='hackrf'):
super().__init__(name)
self.src_root = 'host'
def prepare_source(self, state: BuildState):
state.download_source(
'https://github.com/greatscottgadgets/hackrf/releases/download/v2024.02.1/hackrf-2024.02.1.tar.xz',
'd9ced67e6b801cd02c18d0c4654ed18a4bcb36c24a64330c347dfccbd859ad16')
def configure(self, state: BuildState):
state.options['CMAKE_EXE_LINKER_FLAGS'] += '-framework CoreFoundation -framework IOKit -framework Security'
super().configure(state)
@staticmethod
def _process_pkg_config(pcfile: Path, line: str) -> str:
cflags = 'Cflags:'
return cflags + ' -I${includedir} -I${includedir}/libhackrf\n' if line.startswith(cflags) else line
class M4Target(base.ConfigureMakeDependencyTarget):
def __init__(self, name='m4'):
super().__init__(name)