forgejo-lts: 7.0.10 -> 7.0.11
[NixPkgs.git] / pkgs / development / libraries / openexr / default.nix
bloba79759be24f22661290f6260755e5c2db7c78b48
1 { lib
2 , stdenv
3 , fetchFromGitHub
4 , zlib
5 , ilmbase
6 , fetchpatch
7 , cmake
8 }:
10 stdenv.mkDerivation rec {
11   pname = "openexr";
12   version = "2.5.10";
14   outputs = [ "bin" "dev" "out" "doc" ];
16   src = fetchFromGitHub {
17     owner = "AcademySoftwareFoundation";
18     repo = "openexr";
19     rev = "v${version}";
20     hash = "sha256-xdC+T79ZQBx/XhuIXtP93Roj0N9lF+E65ReEKQ4kIsg=";
21   };
23   patches = [
24     (fetchpatch {
25       name = "CVE-2021-45942.patch";
26       url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch";
27       stripLen = 4;
28       extraPrefix = "OpenEXR/IlmImf/";
29       sha256 = "1wa2jn6sa0n3phaqvklnlbgk1bz60y756ad4jk4d757pzpnannsy";
30     })
31     (fetchpatch {
32       name = "CVE-2021-3933.patch";
33       url = "https://github.com/AcademySoftwareFoundation/openexr/commit/5db6f7aee79e3e75e8c3780b18b28699614dd08e.patch";
34       stripLen = 4;
35       extraPrefix = "OpenEXR/IlmImf/";
36       sha256 = "sha256-DrpldpNgN5pWKzIuuPIrynGX3EpP8YhJlu+lLfNFGxQ=";
37     })
39     # GCC 13 fixes
40     ./gcc-13.patch
41   ];
43   postPatch = ''
44     # tests are determined to use /var/tmp on unix
45     find . -name tmpDir.h | while read -r f ; do
46       substituteInPlace $f --replace '/var/tmp' "$TMPDIR"
47     done
48     # On slower machines this test can take more than the default 1500 seconds
49     echo 'set_tests_properties(OpenEXR.IlmImf PROPERTIES TIMEOUT 3000)' >> OpenEXR/IlmImfTest/CMakeLists.txt
50   '';
52   cmakeFlags = [
53     "-DCMAKE_CTEST_ARGUMENTS=--timeout;3600"
54   ] ++ lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
56   nativeBuildInputs = [ cmake ];
57   propagatedBuildInputs = [ ilmbase zlib ];
59   # https://github.com/AcademySoftwareFoundation/openexr/issues/1400
60   # https://github.com/AcademySoftwareFoundation/openexr/issues/1281
61   doCheck = !stdenv.hostPlatform.isAarch32 && !stdenv.hostPlatform.isi686;
63   meta = with lib; {
64     description = "High dynamic-range (HDR) image file format";
65     homepage = "https://www.openexr.com/";
66     license = licenses.bsd3;
67     platforms = platforms.all;
68   };