2017-10-17 13:44:24 -07:00
|
|
|
{ stdenv
|
|
|
|
|
|
|
|
# Build time
|
2018-12-11 16:30:00 -08:00
|
|
|
, fetchurl, fetchpatch, pkgconfig, perl, texinfo, setupDebugInfoDirs, buildPackages
|
2017-10-17 13:44:24 -07:00
|
|
|
|
|
|
|
# Run time
|
|
|
|
, ncurses, readline, gmp, mpfr, expat, zlib, dejagnu
|
2017-05-22 13:36:59 -07:00
|
|
|
|
2018-12-01 01:00:51 -08:00
|
|
|
, pythonSupport ? stdenv.hostPlatform == stdenv.buildPlatform && !stdenv.hostPlatform.isCygwin, python3 ? null
|
2015-11-26 04:00:36 -08:00
|
|
|
, guile ? null
|
2017-05-22 13:36:59 -07:00
|
|
|
|
2012-06-21 06:28:17 -07:00
|
|
|
}:
|
2007-02-22 08:07:51 -08:00
|
|
|
|
2009-12-02 12:54:40 -08:00
|
|
|
let
|
2017-05-22 13:36:59 -07:00
|
|
|
basename = "gdb-${version}";
|
2019-05-15 08:06:32 -07:00
|
|
|
version = "8.3";
|
2009-12-02 12:54:40 -08:00
|
|
|
in
|
2011-08-20 07:30:23 -07:00
|
|
|
|
2018-12-01 01:00:51 -08:00
|
|
|
assert pythonSupport -> python3 != null;
|
2011-11-19 10:28:10 -08:00
|
|
|
|
2007-11-16 09:30:34 -08:00
|
|
|
stdenv.mkDerivation rec {
|
2017-05-22 13:36:59 -07:00
|
|
|
name =
|
2018-08-20 11:43:41 -07:00
|
|
|
stdenv.lib.optionalString (stdenv.targetPlatform != stdenv.hostPlatform)
|
|
|
|
(stdenv.targetPlatform.config + "-")
|
2017-05-22 13:36:59 -07:00
|
|
|
+ basename;
|
2008-09-03 06:12:23 -07:00
|
|
|
|
2012-06-21 06:28:17 -07:00
|
|
|
src = fetchurl {
|
2014-08-19 11:36:25 -07:00
|
|
|
url = "mirror://gnu/gdb/${basename}.tar.xz";
|
2019-05-15 08:06:32 -07:00
|
|
|
sha256 = "0bnpzz0rl672xg5547q5qck2sxi6cnyixmk8bbb4gifw17ipwbw0";
|
2012-06-21 06:28:17 -07:00
|
|
|
};
|
2008-09-03 06:12:23 -07:00
|
|
|
|
2019-06-09 20:56:08 -07:00
|
|
|
postPatch = if stdenv.isDarwin then ''
|
|
|
|
substituteInPlace gdb/darwin-nat.c \
|
|
|
|
--replace '#include "bfd/mach-o.h"' '#include "mach-o.h"'
|
|
|
|
'' else null;
|
|
|
|
|
2018-11-15 23:31:05 -08:00
|
|
|
patches = [
|
|
|
|
./debug-info-from-env.patch
|
|
|
|
] ++ stdenv.lib.optionals stdenv.isDarwin [
|
|
|
|
./darwin-target-match.patch
|
|
|
|
];
|
2017-07-28 04:51:27 -07:00
|
|
|
|
2018-08-28 14:17:54 -07:00
|
|
|
nativeBuildInputs = [ pkgconfig texinfo perl setupDebugInfoDirs ];
|
2011-08-20 07:30:23 -07:00
|
|
|
|
2017-05-22 13:36:59 -07:00
|
|
|
buildInputs = [ ncurses readline gmp mpfr expat zlib guile ]
|
2018-12-01 01:00:51 -08:00
|
|
|
++ stdenv.lib.optional pythonSupport python3
|
2010-09-05 08:19:07 -07:00
|
|
|
++ stdenv.lib.optional doCheck dejagnu;
|
2008-09-03 06:12:23 -07:00
|
|
|
|
2017-07-28 05:22:48 -07:00
|
|
|
propagatedNativeBuildInputs = [ setupDebugInfoDirs ];
|
|
|
|
|
2018-12-11 16:30:00 -08:00
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
|
2012-06-21 06:28:17 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2016-10-12 14:18:23 -07:00
|
|
|
# darwin build fails with format hardening since v7.12
|
|
|
|
hardeningDisable = stdenv.lib.optionals stdenv.isDarwin [ "format" ];
|
|
|
|
|
2017-06-11 02:34:17 -07:00
|
|
|
NIX_CFLAGS_COMPILE = "-Wno-format-nonliteral";
|
|
|
|
|
2017-06-23 14:45:27 -07:00
|
|
|
# TODO(@Ericson2314): Always pass "--target" and always prefix.
|
2018-08-20 11:43:41 -07:00
|
|
|
configurePlatforms = [ "build" "host" ] ++ stdenv.lib.optional (stdenv.targetPlatform != stdenv.hostPlatform) "target";
|
2017-06-23 14:45:27 -07:00
|
|
|
|
2017-05-22 13:36:59 -07:00
|
|
|
configureFlags = with stdenv.lib; [
|
2017-10-17 13:44:24 -07:00
|
|
|
"--enable-targets=all" "--enable-64-bit-bfd"
|
|
|
|
"--disable-install-libbfd"
|
|
|
|
"--disable-shared" "--enable-static"
|
|
|
|
"--with-system-zlib"
|
|
|
|
"--with-system-readline"
|
|
|
|
|
|
|
|
"--with-gmp=${gmp.dev}"
|
|
|
|
"--with-mpfr=${mpfr.dev}"
|
|
|
|
"--with-expat" "--with-libexpat-prefix=${expat.dev}"
|
|
|
|
] ++ stdenv.lib.optional (!pythonSupport) "--without-python";
|
2010-12-04 02:35:04 -08:00
|
|
|
|
2009-10-28 15:25:50 -07:00
|
|
|
postInstall =
|
|
|
|
'' # Remove Info files already provided by Binutils and other packages.
|
2015-04-14 08:25:34 -07:00
|
|
|
rm -v $out/share/info/bfd.info
|
2009-10-28 15:25:50 -07:00
|
|
|
'';
|
2009-10-12 03:06:41 -07:00
|
|
|
|
2010-09-05 08:19:07 -07:00
|
|
|
# TODO: Investigate & fix the test failures.
|
|
|
|
doCheck = false;
|
|
|
|
|
2011-08-20 07:30:23 -07:00
|
|
|
meta = with stdenv.lib; {
|
2014-08-24 07:21:08 -07:00
|
|
|
description = "The GNU Project debugger";
|
2008-09-03 06:12:23 -07: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.
|
|
|
|
'';
|
|
|
|
|
2018-12-01 10:22:13 -08:00
|
|
|
homepage = https://www.gnu.org/software/gdb/;
|
2008-09-03 06:12:23 -07:00
|
|
|
|
2014-06-18 21:19:00 -07:00
|
|
|
license = stdenv.lib.licenses.gpl3Plus;
|
2009-09-23 12:45:02 -07:00
|
|
|
|
2014-01-15 06:33:31 -08:00
|
|
|
platforms = with platforms; linux ++ cygwin ++ darwin;
|
2013-08-16 14:44:33 -07:00
|
|
|
maintainers = with maintainers; [ pierron ];
|
2007-02-22 08:07:51 -08:00
|
|
|
};
|
|
|
|
}
|