nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 apple-sdk_15,
4 rustPlatform,
5 fetchFromGitHub,
6 pkg-config,
7 makeBinaryWrapper,
8 copyDesktopItems,
9 makeDesktopItem,
10 imagemagick,
11 atk,
12 cairo,
13 gdk-pixbuf,
14 glib,
15 gtk3,
16 libxkbcommon,
17 pango,
18 vulkan-loader,
19 stdenv,
20 wayland,
21}:
22rustPlatform.buildRustPackage rec {
23 pname = "bite";
24 version = "0.3";
25
26 src = fetchFromGitHub {
27 owner = "WINSDK";
28 repo = "bite";
29 rev = "V${version}";
30 hash = "sha256-gio4J+V8achSuR2vQa2dnvOR/u4Zbb5z0UE0xP0gGCU=";
31 };
32
33 cargoHash = "sha256-ESGX1hnDnU2taKQXre4AQRzQxTC7W+0cEIoQPPC9Lfs=";
34
35 nativeBuildInputs = [
36 pkg-config
37 makeBinaryWrapper
38 copyDesktopItems
39 imagemagick
40 ];
41
42 buildInputs = [
43 atk
44 cairo
45 gdk-pixbuf
46 glib
47 gtk3
48 libxkbcommon
49 pango
50 vulkan-loader
51 ]
52 ++ lib.optionals stdenv.hostPlatform.isLinux [
53 wayland
54 ]
55 ++ lib.optionals stdenv.hostPlatform.isDarwin [
56 apple-sdk_15
57 ];
58
59 runtimeDependencies = [
60 libxkbcommon
61 vulkan-loader
62 ]
63 ++ lib.optionals stdenv.hostPlatform.isLinux [
64 wayland
65 ];
66
67 postInstall = ''
68 wrapProgram $out/bin/bite \
69 --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDependencies}"
70
71 mkdir -p $out/share/icons/hicolor/64x64/apps
72 convert $src/assets/iconx64.png -background black -alpha remove -alpha off $out/share/icons/hicolor/64x64/apps/bite.png
73 '';
74
75 desktopItems = [
76 (makeDesktopItem {
77 name = "BiTE";
78 exec = meta.mainProgram;
79 icon = "bite";
80 desktopName = "BiTE";
81 comment = meta.description;
82 categories = [
83 "Development"
84 "Utility"
85 ];
86 })
87 ];
88
89 meta = {
90 description = "Disassembler focused on comprehensive rust support";
91 homepage = "https://github.com/WINSDK/bite";
92 license = lib.licenses.mit;
93 maintainers = with lib.maintainers; [ vinnymeller ];
94 mainProgram = "bite";
95 };
96}