1{ lib
2, rustPlatform
3, fetchFromGitHub
4, pkg-config
5, stdenv
6, darwin
7, libxkbcommon
8, wayland
9}:
10
11rustPlatform.buildRustPackage {
12 pname = "cargo-bundle";
13 # the latest stable release fails to build on darwin
14 version = "unstable-2023-03-17";
15
16 src = fetchFromGitHub {
17 owner = "burtonageo";
18 repo = "cargo-bundle";
19 rev = "eb9fe1b0880c7c0e929a93edaddcb0a61cd3f0d4";
20 hash = "sha256-alO+Q9IK5Hz09+TqHWsbjuokxISKQfQTM6QnLlUNydw=";
21 };
22
23 cargoHash = "sha256-h+QPbwYTJk6dieta/Q+VAhYe8/YH/Nik6gslzUn0YxI=";
24
25 nativeBuildInputs = [
26 pkg-config
27 ];
28
29 buildInputs = lib.optionals stdenv.isDarwin [
30 darwin.apple_sdk.frameworks.AppKit
31 ] ++ lib.optionals stdenv.isLinux [
32 libxkbcommon
33 wayland
34 ];
35
36 meta = with lib; {
37 description = "Wrap rust executables in OS-specific app bundles";
38 homepage = "https://github.com/burtonageo/cargo-bundle";
39 license = with licenses; [ asl20 mit ];
40 maintainers = with maintainers; [ figsoda ];
41 };
42}