nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchFromGitHub,
5 pkg-config,
6 stdenv,
7 libxkbcommon,
8 wayland,
9 openssl,
10 squashfsTools,
11 makeWrapper,
12 versionCheckHook,
13 nix-update-script,
14}:
15
16rustPlatform.buildRustPackage (finalAttrs: {
17 pname = "cargo-bundle";
18 version = "0.9.0";
19
20 src = fetchFromGitHub {
21 owner = "burtonageo";
22 repo = "cargo-bundle";
23 tag = "v${finalAttrs.version}";
24 hash = "sha256-8Ulah5NtjQh5dIB/nhTrDstnaub4LS9iH33E1iv1JpY=";
25 };
26
27 cargoHash = "sha256-qE0ZDq0UJHfsivvI1W44u/pVjKMDGrghSl7sfau/pIY=";
28
29 nativeBuildInputs = [
30 pkg-config
31 makeWrapper
32 ];
33
34 buildInputs = lib.optionals stdenv.hostPlatform.isLinux [
35 libxkbcommon
36 wayland
37 openssl
38 ];
39
40 postFixup = ''
41 wrapProgram $out/bin/cargo-bundle \
42 --prefix PATH : ${lib.makeBinPath [ squashfsTools ]}
43 '';
44
45 doInstallCheck = true;
46 nativeInstallCheckInputs = [ versionCheckHook ];
47 versionCheckProgramArg = "--version";
48
49 passthru.updateScript = nix-update-script { };
50
51 meta = {
52 description = "Wrap rust executables in OS-specific app bundles";
53 mainProgram = "cargo-bundle";
54 homepage = "https://github.com/burtonageo/cargo-bundle";
55 license = with lib.licenses; [
56 asl20
57 mit
58 ];
59 maintainers = [ lib.maintainers.progrm_jarvis ];
60 };
61})