1{ lib, stdenv, buildPackages
2, autoreconfHook, bison, binutils-unwrapped
3, libiberty, libbfd
4}:
5
6stdenv.mkDerivation {
7 pname = "libopcodes";
8 inherit (binutils-unwrapped) version src;
9
10 outputs = [ "out" "dev" ];
11
12 patches = binutils-unwrapped.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 = [ autoreconfHook 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 lib; {
38 description = "A library from binutils for manipulating machine code";
39 homepage = "https://www.gnu.org/software/binutils/";
40 license = licenses.gpl3Plus;
41 maintainers = with maintainers; [ ericson2314 ];
42 platforms = platforms.unix;
43 };
44}