summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Kosukhin <sergey.kosukhin@mpimet.mpg.de>2021-12-11 18:51:17 +0100
committerGitHub <noreply@github.com>2021-12-11 11:51:17 -0600
commitee46a1077cc5dd2648a693668cd3854fdf2add6a (patch)
treec3a81831ec2b11d201fb61cd9f5c4230ad7b0148
parent5d11bc9a775a81247e04474fa82104c326633db3 (diff)
downloadspack-ee46a1077cc5dd2648a693668cd3854fdf2add6a.tar.gz
spack-ee46a1077cc5dd2648a693668cd3854fdf2add6a.tar.bz2
spack-ee46a1077cc5dd2648a693668cd3854fdf2add6a.tar.xz
spack-ee46a1077cc5dd2648a693668cd3854fdf2add6a.zip
openjpeg: add missing dependencies and optionally disable them (#27904)
* openjpeg: add missing dependencies and optionally disable them * openjpeg: remove variant 'ownlibs' * openjpeg: bugfix Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com> * openjpeg: do not build CODEC executables by default Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
-rw-r--r--var/spack/repos/builtin/packages/openjpeg/package.py22
1 files changed, 21 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/openjpeg/package.py b/var/spack/repos/builtin/packages/openjpeg/package.py
index a6b628f3f1..1a6b81359e 100644
--- a/var/spack/repos/builtin/packages/openjpeg/package.py
+++ b/var/spack/repos/builtin/packages/openjpeg/package.py
@@ -31,7 +31,12 @@ class Openjpeg(CMakePackage):
version('1.5.2', sha256='3734e95edd0bef6e056815591755efd822228dc3cd866894e00a2c929026b16d')
version('1.5.1', sha256='6a42fcc23cb179f69a1e94429089e5a5926aee1ffe582a0a6bd91299d297e61a')
- depends_on('zlib')
+ variant('codec', default=False, description='Build the CODEC executables')
+
+ depends_on('zlib', when='+codec')
+ depends_on('libpng', when='+codec')
+ depends_on('libtiff', when='+codec')
+ depends_on('lcms', when='+codec')
# The problem with install name of the library on MacOs was fixed starting
# version 2.1.1: https://github.com/uclouvain/openjpeg/commit/b9a247b559e62e55f5561624cf4a19aee3c8afdc
@@ -56,3 +61,18 @@ class Openjpeg(CMakePackage):
def libs(self):
return find_libraries('libopenjp{0}'.format(self.version.up_to(1)),
root=self.prefix, recursive=True)
+
+ def cmake_args(self):
+ args = [
+ self.define_from_variant('BUILD_CODEC', 'codec'),
+ # MJ2 executables are disabled by default and we just make it
+ # explicit. Note that the executables require additional libraries
+ # as in the case '+codec', therefore, we will need to update the
+ # 'depends_on' directives when/if we introduce a variant that
+ # enables them.
+ self.define('BUILD_MJ2', False),
+ # Note that if the list of dependencies is incomplete, there is
+ # still a chance that the bundled third-party libraries get built.
+ self.define('BUILD_THIRDPARTY', False)
+ ]
+ return args