nixpkgs/pkgs/development/libraries/libopcodes/default.nix
John Ericson adaa110a72 binutils: No more darwin conditionals
Since at least d7bddc27b2, we've had a
situation where one should depend on:

 - `stdenv.cc.bintools`: for executables at build time
 - `libbfd` or `libiberty`: for those libraries
 - `targetPackages.cc.bintools`: for exectuables at *run* time
 - `binutils`: only for specifically GNU Binutils's executables,
   regardless of the host platform, at run time.

and that commit cleaned up this usage to reflect that. This PR flips the
switch so that:

 - `binutils` is indeed unconditionally GNU Binutils
 - `binutils-raw`, which previously served that role, is gone.

so that the correct usage will be enforced going forward and everything
is simple.

N.B. In a few cases `binutils-unwrapped` (which before and now was
unconditionally actual GNU binutils), rather than `binutils` was used to
replace old `binutils-raw` as it is friendly towards some cross
compilation usage by avoiding a reference to the next bootstrapping
change.
2018-04-03 13:34:52 -04:00

45 lines
1.2 KiB
Nix

{ stdenv, buildPackages
, fetchurl, autoreconfHook264, bison, binutils-unwrapped
, libiberty, libbfd
}:
stdenv.mkDerivation rec {
name = "libopcodes-${version}";
inherit (binutils-unwrapped) version src;
outputs = [ "out" "dev" ];
patches = binutils-unwrapped.patches ++ [
../../tools/misc/binutils/build-components-separately.patch
];
# We just want to build libopcodes
postPatch = ''
cd opcodes
find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
'';
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ autoreconfHook264 bison ];
buildInputs = [ libiberty ];
# dis-asm.h includes bfd.h
propagatedBuildInputs = [ libbfd ];
configurePlatforms = [ "build" "host" ];
configureFlags = [
"--enable-targets=all" "--enable-64-bit-bfd"
"--enable-install-libbfd"
"--enable-shared"
];
enableParallelBuilding = true;
meta = with stdenv.lib; {
description = "A library from binutils for manipulating machine code";
homepage = http://www.gnu.org/software/binutils/;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ericson2314 ];
platforms = platforms.unix;
};
}