Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/bzip2.py
4130 views
1
# Copyright 2014 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
VERSION = '1.0.6'
7
HASH = '512cbfde5144067f677496452f3335e9368fd5d7564899cb49e77847b9ae7dca598218276637cbf5ec524523be1e8ace4ad36a148ef7f4badf3f6d5a002a4bb2'
8
9
10
def needed(settings):
11
return settings.USE_BZIP2
12
13
14
def get(ports, settings, shared):
15
ports.fetch_project('bzip2', f'https://github.com/emscripten-ports/bzip2/archive/{VERSION}.zip', sha512hash=HASH)
16
17
def create(final):
18
source_path = ports.get_dir('bzip2', 'bzip2-' + VERSION)
19
ports.install_headers(source_path)
20
ports.make_pkg_config('bzip2', VERSION, '-sUSE_BZIP2')
21
22
# build
23
srcs = [
24
'blocksort.c', 'compress.c', 'decompress.c', 'huffman.c',
25
'randtable.c', 'bzlib.c', 'crctable.c',
26
]
27
ports.build_port(source_path, final, 'bzip2', srcs=srcs)
28
29
return [shared.cache.get_lib('libbz2.a', create, what='port')]
30
31
32
def clear(ports, settings, shared):
33
shared.cache.erase_lib('libbz2.a')
34
35
36
def show():
37
return 'bzip2 (-sUSE_BZIP2 or --use-port=bzip2; BSD license)'
38
39