core/pkgs/by-name/bi/binutils/2.38/libopcodes.nix

59 lines
1.2 KiB
Nix
Raw Normal View History

2024-06-30 08:16:52 +00:00
{
lib,
stdenv,
buildPackages,
autoreconfHook,
bison,
binutils-unwrapped_2_38,
libiberty,
libbfd_2_38,
2024-05-02 00:46:19 +00:00
}:
stdenv.mkDerivation {
pname = "libopcodes";
inherit (binutils-unwrapped_2_38) version src;
2024-06-30 08:16:52 +00:00
outputs = [
"out"
"dev"
2024-05-02 00:46:19 +00:00
];
2024-06-30 08:16:52 +00:00
patches = binutils-unwrapped_2_38.patches ++ [ ./build-components-separately.patch ];
2024-05-02 00:46:19 +00:00
# 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 ];
2024-06-30 08:16:52 +00:00
nativeBuildInputs = [
autoreconfHook
bison
];
2024-05-02 00:46:19 +00:00
buildInputs = [ libiberty ];
# dis-asm.h includes bfd.h
propagatedBuildInputs = [ libbfd_2_38 ];
2024-06-30 08:16:52 +00:00
configurePlatforms = [
"build"
"host"
];
2024-05-02 00:46:19 +00:00
configureFlags = [
2024-06-30 08:16:52 +00:00
"--enable-targets=all"
"--enable-64-bit-bfd"
2024-05-02 00:46:19 +00:00
"--enable-install-libbfd"
"--enable-shared"
];
enableParallelBuilding = true;
meta = with lib; {
description = "A library from binutils for manipulating machine code";
homepage = "https://www.gnu.org/software/binutils/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ericson2314 ];
platforms = platforms.unix;
};
}