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