about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/libraries/openexr
diff options
context:
space:
mode:
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/openexr')
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/3.nix49
-rw-r--r--nixpkgs/pkgs/development/libraries/openexr/default.nix44
2 files changed, 93 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..243d8830565d
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexr/3.nix
@@ -0,0 +1,49 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, fetchpatch
+, zlib
+, cmake
+, imath
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openexr";
+  version = "3.1.7";
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "openexr";
+    rev = "v${version}";
+    sha256 = "sha256-Kl+aOA797aZvrvW4ZQNHdSU7YFPieZEzX3aYeaoH6eU=";
+  };
+
+  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
+  '';
+
+  cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
+
+  nativeBuildInputs = [ cmake ];
+  propagatedBuildInputs = [ imath zlib ];
+
+  # 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";
+
+  # https://github.com/AcademySoftwareFoundation/openexr/issues/1400
+  doCheck = !stdenv.isAarch32;
+
+  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..ba0263bcad13
--- /dev/null
+++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix
@@ -0,0 +1,44 @@
+{ lib
+, stdenv
+, fetchFromGitHub
+, zlib
+, ilmbase
+, fetchpatch
+, cmake
+}:
+
+stdenv.mkDerivation rec {
+  pname = "openexr";
+  version = "2.5.8";
+
+  outputs = [ "bin" "dev" "out" "doc" ];
+
+  src = fetchFromGitHub {
+    owner = "AcademySoftwareFoundation";
+    repo = "openexr";
+    rev = "v${version}";
+    sha256 = "sha256-N7XdDaDsYdx4TXvHplQDTvhHNUmW5rntdaTKua4C0es=";
+  };
+
+  patches = [
+    (fetchpatch {
+      name = "CVE-2021-45942.patch";
+      url = "https://github.com/AcademySoftwareFoundation/openexr/commit/11cad77da87c4fa2aab7d58dd5339e254db7937e.patch";
+      stripLen = 4;
+      extraPrefix = "OpenEXR/IlmImf/";
+      sha256 = "1wa2jn6sa0n3phaqvklnlbgk1bz60y756ad4jk4d757pzpnannsy";
+    })
+  ];
+
+  cmakeFlags = lib.optional stdenv.hostPlatform.isStatic "-DCMAKE_SKIP_RPATH=ON";
+
+  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;
+  };
+}