de28bd4832
On most distros, these are just built and distributed as part of binutils. We don't use binutils across the board, however, but rather switch between binutils and a cctools-binutils mashup, and change the outputs on binutils too. This creates a combinatorial conditional soup which is hard to maintain. My hope is to lower the the state space. While my patch isn't the most maintainable, they make downstream packages become more maintainable to compensate. The additional derivations themselves are completely platform-agnostic, always they always supports all possible target platforms, and always yield "out" and "dev" outputs. That, in turn, allows downstream packages to not worry about a dependency shape-shifting under them. In fact, the actual binutils package can avoid needing multiple outputs now that these serve the requisite libraries, so that also can become simpler on all platforms, too, removing the original wart this PR circumnavigates for now. Actually changing the binutils package to leverage is a mass rebuild, however, so I'll leave that for a separate PR. I do hope to upstream something like my patch too, but until then I'll make myself maintainer of these derivations
44 lines
1.1 KiB
Nix
44 lines
1.1 KiB
Nix
{ stdenv, buildPackages
|
|
, fetchurl, autoreconfHook264, bison, binutils
|
|
, libiberty, libbfd
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "libopcodes-${version}";
|
|
inherit (binutils) version src;
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
patches = binutils.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>/' \;
|
|
'';
|
|
|
|
nativeBuildInputs = [ autoreconfHook264 bison buildPackages.stdenv.cc ];
|
|
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;
|
|
};
|
|
}
|