From a557733000d173ec4160a2ba2f0e074282951308 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:26:28 +0300 Subject: [PATCH 1/3] edb: 1.4.0 -> 1.5.0 Drop fixes that are now in upstream: - https://github.com/eteran/edb-debugger/commit/53a7bfb4e93e3866e50f42d817b04765e21853c9 - https://github.com/eteran/edb-debugger/pull/844 --- pkgs/development/tools/misc/edb/default.nix | 30 +++++++++++---------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/pkgs/development/tools/misc/edb/default.nix b/pkgs/development/tools/misc/edb/default.nix index f5103f9d0c2c6..e7e7de50e4278 100644 --- a/pkgs/development/tools/misc/edb/default.nix +++ b/pkgs/development/tools/misc/edb/default.nix @@ -1,6 +1,6 @@ { lib, - mkDerivation, + stdenv, fetchFromGitHub, cmake, pkg-config, @@ -9,26 +9,32 @@ double-conversion, graphviz, qtxmlpatterns, + qttools, + qtbase, + wrapQtAppsHook, }: -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 @@ -36,19 +42,15 @@ mkDerivation rec { 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; { @@ -62,4 +64,4 @@ mkDerivation rec { ]; platforms = [ "x86_64-linux" ]; }; -} +}) From 35daaa722171d66b72d1946ef9506cf45cc38670 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Fri, 20 Dec 2024 19:55:54 +0300 Subject: [PATCH 2/3] edb: remove usage of with lib; --- pkgs/development/tools/misc/edb/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/misc/edb/default.nix b/pkgs/development/tools/misc/edb/default.nix index e7e7de50e4278..1bdea24604dd1 100644 --- a/pkgs/development/tools/misc/edb/default.nix +++ b/pkgs/development/tools/misc/edb/default.nix @@ -53,12 +53,12 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p src/qhexview/.git lib/gdtoa-desktop/.git ''; - meta = with lib; { + 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 ]; From a85be42abaa384f36a306d6757ed8b067f821450 Mon Sep 17 00:00:00 2001 From: Sergei Zimmerman <145775305+xokdvium@users.noreply.github.com> Date: Fri, 20 Dec 2024 20:24:28 +0300 Subject: [PATCH 3/3] edb: add passthru.tests.version, use nix-update-script --- pkgs/development/tools/misc/edb/default.nix | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkgs/development/tools/misc/edb/default.nix b/pkgs/development/tools/misc/edb/default.nix index 1bdea24604dd1..786209cb74f4e 100644 --- a/pkgs/development/tools/misc/edb/default.nix +++ b/pkgs/development/tools/misc/edb/default.nix @@ -12,6 +12,8 @@ qttools, qtbase, wrapQtAppsHook, + testers, + nix-update-script, }: stdenv.mkDerivation (finalAttrs: { @@ -53,6 +55,14 @@ stdenv.mkDerivation (finalAttrs: { mkdir -p src/qhexview/.git lib/gdtoa-desktop/.git ''; + 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";