diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/openexr')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/openexr/bootstrap.patch | 15 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/openexr/default.nix | 55 |
2 files changed, 70 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/openexr/bootstrap.patch b/nixpkgs/pkgs/development/libraries/openexr/bootstrap.patch new file mode 100644 index 000000000000..af6669c16a45 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/openexr/bootstrap.patch @@ -0,0 +1,15 @@ +diff -ur openexr-v2.2.0-src-orig/OpenEXR/bootstrap openexr-v2.2.0-src/OpenEXR/bootstrap +--- OpenEXR/bootstrap 2015-03-31 01:02:41.000000000 -0400 ++++ OpenEXR/bootstrap 2015-03-31 01:03:35.000000000 -0400 +@@ -47,11 +47,6 @@ + fi + } + +-# Check if /usr/local/share/aclocal exists +-if [ -d /usr/local/share/aclocal ]; then +- ACLOCAL_INCLUDE="$ACLOCAL_INCLUDE -I /usr/local/share/aclocal" +-fi +- + run_cmd aclocal -I m4 $ACLOCAL_INCLUDE + run_cmd $LIBTOOLIZE --automake --copy + run_cmd automake --add-missing --copy diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix new file mode 100644 index 000000000000..9eef138c532e --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix @@ -0,0 +1,55 @@ +{ lib, stdenv, buildPackages, fetchurl, autoconf, automake, libtool, pkgconfig, zlib, ilmbase, }: + +let + # Doesn't really do anything when not crosscompiling + emulator = stdenv.hostPlatform.emulator buildPackages; +in + +stdenv.mkDerivation rec { + pname = "openexr"; + version = lib.getVersion ilmbase; + + src = fetchurl { + url = "https://github.com/openexr/openexr/releases/download/v${version}/${pname}-${version}.tar.gz"; + sha256 = "19jywbs9qjvsbkvlvzayzi81s976k53wg53vw4xj66lcgylb6v7x"; + }; + + patches = [ + ./bootstrap.patch + ]; + + outputs = [ "bin" "dev" "out" "doc" ]; + + # Needed because there are some generated sources. Solution: just run them under QEMU. + postPatch = '' + for file in b44ExpLogTable dwaLookups + do + # Ecape for both sh and Automake + emu=${lib.escapeShellArg (lib.replaceStrings ["$"] ["$$"] emulator)} + before="./$file > $file.h" + after="$emu $before" + substituteInPlace IlmImf/Makefile.am \ + --replace "$before" "$after" + done + + # Make sure the patch succeeded + [[ $(grep "$emu" IlmImf/Makefile.am | wc -l) = 2 ]] + ''; + + preConfigure = '' + patchShebangs ./bootstrap + ./bootstrap + ''; + + nativeBuildInputs = [ pkgconfig autoconf automake libtool ]; + propagatedBuildInputs = [ ilmbase zlib ]; + + enableParallelBuilding = true; + doCheck = false; # fails 1 of 1 tests + + meta = with stdenv.lib; { + homepage = https://www.openexr.com/; + license = licenses.bsd3; + platforms = platforms.all; + }; +} |