2021-01-14 08:34:20 +00:00
|
|
|
#
|
|
|
|
# Helper module to build macOS version of various source ports
|
2022-01-11 09:43:29 +00:00
|
|
|
# Copyright (C) 2020-2022 Alexey Lysiuk
|
2021-01-14 08:34:20 +00:00
|
|
|
#
|
|
|
|
# This program is free software: you can redistribute it and/or modify
|
|
|
|
# it under the terms of the GNU General Public License as published by
|
|
|
|
# the Free Software Foundation, either version 3 of the License, or
|
|
|
|
# (at your option) any later version.
|
|
|
|
#
|
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
|
|
|
#
|
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#
|
|
|
|
|
|
|
|
import os
|
|
|
|
import shutil
|
2022-08-22 07:49:48 +00:00
|
|
|
from pathlib import Path
|
2021-08-05 07:12:20 +00:00
|
|
|
from platform import machine
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
from ..state import BuildState
|
2021-08-05 07:12:20 +00:00
|
|
|
from .base import CMakeTarget, MakeTarget
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
class MakeMainTarget(MakeTarget):
|
|
|
|
def __init__(self, name=None):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
self.destination = self.DESTINATION_OUTPUT
|
|
|
|
|
|
|
|
|
|
|
|
class CMakeMainTarget(CMakeTarget):
|
|
|
|
def __init__(self, name=None):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
self.destination = self.DESTINATION_OUTPUT
|
|
|
|
self.outputs = (self.name + '.app',)
|
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
if state.xcode:
|
|
|
|
return
|
|
|
|
|
2021-07-22 06:51:13 +00:00
|
|
|
if state.install_path.exists():
|
2021-01-14 08:34:20 +00:00
|
|
|
shutil.rmtree(state.install_path)
|
|
|
|
|
|
|
|
os.makedirs(state.install_path)
|
|
|
|
|
|
|
|
for output in self.outputs:
|
2021-07-22 06:51:13 +00:00
|
|
|
src = state.build_path / output
|
2021-01-14 08:34:20 +00:00
|
|
|
dst_sep_pos = output.rfind(os.sep)
|
2021-07-22 06:51:13 +00:00
|
|
|
dst = state.install_path / (output if dst_sep_pos == -1 else output[dst_sep_pos + 1:])
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-08-04 06:40:31 +00:00
|
|
|
if src.is_dir():
|
|
|
|
shutil.copytree(src, dst)
|
|
|
|
else:
|
|
|
|
shutil.copy(src, dst)
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
@staticmethod
|
|
|
|
def _force_cross_compilation(state: BuildState):
|
2021-01-14 08:34:20 +00:00
|
|
|
if state.architecture() == machine():
|
|
|
|
return
|
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
opts = state.options
|
2021-01-14 08:34:20 +00:00
|
|
|
opts['FORCE_CROSSCOMPILE'] = 'YES'
|
2021-07-22 06:51:13 +00:00
|
|
|
opts['IMPORT_EXECUTABLES'] = state.native_build_path / 'ImportExecutables.cmake'
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-12-11 14:07:33 +00:00
|
|
|
@staticmethod
|
|
|
|
def _force_openal_soft(state: BuildState):
|
|
|
|
# Explicit OpenAL configuration to avoid selection of Apple's framework
|
|
|
|
opts = state.options
|
|
|
|
opts['OPENAL_INCLUDE_DIR'] = state.include_path / 'AL'
|
|
|
|
opts['OPENAL_LIBRARY'] = state.lib_path / 'libopenal.a'
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2022-07-26 07:19:02 +00:00
|
|
|
class CMakeSingleExeMainTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name=None):
|
|
|
|
super().__init__(name)
|
|
|
|
self.outputs = (name,)
|
|
|
|
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
class ZDoomBaseTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name=None):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2021-08-05 06:59:49 +00:00
|
|
|
opts = state.options
|
2022-08-22 07:49:48 +00:00
|
|
|
opts['CMAKE_EXE_LINKER_FLAGS'] += state.run_pkg_config('--libs', 'fluidsynth', 'libmpg123')
|
2021-01-14 08:34:20 +00:00
|
|
|
opts['PK3_QUIET_ZIPDIR'] = 'YES'
|
|
|
|
opts['DYN_OPENAL'] = 'NO'
|
|
|
|
|
|
|
|
self._force_cross_compilation(state)
|
2021-12-11 14:07:33 +00:00
|
|
|
self._force_openal_soft(state)
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
|
2021-04-09 19:06:19 +00:00
|
|
|
class ZDoomVulkanBaseTarget(ZDoomBaseTarget):
|
|
|
|
def __init__(self, name=None):
|
2021-01-14 08:34:20 +00:00
|
|
|
super().__init__(name)
|
|
|
|
|
2022-08-22 07:49:48 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
if state.static_moltenvk:
|
|
|
|
state.options['CMAKE_EXE_LINKER_FLAGS'] += '-framework Metal -framework IOSurface -lMoltenVK-static'
|
|
|
|
|
|
|
|
# Unset SDK because MoltenVK usually requires the latest one shipped with Xcode
|
|
|
|
state.platform.sdk_path = None
|
|
|
|
|
|
|
|
# Replace volk and update revision files
|
|
|
|
replacement_src_path = state.patch_path / 'static-moltenvk'
|
|
|
|
replacement_files = ('UpdateRevision.cmake', 'volk.c', 'volk.h')
|
|
|
|
|
|
|
|
replacement_dst_volk_subpath = 'common/rendering/vulkan/thirdparty/volk/'
|
|
|
|
replacement_dst_volk_path = Path('src') / replacement_dst_volk_subpath
|
|
|
|
|
|
|
|
if not os.path.exists(state.source / replacement_dst_volk_path):
|
|
|
|
replacement_dst_volk_path = Path('source') / replacement_dst_volk_subpath
|
|
|
|
|
|
|
|
replacement_dst_paths = (
|
|
|
|
'tools/updaterevision',
|
|
|
|
replacement_dst_volk_path,
|
|
|
|
replacement_dst_volk_path
|
|
|
|
)
|
|
|
|
|
|
|
|
for dst_path, filename in zip(replacement_dst_paths, replacement_files):
|
|
|
|
src = replacement_src_path / filename
|
|
|
|
dst = state.source / dst_path / filename
|
|
|
|
|
|
|
|
src_stat = os.stat(src)
|
|
|
|
dst_stat = os.stat(dst)
|
|
|
|
|
|
|
|
if src_stat.st_mtime != dst_stat.st_mtime:
|
|
|
|
shutil.copy2(src, dst)
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
def post_build(self, state: BuildState):
|
2022-08-22 07:49:48 +00:00
|
|
|
if not state.static_moltenvk:
|
|
|
|
# Put MoltenVK library into application bundle
|
|
|
|
molten_lib = 'libMoltenVK.dylib'
|
|
|
|
src_path = state.lib_path / molten_lib
|
|
|
|
dst_path = state.build_path
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2022-08-22 07:49:48 +00:00
|
|
|
if state.xcode:
|
|
|
|
# TODO: Support other configurations
|
|
|
|
dst_path /= 'Debug'
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2022-08-22 07:49:48 +00:00
|
|
|
dst_path /= self.name + '.app/Contents/MacOS'
|
|
|
|
os.makedirs(dst_path, exist_ok=True)
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2022-08-22 07:49:48 +00:00
|
|
|
dst_path /= molten_lib
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2022-08-22 07:49:48 +00:00
|
|
|
if not dst_path.exists():
|
|
|
|
copy_func = state.xcode and os.symlink or shutil.copy
|
|
|
|
copy_func(src_path, dst_path)
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
super().post_build(state)
|
|
|
|
|
|
|
|
|
2021-04-09 19:06:19 +00:00
|
|
|
class GZDoomTarget(ZDoomVulkanBaseTarget):
|
|
|
|
def __init__(self, name='gzdoom'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2022-07-26 07:17:32 +00:00
|
|
|
state.checkout_git('https://github.com/ZDoom/gzdoom.git')
|
2021-04-09 19:06:19 +00:00
|
|
|
|
|
|
|
|
|
|
|
class QZDoomTarget(ZDoomVulkanBaseTarget):
|
2021-01-14 08:34:20 +00:00
|
|
|
def __init__(self, name='qzdoom'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2022-07-26 07:17:32 +00:00
|
|
|
state.checkout_git('https://github.com/ZDoom/qzdoom.git')
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
|
2021-08-01 09:43:57 +00:00
|
|
|
class LZDoomTarget(ZDoomBaseTarget):
|
2021-02-01 08:44:38 +00:00
|
|
|
def __init__(self, name='lzdoom'):
|
|
|
|
super().__init__(name)
|
2021-01-14 08:34:20 +00:00
|
|
|
self.unsupported_architectures = ('arm64',)
|
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
2021-06-28 07:50:35 +00:00
|
|
|
opts['DYN_FLUIDSYNTH'] = 'NO'
|
|
|
|
opts['DYN_MPG123'] = 'NO'
|
|
|
|
opts['DYN_SNDFILE'] = 'NO'
|
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
super().configure(state)
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
def prepare_source(self, state: BuildState):
|
2021-02-18 11:21:46 +00:00
|
|
|
state.checkout_git('https://github.com/drfrag666/gzdoom.git', branch='g3.3mgw')
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-04-10 11:37:34 +00:00
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-08-01 09:43:57 +00:00
|
|
|
return state.has_source_file('ico_lzdoom.png')
|
2021-04-10 11:37:34 +00:00
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-04-09 19:06:48 +00:00
|
|
|
class RazeTarget(ZDoomVulkanBaseTarget):
|
2021-01-14 08:34:20 +00:00
|
|
|
def __init__(self, name='raze'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2022-07-26 07:17:32 +00:00
|
|
|
state.checkout_git('https://github.com/ZDoom/Raze.git')
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
|
2022-09-03 07:15:14 +00:00
|
|
|
class HandsOfNecromancyTarget(ZDoomVulkanBaseTarget):
|
|
|
|
def __init__(self, name='handsofnecromancy'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/HandsOfNecromancy/HandsOfNecromancy-Engine.git')
|
|
|
|
|
|
|
|
|
2022-09-03 07:15:44 +00:00
|
|
|
class RedemptionTarget(ZDoomVulkanBaseTarget):
|
|
|
|
def __init__(self, name='redemption'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/RedemptionEngine/redemption.git')
|
|
|
|
|
|
|
|
|
2022-09-19 13:40:23 +00:00
|
|
|
class DisdainTarget(ZDoomVulkanBaseTarget):
|
|
|
|
def __init__(self, name='disdain'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/MischiefDonut/disdain-src.git')
|
|
|
|
|
|
|
|
|
2022-07-26 07:19:02 +00:00
|
|
|
class AccTarget(CMakeSingleExeMainTarget):
|
2021-01-14 08:34:20 +00:00
|
|
|
def __init__(self, name='acc'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2022-07-26 07:17:32 +00:00
|
|
|
state.checkout_git('https://github.com/ZDoom/acc.git')
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
|
2022-07-26 07:19:02 +00:00
|
|
|
class WadExtTarget(CMakeSingleExeMainTarget):
|
2021-08-08 10:09:38 +00:00
|
|
|
def __init__(self, name='wadext'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2022-07-26 07:17:32 +00:00
|
|
|
state.checkout_git('https://github.com/ZDoom/wadext.git')
|
2021-08-08 10:09:38 +00:00
|
|
|
|
|
|
|
|
2022-07-26 07:19:54 +00:00
|
|
|
class ZdbspTarget(CMakeSingleExeMainTarget):
|
|
|
|
def __init__(self, name='zdbsp'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/ZDoom/zdbsp.git')
|
|
|
|
|
|
|
|
|
2022-07-26 07:22:30 +00:00
|
|
|
class ZDRayTarget(CMakeSingleExeMainTarget):
|
|
|
|
def __init__(self, name='zdray'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/ZDoom/ZDRay.git')
|
|
|
|
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
class PrBoomPlusTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name='prboom-plus'):
|
|
|
|
super().__init__(name)
|
|
|
|
self.src_root = 'prboom2'
|
|
|
|
self.outputs = ('Launcher.app',)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/coelckers/prboom-plus.git')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2021-08-05 06:59:49 +00:00
|
|
|
opts = state.options
|
2021-01-14 08:34:20 +00:00
|
|
|
opts['CMAKE_C_FLAGS'] = '-D_FILE_OFFSET_BITS=64'
|
|
|
|
opts['CMAKE_EXE_LINKER_FLAGS'] = state.run_pkg_config('--libs', 'SDL2_mixer', 'SDL2_image')
|
|
|
|
opts['CMAKE_POLICY_DEFAULT_CMP0056'] = 'NEW'
|
|
|
|
|
|
|
|
self._force_cross_compilation(state)
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
|
2021-03-10 08:41:10 +00:00
|
|
|
class DsdaDoom(PrBoomPlusTarget):
|
|
|
|
def __init__(self, name='dsda-doom'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/kraflab/dsda-doom.git')
|
|
|
|
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
class ChocolateDoomBaseTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name=None):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2021-08-05 06:59:49 +00:00
|
|
|
state.options['CMAKE_EXE_LINKER_FLAGS'] = state.run_pkg_config('--libs', 'SDL2_mixer')
|
2021-01-14 08:34:20 +00:00
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
def _fill_outputs(self, exe_prefix: str):
|
|
|
|
self.outputs = (
|
|
|
|
f'src/{exe_prefix}-doom',
|
|
|
|
f'src/{exe_prefix}-heretic',
|
|
|
|
f'src/{exe_prefix}-hexen',
|
|
|
|
f'src/{exe_prefix}-server',
|
|
|
|
f'src/{exe_prefix}-setup',
|
|
|
|
f'src/{exe_prefix}-strife',
|
2021-08-04 06:39:51 +00:00
|
|
|
'src/midiread',
|
|
|
|
'src/mus2mid',
|
2021-01-14 08:34:20 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
class ChocolateDoomTarget(ChocolateDoomBaseTarget):
|
|
|
|
def __init__(self, name='chocolate-doom'):
|
|
|
|
super().__init__(name)
|
|
|
|
self._fill_outputs('chocolate')
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/chocolate-doom/chocolate-doom.git')
|
|
|
|
|
|
|
|
|
|
|
|
class CrispyDoomTarget(ChocolateDoomBaseTarget):
|
|
|
|
def __init__(self, name='crispy-doom'):
|
|
|
|
super().__init__(name)
|
|
|
|
self._fill_outputs('crispy')
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/fabiangreffrath/crispy-doom.git')
|
|
|
|
|
|
|
|
|
|
|
|
class RudeTarget(ChocolateDoomBaseTarget):
|
|
|
|
def __init__(self, name='rude'):
|
|
|
|
super().__init__(name)
|
|
|
|
self._fill_outputs('rude')
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/drfrag666/RUDE.git')
|
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
2021-01-17 10:37:35 +00:00
|
|
|
shutil.copy(state.source + '/data/rude.wad', state.install_path)
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
|
|
|
|
class WoofTarget(ChocolateDoomBaseTarget):
|
|
|
|
def __init__(self, name='woof'):
|
|
|
|
super().__init__(name)
|
|
|
|
self.outputs = ('Source/woof',)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/fabiangreffrath/woof.git')
|
|
|
|
|
|
|
|
|
|
|
|
class DoomRetroTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name='doomretro'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/bradharding/doomretro.git')
|
|
|
|
|
|
|
|
|
|
|
|
class Doom64EXTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name='doom64ex'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/svkaiser/Doom64EX.git')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2021-08-05 06:59:49 +00:00
|
|
|
opts = state.options
|
2021-01-14 08:34:20 +00:00
|
|
|
opts['ENABLE_SYSTEM_FLUIDSYNTH'] = 'YES'
|
|
|
|
opts['CMAKE_EXE_LINKER_FLAGS'] = state.run_pkg_config('--libs', 'SDL2', 'fluidsynth')
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
|
|
|
|
class DevilutionXTarget(CMakeMainTarget):
|
|
|
|
def __init__(self, name='devilutionx'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/diasurgical/devilutionX.git')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2021-08-05 06:59:49 +00:00
|
|
|
state.options['CMAKE_EXE_LINKER_FLAGS'] = state.run_pkg_config('--libs', 'SDL2_mixer', 'SDL2_ttf')
|
2021-01-14 08:34:20 +00:00
|
|
|
super().configure(state)
|
|
|
|
|
2021-06-05 09:59:37 +00:00
|
|
|
# Remove version file that is included erroneously because of case-insensitive file system
|
2021-07-22 06:51:13 +00:00
|
|
|
version_file = state.build_path / '_deps/libzt-src/ext/ZeroTierOne/ext/miniupnpc/VERSION'
|
|
|
|
version_file.unlink(missing_ok=True)
|
2021-06-05 09:59:37 +00:00
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
class EDuke32Target(MakeMainTarget):
|
|
|
|
def __init__(self, name='eduke32'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://voidpoint.io/terminx/eduke32.git')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
|
|
|
def has_bundle(name: str) -> bool:
|
2021-08-04 06:39:51 +00:00
|
|
|
probe_path = state.source / f'platform/Apple/bundles/{name}.app'
|
2021-07-22 06:51:13 +00:00
|
|
|
return probe_path.exists()
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
return has_bundle('EDuke32') and not has_bundle('NBlood')
|
|
|
|
|
|
|
|
|
|
|
|
class NBloodTarget(EDuke32Target):
|
|
|
|
def __init__(self, name='nblood'):
|
|
|
|
super().__init__(name)
|
|
|
|
self.tool = 'gmake'
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://github.com/nukeykt/NBlood.git')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('nblood.pk3')
|
2021-01-14 08:34:20 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
for target in ('duke3d', 'sw', 'blood', 'rr', 'exhumed', 'tools'):
|
|
|
|
state.options[target] = None
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
|
|
|
|
class QuakespasmTarget(MakeMainTarget):
|
|
|
|
def __init__(self, name='quakespasm'):
|
|
|
|
super().__init__(name)
|
|
|
|
self.src_root = 'Quake'
|
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.checkout_git('https://git.code.sf.net/p/quakespasm/quakespasm')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
|
|
|
return state.has_source_file('Quakespasm.txt')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-01-14 08:34:20 +00:00
|
|
|
# TODO: Use macOS specific Makefile which requires manual application bundle creation
|
2021-08-05 06:59:49 +00:00
|
|
|
opts = state.options
|
2021-01-14 08:34:20 +00:00
|
|
|
opts['USE_SDL2'] = '1'
|
|
|
|
opts['USE_CODEC_FLAC'] = '1'
|
|
|
|
opts['USE_CODEC_OPUS'] = '1'
|
|
|
|
opts['USE_CODEC_MIKMOD'] = '1'
|
|
|
|
opts['USE_CODEC_UMX'] = '1'
|
|
|
|
# Add main() alias to workaround executable linking without macOS launcher
|
|
|
|
opts['COMMON_LIBS'] = '-framework OpenGL -Wl,-alias -Wl,_SDL_main -Wl,_main'
|