2024-05-13 21:24:10 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, cmake, imath, libdeflate, pkg-config, pkgsCross
|
2024-05-02 00:46:19 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "openexr";
|
|
|
|
version = "3.2.4";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
|
|
|
hash = "sha256-mVUxxYe6teiJ18PQ9703/kjBpJ9+a7vcDme+NwtQQQM=";
|
|
|
|
};
|
|
|
|
|
|
|
|
outputs = [ "bin" "dev" "out" "doc" ];
|
|
|
|
|
|
|
|
patches =
|
|
|
|
# Disable broken test on musl libc
|
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1556
|
2024-05-13 21:24:10 +00:00
|
|
|
lib.optional stdenv.hostPlatform.isMusl ./disable-iex-test.patch;
|
2024-05-02 00:46:19 +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
|
|
|
|
'';
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
cmakeFlags =
|
|
|
|
lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
|
|
|
propagatedBuildInputs = [ imath libdeflate ];
|
|
|
|
|
|
|
|
# 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
|
2024-05-13 21:24:10 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE =
|
|
|
|
lib.optionalString stdenv.isi686 "-msse2 -mfpmath=sse";
|
2024-05-02 00:46:19 +00:00
|
|
|
|
|
|
|
# https://github.com/AcademySoftwareFoundation/openexr/issues/1400
|
|
|
|
doCheck = !stdenv.isAarch32;
|
|
|
|
|
2024-05-13 21:24:10 +00:00
|
|
|
passthru.tests = { musl = pkgsCross.musl64.openexr_3; };
|
2024-05-02 00:46:19 +00: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;
|
|
|
|
};
|
|
|
|
}
|