about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/tools/misc/edb/default.nix
blob: fdde4064698cea628c44301503d835e1c3084a47 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
{ lib, mkDerivation, fetchFromGitHub, cmake, pkg-config, boost, capstone
, double-conversion, graphviz, qtxmlpatterns }:

mkDerivation rec {
  pname = "edb";
  version = "1.4.0";

  src = fetchFromGitHub {
    owner = "eteran";
    repo = "edb-debugger";
    rev = version;
    fetchSubmodules = true;
    hash = "sha256-1Q0eZS05L4sxzcPvEFdEaobO7JYHRu98Yf+n3ZnBi+E=";
  };

  nativeBuildInputs = [ cmake pkg-config ];

  buildInputs = [ boost.dev capstone double-conversion graphviz qtxmlpatterns ];

  postPatch = ''
    # Remove CMAKE_INSTALL_PREFIX from DEFAULT_PLUGIN_PATH otherwise the nix store path will appear twice.
    substituteInPlace ./src/CMakeLists.txt --replace \
        '-DDEFAULT_PLUGIN_PATH=\"''${CMAKE_INSTALL_PREFIX}/''${CMAKE_INSTALL_LIBDIR}/edb\"' \
        '-DDEFAULT_PLUGIN_PATH=\"''${CMAKE_INSTALL_LIBDIR}/edb\"'

    # The build script checks for the presence of .git to determine whether
    # submodules were fetched and will throw an error if it's not there.
    # Avoid using leaveDotGit in the fetchFromGitHub options as it is non-deterministic.
    mkdir -p src/qhexview/.git lib/gdtoa-desktop/.git

    # Change default optional terminal program path to one that is more likely to work on NixOS.
    substituteInPlace ./src/Configuration.cpp --replace "/usr/bin/xterm" "xterm";
  '';

  meta = with lib; {
    description = "Cross platform AArch32/x86/x86-64 debugger";
    homepage = "https://github.com/eteran/edb-debugger";
    license = licenses.gpl2Plus;
    maintainers = with maintainers; [ lihop maxxk ];
    platforms = [ "x86_64-linux" ];
  };
}