2020-05-15 21:57:56 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, zlib
|
|
|
|
, ilmbase
|
2020-08-20 17:08:02 +00:00
|
|
|
, fetchpatch
|
2020-05-15 21:57:56 +00:00
|
|
|
, cmake
|
|
|
|
}:
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openexr";
|
2024-01-25 14:12:00 +00:00
|
|
|
version = "2.5.10";
|
2020-09-25 04:45:31 +00:00
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "doc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2020-05-03 17:38:23 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
2024-01-25 14:12:00 +00:00
|
|
|
hash = "sha256-xdC+T79ZQBx/XhuIXtP93Roj0N9lF+E65ReEKQ4kIsg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
patches = [
|
2022-01-26 04:04:25 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2021-45942.patch";
|
|
|
|
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch";
|
|
|
|
stripLen = 4;
|
|
|
|
extraPrefix = "OpenEXR/IlmImf/";
|
|
|
|
sha256 = "1wa2jn6sa0n3phaqvklnlbgk1bz60y756ad4jk4d757pzpnannsy";
|
|
|
|
})
|
2023-07-15 17:15:38 +00:00
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2021-3933.patch";
|
|
|
|
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/5db6f7aee79e3e75e8c3780b18b28699614dd08e.patch";
|
|
|
|
stripLen = 4;
|
|
|
|
extraPrefix = "OpenEXR/IlmImf/";
|
|
|
|
sha256 = "sha256-DrpldpNgN5pWKzIuuPIrynGX3EpP8YhJlu+lLfNFGxQ=";
|
|
|
|
})
|
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
# GCC 13 fixes
|
2023-07-15 17:15:38 +00:00
|
|
|
./gcc-13.patch
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
postPatch = ''
|
2023-08-04 22:07:22 +00:00
|
|
|
# tests are determined to use /var/tmp on unix
|
2023-07-15 17:15:38 +00:00
|
|
|
find . -name tmpDir.h | while read -r f ; do
|
|
|
|
substituteInPlace $f --replace '/var/tmp' "$TMPDIR"
|
|
|
|
done
|
2023-08-04 22:07:22 +00:00
|
|
|
# On slower machines this test can take more than the default 1500 seconds
|
|
|
|
echo 'set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 3000)' >> OpenEXR/IlmImfTest/CMakeLists.txt
|
2023-07-15 17:15:38 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DCMAKE_CTEST_ARGUMENTS=--timeout;3600"
|
|
|
|
] ++ lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
|
2022-09-09 14:08:57 +00:00
|
|
|
|
2020-09-25 04:45:31 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
propagatedBuildInputs = [ ilmbase zlib ];
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2023-07-15 17:15:38 +00:00
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1400
|
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1281
|
|
|
|
doCheck = !stdenv.isAarch32 && !stdenv.isi686;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "High dynamic-range (HDR) image file format";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.openexr.com/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|