From 6271f75898093b556b701d884ed1f73889a8ca94 Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Mon, 20 Mar 2023 13:06:24 +0200 Subject: [PATCH] wip [skip test] --- .github/workflows/build.yml | 8 +----- aedi/target/base.py | 52 ++++++++++++++++++++++++++++++++++++ aedi/target/library_tier1.py | 47 +++----------------------------- 3 files changed, 56 insertions(+), 51 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 98229543..e887a262 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,9 +14,7 @@ jobs: fail-fast: false matrix: target: - - GZDoom - - Raze - - PrBoom-Plus + - glib steps: - uses: actions/checkout@v3 @@ -25,10 +23,6 @@ jobs: run: | ./build.py --target ${{ matrix.target }} - - name: Generate Xcode project - run: | - ./build.py --target ${{ matrix.target }} --xcode - - name: List Build Directory if: always() shell: bash diff --git a/aedi/target/base.py b/aedi/target/base.py index 64a9e07c..baa305cd 100644 --- a/aedi/target/base.py +++ b/aedi/target/base.py @@ -502,3 +502,55 @@ class SingleExeCTarget(MakeTarget): def post_build(self, state: BuildState): self.copy_to_bin(state) + + +class MesonTarget(BuildTarget): + def __init__(self, name=None): + super().__init__(name) + + def configure(self, state: BuildState): + super().configure(state) + + c_compiler = state.c_compiler() + assert c_compiler + + cxx_compiler = state.cxx_compiler() + assert cxx_compiler + + cpu = state.architecture() + cpu_family = 'arm' if 'arm64' == cpu else cpu + + cross_file = state.build_path / (state.architecture() + '.txt') + with open(cross_file, 'w') as f: + f.write(f''' +[binaries] +c = '{c_compiler}' +cpp = '{cxx_compiler}' +objc = '{c_compiler}' +objcpp = '{cxx_compiler}' +pkgconfig = '{state.prefix_path}/bin/pkg-config' +strip = '/usr/bin/strip' + +[host_machine] +system = 'darwin' +cpu_family = '{cpu_family}' +cpu = '{cpu}' +endian = 'little' +''') + + args = ( + state.bin_path / 'meson', + f'--prefix={state.install_path}', + '--buildtype=release', + '--default-library=static', + f'--cross-file={cross_file}', + state.source + ) + subprocess.run(args, check=True, cwd=state.build_path, env=state.environment) + + def build(self, state: BuildState): + args = ('ninja',) + subprocess.run(args, check=True, cwd=state.build_path, env=state.environment) + + def post_build(self, state: BuildState): + self.install(state, tool='ninja') diff --git a/aedi/target/library_tier1.py b/aedi/target/library_tier1.py index 6ee3b391..8f1844ee 100644 --- a/aedi/target/library_tier1.py +++ b/aedi/target/library_tier1.py @@ -136,7 +136,7 @@ class GettextTarget(base.ConfigureMakeStaticDependencyTarget): super().configure(state) -class GlibTarget(base.BuildTarget): +class GlibTarget(base.MesonTarget): def __init__(self, name='glib'): super().__init__(name) @@ -150,54 +150,13 @@ class GlibTarget(base.BuildTarget): return state.has_source_file('glib.doap') def configure(self, state: BuildState): - super().configure(state) - environment = state.environment environment['LDFLAGS'] += ' -framework CoreFoundation -framework Foundation' - c_compiler = state.c_compiler() - assert c_compiler - - cxx_compiler = state.cxx_compiler() - assert cxx_compiler - - cpu = state.architecture() - cpu_family = 'arm' if 'arm64' == cpu else cpu - - cross_file = state.build_path / (state.architecture() + '.txt') - with open(cross_file, 'w') as f: - f.write(f''' -[binaries] -c = '{c_compiler}' -cpp = '{cxx_compiler}' -objc = '{c_compiler}' -objcpp = '{cxx_compiler}' -pkgconfig = '{state.prefix_path}/bin/pkg-config' -strip = '/usr/bin/strip' - -[host_machine] -system = 'darwin' -cpu_family = '{cpu_family}' -cpu = '{cpu}' -endian = 'little' -''') - - args = ( - state.bin_path / 'meson', - f'--prefix={state.install_path}', - '--buildtype=release', - '--default-library=static', - f'--cross-file={cross_file}', - state.source - ) - subprocess.run(args, check=True, cwd=state.build_path, env=environment) - - def build(self, state: BuildState): - args = ('ninja',) - subprocess.run(args, check=True, cwd=state.build_path, env=state.environment) + super().configure(state) def post_build(self, state: BuildState): - self.install(state, tool='ninja') + super().post_build(state) self.make_platform_header(state, '../lib/glib-2.0/include/glibconfig.h') @staticmethod