Merge pull request #329823 from ExpidusOS/fix/pkgsllvm/elfutils
[NixPkgs.git] / pkgs / by-name / bi / bite / package.nix
blobde072e33d470223dae1d1a2417a0117b5a15ef88
2   lib,
3   rustPlatform,
4   fetchFromGitHub,
5   pkg-config,
6   makeBinaryWrapper,
7   copyDesktopItems,
8   makeDesktopItem,
9   imagemagick,
10   atk,
11   cairo,
12   gdk-pixbuf,
13   glib,
14   gtk3,
15   libxkbcommon,
16   pango,
17   vulkan-loader,
18   stdenv,
19   darwin,
20   wayland,
22 rustPlatform.buildRustPackage rec {
23   pname = "bite";
24   version = "0.2.1";
26   src = fetchFromGitHub {
27     owner = "WINSDK";
28     repo = "bite";
29     rev = "V${version}";
30     hash = "sha256-A5NII5pLnM4BBy2L+ylXU0anqw4DpKgXmc29fcTq2z8=";
31   };
33   cargoLock = {
34     lockFile = ./Cargo.lock;
35     outputHashes = {
36       "libc-0.2.140" = "sha256-5cP25BDfkrybiZjmwmzeqd0nzdItFdNSZ4te7FdLpnk=";
37       "nix-0.26.1" = "sha256-AsOX8sLGHJNJhq0P9WDxWsNiRXgZJl15paTcGdPMQXA=";
38       "pdb-0.8.0" = "sha256-CEglHzBpS3rN7+05tS09FbBcOM0jjyvR+DWrEbvRYwE=";
39       "tree-sitter-c-0.21.0" = "sha256-7L3Ua6LBeX2492RTikKYeCNIG5e5XSrCu4UyXX1eQiI=";
40       "tree-sitter-cpp-0.21.0" = "sha256-WZy3S8+bRkpzUFpnLVp18rY5DxN70fdEPYIYx0UqJhs=";
41       "tree-sitter-rust-0.21.0" = "sha256-kZT4Hil7u4GFWImuQCt9nQJ+HL3B5yHD5wjalpDLlSE=";
42     };
43   };
45   nativeBuildInputs = [
46     pkg-config
47     makeBinaryWrapper
48     copyDesktopItems
49     imagemagick
50   ];
52   buildInputs =
53     [
54       atk
55       cairo
56       gdk-pixbuf
57       glib
58       gtk3
59       libxkbcommon
60       pango
61       vulkan-loader
62     ]
63     ++ lib.optionals stdenv.isDarwin [
64       darwin.apple_sdk.frameworks.AppKit
65       darwin.apple_sdk.frameworks.CoreGraphics
66       darwin.apple_sdk.frameworks.Foundation
67       darwin.apple_sdk.frameworks.Metal
68       darwin.apple_sdk.frameworks.QuartzCore
69     ]
70     ++ lib.optionals stdenv.isLinux [
71       wayland
72     ];
74   runtimeDependencies =
75     [
76       libxkbcommon
77       vulkan-loader
78     ]
79     ++ lib.optionals stdenv.isLinux [
80       wayland
81     ];
83   postInstall = ''
84     wrapProgram $out/bin/bite \
85       --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath runtimeDependencies}"
87     mkdir -p $out/share/icons/hicolor/64x64/apps
88     convert $src/assets/iconx64.png -background black -alpha remove -alpha off $out/share/icons/hicolor/64x64/apps/bite.png
89   '';
91   desktopItems = [
92     (makeDesktopItem {
93       name = "BiTE";
94       exec = meta.mainProgram;
95       icon = "bite";
96       desktopName = "BiTE";
97       comment = meta.description;
98       categories = ["Development" "Utility"];
99     })
100   ];
102   meta = with lib; {
103     description = "Disassembler focused on comprehensive rust support";
104     homepage = "https://github.com/WINSDK/bite";
105     license = licenses.mit;
106     maintainers = with maintainers; [vinnymeller];
107     mainProgram = "bite";
108     broken = stdenv.isDarwin && stdenv.isx86_64;
109   };