From 1d2612cc76af32388660f3510dd4b33810557b26 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Oct 04 2018 15:50:11 +0000 Subject: initial import Signed-off-by: Igor Gnatenko --- diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..26b12a5 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/cexpr-0.3.0.crate diff --git a/0001-bump-clang-sys-to-0.24.patch b/0001-bump-clang-sys-to-0.24.patch new file mode 100644 index 0000000..ec1b635 --- /dev/null +++ b/0001-bump-clang-sys-to-0.24.patch @@ -0,0 +1,31 @@ +From 4102a9e624596828aa36f4b9c487be928687b561 Mon Sep 17 00:00:00 2001 +From: Igor Gnatenko +Date: Thu, 4 Oct 2018 14:43:07 +0200 +Subject: [PATCH] bump clang-sys to 0.24 + +Signed-off-by: Igor Gnatenko +--- + tests/clang.rs | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/tests/clang.rs b/tests/clang.rs +index 8578811..93cb8dc 100644 +--- a/tests/clang.rs ++++ b/tests/clang.rs +@@ -149,11 +149,11 @@ unsafe fn visit_children(cursor: CXCursor, mut f: F) + + unsafe fn location_in_scope(r: CXSourceRange) -> bool { + let start=clang_getRangeStart(r); +- let mut file=CXFile(ptr::null_mut()); ++ let mut file: CXFile=ptr::null_mut(); + clang_getSpellingLocation(start,&mut file,ptr::null_mut(),ptr::null_mut(),ptr::null_mut()); + clang_Location_isFromMainFile(start)!=0 + && clang_Location_isInSystemHeader(start)==0 +- && file.0!=ptr::null_mut() ++ && file!=ptr::null_mut() + } + + /// tokenize_range_adjust can be used to work around LLVM bug 9069 +-- +2.19.0 + diff --git a/cexpr-fix-metadata.diff b/cexpr-fix-metadata.diff new file mode 100644 index 0000000..27202a9 --- /dev/null +++ b/cexpr-fix-metadata.diff @@ -0,0 +1,8 @@ +--- cexpr-0.3.0/Cargo.toml 1970-01-01T01:00:00+01:00 ++++ cexpr-0.3.0/Cargo.toml 2018-10-04T14:40:18.081705+02:00 +@@ -23,4 +23,4 @@ + version = "^4" + features = ["verbose-errors"] + [dev-dependencies.clang-sys] +-version = "0.11.0" ++version = "0.24" diff --git a/rust-cexpr.spec b/rust-cexpr.spec new file mode 100644 index 0000000..7d56ee5 --- /dev/null +++ b/rust-cexpr.spec @@ -0,0 +1,65 @@ +# Generated by rust2rpm +%bcond_without check +%global debug_package %{nil} + +%global crate cexpr + +Name: rust-%{crate} +Version: 0.3.0 +Release: 1%{?dist} +Summary: C expression parser and evaluator + +# Upstream license specification: Apache-2.0/MIT +License: ASL 2.0 or MIT +URL: https://crates.io/crates/cexpr +Source0: https://crates.io/api/v1/crates/%{crate}/%{version}/download#/%{crate}-%{version}.crate +# Initial patched metadata +# * Bump clang-sys to 0.24 and fix tests +Patch0: cexpr-fix-metadata.diff +Patch0001: 0001-bump-clang-sys-to-0.24.patch + +ExclusiveArch: %{rust_arches} + +BuildRequires: rust-packaging +# [dependencies] +BuildRequires: ((crate(nom) >= 4.0.0 with crate(nom) < 5.0.0) with crate(nom/verbose-errors)) +%if %{with check} +# [dev-dependencies] +BuildRequires: (crate(clang-sys) >= 0.24.0 with crate(clang-sys) < 0.25.0) +%endif + +%description +%{summary}. + +%package devel +Summary: %{summary} +BuildArch: noarch + +%description devel +C expression parser and evaluator. + +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-MIT LICENSE-APACHE +%{cargo_registry}/%{crate}-%{version}/ + +%changelog +* Thu Oct 04 2018 Igor Gnatenko - 0.3.0-1 +- Initial package diff --git a/sources b/sources new file mode 100644 index 0000000..4cca11f --- /dev/null +++ b/sources @@ -0,0 +1 @@ +SHA512 (cexpr-0.3.0.crate) = e658eae2643c4b82005c812859caa92576eafcaeb5aa7dc6c438e8d2b562bb249c9b4fa5d365011db9c4e057ff85a90b3e55e2efa662c161bd0e196b0a2eb6c7