2020-04-28 18:22:31 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, buildPackages
|
|
|
|
, fetchFromGitHub
|
|
|
|
, zlib
|
|
|
|
, ilmbase
|
2020-07-30 01:35:18 +01:00
|
|
|
, fetchpatch
|
2020-04-28 18:22:31 +01:00
|
|
|
, cmake
|
|
|
|
, libtool
|
|
|
|
}:
|
2020-07-30 01:35:18 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
non_glibc_fpstate_patch =
|
|
|
|
# Fix ilmbase/openexr using glibc-only fpstate.
|
|
|
|
# Found via https://git.alpinelinux.org/aports/tree/community/openexr/10-musl-_fpstate.patch?id=80d9611b7b8e406a554c6f511137e03ff26acbae,
|
|
|
|
# TODO Remove when https://github.com/AcademySoftwareFoundation/openexr/pull/798 is merged and available.
|
|
|
|
# Remove it from `ilmbase` as well then.
|
|
|
|
(fetchpatch {
|
|
|
|
name = "ilmbase-musl-_fpstate.patch.patch";
|
|
|
|
url = "https://raw.githubusercontent.com/void-linux/void-packages/80bbc168faa25448bd3399f4df331b836e74b85c/srcpkgs/ilmbase/patches/musl-_fpstate.patch";
|
|
|
|
sha256 = "0appzbs9pd6dia5pzxmrs9ww35shlxi329ks6lchwzw4f2a81arz";
|
|
|
|
});
|
|
|
|
in
|
|
|
|
|
2010-07-28 19:01:17 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "openexr";
|
2020-04-26 22:29:17 +01:00
|
|
|
version = "2.4.1";
|
2015-02-19 02:02:05 +00:00
|
|
|
|
2020-04-26 22:29:17 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "AcademySoftwareFoundation";
|
|
|
|
repo = "openexr";
|
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "020gyl8zv83ag6gbcchmqiyx9rh2jca7j8n52zx1gk4rck7kwc01";
|
2015-07-02 13:27:47 +01:00
|
|
|
};
|
2015-02-19 02:02:05 +00:00
|
|
|
|
2016-09-01 14:29:00 +01:00
|
|
|
outputs = [ "bin" "dev" "out" "doc" ];
|
2020-04-28 18:22:31 +01:00
|
|
|
nativeBuildInputs = [ cmake libtool ];
|
2015-02-19 02:02:05 +00:00
|
|
|
propagatedBuildInputs = [ ilmbase zlib ];
|
2015-03-31 06:27:36 +01:00
|
|
|
|
2020-07-30 01:35:18 +01:00
|
|
|
postPatch =
|
|
|
|
if (stdenv.hostPlatform.isLinux && stdenv.hostPlatform.libc != "glibc")
|
|
|
|
then
|
|
|
|
''
|
|
|
|
patch -p0 < ${non_glibc_fpstate_patch}
|
|
|
|
''
|
|
|
|
else null; # `null` avoids rebuild on glibc
|
|
|
|
|
2015-07-02 13:27:47 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2020-07-30 01:35:18 +01:00
|
|
|
passthru = {
|
|
|
|
# So that ilmbase (sharing the same source code) can re-use this patch.
|
|
|
|
inherit non_glibc_fpstate_patch;
|
|
|
|
};
|
|
|
|
|
2015-02-19 02:02:05 +00:00
|
|
|
meta = with stdenv.lib; {
|
2019-11-17 08:43:55 +00:00
|
|
|
description = "A high dynamic-range (HDR) image file format";
|
|
|
|
homepage = "https://www.openexr.com/";
|
2015-02-19 02:02:05 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
platforms = platforms.all;
|
|
|
|
};
|
2005-11-12 22:04:57 +00:00
|
|
|
}
|