Skip to content

Commit 5c41ff7

Browse files
authored
Merge pull request #3 from TheOnAndOnlyZenomat/desktopentry
package: add desktop entry
2 parents 9a0b732 + e434b8d commit 5c41ff7

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

package.nix

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
lib,
33
stdenv,
44
callPackage,
5+
fetchurl,
56
autoPatchelfHook,
67
makeWrapper,
8+
makeDesktopItem,
9+
copyDesktopItems,
710
unzip,
811
libGL,
912
glib,
@@ -26,6 +29,10 @@ let
2629
platformSources.${stdenv.hostPlatform.system}
2730
else
2831
throw "No source for system ${stdenv.hostPlatform.system}";
32+
desktopIcon = fetchurl {
33+
url = "https://docs.binary.ninja/img/logo.png";
34+
hash = "sha256-TzGAAefTknnOBj70IHe64D6VwRKqIDpL4+o9kTw0Mn4=";
35+
};
2936
in
3037
stdenv.mkDerivation {
3138
pname = "binary-ninja";
@@ -36,6 +43,7 @@ stdenv.mkDerivation {
3643
autoPatchelfHook
3744
python3.pkgs.wrapPython
3845
kdePackages.wrapQtAppsHook
46+
copyDesktopItems
3947
];
4048
buildInputs = [
4149
unzip
@@ -60,12 +68,26 @@ stdenv.mkDerivation {
6068
"wayland"
6169
];
6270
buildPhase = ":";
71+
72+
desktopItems = [
73+
(makeDesktopItem {
74+
name = "Binary Ninja";
75+
exec = "binaryninja";
76+
icon = "binaryninja";
77+
desktopName = "Binary Ninja";
78+
comment = "Binary Ninja is an interactive decompiler, disassembler, debugger, and binary analysis platform built by reverse engineers, for reverse engineers";
79+
categories = [ "Development" ];
80+
})
81+
];
82+
6383
installPhase = ''
6484
runHook preInstall
6585
6686
mkdir -p $out/bin
6787
mkdir -p $out/opt
88+
mkdir -p $out/share/pixmaps
6889
cp -r * $out/opt
90+
cp ${desktopIcon} $out/share/pixmaps/binaryninja.png
6991
chmod +x $out/opt/binaryninja
7092
buildPythonPath "$pythonDeps"
7193
makeWrapper $out/opt/binaryninja $out/bin/binaryninja \

0 commit comments

Comments
 (0)