Add cargo test and build Requires edk2
This commit is contained in:
parent
e482828c8f
commit
d8cf74ae1c
@ -6,7 +6,7 @@
|
||||
|
||||
Name: stratovirt
|
||||
Version: 2.2.0
|
||||
Release: 7
|
||||
Release: 8
|
||||
Summary: StratoVirt is an opensource VMM(Virtual Machine Manager) which aims to perform next generation virtualization.
|
||||
|
||||
License: Mulan PSL v2
|
||||
@ -19,8 +19,13 @@ ExclusiveArch: x86_64 aarch64
|
||||
Requires: pixman
|
||||
Requires: pixman-devel
|
||||
|
||||
%ifarch x86_64
|
||||
Requires: edk2-ovmf
|
||||
%endif
|
||||
|
||||
%ifarch aarch64
|
||||
Requires: dtc
|
||||
Requires: edk2-aarch64
|
||||
BuildRequires: dtc-devel
|
||||
%endif
|
||||
|
||||
@ -40,6 +45,8 @@ BuildRequires: pixman-devel
|
||||
%define rust_musl_target aarch64-unknown-linux-musl
|
||||
%endif
|
||||
|
||||
%define _cargo /usr/bin/env CARGO_HOME=.cargo RUSTC_BOOTSTRAP=1 /usr/bin/cargo
|
||||
|
||||
%description
|
||||
Based on Rust programming language, StratoVirt is lightweight, efficient and safe. StratoVirt reduces memory resource consumption and improves VM startup speed while retains isolation capability and security capability of traditional virtualization. StratoVirt works with iSulad and Kata container, and can be integrated in Kubernetes ecosystem perfectly. The current version can be applied to microservices or serverless scenarios. StratoVirt reserves interface and design for importing more features, even standard virtualization.
|
||||
|
||||
@ -62,16 +69,20 @@ Summary: %{summary}
|
||||
sed -i '/\[source.crates-io\]/{n;d}' ./.cargo/config
|
||||
sed -i '/\[source.local-registry\]/{n;d}' ./.cargo/config
|
||||
sed -i '/\[source.local-registry\]/a directory = "vendor"' ./.cargo/config
|
||||
sed -i '/^rustflags/d' ./.cargo/config
|
||||
sed -i '/\[build\]/arustflags = \["-Copt-level=3", "-Cdebuginfo=2", "-Clink-arg=-Wl,-z,relro,-z,now", "-Ccodegen-units=1", "--cap-lints=warn", \]' ./.cargo/config
|
||||
|
||||
%ifarch aarch64
|
||||
sed -i 's/rustflags = \[/&"-Clink-arg=-lgcc", /' ./.cargo/config
|
||||
%endif
|
||||
|
||||
cargo build --release --target=%{rust_musl_target} --all-features
|
||||
%{_cargo} build --release -Z avoid-dev-deps --target=%{rust_musl_target} --all-features
|
||||
|
||||
sed -i 's/rustflags = \[/&"-Clink-arg=-lpixman-1", /' ./.cargo/config
|
||||
cargo build --release --target=%{rust_gnu_target} --all-features --bin stratovirt
|
||||
%{_cargo} build --release -Z avoid-dev-deps --target=%{rust_gnu_target} --all-features
|
||||
|
||||
%check
|
||||
RUST_BACKTRACE=1 cargo test --all -- --nocapture --test-threads=1
|
||||
|
||||
%install
|
||||
rm -rf %{buildroot}
|
||||
@ -83,6 +94,9 @@ install -d %{buildroot}%{_libdir}/stratovirt/static
|
||||
install -D -m555 ./target/%{rust_musl_target}/release/stratovirt %{buildroot}%{_libdir}/stratovirt/static
|
||||
|
||||
%changelog
|
||||
* Tue Sep 20 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-8
|
||||
- Add cargo test and build Requires edk2
|
||||
|
||||
* Fri Sep 16 2022 yezengruan <yezengruan@huawei.com> - 2.2.0-7
|
||||
- Update to StratoVirt 2.2.0-rc5
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user