2015-11-26 12:00:36 +00:00
|
|
|
{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo, zlib
|
|
|
|
, dejagnu, perl, pkgconfig
|
|
|
|
, python ? null
|
|
|
|
, guile ? null
|
|
|
|
, target ? null
|
2016-02-18 05:21:04 +00:00
|
|
|
# Support all known targets in one gdb binary.
|
|
|
|
, multitarget ? false
|
2011-11-19 18:28:10 +00:00
|
|
|
# Additional dependencies for GNU/Hurd.
|
|
|
|
, mig ? null, hurd ? null
|
|
|
|
|
2012-06-21 14:28:17 +01:00
|
|
|
}:
|
2007-02-22 16:07:51 +00:00
|
|
|
|
2009-12-02 20:54:40 +00:00
|
|
|
let
|
2012-06-21 14:28:17 +01:00
|
|
|
|
2016-10-09 20:23:13 +01:00
|
|
|
basename = "gdb-7.12";
|
2011-11-19 18:28:10 +00:00
|
|
|
|
|
|
|
# Whether (cross-)building for GNU/Hurd. This is an approximation since
|
2012-12-28 18:08:19 +00:00
|
|
|
# having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
|
|
|
|
# `nativeDrv'.
|
2011-11-19 18:28:10 +00:00
|
|
|
isGNU =
|
2011-11-19 20:37:44 +00:00
|
|
|
stdenv.system == "i686-gnu"
|
2011-11-19 18:28:10 +00:00
|
|
|
|| (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
|
2012-06-21 14:28:17 +01:00
|
|
|
|
2009-12-02 20:54:40 +00:00
|
|
|
in
|
2011-08-20 15:30:23 +01:00
|
|
|
|
2011-11-19 18:28:10 +00:00
|
|
|
assert isGNU -> mig != null && hurd != null;
|
|
|
|
|
2007-11-16 17:30:34 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2009-12-02 20:54:40 +00:00
|
|
|
name = basename + stdenv.lib.optionalString (target != null)
|
|
|
|
("-" + target.config);
|
2008-09-03 14:12:23 +01:00
|
|
|
|
2012-06-21 14:28:17 +01:00
|
|
|
src = fetchurl {
|
2014-08-19 19:36:25 +01:00
|
|
|
url = "mirror://gnu/gdb/${basename}.tar.xz";
|
2016-10-09 20:23:13 +01:00
|
|
|
sha256 = "152g2qa8337cxif3lkvabjcxfd9jphfb2mza8f1p2c4bjk2z6kw3";
|
2012-06-21 14:28:17 +01:00
|
|
|
};
|
2008-09-03 14:12:23 +01:00
|
|
|
|
2015-11-26 12:00:36 +00:00
|
|
|
nativeBuildInputs = [ pkgconfig texinfo perl ]
|
2012-06-21 14:28:17 +01:00
|
|
|
++ stdenv.lib.optional isGNU mig;
|
2011-08-20 15:30:23 +01:00
|
|
|
|
2015-11-26 12:00:36 +00:00
|
|
|
buildInputs = [ ncurses readline gmp mpfr expat zlib python guile ]
|
2011-11-19 18:28:10 +00:00
|
|
|
++ stdenv.lib.optional isGNU hurd
|
2010-09-05 16:19:07 +01:00
|
|
|
++ stdenv.lib.optional doCheck dejagnu;
|
2008-09-03 14:12:23 +01:00
|
|
|
|
2012-06-21 14:28:17 +01:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-10-12 22:18:23 +01:00
|
|
|
# darwin build fails with format hardening since v7.12
|
|
|
|
hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
|
|
|
|
|
2011-08-21 16:36:33 +01:00
|
|
|
configureFlags = with stdenv.lib;
|
2016-04-16 18:40:40 +01:00
|
|
|
[ "--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
|
2016-04-16 17:49:30 +01:00
|
|
|
"--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
|
2015-11-26 12:00:36 +00:00
|
|
|
"--with-separate-debug-dir=/run/current-system/sw/lib/debug"
|
|
|
|
]
|
|
|
|
++ optional (target != null) "--target=${target.config}"
|
2016-02-18 05:21:04 +00:00
|
|
|
++ optional multitarget "--enable-targets=all"
|
2015-11-26 12:00:36 +00:00
|
|
|
++ optional (elem stdenv.system platforms.cygwin) "--without-python";
|
2008-09-03 14:12:23 +01:00
|
|
|
|
2010-12-04 10:35:04 +00:00
|
|
|
crossAttrs = {
|
2011-06-14 03:39:03 +01:00
|
|
|
# Do not add --with-python here to avoid cross building it.
|
2015-11-26 12:00:36 +00:00
|
|
|
configureFlags = with stdenv.lib;
|
|
|
|
[ "--with-gmp=${gmp.crossDrv}" "--with-mpfr=${mpfr.crossDrv}" "--with-system-readline"
|
|
|
|
"--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.crossDrv}" "--without-python"
|
2016-02-18 05:21:04 +00:00
|
|
|
]
|
|
|
|
++ optional (target != null) "--target=${target.config}"
|
|
|
|
++ optional multitarget "--enable-targets=all";
|
2010-12-04 10:35:04 +00:00
|
|
|
};
|
|
|
|
|
2009-10-28 22:25:50 +00:00
|
|
|
postInstall =
|
|
|
|
'' # Remove Info files already provided by Binutils and other packages.
|
2015-04-14 16:25:34 +01:00
|
|
|
rm -v $out/share/info/bfd.info
|
2009-10-28 22:25:50 +00:00
|
|
|
'';
|
2009-10-12 11:06:41 +01:00
|
|
|
|
2010-09-05 16:19:07 +01:00
|
|
|
# TODO: Investigate & fix the test failures.
|
|
|
|
doCheck = false;
|
|
|
|
|
2011-08-20 15:30:23 +01:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 15:21:08 +01:00
|
|
|
description = "The GNU Project debugger";
|
2008-09-03 14:12:23 +01:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GDB, the GNU Project debugger, allows you to see what is going
|
|
|
|
on `inside' another program while it executes -- or what another
|
|
|
|
program was doing at the moment it crashed.
|
|
|
|
'';
|
|
|
|
|
|
|
|
homepage = http://www.gnu.org/software/gdb/;
|
|
|
|
|
2014-06-19 05:19:00 +01:00
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2009-09-23 20:45:02 +01:00
|
|
|
|
2014-01-15 14:33:31 +00:00
|
|
|
platforms = with platforms; linux ++ cygwin ++ darwin;
|
2013-08-16 22:44:33 +01:00
|
|
|
maintainers = with maintainers; [ pierron ];
|
2007-02-22 16:07:51 +00:00
|
|
|
};
|
|
|
|
}
|