1{
2 lib,
3 stdenv,
4 fetchurl,
5 imagemagick,
6 desktopToDarwinBundle,
7 motif,
8 ncurses,
9 libX11,
10 libXt,
11 gdb,
12}:
13
14stdenv.mkDerivation (finalAttrs: {
15 pname = "ddd";
16 version = "3.4.0";
17
18 src = fetchurl {
19 url = "mirror://gnu/ddd/ddd-${finalAttrs.version}.tar.gz";
20 hash = "sha256-XUy8iguwRYVDhm1nkwjFOj7wZuQC/loZGOGWmKPTWA8=";
21 };
22
23 postPatch = ''
24 substituteInPlace ddd/Ddd.in \
25 --replace-fail 'debuggerCommand:' 'debuggerCommand: ${gdb}/bin/gdb'
26 '';
27
28 nativeBuildInputs = [
29 imagemagick
30 ]
31 ++ lib.optionals stdenv.hostPlatform.isDarwin [ desktopToDarwinBundle ];
32
33 buildInputs = [
34 motif
35 ncurses
36 libX11
37 libXt
38 ];
39
40 # ioctl is not found without this flag. fixed in next release
41 # Upstream issue ref: https://savannah.gnu.org/bugs/index.php?64188
42 env = lib.optionalAttrs stdenv.hostPlatform.isDarwin { NIX_CFLAGS_COMPILE = "-DHAVE_SYS_IOCTL_H"; };
43
44 configureFlags = [
45 "--enable-builtin-manual"
46 "--enable-builtin-app-defaults"
47 ];
48
49 # From MacPorts: make will build the executable "ddd" and the X resource
50 # file "Ddd" in the same directory, as HFS+ is case-insensitive by default
51 # this will loosely FAIL
52 makeFlags = [ "EXEEXT=exe" ];
53 enableParallelBuilding = true;
54
55 postInstall = ''
56 mv $out/bin/dddexe $out/bin/ddd
57 convert icons/ddd.xbm ddd.png
58 install -D ddd.png $out/share/icons/hicolor/48x48/apps/ddd.png
59 '';
60
61 meta = {
62 changelog = "https://www.gnu.org/software/ddd/news.html";
63 description = "Graphical front-end for command-line debuggers";
64 homepage = "https://www.gnu.org/software/ddd";
65 license = lib.licenses.gpl3Only;
66 mainProgram = "ddd";
67 maintainers = with lib.maintainers; [ emilytrau ];
68 platforms = lib.platforms.unix;
69 };
70})