From 104b1455d78543dc1563828d9b27e7597b26a4ab Mon Sep 17 00:00:00 2001 From: zeno Date: Tue, 3 Dec 2024 09:47:32 +0100 Subject: [PATCH 1/2] package: add desktop entry Co-authored-by: jchv --- package.nix | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/package.nix b/package.nix index 89de4a7..e6ff9b8 100644 --- a/package.nix +++ b/package.nix @@ -2,8 +2,11 @@ lib, stdenv, callPackage, + fetchurl, autoPatchelfHook, makeWrapper, + makeDesktopItem, + copyDesktopItems, unzip, libGL, glib, @@ -26,6 +29,10 @@ let platformSources.${stdenv.hostPlatform.system} else throw "No source for system ${stdenv.hostPlatform.system}"; + desktopItem = fetchurl { + url = "https://docs.binary.ninja/img/logo.png"; + hash = "sha256-TzGAAefTknnOBj70IHe64D6VwRKqIDpL4+o9kTw0Mn4="; + }; in stdenv.mkDerivation { pname = "binary-ninja"; @@ -36,6 +43,7 @@ stdenv.mkDerivation { autoPatchelfHook python3.pkgs.wrapPython kdePackages.wrapQtAppsHook + copyDesktopItems ]; buildInputs = [ unzip @@ -60,12 +68,26 @@ stdenv.mkDerivation { "wayland" ]; buildPhase = ":"; + + desktopItems = [ + (makeDesktopItem { + name = "Binary Ninja"; + exec = "binaryninja"; + icon = "binaryninja"; + desktopName = "Binary Ninja"; + comment = "Binary Ninja is an interactive decompiler, disassembler, debugger, and binary analysis platform built by reverse engineers, for reverse engineers"; + categories = [ "Development" ]; + }) + ]; + installPhase = '' runHook preInstall mkdir -p $out/bin mkdir -p $out/opt + mkdir -p $out/share/pixmaps cp -r * $out/opt + cp ${desktopItem} $out/share/pixmaps/binaryninja.png chmod +x $out/opt/binaryninja buildPythonPath "$pythonDeps" makeWrapper $out/opt/binaryninja $out/bin/binaryninja \ From e434b8d2c6fc36dfdbc02003457cda7452cc4f41 Mon Sep 17 00:00:00 2001 From: zeno Date: Tue, 3 Dec 2024 21:45:11 +0100 Subject: [PATCH 2/2] package: change icon var name --- package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.nix b/package.nix index e6ff9b8..6eb4b77 100644 --- a/package.nix +++ b/package.nix @@ -29,7 +29,7 @@ let platformSources.${stdenv.hostPlatform.system} else throw "No source for system ${stdenv.hostPlatform.system}"; - desktopItem = fetchurl { + desktopIcon = fetchurl { url = "https://docs.binary.ninja/img/logo.png"; hash = "sha256-TzGAAefTknnOBj70IHe64D6VwRKqIDpL4+o9kTw0Mn4="; }; @@ -87,7 +87,7 @@ stdenv.mkDerivation { mkdir -p $out/opt mkdir -p $out/share/pixmaps cp -r * $out/opt - cp ${desktopItem} $out/share/pixmaps/binaryninja.png + cp ${desktopIcon} $out/share/pixmaps/binaryninja.png chmod +x $out/opt/binaryninja buildPythonPath "$pythonDeps" makeWrapper $out/opt/binaryninja $out/bin/binaryninja \