Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/tools/ports/giflib.py
4130 views
1
# Copyright 2020 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 = '5.2.1'
7
HASH = '4550e53c21cb1191a4581e363fc9d0610da53f7898ca8320f0d3ef6711e76bdda2609c2df15dc94c45e28bff8de441f1227ec2da7ea827cb3c0405af4faa4736'
8
9
10
def needed(settings):
11
return settings.USE_GIFLIB
12
13
14
def get(ports, settings, shared):
15
ports.fetch_project('giflib', f'https://storage.googleapis.com/webassembly/emscripten-ports/giflib-{VERSION}.tar.gz', sha512hash=HASH)
16
17
def create(final):
18
source_path = ports.get_dir('giflib', f'giflib-{VERSION}')
19
ports.install_headers(source_path)
20
ports.make_pkg_config('giflib', VERSION, '-sUSE_GIFLIB')
21
exclude_files = [
22
'giffix.c', 'gifecho.c', 'giffilter.c', 'gifcolor.c', 'gifecho.c', 'gifinto.c',
23
'gifsponge.c', 'gif2rgb.c', 'gifbg.c', 'gifbuild.c', 'gifclrmp.c', 'gifhisto.c',
24
'gifbuild.c', 'gifclrmp.c', 'gifhisto.c', 'giftext.c', 'giftool.c', 'gifwedge.c',
25
]
26
ports.build_port(source_path, final, 'giflib', exclude_files=exclude_files)
27
28
return [shared.cache.get_lib('libgif.a', create, what='port')]
29
30
31
def clear(ports, settings, shared):
32
shared.cache.erase_lib('libgif.a')
33
34
35
def show():
36
return 'giflib (-sUSE_GIFLIB or --use-port=giflib; MIT license)'
37
38