nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 rustPlatform,
4 fetchCrate,
5 pkg-config,
6 libgit2,
7 openssl,
8 stdenv,
9 expat,
10 fontconfig,
11 libGL,
12 libxrandr,
13 libxi,
14 libxcursor,
15 libx11,
16 libxcb,
17}:
18
19rustPlatform.buildRustPackage rec {
20 pname = "cargo-ui";
21 version = "0.3.3";
22
23 src = fetchCrate {
24 inherit pname version;
25 hash = "sha256-M/ljgtTHMSc7rY/a8CpKGNuOSdVDwRt6+tzPPHdpKOw=";
26 };
27
28 cargoHash = "sha256-odcyKOveYCWQ35uh//s19Jtq7OqiUnkeqbh90VWHp9A=";
29
30 nativeBuildInputs = [
31 pkg-config
32 ];
33
34 buildInputs = [
35 libgit2
36 openssl
37 ]
38 ++ lib.optionals stdenv.hostPlatform.isLinux [
39 expat
40 fontconfig
41 libGL
42 libx11
43 libxcursor
44 libxi
45 libxrandr
46 libxcb
47 ];
48
49 postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
50 patchelf $out/bin/cargo-ui \
51 --add-rpath ${
52 lib.makeLibraryPath [
53 fontconfig
54 libGL
55 ]
56 }
57 '';
58
59 env = {
60 LIBGIT2_NO_VENDOR = 1;
61 };
62
63 meta = {
64 description = "GUI for Cargo";
65 mainProgram = "cargo-ui";
66 homepage = "https://github.com/slint-ui/cargo-ui";
67 changelog = "https://github.com/slint-ui/cargo-ui/blob/v${version}/CHANGELOG.md";
68 license = with lib.licenses; [
69 mit
70 asl20
71 gpl3Only
72 ];
73 maintainers = with lib.maintainers; [
74 matthiasbeyer
75 ];
76 };
77}