2012-06-27 20:21:44 +02:00
|
|
|
{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo
|
2014-08-19 20:36:25 +02:00
|
|
|
, dejagnu, python, pkgconfig, guile, target ? null
|
2011-08-20 16:30:23 +02:00
|
|
|
|
2011-11-19 19:28:10 +01:00
|
|
|
# Additional dependencies for GNU/Hurd.
|
|
|
|
, mig ? null, hurd ? null
|
|
|
|
|
2012-06-21 15:28:17 +02:00
|
|
|
}:
|
2007-02-22 17:07:51 +01:00
|
|
|
|
2009-12-02 21:54:40 +01:00
|
|
|
let
|
2012-06-21 15:28:17 +02:00
|
|
|
|
2014-08-19 20:36:25 +02:00
|
|
|
basename = "gdb-7.8";
|
2011-11-19 19:28:10 +01:00
|
|
|
|
|
|
|
# Whether (cross-)building for GNU/Hurd. This is an approximation since
|
2012-12-28 19:08:19 +01:00
|
|
|
# having `stdenv ? cross' doesn't tell us if we're building `crossDrv' and
|
|
|
|
# `nativeDrv'.
|
2011-11-19 19:28:10 +01:00
|
|
|
isGNU =
|
2011-11-19 21:37:44 +01:00
|
|
|
stdenv.system == "i686-gnu"
|
2011-11-19 19:28:10 +01:00
|
|
|
|| (stdenv ? cross && stdenv.cross.config == "i586-pc-gnu");
|
2012-06-21 15:28:17 +02:00
|
|
|
|
2009-12-02 21:54:40 +01:00
|
|
|
in
|
2011-08-20 16:30:23 +02:00
|
|
|
|
2011-11-19 19:28:10 +01:00
|
|
|
assert isGNU -> mig != null && hurd != null;
|
|
|
|
|
2007-11-16 18:30:34 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2009-12-02 21:54:40 +01:00
|
|
|
name = basename + stdenv.lib.optionalString (target != null)
|
|
|
|
("-" + target.config);
|
2008-09-03 15:12:23 +02:00
|
|
|
|
2012-06-21 15:28:17 +02:00
|
|
|
src = fetchurl {
|
2014-08-19 20:36:25 +02:00
|
|
|
url = "mirror://gnu/gdb/${basename}.tar.xz";
|
|
|
|
sha256 = "49c4abe174f79f54e1f9e75210ffb590d9b497d5b5200b5398c0e073a4ecb875";
|
2012-06-21 15:28:17 +02:00
|
|
|
};
|
2008-09-03 15:12:23 +02:00
|
|
|
|
2014-03-20 11:09:39 +01:00
|
|
|
patches = [ ./edit-signals.patch ];
|
|
|
|
|
2010-12-04 11:35:04 +01:00
|
|
|
# I think python is not a native input, but I leave it
|
|
|
|
# here while I will not need it cross building
|
2012-12-28 19:20:09 +01:00
|
|
|
nativeBuildInputs = [ texinfo python ]
|
2012-06-21 15:28:17 +02:00
|
|
|
++ stdenv.lib.optional isGNU mig;
|
2011-08-20 16:30:23 +02:00
|
|
|
|
2014-08-19 20:36:25 +02:00
|
|
|
buildInputs = [ ncurses readline gmp mpfr expat pkgconfig guile ]
|
2011-11-19 19:28:10 +01:00
|
|
|
++ stdenv.lib.optional isGNU hurd
|
2010-09-05 17:19:07 +02:00
|
|
|
++ stdenv.lib.optional doCheck dejagnu;
|
2008-09-03 15:12:23 +02:00
|
|
|
|
2012-06-21 15:28:17 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2011-08-21 17:36:33 +02:00
|
|
|
configureFlags = with stdenv.lib;
|
2009-10-28 23:25:50 +01:00
|
|
|
'' --with-gmp=${gmp} --with-mpfr=${mpfr} --with-system-readline
|
2011-08-27 17:29:04 +02:00
|
|
|
--with-expat --with-libexpat-prefix=${expat}
|
2011-08-21 17:36:33 +02:00
|
|
|
''
|
|
|
|
+ optionalString (target != null) " --target=${target.config}"
|
2012-06-21 15:28:17 +02:00
|
|
|
+ optionalString (elem stdenv.system platforms.cygwin) " --without-python";
|
2008-09-03 15:12:23 +02:00
|
|
|
|
2010-12-04 11:35:04 +01:00
|
|
|
crossAttrs = {
|
2011-06-14 04:39:03 +02:00
|
|
|
# Do not add --with-python here to avoid cross building it.
|
2010-12-04 11:35:04 +01:00
|
|
|
configureFlags =
|
2012-12-28 19:08:19 +01:00
|
|
|
'' --with-gmp=${gmp.crossDrv} --with-mpfr=${mpfr.crossDrv} --with-system-readline
|
|
|
|
--with-expat --with-libexpat-prefix=${expat.crossDrv} --without-python
|
2010-12-04 11:35:04 +01:00
|
|
|
'' + stdenv.lib.optionalString (target != null)
|
|
|
|
" --target=${target.config}";
|
|
|
|
};
|
|
|
|
|
2009-10-28 23:25:50 +01:00
|
|
|
postInstall =
|
|
|
|
'' # Remove Info files already provided by Binutils and other packages.
|
|
|
|
rm -v $out/share/info/{standards,configure,bfd}.info
|
|
|
|
'';
|
2009-10-12 12:06:41 +02:00
|
|
|
|
2010-09-05 17:19:07 +02:00
|
|
|
# TODO: Investigate & fix the test failures.
|
|
|
|
doCheck = false;
|
|
|
|
|
2011-08-20 16:30:23 +02:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 16:21:08 +02:00
|
|
|
description = "The GNU Project debugger";
|
2008-09-03 15:12:23 +02: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 06:19:00 +02:00
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2009-09-23 21:45:02 +02:00
|
|
|
|
2014-01-15 15:33:31 +01:00
|
|
|
platforms = with platforms; linux ++ cygwin ++ darwin;
|
2013-08-16 23:44:33 +02:00
|
|
|
maintainers = with maintainers; [ pierron ];
|
2007-02-22 17:07:51 +01:00
|
|
|
};
|
|
|
|
}
|