Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/vorbis.py
6175 views
1
# Copyright 2015 The Emscripten Authors. All rights reserved.
2
# Emscripten is available under two separate licenses, the MIT license and the
3
# University of Illinois/NCSA Open Source License. Both these licenses can be
4
# found in the LICENSE file.
5
6
import os
7
8
VERSION = '1.3.7'
9
HASH = '10edd193f44f2b2d6085672e257b5be11066f5db27348d4cab53789bf9e8739c2df2cd7f42b83e4edbab53e10b5dc84320d6aab1deac0d8e18196a8a88b19b77'
10
11
deps = ['ogg']
12
13
14
def needed(settings):
15
return settings.USE_VORBIS
16
17
18
def get(ports, settings, shared):
19
ports.fetch_project('vorbis', f'https://github.com/xiph/vorbis/releases/download/v{VERSION}/libvorbis-{VERSION}.zip', sha512hash=HASH)
20
21
def create(final):
22
source_path = ports.get_dir('vorbis', 'libvorbis-' + VERSION)
23
ports.install_headers(os.path.join(source_path, 'include', 'vorbis'), target='vorbis')
24
ports.make_pkg_config('vorbis', VERSION, '-sUSE_VORBIS')
25
ports.build_port(os.path.join(source_path, 'lib'), final, 'vorbis',
26
flags=['-sUSE_OGG'],
27
exclude_files=['psytune', 'barkmel', 'tone', 'misc'])
28
29
return [shared.cache.get_lib('libvorbis.a', create)]
30
31
32
def clear(ports, settings, shared):
33
shared.cache.erase_lib('libvorbis.a')
34
35
36
def process_dependencies(settings):
37
settings.USE_OGG = 1
38
39
40
def show():
41
return 'vorbis (-sUSE_VORBIS or --use-port=vorbis; zlib license)'
42
43