nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, rustPlatform
4, fetchFromGitHub
5, makeWrapper
6, AppKit
7, CoreFoundation
8, CoreGraphics
9, CoreVideo
10, Foundation
11, Metal
12, QuartzCore
13, xorg
14, vulkan-loader
15}:
16
17rustPlatform.buildRustPackage rec {
18 pname = "binocle";
19 version = "0.3.1";
20
21 src = fetchFromGitHub {
22 owner = "sharkdp";
23 repo = pname;
24 rev = "v${version}";
25 sha256 = "sha256-L4l8Gl7Ok/TWqHjNujPx8Qk3UWebs0SgOQNyBNtpnZo=";
26 };
27
28 cargoHash = "sha256-9d0MNQ7jEJKpGbjVtl1XBoOBEVNKDgFouSMrcZ7tXNU=";
29
30 nativeBuildInputs = [
31 makeWrapper
32 ];
33
34 buildInputs = lib.optionals stdenv.isDarwin [
35 AppKit CoreFoundation CoreGraphics CoreVideo Foundation Metal QuartzCore
36 ];
37
38 postInstall = lib.optionalString (!stdenv.isDarwin) ''
39 wrapProgram $out/bin/binocle \
40 --suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with xorg; [ libX11 libXcursor libXi libXrandr ] ++ [ vulkan-loader ])}
41 '';
42
43 meta = with lib; {
44 description = "Graphical tool to visualize binary data";
45 homepage = "https://github.com/sharkdp/binocle";
46 license = with licenses; [ asl20 /* or */ mit ];
47 maintainers = with maintainers; [ SuperSandro2000 ];
48 };
49}