Rebuild with automatic stripping and fix tests

This commit is contained in:
2025-10-28 12:07:26 +02:00
parent 4b8c2f0a71
commit ac8e6873b0
3 changed files with 50 additions and 3 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
name: librsvg name: librsvg
description: SVG rendering library description: SVG rendering library
version: 2.61.2 version: 2.61.2
revision: 1 revision: 2
url: https://wiki.gnome.org/Projects/LibRsvg url: https://wiki.gnome.org/Projects/LibRsvg
license: LGPL2.1-or-later license: LGPL2.1-or-later
architecture: any architecture: any
@@ -0,0 +1,45 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: "Jan Alexander Steffens (heftig)" <[email protected]>
Date: Fri, 17 Oct 2025 23:54:50 +0200
Subject: [PATCH] xml: Treat user stop errors as successful parses
An attempt at fixing
https://gitlab.gnome.org/GNOME/librsvg/-/issues/1201.
---
rsvg/src/xml/xml2.rs | 2 ++
rsvg/src/xml/xml2_load.rs | 9 +++++++--
2 files changed, 9 insertions(+), 2 deletions(-)
diff --git a/rsvg/src/xml/xml2.rs b/rsvg/src/xml/xml2.rs
index b2f9785ff6d3..5da2fbddc31e 100644
--- a/rsvg/src/xml/xml2.rs
+++ b/rsvg/src/xml/xml2.rs
@@ -15,6 +15,8 @@ pub const XML_PARSE_BIG_LINES: libc::c_int = 1 << 22;
pub const XML_SAX2_MAGIC: libc::c_uint = 0xDEEDBEAF;
+pub const XML_ERR_USER_STOP: libc::c_int = 111;
+
pub type xmlDocPtr = gpointer;
pub type xmlEntityPtr = gpointer;
diff --git a/rsvg/src/xml/xml2_load.rs b/rsvg/src/xml/xml2_load.rs
index d9e4f3926db0..28e81e0e7ff7 100644
--- a/rsvg/src/xml/xml2_load.rs
+++ b/rsvg/src/xml/xml2_load.rs
@@ -473,8 +473,13 @@ impl<'a> Xml2Parser<'a> {
Err(LoadingError::from(io_error))
} else if !xml_parse_success {
let xerr = xmlCtxtGetLastError(parser as *mut _);
- let msg = xml2_error_to_string(xerr);
- Err(LoadingError::XmlParseError(msg))
+ if !xerr.is_null() && (*xerr).code == XML_ERR_USER_STOP {
+ // We stopped the parse ourselves
+ Ok(())
+ } else {
+ let msg = xml2_error_to_string(xerr);
+ Err(LoadingError::XmlParseError(msg))
+ }
} else {
Ok(())
}
+4 -2
View File
@@ -6,13 +6,15 @@
# This function is used for putting downloaded files to the correct location or applying patches # This function is used for putting downloaded files to the correct location or applying patches
prepare() { prepare() {
cd "$BPM_SOURCE" cd "$BPM_SOURCE"
patch -Np1 -i "$BPM_WORKDIR"/xml-treat-user-stop-errors-as-successful-parses.patch
cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')" cargo fetch --locked --target "$(rustc -vV | sed -n 's/host: //p')"
} }
# The build function is executed in the source directory # The build function is executed in the source directory
# This function is used to compile the source code # This function is used to compile the source code
build() { build() {
meson setup --prefix=/usr --buildtype=release build meson setup --prefix=/usr -Davif=enabled -Dpixbuf-loader=disabled build
meson compile -C build meson compile -C build
} }
@@ -25,7 +27,7 @@ check() {
# The package function is executed in the source directory # The package function is executed in the source directory
# This function is used to move the compiled files into the output directory # This function is used to move the compiled files into the output directory
package() { package() {
meson install -C build --destdir="$BPM_OUTPUT" meson install -C build --destdir="$BPM_OUTPUT" --no-rebuild
# Install package license # Install package license
install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/librsvg/COPYING.LIB install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/librsvg/COPYING.LIB