Unbundle Rust deps

Signed-off-by: Igor Gnatenko <ignatenkobrain@fedoraproject.org>
This commit is contained in:
Igor Gnatenko 2019-02-19 07:29:08 +01:00
parent 166919a6b2
commit 2eff85f24a
No known key found for this signature in database
GPG Key ID: 695714BD1BBC5F4C
2 changed files with 188 additions and 6 deletions

View File

@ -0,0 +1,173 @@
From 2aa0419a409df89346b6d50fdbd2c9925409c5a2 Mon Sep 17 00:00:00 2001
From: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Date: Tue, 19 Feb 2019 07:26:32 +0100
Subject: [PATCH] Update dependencies
(cherry picked from commit c414d178777b44fe14af5a61238be912f2516d10)
---
rsvg_internals/Cargo.toml | 4 ++--
rsvg_internals/src/cond.rs | 17 +++++++----------
rsvg_internals/src/filters/convolve_matrix.rs | 4 ++--
rsvg_internals/src/filters/gaussian_blur.rs | 4 ++--
rsvg_internals/src/io.rs | 2 +-
rsvg_internals/src/svg.rs | 6 +++---
6 files changed, 17 insertions(+), 20 deletions(-)
diff --git a/rsvg_internals/Cargo.toml b/rsvg_internals/Cargo.toml
index 268498b9..2e483e8f 100644
--- a/rsvg_internals/Cargo.toml
+++ b/rsvg_internals/Cargo.toml
@@ -34,12 +34,12 @@ gio-sys = "0.7.0"
glib = "0.6.0"
glib-sys = "0.7.0"
gobject-sys = "0.7.0"
-itertools = "0.7.4"
+itertools = "0.8"
language-tags = "0.2.2"
lazy_static = "1.0.0"
libc = "0.2"
locale_config = "*" # recommended explicitly by locale_config's README.md
-nalgebra = "0.16"
+nalgebra = "0.17"
num-traits = "0.2"
owning_ref = "0.4.0"
pango = "0.5.0"
diff --git a/rsvg_internals/src/cond.rs b/rsvg_internals/src/cond.rs
index 63f77dce..12730369 100644
--- a/rsvg_internals/src/cond.rs
+++ b/rsvg_internals/src/cond.rs
@@ -4,7 +4,6 @@ use std::ascii::AsciiExt;
use std::str::FromStr;
use glib;
-use itertools::{FoldWhile, Itertools};
use language_tags::LanguageTag;
use locale_config::{LanguageRange, Locale};
@@ -89,28 +88,26 @@ impl SystemLanguage {
pub fn from_attribute(s: &str, locale: &Locale) -> Result<SystemLanguage, ValueErrorKind> {
s.split(',')
.map(LanguageTag::from_str)
- .fold_while(
+ .try_fold(
// start with no match
- Ok(SystemLanguage(false)),
+ SystemLanguage(false),
// The accumulator is Result<SystemLanguage, ValueErrorKind>
|acc, tag_result| match tag_result {
Ok(language_tag) => {
- let have_match = acc.unwrap().0;
+ let have_match = acc.0;
if have_match {
- FoldWhile::Continue(Ok(SystemLanguage(have_match)))
+ Ok(SystemLanguage(have_match))
} else {
locale_accepts_language_tag(locale, &language_tag)
- .map(|matches| FoldWhile::Continue(Ok(SystemLanguage(matches))))
- .unwrap_or_else(|e| FoldWhile::Done(Err(e)))
+ .map(|matches| SystemLanguage(matches))
}
}
- Err(e) => FoldWhile::Done(Err(ValueErrorKind::Parse(ParseError::new(
+ Err(e) => Err(ValueErrorKind::Parse(ParseError::new(
&format!("invalid language tag: \"{}\"", e),
- )))),
+ ))),
},
)
- .into_inner()
}
}
diff --git a/rsvg_internals/src/filters/convolve_matrix.rs b/rsvg_internals/src/filters/convolve_matrix.rs
index a62f8f45..760d9b55 100644
--- a/rsvg_internals/src/filters/convolve_matrix.rs
+++ b/rsvg_internals/src/filters/convolve_matrix.rs
@@ -1,7 +1,7 @@
use std::cell::{Cell, RefCell};
use cairo::{self, ImageSurface, MatrixTrait};
-use nalgebra::{DMatrix, Dynamic, MatrixVec};
+use nalgebra::{DMatrix, Dynamic, VecStorage};
use attributes::Attribute;
use drawing_ctx::DrawingCtx;
@@ -193,7 +193,7 @@ impl NodeTrait for ConvolveMatrix {
));
}
- DMatrix::from_data(MatrixVec::new(
+ DMatrix::from_data(VecStorage::new(
Dynamic::new(self.order.get().1 as usize),
Dynamic::new(self.order.get().0 as usize),
v,
diff --git a/rsvg_internals/src/filters/gaussian_blur.rs b/rsvg_internals/src/filters/gaussian_blur.rs
index 6b330aec..c387f9c9 100644
--- a/rsvg_internals/src/filters/gaussian_blur.rs
+++ b/rsvg_internals/src/filters/gaussian_blur.rs
@@ -3,7 +3,7 @@ use std::cmp::min;
use std::f64;
use cairo::MatrixTrait;
-use nalgebra::{DMatrix, Dynamic, MatrixVec};
+use nalgebra::{DMatrix, Dynamic, VecStorage};
use attributes::Attribute;
use drawing_ctx::DrawingCtx;
@@ -182,7 +182,7 @@ fn gaussian_blur(
} else {
(1, kernel.len())
};
- let kernel = DMatrix::from_data(MatrixVec::new(
+ let kernel = DMatrix::from_data(VecStorage::new(
Dynamic::new(rows),
Dynamic::new(cols),
kernel,
diff --git a/rsvg_internals/src/io.rs b/rsvg_internals/src/io.rs
index 48efb4ef..d6248496 100644
--- a/rsvg_internals/src/io.rs
+++ b/rsvg_internals/src/io.rs
@@ -113,7 +113,7 @@ pub fn acquire_data(
Ok(BinaryData {
data: contents,
- content_type: mime_type,
+ content_type: mime_type.map(From::from),
})
}
}
diff --git a/rsvg_internals/src/svg.rs b/rsvg_internals/src/svg.rs
index dc75d9d5..f2908bd2 100644
--- a/rsvg_internals/src/svg.rs
+++ b/rsvg_internals/src/svg.rs
@@ -194,6 +194,8 @@ fn load_image(
if load_options.flags.keep_image_data {
if let Some(mime_type) = data.content_type {
+ let data_ptr = ToGlibContainerFromSlice::to_glib_full_from_slice(&data.data);
+
extern "C" {
fn cairo_surface_set_mime_data(
surface: *mut cairo_sys::cairo_surface_t,
@@ -205,8 +207,6 @@ fn load_image(
) -> Status;
}
- let data_ptr = ToGlibContainerFromSlice::to_glib_full_from_slice(&data.data);
-
unsafe {
let status = cairo_surface_set_mime_data(
surface.to_glib_none().0,
@@ -215,7 +215,7 @@ fn load_image(
data.data.len() as libc::c_ulong,
Some(glib_sys::g_free),
data_ptr as *mut _,
- );
+ ).into();
if status != Status::Success {
return Err(LoadingError::Cairo(status));
--
2.21.0.rc1

View File

@ -6,19 +6,22 @@
# Use bundled deps as we don't ship the exact right versions for all the
# required rust libraries
%global bundled_rust_deps 1
%global bundled_rust_deps 0
%global cairo_version 1.15.12
Name: librsvg2
Summary: An SVG library based on cairo
Version: 2.45.5
Release: 1%{?dist}
Release: 2%{?dist}
License: LGPLv2+
URL: https://wiki.gnome.org/Projects/LibRsvg
Source0: https://download.gnome.org/sources/librsvg/2.45/librsvg-%{version}.tar.xz
# https://gitlab.gnome.org/GNOME/librsvg/commit/c414d178777b44fe14af5a61238be912f2516d10
Patch0001: 0001-Update-dependencies.patch
BuildRequires: chrpath
BuildRequires: gcc
BuildRequires: gobject-introspection-devel
@ -56,11 +59,11 @@ BuildRequires: (crate(gio/v2_48) >= 0.5.1 with crate(gio/v2_48) < 0.6.0)
BuildRequires: (crate(glib-sys/default) >= 0.7.0 with crate(glib-sys/default) < 0.8.0)
BuildRequires: (crate(glib/default) >= 0.6.0 with crate(glib/default) < 0.7.0)
BuildRequires: (crate(gobject-sys/default) >= 0.7.0 with crate(gobject-sys/default) < 0.8.0)
BuildRequires: (crate(itertools/default) >= 0.7.4 with crate(itertools/default) < 0.8.0)
BuildRequires: (crate(itertools/default) >= 0.8.0 with crate(itertools/default) < 0.9.0)
BuildRequires: (crate(language-tags/default) >= 0.2.2 with crate(language-tags/default) < 0.3.0)
BuildRequires: (crate(lazy_static/default) >= 1.0.0 with crate(lazy_static/default) < 2.0.0)
BuildRequires: (crate(libc/default) >= 0.2.0 with crate(libc/default) < 0.3.0)
BuildRequires: (crate(nalgebra/default) >= 0.16.0 with crate(nalgebra/default) < 0.17.0)
BuildRequires: (crate(nalgebra/default) >= 0.17.0 with crate(nalgebra/default) < 0.18.0)
BuildRequires: (crate(num-traits/default) >= 0.2.0 with crate(num-traits/default) < 0.3.0)
BuildRequires: (crate(owning_ref/default) >= 0.4.0 with crate(owning_ref/default) < 0.5.0)
BuildRequires: (crate(pango-sys/default) >= 0.7.0 with crate(pango-sys/default) < 0.8.0)
@ -106,8 +109,11 @@ This package provides extra utilities based on the librsvg library.
# Use the bundled deps
%else
# No bundled deps
rm -vrf vendor
%cargo_prep
rm -vrf vendor .cargo Cargo.lock
pushd rsvg_internals
%cargo_prep
mv .cargo ..
popd
%endif
%build
@ -160,6 +166,9 @@ rm -vrf %{buildroot}%{_datadir}/doc
%{_mandir}/man1/rsvg-convert.1*
%changelog
* Tue Feb 19 2019 Igor Gnatenko <ignatenkobrain@fedoraproject.org> - 2.45.5-2
- Unbundle Rust deps
* Sat Feb 16 2019 Kalev Lember <klember@redhat.com> - 2.45.5-1
- Update to 2.45.5