[projects/template-specs] use %cargo_* macros

Jakub Bogusz qboosh at pld-linux.org
Tue Mar 30 20:57:03 CEST 2021


On Tue, Mar 30, 2021 at 06:46:46PM +0300, Elan Ruusamäe wrote:
[...]
> >@@ -40,19 +41,17 @@ EOF
> >  %build
> >  export CARGO_HOME="$(pwd)/.cargo"
> >  
> >-cargo -v build \
> >+%cargo_build \
> >  %ifarch x32
> >  	--target x86_64-unknown-linux-gnux32 \
> >  %endif
> >-	--release \
> >  	--frozen
> >  
> >  %install
> >  rm -rf $RPM_BUILD_ROOT
> >  export CARGO_HOME="$(pwd)/.cargo"
> >  
> >-cargo -vv \
> >-	install \
> >+%cargo_install \
> >  	--frozen \
> >  	--path . \
> >  	--root $RPM_BUILD_ROOT%{_prefix}
> 
> 
> why not include the crate based build options also into common macros?
> 
> 
> also, in template-specs/rust.spec, there's comment for source0, creating 
> crate, maybe an universal script could be provided by macros package?

I'd enhance %cargo_build at least by adding x32 --target option.

When it comes to crates, It'd better to find some generic solution for
packaging creates system-wide instead of vendoring everything
everywhere. I'm aware Fedora has some, but I didn't have enough time to
do a research.


-- 
Jakub Bogusz    http://qboosh.pl/


More information about the pld-devel-en mailing list