2021-05-01 08:54:52 +00:00
|
|
|
#
|
|
|
|
# Helper module to build macOS version of various source ports
|
2024-01-02 08:55:22 +00:00
|
|
|
# Copyright (C) 2020-2024 Alexey Lysiuk
|
2021-05-01 08:54:52 +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/>.
|
|
|
|
#
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
import os
|
|
|
|
import shutil
|
|
|
|
from pathlib import Path
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
from ..state import BuildState
|
|
|
|
from . import base
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
|
|
|
|
class DumbTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='dumb'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/kode54/dumb/archive/2.0.3.tar.gz',
|
|
|
|
'99bfac926aeb8d476562303312d9f47fd05b43803050cd889b44da34a9b2a4f9')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('include/dumb.h')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['BUILD_ALLEGRO4'] = 'NO'
|
|
|
|
opts['BUILD_EXAMPLES'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
@staticmethod
|
2021-08-01 13:14:43 +00:00
|
|
|
def _process_pkg_config(pcfile: Path, line: str) -> str:
|
2021-06-20 11:44:18 +00:00
|
|
|
return 'Libs: -L${libdir} -ldumb\n' if line.startswith('Libs:') else line
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-04-13 14:02:57 +00:00
|
|
|
class FluidSynthTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='fluidsynth'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2024-08-04 06:41:32 +00:00
|
|
|
'https://github.com/FluidSynth/fluidsynth/archive/refs/tags/v2.3.6.tar.gz',
|
|
|
|
'3340d73286b28fe6e5150fbe12648d4640e86c64c228878b572773bd08cac531',
|
2024-03-28 14:01:19 +00:00
|
|
|
patches='fluidsynth-sf3-support')
|
2023-04-13 14:02:57 +00:00
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['DEFAULT_SOUNDFONT'] = 'default.sf2'
|
|
|
|
opts['enable-framework'] = 'NO'
|
|
|
|
opts['enable-readline'] = 'NO'
|
|
|
|
opts['enable-sdl2'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
2023-06-14 13:49:54 +00:00
|
|
|
super().post_build(state)
|
2023-04-13 14:02:57 +00:00
|
|
|
self.keep_module_target(state, 'FluidSynth::libfluidsynth')
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class FmtTarget(base.CMakeStaticDependencyTarget):
|
2021-06-05 08:57:04 +00:00
|
|
|
def __init__(self, name='fmt'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2022-06-20 07:29:45 +00:00
|
|
|
'https://github.com/fmtlib/fmt/archive/refs/tags/8.1.1.tar.gz',
|
|
|
|
'3d794d3cf67633b34b2771eb9f073bde87e846e0d395d254df7b211ef1ec7346')
|
2021-06-05 08:57:04 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['FMT_DOC'] = 'NO'
|
|
|
|
opts['FMT_TEST'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-06-05 08:57:04 +00:00
|
|
|
|
2024-01-24 08:58:51 +00:00
|
|
|
class GmeTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='gme'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/libgme/game-music-emu/archive/refs/tags/0.6.3.tar.gz',
|
|
|
|
'4c5a7614acaea44e5cb1423817d2889deb82674ddbc4e3e1291614304b86fca0',
|
|
|
|
patches='gme-no-ubsan')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
|
|
|
return state.has_source_file('gme.txt')
|
|
|
|
|
|
|
|
|
2023-04-13 14:06:01 +00:00
|
|
|
class InstPatchTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='instpatch'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/swami/libinstpatch/archive/v1.1.6.tar.gz',
|
|
|
|
'8e9861b04ede275d712242664dab6ffa9166c7940fea3b017638681d25e10299')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
state.options['LIB_SUFFIX'] = None
|
|
|
|
|
|
|
|
# Workaround for missing frameworks in dependencies, no clue what's wrong at the moment
|
|
|
|
state.environment['LDFLAGS'] = '-framework CoreFoundation -framework Foundation'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
|
|
|
|
|
|
|
# Remove extra directory from include path
|
|
|
|
include_path = state.install_path / 'include'
|
|
|
|
include_subpath = include_path / 'libinstpatch-2/libinstpatch'
|
|
|
|
shutil.move(str(include_subpath), include_path)
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class MadTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='mad'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://downloads.sourceforge.net/project/mad/libmad/0.15.1b/libmad-0.15.1b.tar.gz',
|
2021-06-01 07:18:38 +00:00
|
|
|
'bbfac3ed6bfbc2823d3775ebb931087371e142bb0e9bb1bee51a76a6e0078690',
|
|
|
|
patches='mad-support-arm64')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('mad.h')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
state.options['--enable-fpm'] = '64bit'
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
|
|
|
self.write_pc_file(state, description='MPEG Audio Decoder', version='0.15.1b')
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class MikmodTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='mikmod'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://downloads.sourceforge.net/project/mikmod/libmikmod/3.3.11.1/libmikmod-3.3.11.1.tar.gz',
|
|
|
|
'ad9d64dfc8f83684876419ea7cd4ff4a41d8bcd8c23ef37ecb3a200a16b46d19')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('libmikmod.pc.in')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
2021-07-22 06:51:13 +00:00
|
|
|
self.update_config_script(state.install_path / 'bin/libmikmod-config')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class ModPlugTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='modplug'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://downloads.sourceforge.net/project/modplug-xmms/libmodplug/0.8.9.0/libmodplug-0.8.9.0.tar.gz',
|
|
|
|
'457ca5a6c179656d66c01505c0d95fafaead4329b9dbaa0f997d00a3508ad9de')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('libmodplug.pc.in')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
@staticmethod
|
2021-08-01 13:14:43 +00:00
|
|
|
def _process_pkg_config(pcfile: Path, line: str) -> str:
|
2021-05-01 08:54:52 +00:00
|
|
|
libs_private = 'Libs.private:'
|
|
|
|
|
|
|
|
if line.startswith(libs_private):
|
|
|
|
return libs_private + ' -lc++\n'
|
|
|
|
|
|
|
|
return line
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class OpusFileTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='opusfile'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2021-05-31 08:46:13 +00:00
|
|
|
'https://ftp.osuosl.org/pub/xiph/releases/opus/opusfile-0.12.tar.gz',
|
2021-05-01 08:54:52 +00:00
|
|
|
'118d8601c12dd6a44f52423e68ca9083cc9f2bfe72da7a8c1acb22a80ae3550b')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('opusfile.pc.in')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
state.options['--enable-http'] = 'no'
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class PngTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='png'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://downloads.sourceforge.net/libpng/libpng-1.6.37.tar.xz',
|
|
|
|
'505e70834d35383537b6491e7ae8641f1a4bed1876dbfe361201fc80868d88ca')
|
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['PNG_ARM_NEON'] = 'on'
|
|
|
|
opts['PNG_SHARED'] = 'OFF'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
2022-08-08 09:57:42 +00:00
|
|
|
|
|
|
|
def update_cmake_libs(line: str):
|
|
|
|
link_libs = ' INTERFACE_LINK_LIBRARIES '
|
|
|
|
return f'{link_libs}"ZLIB::ZLIB"\n' if line.startswith(link_libs) else line
|
|
|
|
|
|
|
|
self.update_text_file(state.install_path / 'lib/libpng/libpng16.cmake', update_cmake_libs)
|
2021-07-22 06:51:13 +00:00
|
|
|
self.update_config_script(state.install_path / 'bin/libpng16-config')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class PortMidiTarget(base.CMakeTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='portmidi'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://downloads.sourceforge.net/project/portmedia/portmidi/217/portmidi-src-217.zip',
|
2021-06-01 07:18:38 +00:00
|
|
|
'08e9a892bd80bdb1115213fb72dc29a7bf2ff108b378180586aa65f3cfd42e0f',
|
|
|
|
patches='portmidi-modernize-cmake')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
2021-07-22 06:51:13 +00:00
|
|
|
if state.install_path.exists():
|
2021-05-01 08:54:52 +00:00
|
|
|
shutil.rmtree(state.install_path)
|
|
|
|
|
2021-07-22 06:51:13 +00:00
|
|
|
include_path = state.install_path / 'include'
|
2021-05-01 08:54:52 +00:00
|
|
|
os.makedirs(include_path)
|
2021-07-22 06:51:13 +00:00
|
|
|
shutil.copy(state.source / 'pm_common/portmidi.h', include_path)
|
|
|
|
shutil.copy(state.source / 'porttime/porttime.h', include_path)
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-07-22 06:51:13 +00:00
|
|
|
lib_path = state.install_path / 'lib'
|
2021-05-01 08:54:52 +00:00
|
|
|
os.makedirs(lib_path)
|
2021-07-22 06:51:13 +00:00
|
|
|
shutil.copy(state.build_path / 'libportmidi_s.a', lib_path / 'libportmidi.a')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class SamplerateTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='samplerate'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/libsndfile/libsamplerate/releases/download/0.2.1/libsamplerate-0.2.1.tar.bz2',
|
2021-08-02 07:53:23 +00:00
|
|
|
'f6323b5e234753579d70a0af27796dde4ebeddf58aae4be598e39b3cee00c90a')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-08-02 07:54:06 +00:00
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
|
|
|
|
|
|
|
def update_linker_flags(line: str):
|
|
|
|
link_var = ' INTERFACE_LINK_LIBRARIES '
|
|
|
|
return None if line.startswith(link_var) else line
|
|
|
|
|
|
|
|
cmake_module = state.install_path / 'lib/cmake/SampleRate/SampleRateTargets.cmake'
|
|
|
|
self.update_text_file(cmake_module, update_linker_flags)
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class Sdl2Target(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='sdl2'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2024-09-02 07:12:06 +00:00
|
|
|
'https://github.com/libsdl-org/SDL/releases/download/release-2.30.7/SDL2-2.30.7.tar.gz',
|
|
|
|
'2508c80438cd5ff3bbeb8fe36b8f3ce7805018ff30303010b61b03bb83ab9694')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2021-08-05 06:59:49 +00:00
|
|
|
def configure(self, state: BuildState):
|
2022-08-20 06:59:37 +00:00
|
|
|
opts = state.options
|
|
|
|
opts['SDL_STATIC_PIC'] = 'YES'
|
|
|
|
opts['SDL_TEST'] = 'NO'
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2022-08-20 06:59:37 +00:00
|
|
|
super().configure(state)
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class Sdl2ImageTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='sdl2_image'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2024-01-02 08:56:33 +00:00
|
|
|
'https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz',
|
|
|
|
'8f486bbfbcf8464dd58c9e5d93394ab0255ce68b51c5a966a918244820a76ddc')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-12-06 08:58:04 +00:00
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['SDL2IMAGE_WEBP'] = 'YES'
|
|
|
|
opts['SDL2IMAGE_WEBP_SHARED'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
@staticmethod
|
|
|
|
def _process_pkg_config(pcfile: Path, line: str) -> str:
|
|
|
|
# Link with webpdemux library instead of webp
|
|
|
|
return line.replace('\n', 'demux\n') if line.startswith('Requires.private:') else line
|
|
|
|
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class Sdl2MixerTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='sdl2_mixer'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
2024-01-24 11:30:14 +00:00
|
|
|
'https://github.com/libsdl-org/SDL_mixer/releases/download/release-2.8.0/SDL2_mixer-2.8.0.tar.gz',
|
|
|
|
'1cfb34c87b26dbdbc7afd68c4f545c0116ab5f90bbfecc5aebe2a9cb4bb31549')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2022-07-09 14:01:03 +00:00
|
|
|
opts = state.options
|
|
|
|
opts['SDL2MIXER_DEPS_SHARED'] = 'NO'
|
2024-01-24 11:30:14 +00:00
|
|
|
opts['SDL2MIXER_FLAC_LIBFLAC'] = 'YES'
|
|
|
|
opts['SDL2MIXER_GME'] = 'YES'
|
|
|
|
opts['SDL2MIXER_MOD_MODPLUG'] = 'YES'
|
2022-07-09 14:01:03 +00:00
|
|
|
opts['SDL2MIXER_MP3_MPG123'] = 'YES'
|
|
|
|
opts['SDL2MIXER_SAMPLES'] = 'NO'
|
|
|
|
opts['SDL2MIXER_VORBIS'] = 'VORBISFILE'
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class Sdl2NetTarget(base.CMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='sdl2_net'):
|
|
|
|
super().__init__(name)
|
2022-08-21 08:59:19 +00:00
|
|
|
self.version = '2.2.0'
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
2023-02-11 10:28:32 +00:00
|
|
|
base_url = 'https://github.com/libsdl-org/SDL_net/releases/download'
|
2021-05-01 08:54:52 +00:00
|
|
|
state.download_source(
|
2022-08-21 08:59:19 +00:00
|
|
|
f'{base_url}/release-{self.version}/SDL2_net-{self.version}.tar.gz',
|
|
|
|
'4e4a891988316271974ff4e9585ed1ef729a123d22c08bd473129179dc857feb')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
2022-08-21 08:59:19 +00:00
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
|
|
|
|
|
|
|
self.write_pc_file(state, filename='SDL2_net.pc', name='SDL2_net',
|
|
|
|
description='net library for Simple DirectMedia Layer',
|
|
|
|
version=self.version, requires='sdl2 >= 2.0.4',
|
|
|
|
libs='-lSDL2_net', cflags='-I${includedir}/SDL2')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class SodiumTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-05-01 08:54:52 +00:00
|
|
|
def __init__(self, name='sodium'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://download.libsodium.org/libsodium/releases/libsodium-1.0.18.tar.gz',
|
|
|
|
'6f504490b342a4f8a4c4a02fc9b866cbef8622d5df4e5452b46be121e46636c1')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
2021-07-22 06:51:13 +00:00
|
|
|
return state.has_source_file('libsodium.pc.in')
|
2021-05-01 08:54:52 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class VulkanHeadersTarget(base.CMakeStaticDependencyTarget):
|
2021-09-08 07:36:56 +00:00
|
|
|
def __init__(self, name='vulkan-headers'):
|
|
|
|
super().__init__(name)
|
2024-01-12 08:02:35 +00:00
|
|
|
self.multi_platform = False
|
2021-09-08 07:36:56 +00:00
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
# Version should match with the current MoltenVK release
|
2024-07-20 07:14:14 +00:00
|
|
|
'https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/v1.3.290.tar.gz',
|
|
|
|
'c4606a201e8704d75bb974657f08604013d073a862cc127f9f31760213f3afa0')
|
2021-09-08 07:36:56 +00:00
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class VulkanLoaderTarget(base.CMakeStaticDependencyTarget):
|
2021-09-08 07:49:49 +00:00
|
|
|
def __init__(self, name='vulkan-loader'):
|
|
|
|
super().__init__(name)
|
2024-07-20 07:18:41 +00:00
|
|
|
self.version = '1.3.290'
|
2021-09-08 07:49:49 +00:00
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
# Version should match with the current MoltenVK release
|
2023-10-18 09:00:22 +00:00
|
|
|
f'https://github.com/KhronosGroup/Vulkan-Loader/archive/refs/tags/v{self.version}.tar.gz',
|
2024-07-20 07:18:41 +00:00
|
|
|
'a1f0d80c4ee448d4fa37d1d4a4c4cf1d6d0f5873d3ca6dffe2a9498e6e654142')
|
2021-09-08 07:49:49 +00:00
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
2022-08-15 07:34:46 +00:00
|
|
|
opts = state.options
|
2024-01-12 08:14:58 +00:00
|
|
|
opts['APPLE_STATIC_LOADER'] = 'YES'
|
2022-08-15 07:34:46 +00:00
|
|
|
opts['CMAKE_INSTALL_SYSCONFDIR'] = '/usr/local/etc'
|
|
|
|
|
2021-09-08 07:49:49 +00:00
|
|
|
super().configure(state)
|
|
|
|
|
2023-10-18 09:00:22 +00:00
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
lib_path = state.install_path / 'lib'
|
|
|
|
os.makedirs(lib_path, exist_ok=True)
|
|
|
|
shutil.copy(state.build_path / 'loader/libvulkan.a', lib_path)
|
|
|
|
|
|
|
|
self.write_pc_file(state, filename='vulkan.pc',
|
|
|
|
name='Vulkan-Loader', description='Vulkan Loader', version=self.version,
|
|
|
|
libs='-lvulkan', libs_private='-lc++ -framework CoreFoundation')
|
2023-01-25 10:43:02 +00:00
|
|
|
|
2021-09-08 07:49:49 +00:00
|
|
|
|
2024-01-23 09:50:28 +00:00
|
|
|
class WavPackTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='wavpack'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/dbry/WavPack/releases/download/5.6.0/wavpack-5.6.0.tar.xz',
|
|
|
|
'af8035f457509c3d338b895875228a9b81de276c88c79bb2d3e31d9b605da9a9')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['BUILD_TESTING'] = 'NO'
|
|
|
|
opts['WAVPACK_BUILD_DOCS'] = 'NO'
|
|
|
|
opts['WAVPACK_BUILD_PROGRAMS'] = 'NO'
|
|
|
|
opts['WAVPACK_ENABLE_LIBCRYPTO'] = 'NO'
|
|
|
|
opts['WAVPACK_INSTALL_DOCS'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
|
2024-04-18 14:53:00 +00:00
|
|
|
class WebpTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='webp'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://storage.googleapis.com/downloads.webmproject.org/releases/webp/libwebp-1.4.0.tar.gz',
|
|
|
|
'61f873ec69e3be1b99535634340d5bde750b2e4447caa1db9f61be3fd49ab1e5')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
option_suffices = (
|
|
|
|
'ANIM_UTILS', 'CWEBP', 'DWEBP', 'EXTRAS', 'GIF2WEBP', 'IMG2WEBP', 'VWEBP', 'WEBPINFO', 'WEBPMUX',
|
|
|
|
)
|
|
|
|
|
|
|
|
for suffix in option_suffices:
|
|
|
|
state.options[f'WEBP_BUILD_{suffix}'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|
|
|
|
|
|
|
|
def post_build(self, state: BuildState):
|
|
|
|
super().post_build(state)
|
|
|
|
|
|
|
|
shutil.copytree(state.install_path / 'share/WebP/cmake', state.install_path / 'lib/cmake/WebP')
|
|
|
|
|
|
|
|
|
2023-03-21 10:52:54 +00:00
|
|
|
class XmpTarget(base.ConfigureMakeStaticDependencyTarget):
|
2021-09-03 08:32:52 +00:00
|
|
|
def __init__(self, name='xmp'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://sourceforge.net/projects/xmp/files/libxmp/4.5.0/libxmp-4.5.0.tar.gz',
|
|
|
|
'7847d262112d14e8442f44e5ac6ed9ddbca54c251284720b563c852b31f26e75')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
|
|
|
return state.has_source_file('libxmp.pc.in')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
state.options['--enable-static'] = None
|
|
|
|
super().configure(state)
|
2024-04-28 10:57:33 +00:00
|
|
|
|
|
|
|
|
|
|
|
class ZlibNgTarget(base.CMakeStaticDependencyTarget):
|
|
|
|
def __init__(self, name='zlib-ng'):
|
|
|
|
super().__init__(name)
|
|
|
|
|
|
|
|
def prepare_source(self, state: BuildState):
|
|
|
|
state.download_source(
|
|
|
|
'https://github.com/zlib-ng/zlib-ng/archive/refs/tags/2.1.6.tar.gz',
|
|
|
|
'a5d504c0d52e2e2721e7e7d86988dec2e290d723ced2307145dedd06aeb6fef2')
|
|
|
|
|
|
|
|
def detect(self, state: BuildState) -> bool:
|
|
|
|
return state.has_source_file('zlib-ng.h')
|
|
|
|
|
|
|
|
def configure(self, state: BuildState):
|
|
|
|
opts = state.options
|
|
|
|
opts['WITH_GTEST'] = 'NO'
|
|
|
|
opts['WITH_SANITIZER'] = 'NO'
|
|
|
|
opts['ZLIB_COMPAT'] = 'YES'
|
|
|
|
opts['ZLIB_ENABLE_TESTS'] = 'NO'
|
|
|
|
opts['ZLIBNG_ENABLE_TESTS'] = 'NO'
|
|
|
|
|
|
|
|
super().configure(state)
|