openexr: add 2.4.3, 2.5.9, 3.1.11 & 3.2.0 (#39863)

* openexr: add 2.4.3, 2.5.9, 3.1.11 & 3.2.0

- 2.5.9 is the latest version compatible with OpenScenGraph
- improved compatibility with GCC 13

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>

* openexr: drop unsupported debug variant

--disable/enable-debug is not supported by ./configure in 1.3, 1.7, 2.0, 2.2 and 2.3

* openexr: transform into multi-build system package

simplifies package considerably, as nothing special seems to be required

* openexr: pkg-config is also used by @3

* openexr: use system libdeflate instead of internal

if no libdeflate is found, openexr would download and build its own starting with 3.2.0

* openexr: disable tests

would download lots of data during cmake and make build times noticably longer

---------

Co-authored-by: Adam J. Stewart <ajstewart426@gmail.com>
This commit is contained in:
Martin Aumüller 2023-09-12 19:37:48 +02:00 committed by GitHub
parent 562065c427
commit 02c9296db4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,18 +3,23 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.build_systems.cmake import CMakeBuilder
from spack.package import *
class Openexr(CMakePackage):
class Openexr(CMakePackage, AutotoolsPackage):
"""OpenEXR Graphics Tools (high dynamic-range image file format)"""
homepage = "https://www.openexr.com/"
url = "https://github.com/AcademySoftwareFoundation/openexr/archive/refs/tags/v3.1.5.tar.gz"
# New versions should come from github now
version("3.2.0", sha256="b1b200606640547fceff0d3ebe01ac05c4a7ae2a131be7e9b3e5b9f491ef35b3")
version("3.1.11", sha256="06b4a20d0791b5ec0f804c855d320a0615ce8445124f293616a086e093f1f1e1")
version("3.1.7", sha256="78dbca39115a1c526e6728588753955ee75fa7f5bb1a6e238bed5b6d66f91fd7")
version("3.1.5", sha256="93925805c1fc4f8162b35f0ae109c4a75344e6decae5a240afdfce25f8a433ec")
version("2.5.9", sha256="05bb9c2da3ff3508eee51c30f59c7f2c59bf068f3b636d12d5991e8bbaf13e01")
version("2.4.2", sha256="8e5bfd89f4ae1221f84216a163003edddf0d37b8aac4ee42b46edb55544599b9")
version(
"2.3.0",
sha256="fd6cb3a87f8c1a233be17b94c74799e6241d50fc5efd4df75c7a4b9cf4e25ea6",
@ -62,31 +67,24 @@ class Openexr(CMakePackage):
url="http://download.savannah.nongnu.org/releases/openexr/openexr-1.3.2.tar.gz",
)
variant("debug", default=False, description="Builds a debug version of the libraries")
depends_on("cmake@3.12:", when="@3:", type="build")
depends_on("pkgconfig", when="@:2", type="build")
depends_on("pkgconfig", type="build")
depends_on("imath", when="@3:")
depends_on("ilmbase", when="@:2")
depends_on("zlib-api")
depends_on("libdeflate", when="@3.2:")
@property
def build_directory(self):
if self.spec.satisfies("@3:"):
return super().build_directory
else:
return "."
conflicts("@:2.5.8 %gcc@13:")
def configure_args(self):
args = ["--prefix=" + self.prefix]
# Build system
build_system(
conditional("cmake", when="@2.4:"), conditional("autotools", when="@:2.3"), default="cmake"
)
if "+debug" in self.spec:
args.append("--enable-debug")
else:
args.append("--disable-debug")
with when("build_system=cmake"):
depends_on("cmake@3.12:", type="build")
class CMakeBuilder(CMakeBuilder):
def cmake_args(self):
args = [self.define("BUILD_TESTING", self.pkg.run_tests)]
return args
@when("@:2")
def cmake(self, spec, prefix):
configure(*self.configure_args())