about summary refs log tree commit diff
path: root/pkgs/development/tools/rust/cargo-update/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/tools/rust/cargo-update/default.nix')
-rw-r--r--pkgs/development/tools/rust/cargo-update/default.nix49
1 files changed, 49 insertions, 0 deletions
diff --git a/pkgs/development/tools/rust/cargo-update/default.nix b/pkgs/development/tools/rust/cargo-update/default.nix
new file mode 100644
index 0000000000000..383eeac432d9a
--- /dev/null
+++ b/pkgs/development/tools/rust/cargo-update/default.nix
@@ -0,0 +1,49 @@
+{ lib, stdenv
+, rustPlatform
+, fetchCrate
+, cmake
+, pkg-config
+, installShellFiles
+, ronn
+, curl
+, libgit2
+, libssh2
+, openssl
+, Security
+, zlib
+}:
+
+rustPlatform.buildRustPackage rec {
+  pname = "cargo-update";
+  version = "8.1.4";
+
+  src = fetchCrate {
+    inherit pname version;
+    sha256 = "sha256-Q8Cd//QDQ6kWgp+QEn9/h69jfaUNE1/+oqQne/2wvAg=";
+  };
+
+  cargoSha256 = "sha256-khJ6EZVJ96geD1VzvR8E2ZgHfxhX/NTPVoVIMhCh+c4=";
+
+  nativeBuildInputs = [ cmake installShellFiles pkg-config ronn ];
+
+  buildInputs = [ libgit2 libssh2 openssl zlib ]
+    ++ lib.optionals stdenv.isDarwin [ curl 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
+  '';
+
+  meta = with lib; {
+    description = "A cargo subcommand for checking and applying updates to installed executables";
+    homepage = "https://github.com/nabijaczleweli/cargo-update";
+    license = licenses.mit;
+    maintainers = with maintainers; [ gerschtli Br1ght0ne johntitor ];
+  };
+}