summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/development/tools/rust/cargo-generate/default.nix32
-rw-r--r--pkgs/development/tools/rust/cargo-generate/no-vendor.patch11
2 files changed, 33 insertions, 10 deletions
diff --git a/pkgs/development/tools/rust/cargo-generate/default.nix b/pkgs/development/tools/rust/cargo-generate/default.nix
index 337ff0dda75..dec12ef677a 100644
--- a/pkgs/development/tools/rust/cargo-generate/default.nix
+++ b/pkgs/development/tools/rust/cargo-generate/default.nix
@@ -1,22 +1,33 @@
-{ lib, stdenv, fetchFromGitHub, rustPlatform, Security, openssl, pkg-config, libiconv, curl }:
+{ lib
+, rustPlatform
+, fetchFromGitHub
+, pkg-config
+, libgit2
+, openssl
+, stdenv
+, Security
+}:
 
 rustPlatform.buildRustPackage rec {
   pname = "cargo-generate";
-  version = "0.14.0";
+  version = "0.16.0";
 
   src = fetchFromGitHub {
-    owner = "ashleygwilliams";
+    owner = "cargo-generate";
     repo = "cargo-generate";
     rev = "v${version}";
-    sha256 = "sha256-OYYGOB1NfNnOl8bd8KozgMCyW4Gb39LoFtD80DPzpdw=";
+    sha256 = "sha256-qL5ZbLimpsi/7yuhubHF3/tAouE/5zCWRx4nZG841cU=";
   };
 
-  cargoSha256 = "sha256-qmRKjPhPLpzVVuTHuoo0iTlX3BnT2Udo1kFXvA3zNQE=";
+  # patch Cargo.toml to not vendor libgit2 and openssl
+  cargoPatches = [ ./no-vendor.patch ];
+
+  cargoSha256 = "sha256-OB3rjJNxkUKRQPsWRvCniNPfYBgLFV4yXO7dnVvL7wo=";
 
   nativeBuildInputs = [ pkg-config ];
 
-  buildInputs = [ openssl  ]
-    ++ lib.optionals stdenv.isDarwin [ Security libiconv curl ];
+  buildInputs = [ libgit2 openssl ]
+    ++ lib.optionals stdenv.isDarwin [ Security ];
 
   preCheck = ''
     export HOME=$(mktemp -d) USER=nixbld
@@ -32,8 +43,9 @@ rustPlatform.buildRustPackage rec {
 
   meta = with lib; {
     description = "cargo, make me a project";
-    homepage = "https://github.com/ashleygwilliams/cargo-generate";
-    license = licenses.asl20;
-    maintainers = [ maintainers.turbomack ];
+    homepage = "https://github.com/cargo-generate/cargo-generate";
+    changelog = "https://github.com/cargo-generate/cargo-generate/blob/v${version}/CHANGELOG.md";
+    license = with licenses; [ asl20 /* or */ mit ];
+    maintainers = with maintainers; [ figsoda turbomack ];
   };
 }
diff --git a/pkgs/development/tools/rust/cargo-generate/no-vendor.patch b/pkgs/development/tools/rust/cargo-generate/no-vendor.patch
new file mode 100644
index 00000000000..0c3b18de211
--- /dev/null
+++ b/pkgs/development/tools/rust/cargo-generate/no-vendor.patch
@@ -0,0 +1,11 @@
+--- a/Cargo.toml
++++ b/Cargo.toml
+@@ -10,7 +10,7 @@ include = ["src/**/*", "LICENSE-*", "*.md"]
+ 
+ [dependencies]
+ clap = { version = "3.2", features = ["derive", "std"], default-features = false }
+-git2 = { version = "0.14", features = ["ssh", "https", "vendored-libgit2", "vendored-openssl"], default-features = false }
++git2 = { version = "0.14", features = ["ssh", "https"], default-features = false }
+ console = "0.15"
+ dialoguer = "0.10"
+ dirs = "4.0"