2021-08-22 07:53:02 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchFromGitHub
|
|
|
|
, cmake
|
|
|
|
, imath
|
2023-10-09 19:29:22 +00:00
|
|
|
, libdeflate
|
|
|
|
, pkg-config
|
2021-08-22 07:53:02 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openexr";
|
2023-10-09 19:29:22 +00:00
|
|
|
version = "3.2.0";
|
2021-08-22 07:53:02 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
2023-10-09 19:29:22 +00:00
|
|
|
hash = "sha256-cV+qgx3WzdotypgpZhVFxzdKAU2rNVw0KWSdkeN0gLk=";
|
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
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
patches =
|
|
|
|
# Disable broken test on musl libc
|
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1556
|
|
|
|
lib.optional stdenv.hostPlatform.isMusl ./disable-iex-test.patch
|
|
|
|
;
|
|
|
|
|
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";
|
|
|
|
|
2023-10-09 19:29:22 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
propagatedBuildInputs = [ imath libdeflate ];
|
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;
|
|
|
|
};
|
|
|
|
}
|