[packages/ripgrep] handle cargo outdir manually until elegant generic solution is figured; rel 2
atler
atler at pld-linux.org
Mon Apr 5 23:10:21 CEST 2021
commit 0835f935dc8aa84ab33787fbe4815806d1f6ac16
Author: Jan Palus <atler at pld-linux.org>
Date: Mon Apr 5 23:03:44 2021 +0200
handle cargo outdir manually until elegant generic solution is figured; rel 2
see https://doc.rust-lang.org/cargo/guide/build-cache.html
if only %cargo_target could be magically set so it's possible to:
%cargo_build ... %{?cargo_target:--target %{cargo_target}}
%cargo_outdir target%{?cargo_target:/%{cargo_target}}
ripgrep.spec | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/ripgrep.spec b/ripgrep.spec
index 5040e09..fe53510 100644
--- a/ripgrep.spec
+++ b/ripgrep.spec
@@ -3,7 +3,7 @@
Summary: Line oriented search tool using Rust's regex library
Name: ripgrep
Version: 12.1.1
-Release: 1
+Release: 2
License: MIT or Unlicense
Group: Applications
Source0: https://github.com/BurntSushi/ripgrep/archive/%{version}/%{name}-%{version}.tar.gz
@@ -20,6 +20,12 @@ BuildRequires: xz
ExclusiveArch: %{rust_arches}
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
+%ifarch x32
+%define cargo_outdir target/x86_64-unknown-linux-gnux32
+%else
+%define cargo_outdir target
+%endif
+
%description
ripgrep is a line-oriented search tool that recursively searches your
current directory for a regex pattern. By default, ripgrep will
@@ -75,9 +81,9 @@ rm -rf $RPM_BUILD_ROOT
export CARGO_HOME="$(pwd)/.cargo"
%cargo_install --frozen --root $RPM_BUILD_ROOT%{_prefix} --path $PWD
-install -D target/release/build/%{name}-*/out/rg.1 $RPM_BUILD_ROOT%{_mandir}/man1/rg.1
-install -D target/release/build/%{name}-*/out/rg.bash $RPM_BUILD_ROOT%{bash_compdir}/rg
-install -D target/release/build/%{name}-*/out/rg.fish $RPM_BUILD_ROOT%{fish_compdir}/rg.fish
+install -D %{cargo_outdir}/release/build/%{name}-*/out/rg.1 $RPM_BUILD_ROOT%{_mandir}/man1/rg.1
+install -D %{cargo_outdir}/release/build/%{name}-*/out/rg.bash $RPM_BUILD_ROOT%{bash_compdir}/rg
+install -D %{cargo_outdir}/release/build/%{name}-*/out/rg.fish $RPM_BUILD_ROOT%{fish_compdir}/rg.fish
%{__rm} $RPM_BUILD_ROOT%{_prefix}/.crates*
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ripgrep.git/commitdiff/0835f935dc8aa84ab33787fbe4815806d1f6ac16
More information about the pld-cvs-commit
mailing list