Skip to content

Commit

Permalink
Added libogg dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
runei committed Aug 14, 2024
1 parent a8e3466 commit 8b0045a
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 0 deletions.
23 changes: 23 additions & 0 deletions 3rdparty/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ thirdparty_versions = {
'alsa': '1.1.9',
'json-c': '0.12-20140410',
'libatomic_ops': '7.6.10',
'libogg': '1.3.4',
'libunwind': '1.2.1',
'libuv': '1.35.0',
'libvorbis': '1.3.7',
Expand Down Expand Up @@ -49,6 +50,9 @@ external_dependencies.add('ragel')
if 'pulseaudio' in external_dependencies:
external_dependencies.add('sndfile')

if 'libvorbis' in external_dependencies:
external_dependencies.add('libogg')

# on Linux, PulseAudio needs ALSA
if meta.platform in ['linux'] and 'pulseaudio' in external_dependencies:
external_dependencies.add('alsa')
Expand Down Expand Up @@ -255,6 +259,25 @@ elif 'sndfile' in system_dependencies:

env = conf.Finish()

# dep: libogg
if 'libogg' in autobuild_dependencies:
env.BuildThirdParty(thirdparty_versions, 'libogg')

conf = Configure(env, custom_tests=env.CustomTests)

env = conf.Finish()

elif 'libogg' in system_dependencies:
conf = Configure(subenvs.libs, custom_tests=env.CustomTests)

if not conf.AddPkgConfigDependency('ogg', '--cflags --libs', exclude_from_pc=True):
conf.env.AddManualDependency(libs=['ogg'], exclude_from_pc=True)

if not conf.CheckLibWithHeader('ogg', 'ogg/ogg.h', 'C', run=False):
env.Die("libogg not found (see 'config.log' for details)")

env = conf.Finish()

# dep: libvorbis
if 'libvorbis' in autobuild_dependencies:
env.BuildThirdParty(thirdparty_versions, 'libvorbis')
Expand Down
3 changes: 3 additions & 0 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -861,6 +861,9 @@ else:
'target_pulseaudio',
])
if not GetOption('disable_libvorbis'):
env.Append(ROC_TARGETS=[
'target_libogg',
])
env.Append(ROC_TARGETS=[
'target_libvorbis',
])
Expand Down
20 changes: 20 additions & 0 deletions scripts/scons_helpers/build-3rdparty.py
Original file line number Diff line number Diff line change
Expand Up @@ -1438,6 +1438,26 @@ def die(text, *args):
install_files(ctx, 'builddir/src/pulse/libpulse-simple.so.0', ctx.pkg_rpath_dir)
install_files(ctx, 'builddir/src/libpulsecommon-*.so', ctx.pkg_lib_dir)
install_files(ctx, 'builddir/src/libpulsecommon-*.so', ctx.pkg_rpath_dir)
elif ctx.pkg_name == 'libogg':
download(
ctx,
'https://downloads.xiph.org/releases/ogg/libogg-{ctx.pkg_ver}.tar.gz',
'libogg-{ctx.pkg_ver}.tar.gz')
unpack(ctx,
'libogg-{ctx.pkg_ver}.tar.gz',
'libogg-{ctx.pkg_ver}')
changedir(ctx, 'src/libogg-{ctx.pkg_ver}')
execute(ctx, './configure --host={host} {vars} {flags} {opts}'.format(
host=ctx.toolchain,
vars=format_vars(ctx),
flags=format_flags(ctx, cflags='-fPIC'),
opts=' '.join([
'--disable-shared',
'--enable-static',
])))
execute_make(ctx)
install_tree(ctx, 'include', ctx.pkg_inc_dir, include=['*.h'])
install_files(ctx, 'src/.libs/libogg.a', ctx.pkg_lib_dir)
elif ctx.pkg_name == 'libvorbis':
download(
ctx,
Expand Down

0 comments on commit 8b0045a

Please sign in to comment.