use Dpkg::Changelog::Debian;
use Dpkg::Control::Info;
use Dpkg::Version;
+use JSON::PP;
use base 'Debian::Debhelper::Buildsystem';
sub DESCRIPTION {
"Rust Cargo"
}
+sub cargo_version {
+ my $src = shift;
+ open(F, "cargo metadata --manifest-path $src --no-deps --format-version 1 |");
+ local $/;
+ my $json = JSON::PP->new;
+ my $manifest = $json->decode(<F>);
+ return %{@{%{$manifest}{'packages'}}[0]}{'version'} . "\n";
+}
+
sub check_auto_buildable {
my $this = shift;
if (-f $this->get_sourcepath("Cargo.toml")) {
}
if ($this->{binpkg}) {
my $target = $this->get_sourcepath("debian/" . $this->{binpkg} . "/usr");
- doit("cargo", "install", $this->{crate}, "--verbose", "--vers", $this->{version}, "--root", $target, @{$this->{j}});
+ doit("cargo", "install", $this->{crate}, "--verbose", @{$this->{j}},
+ "--vers", cargo_version($this->get_sourcepath("Cargo.toml")),
+ "--root", $target);
doit("rm", "$target/.crates.toml");
}
}
+dh-cargo (4) UNRELEASED; urgency=medium
+
+ * Pass cargo-version not Debian-version to `cargo install`.
+
+ -- Ximin Luo <infinity0@debian.org> Wed, 06 Jun 2018 19:50:22 -0700
+
dh-cargo (3) unstable; urgency=medium
* Update to latest Standards-Version; no changes required.