diff --git a/0019-Do-not-pull-optional-dependencies.patch b/0019-Do-not-pull-optional-dependencies.patch index 80d715a..5b8a70e 100644 --- a/0019-Do-not-pull-optional-dependencies.patch +++ b/0019-Do-not-pull-optional-dependencies.patch @@ -1,16 +1,16 @@ -From 72d9afecc6da319e1d59170f07a7b78afbbb1a68 Mon Sep 17 00:00:00 2001 +From 643bf0d32982b67854a39586244b25f54518de02 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Sat, 9 Mar 2019 22:04:49 +0100 Subject: [PATCH 19/19] Do not pull optional dependencies Signed-off-by: Igor Gnatenko --- - data/macros.cargo | 13 +++++++++++-- + data/macros.cargo | 20 +++++++++++--------- rust2rpm/templates/main.spec | 5 ----- - 2 files changed, 11 insertions(+), 7 deletions(-) + 2 files changed, 11 insertions(+), 14 deletions(-) diff --git a/data/macros.cargo b/data/macros.cargo -index 96dc354..b1a2e0b 100644 +index 96dc354..f950e79 100644 --- a/data/macros.cargo +++ b/data/macros.cargo @@ -2,8 +2,10 @@ @@ -26,7 +26,18 @@ index 96dc354..b1a2e0b 100644 %__cargo_inspector %{_bindir}/cargo-inspector %cargo_registry %{_datadir}/cargo/registry -@@ -74,10 +76,17 @@ if %__cargo_is_lib; then \ +@@ -36,10 +38,6 @@ registry = "https://crates.io"\ + replace-with = "local-registry"\ + EOF\ + %{__rm} -f Cargo.lock \ +-%if ! %{with check} \ +-# https://github.com/rust-lang/cargo/issues/3732 \ +-%{__awk} -i inplace -v INPLACE_SUFFIX=.orig '/^\\\[dev-dependencies/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ +-%endif \ + ) + + %__cargo_parse_opts(naf:) %{shrink:\ +@@ -74,10 +72,14 @@ if %__cargo_is_lib; then \ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \ %{__mkdir} -p $REG_DIR \ @@ -35,12 +46,12 @@ index 96dc354..b1a2e0b 100644 +# https://github.com/rust-lang/cargo/pull/6729 \ + %{__awk} -i inplace -v INPLACE_SUFFIX=.deps '/^\\\[((.+\\\.)?((dev|build)-)?dependencies|features)/{f=1;next} /^\\\[/{f=0}; !f' Cargo.toml \ %{__cargo} package -l | xargs -d '\\\n' %{__cp} --parents -a -t $REG_DIR \ - %if ! %{with check} \ - %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ -+%else \ -+ %{__cp} -a Cargo.toml.deps $REG_DIR/Cargo.toml \ - %endif \ -+ %{__rm} -f $REG_DIR/Cargo.toml.{orig,deps} \ +-%if ! %{with check} \ +- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \ +-%endif \ ++ %{__mv} Cargo.toml{.deps,} \ ++ %{__mv} $REG_DIR/Cargo.toml{.deps,} \ ++ %{__rm} -f $REG_DIR/Cargo.toml.orig \ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \ fi \ if %__cargo_is_bin; then \ diff --git a/rust-packaging.spec b/rust-packaging.spec index f315a93..0ea39e1 100644 --- a/rust-packaging.spec +++ b/rust-packaging.spec @@ -5,7 +5,7 @@ Name: rust-packaging Version: 6 -Release: 26%{?dist} +Release: 27%{?dist} Summary: RPM macros for building Rust packages on various architectures License: MIT @@ -91,6 +91,9 @@ py.test-%{python3_version} -vv test.py %{python3_sitelib}/rust2rpm/ %changelog +* Sun Mar 10 2019 Igor Gnatenko - 6-27 +- Restore Cargo.toml.deps into $PWD/Cargo.toml + * Sun Mar 10 2019 Igor Gnatenko - 6-26 - Strip out target dependencies too