parent
f0c49a43e2
commit
1676c09d91
@ -0,0 +1 @@
|
|||||||
|
/sys-info-0.5.3.crate
|
@ -0,0 +1,42 @@
|
|||||||
|
From b224a310f0260aff647347758b7d913cc20c3507 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
Date: Mon, 4 Dec 2017 00:32:37 +0100
|
||||||
|
Subject: [PATCH] port to cc crate
|
||||||
|
|
||||||
|
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
|
||||||
|
---
|
||||||
|
build.rs | 10 ++++++----
|
||||||
|
1 file changed, 6 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/build.rs b/build.rs
|
||||||
|
index c09ab88..04f2871 100644
|
||||||
|
--- a/build.rs
|
||||||
|
+++ b/build.rs
|
||||||
|
@@ -1,4 +1,4 @@
|
||||||
|
-extern crate gcc;
|
||||||
|
+extern crate cc;
|
||||||
|
|
||||||
|
use std::env;
|
||||||
|
|
||||||
|
@@ -6,13 +6,15 @@ fn main() {
|
||||||
|
let target = env::var("TARGET").unwrap();
|
||||||
|
let target_os = target.split('-').nth(2).unwrap();
|
||||||
|
|
||||||
|
+ let mut builder = cc::Build::new();
|
||||||
|
match target_os {
|
||||||
|
- "linux" => gcc::compile_library("libinfo.a", &["c/linux.c"]),
|
||||||
|
- "darwin" => gcc::compile_library("libinfo.a", &["c/macos.c"]),
|
||||||
|
+ "linux" => builder.file("c/linux.c"),
|
||||||
|
+ "darwin" => builder.file("c/macos.c"),
|
||||||
|
"windows" => {
|
||||||
|
- gcc::compile_library("libinfo.a", &["c/windows.c"]);
|
||||||
|
println!("cargo:rustc-flags=-l psapi");
|
||||||
|
+ builder.file("c/windows.c")
|
||||||
|
},
|
||||||
|
_ => panic!("Unsupported system")
|
||||||
|
};
|
||||||
|
+ builder.compile("info");
|
||||||
|
}
|
||||||
|
--
|
||||||
|
2.15.1
|
||||||
|
|
@ -0,0 +1,66 @@
|
|||||||
|
# Generated by rust2rpm
|
||||||
|
%bcond_without check
|
||||||
|
%global debug_package %{nil}
|
||||||
|
|
||||||
|
%global crate sys-info
|
||||||
|
|
||||||
|
Name: rust-%{crate}
|
||||||
|
Version: 0.5.3
|
||||||
|
Release: 1%{?dist}
|
||||||
|
Summary: Get system information in Rust
|
||||||
|
|
||||||
|
License: MIT
|
||||||
|
URL: https://crates.io/crates/sys-info
|
||||||
|
Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate
|
||||||
|
# Initial patched metadata
|
||||||
|
# * Replace gcc with cc, https://github.com/FillZpp/sys-info-rs/pull/21
|
||||||
|
Patch0: sys-info-0.5.3-fix-metadata.diff
|
||||||
|
# Finish gcc->cc
|
||||||
|
Patch1: 0001-port-to-cc-crate.patch
|
||||||
|
|
||||||
|
ExclusiveArch: %{rust_arches}
|
||||||
|
|
||||||
|
BuildRequires: rust-packaging
|
||||||
|
# [dependencies]
|
||||||
|
BuildRequires: (crate(libc) >= 0.2.29 with crate(libc) < 0.3.0)
|
||||||
|
# [build-dependencies]
|
||||||
|
BuildRequires: (crate(cc) >= 1.0.0 with crate(cc) < 2.0.0)
|
||||||
|
BuildRequires: %{_bindir}/hostname
|
||||||
|
|
||||||
|
%description
|
||||||
|
%{summary}.
|
||||||
|
|
||||||
|
%package devel
|
||||||
|
Summary: %{summary}
|
||||||
|
Requires: %{_bindir}/hostname
|
||||||
|
BuildArch: noarch
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
Get system information in Rust.
|
||||||
|
|
||||||
|
This package contains library source intended for building other packages
|
||||||
|
which use %{crate} from crates.io.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%autosetup -n %{crate}-%{version} -p1
|
||||||
|
%cargo_prep
|
||||||
|
|
||||||
|
%build
|
||||||
|
%cargo_build
|
||||||
|
|
||||||
|
%install
|
||||||
|
%cargo_install
|
||||||
|
|
||||||
|
%if %{with check}
|
||||||
|
%check
|
||||||
|
%cargo_test
|
||||||
|
%endif
|
||||||
|
|
||||||
|
%files devel
|
||||||
|
%license LICENSE
|
||||||
|
%doc README.md
|
||||||
|
%{cargo_registry}/%{crate}-%{version}/
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Mon Dec 04 2017 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 0.5.3-1
|
||||||
|
- Initial package
|
@ -0,0 +1 @@
|
|||||||
|
SHA512 (sys-info-0.5.3.crate) = 0eddce4753453753929129657c90dc2c37e0d2d80ec45707950adb4f9ec29deef950caabe118561309060c9d8a93fcfd67253763fad1a50391ada4781d3801ba
|
@ -0,0 +1,10 @@
|
|||||||
|
--- sys-info-0.5.3/Cargo.toml 1970-01-01T01:00:00+01:00
|
||||||
|
+++ sys-info-0.5.3/Cargo.toml 2017-12-04T01:13:02.629820+01:00
|
||||||
|
@@ -28,5 +28,5 @@
|
||||||
|
path = "lib.rs"
|
||||||
|
[dependencies.libc]
|
||||||
|
version = "0.2.29"
|
||||||
|
-[build-dependencies.gcc]
|
||||||
|
-version = "0.3.51"
|
||||||
|
+[build-dependencies.cc]
|
||||||
|
+version = "1"
|
Loading…
Reference in new issue