mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-12-23 06:03:40 +00:00
adaa110a72
Since at least d7bddc27b2
, we've had a
situation where one should depend on:
- `stdenv.cc.bintools`: for executables at build time
- `libbfd` or `libiberty`: for those libraries
- `targetPackages.cc.bintools`: for exectuables at *run* time
- `binutils`: only for specifically GNU Binutils's executables,
regardless of the host platform, at run time.
and that commit cleaned up this usage to reflect that. This PR flips the
switch so that:
- `binutils` is indeed unconditionally GNU Binutils
- `binutils-raw`, which previously served that role, is gone.
so that the correct usage will be enforced going forward and everything
is simple.
N.B. In a few cases `binutils-unwrapped` (which before and now was
unconditionally actual GNU binutils), rather than `binutils` was used to
replace old `binutils-raw` as it is friendly towards some cross
compilation usage by avoiding a reference to the next bootstrapping
change.
60 lines
1.7 KiB
Nix
60 lines
1.7 KiB
Nix
{ stdenv, buildPackages
|
|
, fetchurl, fetchpatch, gnu-config, autoreconfHook264, bison, binutils-unwrapped
|
|
, libiberty, zlib
|
|
}:
|
|
|
|
stdenv.mkDerivation rec {
|
|
name = "libbfd-${version}";
|
|
inherit (binutils-unwrapped) version src;
|
|
|
|
outputs = [ "out" "dev" ];
|
|
|
|
patches = binutils-unwrapped.patches ++ [
|
|
../../tools/misc/binutils/build-components-separately.patch
|
|
(fetchpatch {
|
|
url = "https://raw.githubusercontent.com/mxe/mxe/e1d4c144ee1994f70f86cf7fd8168fe69bd629c6/src/bfd-1-disable-subdir-doc.patch";
|
|
sha256 = "0pzb3i74d1r7lhjan376h59a7kirw15j7swwm8pz3zy9lkdqkj6q";
|
|
})
|
|
];
|
|
|
|
# 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;
|
|
|
|
nativeBuildInputs = [ autoreconfHook264 bison ];
|
|
buildInputs = [ libiberty zlib ];
|
|
|
|
configurePlatforms = [ "build" "host" ];
|
|
configureFlags = [
|
|
"--enable-targets=all" "--enable-64-bit-bfd"
|
|
"--enable-install-libbfd"
|
|
"--enable-shared"
|
|
"--with-system-zlib"
|
|
];
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
meta = with stdenv.lib; {
|
|
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 = http://www.gnu.org/software/binutils/;
|
|
license = licenses.gpl3Plus;
|
|
maintainers = with maintainers; [ ericson2314 ];
|
|
platforms = platforms.unix;
|
|
};
|
|
}
|