Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/ogg.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
import shutil
8
9
TAG = 'version_1'
10
HASH = '929e8d6003c06ae09593021b83323c8f1f54532b67b8ba189f4aedce52c25dc182bac474de5392c46ad5b0dea5a24928e4ede1492d52f4dd5cd58eea9be4dba7'
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/emscripten-ports/ogg/archive/{TAG}.zip', sha512hash=HASH)
19
20
def create(final):
21
source_path = ports.get_dir('ogg', 'Ogg-' + TAG)
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', TAG, '-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