Skip to content

Commit

Permalink
edb: 1.4.0 -> 1.5.0 (NixOS#366875)
Browse files Browse the repository at this point in the history
  • Loading branch information
GaetanLepage authored Dec 24, 2024
2 parents 8aca0d9 + a85be42 commit d3c4bf2
Showing 1 changed file with 29 additions and 17 deletions.
46 changes: 29 additions & 17 deletions pkgs/development/tools/misc/edb/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
lib,
mkDerivation,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
Expand All @@ -9,57 +9,69 @@
double-conversion,
graphviz,
qtxmlpatterns,
qttools,
qtbase,
wrapQtAppsHook,
testers,
nix-update-script,
}:

mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "edb";
version = "1.4.0";
version = "1.5.0";

src = fetchFromGitHub {
owner = "eteran";
repo = "edb-debugger";
rev = version;
tag = finalAttrs.version;
fetchSubmodules = true;
hash = "sha256-1Q0eZS05L4sxzcPvEFdEaobO7JYHRu98Yf+n3ZnBi+E=";
hash = "sha256-ALhA/odVwUQHKuOZ1W/i/6L7da/yitdpBsx2kz2ySQE=";
};

nativeBuildInputs = [
cmake
pkg-config
wrapQtAppsHook
qttools
];

buildInputs = [
qtbase
boost.dev
capstone_4
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\"'
cmakeFlags = [
(lib.cmakeFeature "DEFAULT_PLUGIN_DIR" "${placeholder "out"}/lib/edb")
];

postPatch = ''
# 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; {
passthru = {
tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
command = "env QT_QPA_PLATFORM=minimal ${lib.getExe finalAttrs.finalPackage} --version";
};
updateScript = nix-update-script { };
};

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

0 comments on commit d3c4bf2

Please sign in to comment.