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