2011-08-20 14:30:23 +00:00
|
|
|
{ fetchurl, fetchgit, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo
|
|
|
|
, dejagnu, python, target ? null
|
|
|
|
|
|
|
|
# Set it to true to fetch the latest release/branchpoint from git.
|
|
|
|
, bleedingEdgeVersion ? false
|
|
|
|
|
|
|
|
# needed for the git version
|
|
|
|
, flex, bison }:
|
2007-02-22 16:07:51 +00:00
|
|
|
|
2009-12-02 20:54:40 +00:00
|
|
|
let
|
2011-08-20 14:30:23 +00:00
|
|
|
basename =
|
|
|
|
if bleedingEdgeVersion
|
|
|
|
then "gdb-7.3.20110726"
|
2011-09-08 10:30:24 +00:00
|
|
|
else "gdb-7.3.1";
|
2009-12-02 20:54:40 +00:00
|
|
|
in
|
2011-08-20 14:30:23 +00:00
|
|
|
|
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 13:12:23 +00:00
|
|
|
|
2011-08-20 14:30:23 +00:00
|
|
|
src =
|
|
|
|
if bleedingEdgeVersion
|
|
|
|
then fetchgit {
|
|
|
|
url = "git://sourceware.org/git/gdb.git";
|
|
|
|
rev = "refs/tags/gdb_7_3-2011-07-26-release";
|
|
|
|
}
|
|
|
|
else fetchurl {
|
|
|
|
url = "mirror://gnu/gdb/${basename}.tar.bz2";
|
|
|
|
# md5 is provided by the annoucement page
|
|
|
|
# http://www.gnu.org/s/gdb/download/ANNOUNCEMENT
|
2011-09-08 10:30:24 +00:00
|
|
|
md5 = "b89a5fac359c618dda97b88645ceab47";
|
2011-08-20 14:30:23 +00:00
|
|
|
};
|
2008-09-03 13:12:23 +00:00
|
|
|
|
2010-12-04 10:35:04 +00:00
|
|
|
# I think python is not a native input, but I leave it
|
|
|
|
# here while I will not need it cross building
|
2011-08-20 14:30:23 +00:00
|
|
|
buildNativeInputs = [ texinfo python ]
|
|
|
|
++ stdenv.lib.optionals bleedingEdgeVersion [ flex bison ];
|
|
|
|
|
2010-12-04 10:35:04 +00:00
|
|
|
buildInputs = [ ncurses readline gmp mpfr expat ]
|
2010-09-05 15:19:07 +00:00
|
|
|
++ stdenv.lib.optional doCheck dejagnu;
|
2008-09-03 13:12:23 +00:00
|
|
|
|
2011-08-21 15:36:33 +00:00
|
|
|
configureFlags = with stdenv.lib;
|
2009-10-28 22:25:50 +00:00
|
|
|
'' --with-gmp=${gmp} --with-mpfr=${mpfr} --with-system-readline
|
2011-08-27 15:29:04 +00:00
|
|
|
--with-expat --with-libexpat-prefix=${expat}
|
2011-08-21 15:36:33 +00:00
|
|
|
''
|
|
|
|
+ optionalString (target != null) " --target=${target.config}"
|
|
|
|
+ optionalString (elem stdenv.system platforms.cygwin) " --without-python"
|
|
|
|
;
|
2008-09-03 13:12:23 +00:00
|
|
|
|
2010-12-04 10:35:04 +00:00
|
|
|
crossAttrs = {
|
2011-06-14 02:39:03 +00:00
|
|
|
# Do not add --with-python here to avoid cross building it.
|
2010-12-04 10:35:04 +00:00
|
|
|
configureFlags =
|
|
|
|
'' --with-gmp=${gmp.hostDrv} --with-mpfr=${mpfr.hostDrv} --with-system-readline
|
2011-08-20 15:41:03 +00:00
|
|
|
--with-expat --with-libexpat-prefix=${expat.hostDrv} --without-python
|
2010-12-04 10:35:04 +00:00
|
|
|
'' + stdenv.lib.optionalString (target != null)
|
|
|
|
" --target=${target.config}";
|
|
|
|
};
|
|
|
|
|
2009-10-28 22:25:50 +00:00
|
|
|
postInstall =
|
|
|
|
'' # Remove Info files already provided by Binutils and other packages.
|
|
|
|
rm -v $out/share/info/{standards,configure,bfd}.info
|
|
|
|
'';
|
2009-10-12 10:06:41 +00:00
|
|
|
|
2010-09-05 15:19:07 +00:00
|
|
|
# TODO: Investigate & fix the test failures.
|
|
|
|
doCheck = false;
|
|
|
|
|
2011-08-20 14:30:23 +00:00
|
|
|
meta = with stdenv.lib; {
|
2008-09-03 13:12:23 +00:00
|
|
|
description = "GDB, the GNU Project debugger";
|
|
|
|
|
|
|
|
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/;
|
|
|
|
|
|
|
|
license = "GPLv3+";
|
2009-09-23 19:45:02 +00:00
|
|
|
|
2011-08-20 14:30:23 +00:00
|
|
|
platforms = with platforms; linux ++ cygwin;
|
|
|
|
maintainers = with maintainers; [ ludo pierron ];
|
2007-02-22 16:07:51 +00:00
|
|
|
};
|
|
|
|
}
|