2022-06-16 17:23:12 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, rustPlatform
|
|
|
|
, fetchFromGitHub
|
|
|
|
, makeWrapper
|
2022-08-12 12:06:08 +00:00
|
|
|
, AppKit
|
|
|
|
, CoreFoundation
|
|
|
|
, CoreGraphics
|
|
|
|
, CoreVideo
|
|
|
|
, Foundation
|
|
|
|
, Metal
|
|
|
|
, QuartzCore
|
2022-06-16 17:23:12 +00:00
|
|
|
, xorg
|
|
|
|
, vulkan-loader
|
|
|
|
}:
|
|
|
|
|
|
|
|
rustPlatform.buildRustPackage rec {
|
|
|
|
pname = "binocle";
|
2023-04-12 12:48:02 +00:00
|
|
|
version = "0.3.1";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "sharkdp";
|
|
|
|
repo = pname;
|
|
|
|
rev = "v${version}";
|
2023-04-12 12:48:02 +00:00
|
|
|
sha256 = "sha256-L4l8Gl7Ok/TWqHjNujPx8Qk3UWebs0SgOQNyBNtpnZo=";
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
|
2023-04-12 12:48:02 +00:00
|
|
|
cargoHash = "sha256-9d0MNQ7jEJKpGbjVtl1XBoOBEVNKDgFouSMrcZ7tXNU=";
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
makeWrapper
|
|
|
|
];
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
buildInputs = lib.optionals stdenv.isDarwin [
|
|
|
|
AppKit CoreFoundation CoreGraphics CoreVideo Foundation Metal QuartzCore
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstall = lib.optionalString (!stdenv.isDarwin) ''
|
2022-06-16 17:23:12 +00:00
|
|
|
wrapProgram $out/bin/binocle \
|
|
|
|
--suffix LD_LIBRARY_PATH : ${lib.makeLibraryPath (with xorg; [ libX11 libXcursor libXi libXrandr ] ++ [ vulkan-loader ])}
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Graphical tool to visualize binary data";
|
|
|
|
homepage = "https://github.com/sharkdp/binocle";
|
|
|
|
license = with licenses; [ asl20 /* or */ mit ];
|
2023-08-04 22:07:22 +00:00
|
|
|
maintainers = with maintainers; [ figsoda ];
|
2022-06-16 17:23:12 +00:00
|
|
|
};
|
|
|
|
}
|