2021-03-11 15:26:27 +00:00
|
|
|
# openSUSE extension setup to build python-imagecodecs
|
|
|
|
|
|
|
|
import os
|
|
|
|
import subprocess
|
|
|
|
import sys
|
|
|
|
|
|
|
|
def customize_build(EXTENSIONS, OPTIONS):
|
|
|
|
|
|
|
|
includedir = os.getenv("INCDIR",'') + '/'
|
|
|
|
|
|
|
|
del EXTENSIONS['jpeg12'] # jpeg12 requires custom build
|
|
|
|
del EXTENSIONS['lerc'] # LERC library not available
|
|
|
|
del EXTENSIONS['lz4f'] # requires static linking
|
2021-07-01 13:13:31 +00:00
|
|
|
del EXTENSIONS['jpegxl'] # jpeg-xl library not available
|
|
|
|
del EXTENSIONS['brunsli'] # Brunsli library not available
|
2021-03-11 15:26:27 +00:00
|
|
|
|
|
|
|
EXTENSIONS['avif']['libraries'] = [
|
|
|
|
'avif',
|
|
|
|
'aom',
|
|
|
|
'dav1d',
|
|
|
|
'rav1e',
|
|
|
|
]
|
2021-07-01 13:13:31 +00:00
|
|
|
|
2021-03-11 15:26:27 +00:00
|
|
|
|
|
|
|
if sys.maxsize < 2**63 - 1:
|
2021-07-01 13:13:31 +00:00
|
|
|
# no zfp on 32-bit platforms
|
2021-03-11 15:26:27 +00:00
|
|
|
del EXTENSIONS['zfp']
|
2021-07-01 13:13:31 +00:00
|
|
|
# avif tests fail on 32-bit
|
|
|
|
del EXTENSIONS['avif']
|
2021-03-11 15:26:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
openjpeg_inc = subprocess.check_output(
|
|
|
|
['pkgconf', '--variable=includedir', 'libopenjp2'],
|
|
|
|
text=True,
|
|
|
|
).strip()
|
|
|
|
EXTENSIONS['jpeg2k']['include_dirs'].append(openjpeg_inc)
|
|
|
|
EXTENSIONS['jpegxr']['include_dirs'].append(includedir + 'jxrlib')
|
2021-07-01 13:13:31 +00:00
|
|
|
EXTENSIONS['rcomp']['include_dirs'].append(includedir + 'cfitsio')
|
2021-03-11 15:26:27 +00:00
|
|
|
EXTENSIONS['zopfli']['include_dirs'].append(includedir + 'zopfli')
|