nixpkgs/pkgs/by-name/ca/cargo-ui/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

64 lines
1.3 KiB
Nix

{ lib
, rustPlatform
, fetchCrate
, pkg-config
, libgit2
, openssl
, stdenv
, expat
, fontconfig
, libGL
, xorg
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-ui";
version = "0.3.3";
src = fetchCrate {
inherit pname version;
hash = "sha256-M/ljgtTHMSc7rY/a8CpKGNuOSdVDwRt6+tzPPHdpKOw=";
};
cargoHash = "sha256-u3YqXQZCfveSBjxdWb+GC0IA9bpruAYQdxX1zanT3fw=";
nativeBuildInputs = [
pkg-config
];
buildInputs = [
libgit2
openssl
] ++ lib.optionals stdenv.hostPlatform.isLinux [
expat
fontconfig
libGL
xorg.libX11
xorg.libXcursor
xorg.libXi
xorg.libXrandr
xorg.libxcb
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.AppKit
];
postFixup = lib.optionalString stdenv.hostPlatform.isLinux ''
patchelf $out/bin/cargo-ui \
--add-rpath ${lib.makeLibraryPath [ fontconfig libGL ]}
'';
env = {
LIBGIT2_NO_VENDOR = 1;
};
meta = with lib; {
description = "GUI for Cargo";
mainProgram = "cargo-ui";
homepage = "https://github.com/slint-ui/cargo-ui";
changelog = "https://github.com/slint-ui/cargo-ui/blob/v${version}/CHANGELOG.md";
license = with licenses; [ mit asl20 gpl3Only ];
maintainers = with maintainers; [ figsoda matthiasbeyer ];
};
}