Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/ogg.py
6172 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
import shutil
8
9
VERSION = '1.3.5'
10
HASH = 'e7b5f5d469090b66dbb33634591ae6de41af3a5644c10488e59ba7428ed78912e208a2c0fbb5003ec5b7eb2a0102a2f85cecb21fa9512d790139ecc45b6d03f4'
11
12
13
def needed(settings):
14
return settings.USE_OGG
15
16
17
def get(ports, settings, shared):
18
ports.fetch_project('ogg', f'https://github.com/xiph/ogg/releases/download/v{VERSION}/libogg-{VERSION}.zip', sha512hash=HASH)
19
20
def create(final):
21
source_path = ports.get_dir('ogg', 'libogg-' + VERSION)
22
config_types_h = os.path.join(os.path.dirname(__file__), 'ogg/config_types.h')
23
shutil.copyfile(config_types_h, os.path.join(source_path, 'include/ogg/config_types.h'))
24
ports.install_headers(os.path.join(source_path, 'include', 'ogg'), target='ogg')
25
ports.make_pkg_config('ogg', VERSION, '-sUSE_OGG')
26
ports.build_port(os.path.join(source_path, 'src'), final, 'ogg')
27
28
return [shared.cache.get_lib('libogg.a', create)]
29
30
31
def clear(ports, settings, shared):
32
shared.cache.erase_lib('libogg.a')
33
34
35
def show():
36
return 'ogg (-sUSE_OGG or --use-port=ogg; zlib license)'
37
38