depot/third_party/nixpkgs/pkgs/development/tools/rust/cargo-update/default.nix
Default email 472aeafc57 Project import generated by Copybara.
GitOrigin-RevId: c31898adf5a8ed202ce5bea9f347b1c6871f32d1
2024-10-04 18:56:33 +02:00

69 lines
1.4 KiB
Nix

{ lib
, rustPlatform
, fetchCrate
, cmake
, installShellFiles
, pkg-config
, ronn
, stdenv
, curl
, libgit2
, libssh2
, openssl
, zlib
, darwin
}:
rustPlatform.buildRustPackage rec {
pname = "cargo-update";
version = "15.0.0";
src = fetchCrate {
inherit pname version;
hash = "sha256-2Z/fRd80qZi61KO07gx3Jdnslxv1KUCubv9bIUmjGKU=";
};
cargoHash = "sha256-v5rsFzox1x2pf/LilZy/YI985sL5Pigm2GGaCWWjB7s=";
nativeBuildInputs = [
cmake
installShellFiles
pkg-config
ronn
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
curl
];
buildInputs = [
libgit2
libssh2
openssl
zlib
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
curl
darwin.apple_sdk.frameworks.Security
];
postBuild = ''
# Man pages contain non-ASCII, so explicitly set encoding to UTF-8.
HOME=$TMPDIR \
RUBYOPT="-E utf-8:utf-8" \
ronn -r --organization="cargo-update developers" man/*.md
'';
postInstall = ''
installManPage man/*.1
'';
env = {
LIBGIT2_NO_VENDOR = 1;
};
meta = with lib; {
description = "Cargo subcommand for checking and applying updates to installed executables";
homepage = "https://github.com/nabijaczleweli/cargo-update";
changelog = "https://github.com/nabijaczleweli/cargo-update/releases/tag/v${version}";
license = licenses.mit;
maintainers = with maintainers; [ gerschtli Br1ght0ne johntitor matthiasbeyer ];
};
}