2021-08-17 05:29:53 +02:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-01-03 18:49:44 +01:00
|
|
|
, fetchpatch
|
2021-08-17 05:29:53 +02:00
|
|
|
, zlib
|
|
|
|
, cmake
|
|
|
|
, imath
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openexr";
|
2021-12-09 00:04:07 +01:00
|
|
|
version = "3.1.3";
|
2021-08-17 05:29:53 +02:00
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "doc" ];
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
2021-12-09 00:04:07 +01:00
|
|
|
sha256 = "sha256-Bi6yTcZBWTsWWMm3A7FVYblvSXKLSkHmhGvpNYGiOzE=";
|
2021-08-17 05:29:53 +02:00
|
|
|
};
|
|
|
|
|
2022-01-03 18:49:44 +01:00
|
|
|
patches = [
|
|
|
|
(fetchpatch {
|
|
|
|
name = "CVE-2021-45942.patch";
|
|
|
|
url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch";
|
|
|
|
sha256 = "1qa8662ga5i0lyfi9mkj9s9bygdg7h1i6ahki28c664kxrlsakch";
|
|
|
|
})
|
|
|
|
];
|
|
|
|
|
2022-01-03 18:50:36 +01:00
|
|
|
# tests are determined to use /var/tmp on unix
|
|
|
|
postPatch = ''
|
|
|
|
cat <(find . -name tmpDir.h) <(echo src/test/OpenEXRCoreTest/main.cpp) | while read -r f ; do
|
|
|
|
substituteInPlace $f --replace '/var/tmp' "$TMPDIR"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2021-08-17 05:29:53 +02:00
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
propagatedBuildInputs = [ imath zlib ];
|
|
|
|
|
2022-01-03 18:50:36 +01:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-08-17 05:29:53 +02:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A high dynamic-range (HDR) image file format";
|
|
|
|
homepage = "https://www.openexr.com/";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ paperdigits ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|