From ac8e6873b0493adee9d1b135cb04be2fc782a35d Mon Sep 17 00:00:00 2001 From: EnumDev Date: Tue, 28 Oct 2025 12:07:26 +0200 Subject: [PATCH] Rebuild with automatic stripping and fix tests --- pkg.info | 2 +- ...ser-stop-errors-as-successful-parses.patch | 45 +++++++++++++++++++ source.sh | 6 ++- 3 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 source-files/xml-treat-user-stop-errors-as-successful-parses.patch diff --git a/pkg.info b/pkg.info index 83fce29..e8dbeb2 100644 --- a/pkg.info +++ b/pkg.info @@ -1,7 +1,7 @@ name: librsvg description: SVG rendering library version: 2.61.2 -revision: 1 +revision: 2 url: https://wiki.gnome.org/Projects/LibRsvg license: LGPL2.1-or-later architecture: any diff --git a/source-files/xml-treat-user-stop-errors-as-successful-parses.patch b/source-files/xml-treat-user-stop-errors-as-successful-parses.patch new file mode 100644 index 0000000..8a629f2 --- /dev/null +++ b/source-files/xml-treat-user-stop-errors-as-successful-parses.patch @@ -0,0 +1,45 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: "Jan Alexander Steffens (heftig)" +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(()) + } diff --git a/source.sh b/source.sh index 9a8e63b..36c46f3 100644 --- a/source.sh +++ b/source.sh @@ -6,13 +6,15 @@ # This function is used for putting downloaded files to the correct location or applying patches prepare() { 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')" } # The build function is executed in the source directory # This function is used to compile the source code build() { - meson setup --prefix=/usr --buildtype=release build + meson setup --prefix=/usr -Davif=enabled -Dpixbuf-loader=disabled build meson compile -C build } @@ -25,7 +27,7 @@ check() { # The package function is executed in the source directory # This function is used to move the compiled files into the output directory package() { - meson install -C build --destdir="$BPM_OUTPUT" + meson install -C build --destdir="$BPM_OUTPUT" --no-rebuild # Install package license install -Dm644 "$BPM_SOURCE"/COPYING.LIB "$BPM_OUTPUT"/usr/share/licenses/librsvg/COPYING.LIB