diff options
author | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
---|---|---|
committer | Alyssa Ross <hi@alyssa.is> | 2019-05-17 10:56:54 +0000 |
commit | c1d22074139ab0d048a05b5e5116265d099114d6 (patch) | |
tree | 97977009422d675f8930f97c309b010481289e72 /nixpkgs/pkgs/development/libraries/openexr | |
parent | 4dc8afe4fd6b18437150129e0a1ecc23c6a1c0b9 (diff) | |
parent | bc9df0f66110039e495b6debe3a6cda4a1bb0fed (diff) | |
download | nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.gz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.bz2 nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.lz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.xz nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.tar.zst nixlib-c1d22074139ab0d048a05b5e5116265d099114d6.zip |
Merge commit 'bc9df0f66110039e495b6debe3a6cda4a1bb0fed'
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/openexr')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/openexr/default.nix | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/nixpkgs/pkgs/development/libraries/openexr/default.nix b/nixpkgs/pkgs/development/libraries/openexr/default.nix index b575fa0ef08c..54b617fdc014 100644 --- a/nixpkgs/pkgs/development/libraries/openexr/default.nix +++ b/nixpkgs/pkgs/development/libraries/openexr/default.nix @@ -1,4 +1,9 @@ -{ lib, stdenv, fetchurl, autoconf, automake, libtool, pkgconfig, zlib, ilmbase }: +{ 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 { name = "openexr-${version}"; @@ -15,13 +20,28 @@ stdenv.mkDerivation rec { 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 ]; - buildInputs = [ autoconf automake libtool ]; + nativeBuildInputs = [ pkgconfig autoconf automake libtool ]; propagatedBuildInputs = [ ilmbase zlib ]; enableParallelBuilding = true; |