2015-11-26 13:00:36 +01:00
|
|
|
{ fetchurl, stdenv, ncurses, readline, gmp, mpfr, expat, texinfo, zlib
|
|
|
|
, dejagnu, perl, pkgconfig
|
2017-05-22 22:36:59 +02:00
|
|
|
|
|
|
|
, buildPlatform, hostPlatform, targetPlatform
|
|
|
|
|
|
|
|
, pythonSupport ? hostPlatform == buildPlatform && !hostPlatform.isCygwin, python ? null
|
2015-11-26 13:00:36 +01:00
|
|
|
, guile ? null
|
2017-05-22 22:36:59 +02:00
|
|
|
|
2016-02-18 06:21:04 +01:00
|
|
|
# Support all known targets in one gdb binary.
|
|
|
|
, multitarget ? false
|
2017-05-22 22:36:59 +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
|
2017-05-22 22:36:59 +02:00
|
|
|
basename = "gdb-${version}";
|
2017-06-06 09:14:56 +02:00
|
|
|
version = "8.0";
|
2009-12-02 21:54:40 +01:00
|
|
|
in
|
2011-08-20 16:30:23 +02:00
|
|
|
|
2017-05-22 22:36:59 +02:00
|
|
|
assert targetPlatform.isHurd -> mig != null && hurd != null;
|
|
|
|
assert pythonSupport -> python != null;
|
2011-11-19 19:28:10 +01:00
|
|
|
|
2007-11-16 18:30:34 +01:00
|
|
|
stdenv.mkDerivation rec {
|
2017-05-22 22:36:59 +02:00
|
|
|
name =
|
|
|
|
stdenv.lib.optionalString (targetPlatform != hostPlatform)
|
|
|
|
(targetPlatform.config + "-")
|
|
|
|
+ basename;
|
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";
|
2017-06-06 09:14:56 +02:00
|
|
|
sha256 = "1vplyf8v70yn0rdqjx6awl9nmfbwaj5ynwwjxwa71rhp97z4z8pn";
|
2012-06-21 15:28:17 +02:00
|
|
|
};
|
2008-09-03 15:12:23 +02:00
|
|
|
|
2015-11-26 13:00:36 +01:00
|
|
|
nativeBuildInputs = [ pkgconfig texinfo perl ]
|
2017-05-22 22:36:59 +02:00
|
|
|
# TODO(@Ericson2314) not sure if should be host or target
|
|
|
|
++ stdenv.lib.optional targetPlatform.isHurd mig;
|
2011-08-20 16:30:23 +02:00
|
|
|
|
2017-05-22 22:36:59 +02:00
|
|
|
buildInputs = [ ncurses readline gmp mpfr expat zlib guile ]
|
|
|
|
++ stdenv.lib.optional pythonSupport python
|
|
|
|
++ stdenv.lib.optional targetPlatform.isHurd 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;
|
|
|
|
|
2016-10-12 23:18:23 +02:00
|
|
|
# darwin build fails with format hardening since v7.12
|
|
|
|
hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
|
|
|
|
|
2017-06-11 11:34:17 +02:00
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
|
|
|
|
|
2017-05-22 22:36:59 +02:00
|
|
|
configureFlags = with stdenv.lib; [
|
|
|
|
"--with-gmp=${gmp.dev}" "--with-mpfr=${mpfr.dev}" "--with-system-readline"
|
|
|
|
"--with-system-zlib" "--with-expat" "--with-libexpat-prefix=${expat.dev}"
|
|
|
|
] ++ stdenv.lib.optional hostPlatform.isLinux
|
|
|
|
# TODO(@Ericson2314): make this conditional on whether host platform is NixOS
|
2015-11-26 13:00:36 +01:00
|
|
|
"--with-separate-debug-dir=/run/current-system/sw/lib/debug"
|
2017-05-22 22:36:59 +02:00
|
|
|
++ stdenv.lib.optional (!pythonSupport) "--without-python"
|
|
|
|
# TODO(@Ericson2314): This should be done in stdenv, not per-package
|
2017-05-23 07:13:06 +02:00
|
|
|
++ stdenv.lib.optional (targetPlatform != hostPlatform) "--target=${targetPlatform.config}"
|
2017-05-22 22:36:59 +02:00
|
|
|
++ stdenv.lib.optional multitarget "--enable-targets=all";
|
2010-12-04 11:35:04 +01:00
|
|
|
|
2009-10-28 23:25:50 +01:00
|
|
|
postInstall =
|
|
|
|
'' # Remove Info files already provided by Binutils and other packages.
|
2015-04-14 17:25:34 +02:00
|
|
|
rm -v $out/share/info/bfd.info
|
2009-10-28 23:25:50 +01:00
|
|
|
'';
|
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
|
|
|
};
|
|
|
|
}
|