lol
1{ lib
2, rustPlatform
3, fetchCrate
4, cmake
5, installShellFiles
6, pkg-config
7, ronn
8, stdenv
9, curl
10, libgit2_1_5
11, libssh2
12, openssl
13, zlib
14, darwin
15}:
16
17rustPlatform.buildRustPackage rec {
18 pname = "cargo-update";
19 version = "13.2.0";
20
21 src = fetchCrate {
22 inherit pname version;
23 sha256 = "sha256-yMHGn/RPtYuxS3rHzm87mW7nBUEaSOGsCT7Ckxvhabk=";
24 };
25
26 cargoHash = "sha256-hO2W0NRV9fGHnnS1kOkQ+e0sFzVSBQk3MOm8qDYbA00=";
27
28 nativeBuildInputs = [
29 cmake
30 installShellFiles
31 pkg-config
32 ronn
33 ] ++ lib.optionals stdenv.isDarwin [
34 curl
35 ];
36
37 buildInputs = [
38 libgit2_1_5
39 libssh2
40 openssl
41 zlib
42 ] ++ lib.optionals stdenv.isDarwin [
43 curl
44 darwin.apple_sdk.frameworks.Security
45 ];
46
47 postBuild = ''
48 # Man pages contain non-ASCII, so explicitly set encoding to UTF-8.
49 HOME=$TMPDIR \
50 RUBYOPT="-E utf-8:utf-8" \
51 ronn -r --organization="cargo-update developers" man/*.md
52 '';
53
54 postInstall = ''
55 installManPage man/*.1
56 '';
57
58 meta = with lib; {
59 description = "A cargo subcommand for checking and applying updates to installed executables";
60 homepage = "https://github.com/nabijaczleweli/cargo-update";
61 changelog = "https://github.com/nabijaczleweli/cargo-update/releases/tag/v${version}";
62 license = licenses.mit;
63 maintainers = with maintainers; [ gerschtli Br1ght0ne johntitor matthiasbeyer ];
64 };
65}