Merge pull request #61245 from Synthetica9/openexr-crosscompile
openexr: fix cross-compilation
This commit is contained in:
commit
5ff79afb2b
@ -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 {
|
stdenv.mkDerivation rec {
|
||||||
name = "openexr-${version}";
|
name = "openexr-${version}";
|
||||||
@ -15,13 +20,28 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
outputs = [ "bin" "dev" "out" "doc" ];
|
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 = ''
|
preConfigure = ''
|
||||||
patchShebangs ./bootstrap
|
patchShebangs ./bootstrap
|
||||||
./bootstrap
|
./bootstrap
|
||||||
'';
|
'';
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig ];
|
nativeBuildInputs = [ pkgconfig autoconf automake libtool ];
|
||||||
buildInputs = [ autoconf automake libtool ];
|
|
||||||
propagatedBuildInputs = [ ilmbase zlib ];
|
propagatedBuildInputs = [ ilmbase zlib ];
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user