Files
nixpkgs/pkgs/development/tools/misc/binutils/2.38/libopcodes.nix
T
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

61 lines
1.2 KiB
Nix

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