lol

libbfd: fix for cross (based on same from @bgamari)

+16 -3
+16 -3
pkgs/development/libraries/libbfd/default.nix
··· 1 1 { stdenv 2 - , fetchurl, autoreconfHook264, bison, binutils-raw 2 + , fetchurl, fetchpatch, autoreconfHook264, buildPackages, bison, binutils-raw 3 3 , libiberty, zlib 4 4 }: 5 5 ··· 11 11 12 12 patches = binutils-raw.bintools.patches ++ [ 13 13 ../../tools/misc/binutils/build-components-separately.patch 14 + (fetchpatch { 15 + url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch"; 16 + sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q"; 17 + }) 14 18 ]; 15 19 16 20 # We just want to build libbfd 17 - postPatch = '' 21 + preConfigure = '' 18 22 cd bfd 19 23 ''; 20 24 25 + depsBuildBuilds = [ buildPackages.stdenv.cc ]; 21 26 nativeBuildInputs = [ autoreconfHook264 bison ]; 22 27 buildInputs = [ libiberty zlib ]; 23 28 24 - configurePlatforms = [ "build" "host" ]; 29 + configurePlatforms = [ "build" "host" "target" ]; 25 30 configureFlags = [ 26 31 "--enable-targets=all" "--enable-64-bit-bfd" 27 32 "--enable-install-libbfd" 28 33 "--enable-shared" 29 34 "--with-system-zlib" 35 + "CC_FOR_BUILD=$(CC)" 30 36 ]; 37 + 38 + postInstall = stdenv.lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' 39 + # the build system likes to move things into atypical locations 40 + mkdir -p $dev 41 + mv $out/${stdenv.hostPlatform.config}/${stdenv.targetPlatform.config}/include $dev/include 42 + mv $out/${stdenv.hostPlatform.config}/${stdenv.targetPlatform.config}/lib $out/lib 43 + ''; 31 44 32 45 enableParallelBuilding = true; 33 46