2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
2022-01-26 04:04:25 +00:00
|
|
|
, fetchpatch
|
2021-08-22 07:53:02 +00:00
|
|
|
, zlib
|
|
|
|
, cmake
|
|
|
|
, imath
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openexr";
|
2023-08-22 20:05:09 +00:00
|
|
|
version = "3.1.10";
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
2023-08-22 20:05:09 +00:00
|
|
|
sha256 = "sha256-8oV7Himk9AS2e2Z3OREE7KQgFIUysXwATlUN51dDe5M=";
|
2021-08-22 07:53:02 +00:00
|
|
|
};
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
outputs = [ "bin" "dev" "out" "doc" ];
|
2022-01-26 04:04:25 +00: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
|
|
|
|
'';
|
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake ];
|
|
|
|
propagatedBuildInputs = [ imath zlib ];
|
2021-08-22 07:53:02 +00:00
|
|
|
|
2023-04-29 16:46:19 +00:00
|
|
|
# Without 'sse' enforcement tests fail on i686 as due to excessive precision as:
|
|
|
|
# error reading back channel B pixel 21,-76 got -nan expected -nan
|
|
|
|
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
|
|
|
|
|
2023-05-24 13:37:59 +00:00
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1400
|
|
|
|
doCheck = !stdenv.isAarch32;
|
2022-01-26 04:04:25 +00:00
|
|
|
|
2021-08-22 07:53:02 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A high dynamic-range (HDR) image file format";
|
2022-08-12 12:06:08 +00:00
|
|
|
homepage = "https://www.openexr.com";
|
2021-08-22 07:53:02 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ paperdigits ];
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
|
|
|
}
|