2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv
|
2022-09-30 11:47:45 +00:00
|
|
|
, buildPackages
|
|
|
|
, gnu-config, autoreconfHook, bison, binutils-unwrapped, texinfo
|
2021-09-23 15:35:13 +00:00
|
|
|
, libiberty, libintl, zlib
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation {
|
|
|
|
pname = "libbfd";
|
|
|
|
inherit (binutils-unwrapped) version src;
|
|
|
|
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
|
|
|
|
patches = binutils-unwrapped.patches ++ [
|
2022-09-09 14:08:57 +00:00
|
|
|
./build-components-separately.patch
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
# We just want to build libbfd
|
|
|
|
postPatch = ''
|
|
|
|
cd bfd
|
|
|
|
'';
|
|
|
|
|
|
|
|
postAutoreconf = ''
|
|
|
|
echo "Updating config.guess and config.sub from ${gnu-config}"
|
|
|
|
cp -f ${gnu-config}/config.{guess,sub} ../
|
|
|
|
'';
|
|
|
|
|
|
|
|
# We update these ourselves
|
|
|
|
dontUpdateAutotoolsGnuConfigScripts = true;
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
strictDeps = true;
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [ autoreconfHook bison texinfo ];
|
2021-09-23 15:35:13 +00:00
|
|
|
buildInputs = [ libiberty zlib ] ++ lib.optionals stdenv.isDarwin [ libintl ];
|
2022-09-30 11:47:45 +00:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configurePlatforms = [ "build" "host" ];
|
|
|
|
configureFlags = [
|
|
|
|
"--enable-targets=all" "--enable-64-bit-bfd"
|
|
|
|
"--enable-install-libbfd"
|
|
|
|
"--with-system-zlib"
|
2021-09-18 10:52:07 +00:00
|
|
|
] ++ lib.optional (!stdenv.hostPlatform.isStatic) "--enable-shared";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A library for manipulating containers of machine code";
|
|
|
|
longDescription = ''
|
|
|
|
BFD is a library which provides a single interface to read and write
|
|
|
|
object files, executables, archive files, and core files in any format.
|
|
|
|
It is associated with GNU Binutils, and elsewhere often distributed with
|
|
|
|
it.
|
|
|
|
'';
|
|
|
|
homepage = "https://www.gnu.org/software/binutils/";
|
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
maintainers = with maintainers; [ ericson2314 ];
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|