diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/openexr')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/openexr/3.nix | 48 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/openexr/default.nix | 47 |
2 files changed, 95 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/openexr/3.nix b/nixpkgs/pkgs/development/libraries/openexr/3.nix new file mode 100644 index 000000000000..17d4382d0b93 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/openexr/3.nix @@ -0,0 +1,48 @@ +{ lib +, stdenv +, fetchFromGitHub +, fetchpatch +, zlib +, cmake +, imath +}: + +stdenv.mkDerivation rec { + pname = "openexr"; + version = "3.1.5"; + + src = fetchFromGitHub { + owner = "AcademySoftwareFoundation"; + repo = "openexr"; + rev = "v${version}"; + sha256 = "sha256-mmzrMCYyAAa1z8fLZVbaTL1TZzdRaRTLgK+wzPuH4tg="; + }; + + outputs = [ "bin" "dev" "out" "doc" ]; + + # 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 + ''; + + nativeBuildInputs = [ + cmake + ]; + + propagatedBuildInputs = [ + imath + zlib + ]; + + doCheck = true; + + 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; + }; +} diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix new file mode 100644 index 000000000000..31ca48552755 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix @@ -0,0 +1,47 @@ +{ lib +, stdenv +, fetchFromGitHub +, zlib +, ilmbase +, fetchpatch +, cmake +}: + +stdenv.mkDerivation rec { + pname = "openexr"; + version = "2.5.7"; + + outputs = [ "bin" "dev" "out" "doc" ]; + + src = fetchFromGitHub { + owner = "AcademySoftwareFoundation"; + repo = "openexr"; + rev = "v${version}"; + sha256 = "1vja0rbilcd1wn184w8nbcmck00n7bfwlddwiaxw8dhj64nx4468"; + }; + + patches = [ + # Fix pkg-config paths + (fetchpatch { + url = "https://github.com/AcademySoftwareFoundation/openexr/commit/2f19a01923885fda75ec9d19332de080ec7102bd.patch"; + sha256 = "1yxmrdzq1x1911wdzwnzr29jmg2r4wd4yx3vhjn0y5dpny0ri5y5"; + }) + (fetchpatch { + name = "CVE-2021-45942.patch"; + url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch"; + stripLen = 4; + extraPrefix = "OpenEXR/IlmImf/"; + sha256 = "1wa2jn6sa0n3phaqvklnlbgk1bz60y756ad4jk4d757pzpnannsy"; + }) + ]; + + nativeBuildInputs = [ cmake ]; + propagatedBuildInputs = [ ilmbase zlib ]; + + meta = with lib; { + description = "A high dynamic-range (HDR) image file format"; + homepage = "https://www.openexr.com/"; + license = licenses.bsd3; + platforms = platforms.all; + }; +} |