parent
84bf5595e3
commit
a85e0d862f
@ -1,2 +1,3 @@
|
|||||||
/rust2rpm-4.tar.xz
|
/rust2rpm-4.tar.xz
|
||||||
/rust2rpm-5.tar.xz
|
/rust2rpm-5.tar.xz
|
||||||
|
/rust2rpm-6.tar.xz
|
||||||
|
@ -1,31 +0,0 @@
|
|||||||
From 5313b352712486b4001827b04d906bdb91be2314 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
Date: Mon, 8 Jan 2018 23:57:03 +0100
|
|
||||||
Subject: [PATCH 1/5] macros: remove Cargo.lock
|
|
||||||
|
|
||||||
cargo-package automatically strips it out, but we package also some
|
|
||||||
things directly from git.
|
|
||||||
|
|
||||||
Acked-by: Josh Stone <jistone@redhat.com>
|
|
||||||
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
---
|
|
||||||
data/macros.cargo | 3 ++-
|
|
||||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index ebf3edb..288554c 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -27,7 +27,8 @@ directory = "%{cargo_registry}"\
|
|
||||||
[source.crates-io]\
|
|
||||||
registry = "https://crates.io"\
|
|
||||||
replace-with = "local-registry"\
|
|
||||||
-EOF\
|
|
||||||
+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 \
|
|
||||||
--
|
|
||||||
2.18.0.rc2
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
|||||||
From cd6329635329fc7742a18f7ed0933298a0c56cf7 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
Date: Tue, 9 Jan 2018 06:52:36 +0100
|
|
||||||
Subject: [PATCH 2/5] macros: remove spurious whitespace
|
|
||||||
|
|
||||||
Fixes: https://pagure.io/fedora-rust/rust2rpm/issue/48
|
|
||||||
Reported-by: Josh Stone <jistone@redhat.com>
|
|
||||||
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
---
|
|
||||||
data/macros.cargo | 2 +-
|
|
||||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index 288554c..67b1950 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -27,7 +27,7 @@ directory = "%{cargo_registry}"\
|
|
||||||
[source.crates-io]\
|
|
||||||
registry = "https://crates.io"\
|
|
||||||
replace-with = "local-registry"\
|
|
||||||
-EOF \
|
|
||||||
+EOF\
|
|
||||||
%{__rm} -f Cargo.lock \
|
|
||||||
%if ! %{with check} \
|
|
||||||
# https://github.com/rust-lang/cargo/issues/3732 \
|
|
||||||
--
|
|
||||||
2.18.0.rc2
|
|
||||||
|
|
@ -1,50 +0,0 @@
|
|||||||
From c5bab762f56bf07cd0f4a2e2d58b7c295cddedd8 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
Date: Tue, 20 Feb 2018 22:04:35 +0100
|
|
||||||
Subject: [PATCH 3/5] macros: pass %__cargo_common_opts to %cargo_install
|
|
||||||
|
|
||||||
Reason this has not been done before is that cargo-install doesn't
|
|
||||||
understand --release. Let's just add it to other commands and be done
|
|
||||||
with it.
|
|
||||||
|
|
||||||
Reported-by: Josh Stone <jistone@redhat.com>
|
|
||||||
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
---
|
|
||||||
data/macros.cargo | 8 ++++----
|
|
||||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index 67b1950..22721e9 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -1,5 +1,5 @@
|
|
||||||
%__cargo %{_bindir}/cargo
|
|
||||||
-%__cargo_common_opts --release %{?_smp_mflags}
|
|
||||||
+%__cargo_common_opts %{?_smp_mflags}
|
|
||||||
%__cargo_inspector %{_bindir}/cargo-inspector
|
|
||||||
|
|
||||||
%cargo_registry %{_datadir}/cargo/registry
|
|
||||||
@@ -35,9 +35,9 @@ EOF\
|
|
||||||
%endif \
|
|
||||||
)
|
|
||||||
|
|
||||||
-%cargo_build %__cargo build %{__cargo_common_opts}
|
|
||||||
+%cargo_build %__cargo build --release %{__cargo_common_opts}
|
|
||||||
|
|
||||||
-%cargo_test %__cargo test %{__cargo_common_opts} --no-fail-fast
|
|
||||||
+%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast
|
|
||||||
|
|
||||||
%cargo_install (\
|
|
||||||
set -eu \
|
|
||||||
@@ -53,7 +53,7 @@ if %__cargo_is_lib; then \
|
|
||||||
echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
|
|
||||||
fi \
|
|
||||||
if %__cargo_is_bin; then \
|
|
||||||
- %__cargo install %{?_smp_mflags} --path . --root %{buildroot}%{_prefix} \
|
|
||||||
+ %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \
|
|
||||||
%{__rm} %{buildroot}%{_prefix}/.crates.toml \
|
|
||||||
fi \
|
|
||||||
)
|
|
||||||
--
|
|
||||||
2.18.0.rc2
|
|
||||||
|
|
@ -1,96 +0,0 @@
|
|||||||
From c9ce952e260ec0adb166bd6e1de652a0277d2437 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
Date: Fri, 22 Jun 2018 21:04:59 +0200
|
|
||||||
Subject: [PATCH 4/5] macros: make %cargo_* macros parametric
|
|
||||||
MIME-Version: 1.0
|
|
||||||
Content-Type: text/plain; charset=UTF-8
|
|
||||||
Content-Transfer-Encoding: 8bit
|
|
||||||
|
|
||||||
Unfortunately cargo-install doesn't accept --target-dir, so have to pass
|
|
||||||
setting through envvar.
|
|
||||||
|
|
||||||
Also %{shrink:…} them so it looks nicer in build log.
|
|
||||||
|
|
||||||
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
---
|
|
||||||
data/macros.cargo | 62 ++++++++++++++++++++++++++++++++++-------------
|
|
||||||
1 file changed, 45 insertions(+), 17 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index 22721e9..96a2931 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -35,25 +35,53 @@ EOF\
|
|
||||||
%endif \
|
|
||||||
)
|
|
||||||
|
|
||||||
-%cargo_build %__cargo build --release %{__cargo_common_opts}
|
|
||||||
+%__cargo_parse_opts(t:naf:) %{shrink:\
|
|
||||||
+%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
|
|
||||||
+ %{-t:--target-dir %{-t*}} \
|
|
||||||
+ %{-n:--no-default-features} \
|
|
||||||
+ %{-a:--all-features} \
|
|
||||||
+ %{-f:--features %{-f*}} \
|
|
||||||
+ %{nil}
|
|
||||||
+}
|
|
||||||
|
|
||||||
-%cargo_test %__cargo test --release %{__cargo_common_opts} --no-fail-fast
|
|
||||||
+%cargo_build(t:naf:) %{shrink:\
|
|
||||||
+%{__cargo} build \
|
|
||||||
+ %{__cargo_common_opts} \
|
|
||||||
+ --release \
|
|
||||||
+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
+ %* \
|
|
||||||
+}
|
|
||||||
|
|
||||||
-%cargo_install (\
|
|
||||||
-set -eu \
|
|
||||||
-if %__cargo_is_lib; then \
|
|
||||||
- CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \
|
|
||||||
- CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
|
|
||||||
- REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
|
|
||||||
- %{__mkdir} -p $REG_DIR \
|
|
||||||
- %__cargo package -l | xargs %{__cp} --parents -a -t $REG_DIR \
|
|
||||||
-%if ! %{with check} \
|
|
||||||
- %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
|
|
||||||
-%endif \
|
|
||||||
- echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
|
|
||||||
+%cargo_test(t:naf:) %{shrink:\
|
|
||||||
+%{__cargo} test \
|
|
||||||
+ %{__cargo_common_opts} \
|
|
||||||
+ --release \
|
|
||||||
+ --no-fail-fast \
|
|
||||||
+ %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
+ %* \
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+%cargo_install(t:naf:) (\
|
|
||||||
+set -eu \
|
|
||||||
+if %__cargo_is_lib; then \
|
|
||||||
+ CRATE_NAME=$(%__cargo_inspector --name Cargo.toml) \
|
|
||||||
+ CRATE_VERSION=$(%__cargo_inspector --version Cargo.toml) \
|
|
||||||
+ REG_DIR=%{buildroot}%{cargo_registry}/$CRATE_NAME-$CRATE_VERSION \
|
|
||||||
+ %{__mkdir} -p $REG_DIR \
|
|
||||||
+ %{__cargo} package -l | xargs %{__cp} --parents -a -t $REG_DIR \
|
|
||||||
+%if ! %{with check} \
|
|
||||||
+ %{__cp} -a Cargo.toml.orig $REG_DIR/Cargo.toml \
|
|
||||||
+%endif \
|
|
||||||
+ echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
|
|
||||||
fi \
|
|
||||||
-if %__cargo_is_bin; then \
|
|
||||||
- %__cargo install %{__cargo_common_opts} --path . --root %{buildroot}%{_prefix} \
|
|
||||||
- %{__rm} %{buildroot}%{_prefix}/.crates.toml \
|
|
||||||
+if %__cargo_is_bin; then \
|
|
||||||
+ %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \
|
|
||||||
+ %{__cargo_common_opts} \
|
|
||||||
+ --path . \
|
|
||||||
+ --root %{buildroot}%{_prefix} \
|
|
||||||
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
+ %* \
|
|
||||||
+ }\
|
|
||||||
+ %{__rm} %{buildroot}%{_prefix}/.crates.toml \
|
|
||||||
fi \
|
|
||||||
)
|
|
||||||
--
|
|
||||||
2.18.0.rc2
|
|
||||||
|
|
@ -1,71 +0,0 @@
|
|||||||
From 80237720ae3397fc66d8f06e13f868c4bd2723c1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
Date: Fri, 22 Jun 2018 21:53:09 +0200
|
|
||||||
Subject: [PATCH 5/5] macros: remove support for target-dir
|
|
||||||
|
|
||||||
Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
|
|
||||||
---
|
|
||||||
data/macros.cargo | 31 +++++++++++++++----------------
|
|
||||||
1 file changed, 15 insertions(+), 16 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/data/macros.cargo b/data/macros.cargo
|
|
||||||
index 96a2931..a0c456a 100644
|
|
||||||
--- a/data/macros.cargo
|
|
||||||
+++ b/data/macros.cargo
|
|
||||||
@@ -35,30 +35,29 @@ EOF\
|
|
||||||
%endif \
|
|
||||||
)
|
|
||||||
|
|
||||||
-%__cargo_parse_opts(t:naf:) %{shrink:\
|
|
||||||
+%__cargo_parse_opts(naf:) %{shrink:\
|
|
||||||
%{-f:%{-a:%{error:Can't specify both -f(%{-f*}) and -a}}} \
|
|
||||||
- %{-t:--target-dir %{-t*}} \
|
|
||||||
%{-n:--no-default-features} \
|
|
||||||
%{-a:--all-features} \
|
|
||||||
%{-f:--features %{-f*}} \
|
|
||||||
%{nil}
|
|
||||||
}
|
|
||||||
|
|
||||||
-%cargo_build(t:naf:) %{shrink:\
|
|
||||||
-%{__cargo} build \
|
|
||||||
- %{__cargo_common_opts} \
|
|
||||||
- --release \
|
|
||||||
- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
- %* \
|
|
||||||
+%cargo_build(naf:) %{shrink:\
|
|
||||||
+%{__cargo} build \
|
|
||||||
+ %{__cargo_common_opts} \
|
|
||||||
+ --release \
|
|
||||||
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
+ %* \
|
|
||||||
}
|
|
||||||
|
|
||||||
-%cargo_test(t:naf:) %{shrink:\
|
|
||||||
-%{__cargo} test \
|
|
||||||
- %{__cargo_common_opts} \
|
|
||||||
- --release \
|
|
||||||
- --no-fail-fast \
|
|
||||||
- %{__cargo_parse_opts %{-t:-t%{-t*}} %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
- %* \
|
|
||||||
+%cargo_test(naf:) %{shrink:\
|
|
||||||
+%{__cargo} test \
|
|
||||||
+ %{__cargo_common_opts} \
|
|
||||||
+ --release \
|
|
||||||
+ --no-fail-fast \
|
|
||||||
+ %{__cargo_parse_opts %{-n} %{-a} %{-f:-f%{-f*}}} \
|
|
||||||
+ %* \
|
|
||||||
}
|
|
||||||
|
|
||||||
%cargo_install(t:naf:) (\
|
|
||||||
@@ -75,7 +74,7 @@ if %__cargo_is_lib; then \
|
|
||||||
echo '{"files":{},"package":""}' > $REG_DIR/.cargo-checksum.json \
|
|
||||||
fi \
|
|
||||||
if %__cargo_is_bin; then \
|
|
||||||
- %{shrink:%{-t:CARGO_TARGET_DIR=%{-t*}} %{__cargo} install \
|
|
||||||
+ %{shrink:%{__cargo} install \
|
|
||||||
%{__cargo_common_opts} \
|
|
||||||
--path . \
|
|
||||||
--root %{buildroot}%{_prefix} \
|
|
||||||
--
|
|
||||||
2.18.0.rc2
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
SHA512 (rust2rpm-5.tar.xz) = e61c0c9351b3bc76b576fc57950b96793f805109e56d1021da94e5dfceb9d299c868f980de298d6a7f85e1b3477f785df7b5615c702e6a0ac25070fbffc013f3
|
SHA512 (rust2rpm-6.tar.xz) = 408988351156d858f7429d990d7330f216b54add671c6e90e54917e717ad6f2b3b99e414289c252e6a2b5dfad73ce430ac73f03265f6e174ef53edcee34d0fe2
|
||||||
|
Loading…
Reference in new issue