treewide: Try to avoid depending on binutils directly

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.
This commit is contained in:
John Ericson 2017-10-10 19:01:42 -04:00
parent f72bffb4c4
commit d7bddc27b2
11 changed files with 44 additions and 31 deletions

View File

@ -1,5 +1,5 @@
{stdenv, fetchurl, libX11, xproto, indent, readline, gsl, freeglut, mesa, SDL
, blas, binutils, intltool, gettext, zlib, libSM}:
, blas, libbfd, intltool, gettext, zlib, libSM}:
stdenv.mkDerivation rec {
baseName = "lush";
@ -12,7 +12,7 @@ stdenv.mkDerivation rec {
};
buildInputs = [
libX11 libSM xproto indent readline gsl freeglut mesa SDL blas binutils
libX11 libSM xproto indent readline gsl freeglut mesa SDL blas libbfd
intltool gettext zlib
];

View File

@ -1,4 +1,4 @@
{ stdenv, fetchurl, binutils }:
{ stdenv, fetchurl, libopcodes }:
with stdenv.lib;
stdenv.mkDerivation rec {
@ -11,8 +11,7 @@ stdenv.mkDerivation rec {
sha256 = "19j9nwl88k660045s40cbz5zrl1wpd2mcxnnc8qqnnaj311a58qz";
};
# Needs libopcodes.so from binutils for 'make check'
buildInputs = [ binutils ];
buildInputs = stdenv.lib.optional doCheck libopcodes;
doCheck = true;

View File

@ -1,4 +1,7 @@
{stdenv, fetchurl, cmake, pkgconfig, zlib, curl, elfutils, python, libiberty, binutils}:
{ stdenv
, fetchurl, cmake, pkgconfig
, zlib, curl, elfutils, python, libiberty, libopcodes
}:
stdenv.mkDerivation rec {
name = "kcov-${version}";
@ -10,8 +13,9 @@ stdenv.mkDerivation rec {
};
preConfigure = "patchShebangs src/bin-to-c-source.py";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ cmake zlib curl elfutils python libiberty binutils ];
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ zlib curl elfutils python libiberty libopcodes ];
meta = with stdenv.lib; {
description = "Code coverage tester for compiled programs, Python scripts and shell scripts";

View File

@ -1,5 +1,8 @@
{ stdenv, fetchurl, binutils, popt, zlib, pkgconfig, linuxHeaders, coreutils
, libiberty_static, withGUI ? false , qt4 ? null}:
{ stdenv, buildPackages
, fetchurl, pkgconfig
, libbfd, popt, zlib, linuxHeaders, libiberty_static
, withGUI ? false, qt4 ? null
}:
# libX11 is needed because the Qt build stuff automatically adds `-lX11'.
assert withGUI -> qt4 != null;
@ -14,12 +17,12 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace opjitconv/opjitconv.c \
--replace "/bin/rm" "${coreutils}/bin/rm" \
--replace "/bin/cp" "${coreutils}/bin/cp"
--replace "/bin/rm" "${buildPackages.coreutils}/bin/rm" \
--replace "/bin/cp" "${buildPackages.coreutils}/bin/cp"
'';
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ binutils zlib popt linuxHeaders libiberty_static ]
buildInputs = [ libbfd zlib popt linuxHeaders libiberty_static ]
++ stdenv.lib.optionals withGUI [ qt4 ];
configureFlags = [

View File

@ -1,5 +1,7 @@
{ fetchurl, stdenv, binutils
, pkgconfig, gtk2, glib, pango, libglade }:
{ stdenv
, fetchurl, pkgconfig
, gtk2, glib, pango, libglade
}:
stdenv.mkDerivation rec {
name = "sysprof-1.2.0";
@ -10,7 +12,7 @@ stdenv.mkDerivation rec {
};
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ binutils gtk2 glib pango libglade ];
buildInputs = [ gtk2 glib pango libglade ];
meta = {
homepage = http://sysprof.com/;

View File

@ -1,4 +1,4 @@
{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, binutils }:
{ stdenv, fetchgit, cmake, libgcrypt, json_c, curl, expat, boost, libiberty }:
stdenv.mkDerivation rec {
version = "0.3.0";
@ -10,10 +10,10 @@ stdenv.mkDerivation rec {
sha256 = "11cqfcjl128nfg1rjvpvr9x1x2ch3kyliw4vi14n51zqp82f9ysb";
};
buildInputs = [cmake libgcrypt json_c curl expat stdenv binutils boost];
buildInputs = [cmake libgcrypt json_c curl expat stdenv libiberty boost];
# work around new binutils headers, see
# http://stackoverflow.com/questions/11748035/binutils-bfd-h-wants-config-h-now
# work around new libiberty headers, see
# http://stackoverflow.com/questions/11748035/libiberty-bfd-h-wants-config-h-now
prePatch = ''
sed -i '1i#define PACKAGE "grive"\n#define PACKAGE_VERSION "${version}"' \
libgrive/src/bfd/SymbolInfo.cc

View File

@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, binutils }:
{ stdenv, fetchFromGitHub, pkgconfig, fetchurl, yajl, cmake, libgcrypt, curl, expat, boost, libiberty }:
stdenv.mkDerivation rec {
version = "0.5.0";
@ -13,7 +13,7 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [ cmake pkgconfig ];
buildInputs = [ libgcrypt yajl curl expat stdenv boost binutils ];
buildInputs = [ libgcrypt yajl curl expat stdenv boost libiberty ];
meta = with stdenv.lib; {
description = "A console Google Drive client";

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetchgit, python3Packages, docutils
, acl, apktool, binutils, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc
, acl, apktool, libbfd, bzip2, cbfstool, cdrkit, colord, colordiff, coreutils, cpio, diffutils, dtc
, e2fsprogs, file, findutils, fontforge-fonttools, fpc, gettext, ghc, ghostscriptX, giflib, gnupg1, gnutar
, gzip, imagemagick, jdk, libarchive, libcaca, llvm, mono, openssh, pdftk, pgpdump, poppler_utils, sng, sqlite
, squashfsTools, tcpdump, unoconv, unzip, xxd, xz
@ -28,7 +28,7 @@ python3Packages.buildPythonApplication rec {
# Still missing these tools: docx2txt enjarify js-beautify oggDump Rscript
# Also these libraries: python3-guestfs
pythonPath = with python3Packages; [ debian libarchive-c python_magic tlsh rpm ] ++ [
acl binutils bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils
acl libbfd bzip2 cdrkit colordiff coreutils cpio diffutils dtc e2fsprogs file findutils
fontforge-fonttools gettext gnutar gzip libarchive libcaca pgpdump sng sqlite
squashfsTools unzip xxd xz
] ++ lib.optionals enableBloat [

View File

@ -1,4 +1,7 @@
{ stdenv, fetchurl, cpio, zlib, bzip2, file, elfutils, libarchive, nspr, nss, popt, db, xz, python, lua, pkgconfig, binutils, autoreconfHook }:
{ stdenv
, pkgconfig, autoreconfHook
, fetchurl, cpio, zlib, bzip2, file, elfutils, libbfd, libarchive, nspr, nss, popt, db, xz, python, lua
}:
stdenv.mkDerivation rec {
name = "rpm-${version}";
@ -15,7 +18,7 @@ stdenv.mkDerivation rec {
buildInputs = [ cpio zlib bzip2 file libarchive nspr nss db xz python lua ];
# rpm/rpmlib.h includes popt.h, and then the pkg-config file mentions these as linkage requirements
propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive binutils ];
propagatedBuildInputs = [ popt elfutils nss db bzip2 libarchive libbfd ];
NIX_CFLAGS_COMPILE = "-I${nspr.dev}/include/nspr -I${nss.dev}/include/nss";

View File

@ -1,5 +1,7 @@
{ stdenv, fetchgit, autoconf, automake, utillinux, openssl, libuuid, gnu-efi
, binutils, pkgconfig, help2man }:
{ stdenv
, fetchgit, autoconf, automake, pkgconfig, help2man
, utillinux, openssl, libuuid, gnu-efi, libbfd
}:
stdenv.mkDerivation rec {
name = "sbsigntool-${version}";
@ -15,8 +17,8 @@ stdenv.mkDerivation rec {
prePatch = "patchShebangs .";
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ autoconf automake utillinux openssl libuuid gnu-efi binutils help2man ];
nativeBuildInputs = [ autoconf automake pkgconfig help2man ];
buildInputs = [ utillinux openssl libuuid gnu-efi libbfd ];
configurePhase = ''
substituteInPlace configure.ac --replace "@@NIX_GNUEFI@@" "${gnu-efi}"

View File

@ -15226,7 +15226,7 @@ in {
preConfigure = ''
substituteInPlace setup.py \
--replace '"/usr/include"' '"${pkgs.gdb}/include"' \
--replace '"/usr/lib"' '"${pkgs.binutils.lib}/lib"'
--replace '"/usr/lib"' '"${pkgs.libbfd}/lib"'
'';
meta = {