1{ stdenv, buildPackages
2, fetchurl, autoreconfHook264, bison, binutils-raw
3, libiberty, libbfd
4}:
5
6stdenv.mkDerivation rec {
7 name = "libopcodes-${version}";
8 inherit (binutils-raw.bintools) version src;
9
10 outputs = [ "out" "dev" ];
11
12 patches = binutils-raw.bintools.patches ++ [
13 ../../tools/misc/binutils/build-components-separately.patch
14 ];
15
16 # We just want to build libopcodes
17 postPatch = ''
18 cd opcodes
19 find . ../include/opcode -type f -exec sed {} -i -e 's/"bfd.h"/<bfd.h>/' \;
20 '';
21
22 depsBuildBuild = [ buildPackages.stdenv.cc ];
23 nativeBuildInputs = [ autoreconfHook264 bison ];
24 buildInputs = [ libiberty ];
25 # dis-asm.h includes bfd.h
26 propagatedBuildInputs = [ libbfd ];
27
28 configurePlatforms = [ "build" "host" ];
29 configureFlags = [
30 "--enable-targets=all" "--enable-64-bit-bfd"
31 "--enable-install-libbfd"
32 "--enable-shared"
33 ];
34
35 enableParallelBuilding = true;
36
37 meta = with stdenv.lib; {
38 description = "A library from binutils for manipulating machine code";
39 homepage = http://www.gnu.org/software/binutils/;
40 license = licenses.gpl3Plus;
41 maintainers = with maintainers; [ ericson2314 ];
42 platforms = platforms.unix;
43 };
44}