Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/vorbis.py
4130 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
TAG = 'version_1'
9
HASH = '99bee75beb662f8520bbb18ad6dbf8590d30eb3a7360899f0ac4764ca72fe8013da37c9df21e525f9d2dc5632827d4b4cea558cbc938e7fbed0c41a29a7a2dc5'
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/emscripten-ports/vorbis/archive/{TAG}.zip', sha512hash=HASH)
20
21
def create(final):
22
source_path = ports.get_dir('vorbis', 'Vorbis-' + TAG)
23
ports.install_headers(os.path.join(source_path, 'include', 'vorbis'), target='vorbis')
24
ports.make_pkg_config('vorbis', TAG, '-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