summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kanavin <alex.kanavin@gmail.com>2021-10-10 21:09:58 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-10-14 11:48:45 +0100
commit2ff9a053acf9fa9b507d3c80596d20a0f3d064cd (patch)
tree71e364807a442952dce1c6ec01f3d6c6a4c1896e
parent5efebf3be01e239f537eee9418a4414e0e4d9ab0 (diff)
downloadpoky-2ff9a053acf9fa9b507d3c80596d20a0f3d064cd.tar.gz
librsvg: update 2.40.21 -> 2.52.0 (transition to rust!)
After some poking and hacking I have arrived to the settings that work. Please refer to the commit for details. Some of these issues may re-occur in other components; in that case we need to come up with more generic solutions or upstream fixes. So far, it's a learning exercise for everybody in getting to know the rust toolchain. (From OE-Core rev: e060ee5ea96f3c3903b8aa018a5a3af3c60e5ab3) Signed-off-by: Alexander Kanavin <alex@linutronix.de> Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-gnome/librsvg/librsvg/0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch35
-rw-r--r--meta/recipes-gnome/librsvg/librsvg/0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch47
-rw-r--r--meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch30
-rw-r--r--meta/recipes-gnome/librsvg/librsvg/0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch53
-rw-r--r--meta/recipes-gnome/librsvg/librsvg/gtk-option.patch60
-rw-r--r--meta/recipes-gnome/librsvg/librsvg_2.52.0.bb (renamed from meta/recipes-gnome/librsvg/librsvg_2.40.21.bb)42
6 files changed, 130 insertions, 137 deletions
diff --git a/meta/recipes-gnome/librsvg/librsvg/0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch b/meta/recipes-gnome/librsvg/librsvg/0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch
deleted file mode 100644
index 954bb60880..0000000000
--- a/meta/recipes-gnome/librsvg/librsvg/0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch
+++ /dev/null
@@ -1,35 +0,0 @@
1From b99891e31eb6ce550e7e1cb2ca592095b3050a93 Mon Sep 17 00:00:00 2001
2From: Brion Vibber <brion@pobox.com>
3Date: Sun, 25 Feb 2018 18:42:36 -0800
4Subject: Auto-detect -Bsymbolic, fixes configure on macOS
5
6The -Bsymbolic linker option is ELF-specific, and was breaking
7configure on macOS unless --disable-Bsymbolic was explicitly passed.
8
9Switching the behavior from requiring -Bsymbolic to be available
10by default to just warning and continuing on without.
11
12Fixes https://gitlab.gnome.org/GNOME/librsvg/issues/211
13
14Upstream-Status: Backport
15Signed-off-by: Adrian Bunk <bunk@stusta.de>
16---
17 configure.ac | 2 +-
18 1 file changed, 1 insertion(+), 1 deletion(-)
19
20diff --git a/configure.ac b/configure.ac
21index 15b26b2d..9f8dce29 100644
22--- a/configure.ac
23+++ b/configure.ac
24@@ -216,7 +216,7 @@ AM_CONDITIONAL([ENABLE_PIXBUF_LOADER],[test "$enable_pixbuf_loader" = "yes"])
25 AC_ARG_ENABLE([Bsymbolic],
26 [AS_HELP_STRING([--disable-Bsymbolic],
27 [disable linking with -Bsymbolic])],
28- [],[enable_Bsymbolic=yes])
29+ [enable_Bsymbolic=no],[enable_Bsymbolic=auto])
30
31 BSYMBOLIC_LDFLAG=
32 if test "$enable_Bsymbolic" != "no"; then
33--
342.20.1
35
diff --git a/meta/recipes-gnome/librsvg/librsvg/0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch b/meta/recipes-gnome/librsvg/librsvg/0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch
new file mode 100644
index 0000000000..d7487c234c
--- /dev/null
+++ b/meta/recipes-gnome/librsvg/librsvg/0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch
@@ -0,0 +1,47 @@
1From 95b2cd0169cb1b4694c2bce67169b1aa1d5e2be0 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 21 Sep 2021 16:27:14 +0200
4Subject: [PATCH] Makefile.am: pass rust target to cargo also when not cross
5 compiling
6
7Otherwise oe-core's native build doesn't work either.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 Makefile.am | 2 --
13 configure.ac | 4 +---
14 2 files changed, 1 insertion(+), 5 deletions(-)
15
16diff --git a/Makefile.am b/Makefile.am
17index e93714e..effe5d3 100644
18--- a/Makefile.am
19+++ b/Makefile.am
20@@ -137,9 +137,7 @@ else
21 CARGO_RELEASE_ARGS=--release
22 endif
23
24-if CROSS_COMPILING
25 CARGO_TARGET_ARGS=--target=$(RUST_TARGET)
26-endif
27
28 CARGO_VERBOSE = $(cargo_verbose_$(V))
29 cargo_verbose_ = $(cargo_verbose_$(AM_DEFAULT_VERBOSITY))
30diff --git a/configure.ac b/configure.ac
31index 41590ca..84cd56b 100644
32--- a/configure.ac
33+++ b/configure.ac
34@@ -255,9 +255,7 @@ AC_ARG_VAR(RUST_TARGET, [Set rust target (default=$host)])
35 : ${RUST_TARGET:=$host}
36
37 AM_CONDITIONAL([CROSS_COMPILING], [test "x$cross_compiling" = xyes])
38-AS_IF([test "x$cross_compiling" = "xyes"], [
39- RUST_TARGET_SUBDIR="$RUST_TARGET/$RUST_TARGET_SUBDIR"
40-])
41+RUST_TARGET_SUBDIR="$RUST_TARGET/$RUST_TARGET_SUBDIR"
42 AC_SUBST([RUST_TARGET_SUBDIR])
43
44 dnl ===========================================================================
45--
462.20.1
47
diff --git a/meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch b/meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch
deleted file mode 100644
index 75fc7f9d0b..0000000000
--- a/meta/recipes-gnome/librsvg/librsvg/0001-Remove-non-reproducible-SRCDIR.patch
+++ /dev/null
@@ -1,30 +0,0 @@
1From bea5156cd7e7122715b26c769c35928141a1da2c Mon Sep 17 00:00:00 2001
2From: Joshua Watt <JPEWhacker@gmail.com>
3Date: Mon, 18 Nov 2019 14:46:34 -0600
4Subject: [PATCH] Remove non-reproducible SRCDIR
5
6Removes SRCDIR as the prefix for finding the test font. This wouldn't
7work anyway, since that path is not present on the target.
8
9This patch is specific to OE, since it appears that this entire method
10of testing was removed when upstream was re-written in rust
11
12Upstream-Status: Inappropriate [OE-specific, no longer present upstream]
13Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
14---
15 rsvg-cairo-draw.c | 2 +-
16 1 file changed, 1 insertion(+), 1 deletion(-)
17
18diff --git a/rsvg-cairo-draw.c b/rsvg-cairo-draw.c
19index caa9104..cfb7ed2 100644
20--- a/rsvg-cairo-draw.c
21+++ b/rsvg-cairo-draw.c
22@@ -398,7 +398,7 @@ set_font_options_for_testing (PangoContext *context)
23 static void
24 create_font_config_for_testing (RsvgCairoRender *render)
25 {
26- const char *font_path = SRCDIR "/tests/resources/LiberationSans-Regular.ttf";
27+ const char *font_path = "/tests/resources/LiberationSans-Regular.ttf";
28
29 if (render->font_config_for_testing != NULL)
30 return;
diff --git a/meta/recipes-gnome/librsvg/librsvg/0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch b/meta/recipes-gnome/librsvg/librsvg/0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch
new file mode 100644
index 0000000000..849dd98c5f
--- /dev/null
+++ b/meta/recipes-gnome/librsvg/librsvg/0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch
@@ -0,0 +1,53 @@
1From 6d1f0740b111e86e99dcaf0222f3d1d67d3bf1e6 Mon Sep 17 00:00:00 2001
2From: Alexander Kanavin <alex@linutronix.de>
3Date: Tue, 21 Sep 2021 16:54:23 +0200
4Subject: [PATCH] system-deps/src/lib.rs: do not probe into harcoded list of
5 targets
6
7Oe-core defines custom targets, and this probe fails.
8
9Upstream-Status: Inappropriate [oe-core specific]
10Signed-off-by: Alexander Kanavin <alex@linutronix.de>
11---
12 vendor/system-deps/.cargo-checksum.json | 2 +-
13 vendor/system-deps/src/lib.rs | 16 +---------------
14 2 files changed, 2 insertions(+), 16 deletions(-)
15
16diff --git a/vendor/system-deps/.cargo-checksum.json b/vendor/system-deps/.cargo-checksum.json
17index ecebb94..30d594e 100644
18--- a/vendor/system-deps/.cargo-checksum.json
19+++ b/vendor/system-deps/.cargo-checksum.json
20@@ -1 +1 @@
21-{"files":{"Cargo.toml":"56ab5070dc9019b039c5e9904bb466b0879c33a7f69dd030b97abab321b7cc04","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"3fe7396637bf9233908f41c6001cfcb00a379225e06e36e508c8b3d7264a8aae","src/lib.rs":"015518f4337d80249d12c7e6c55e9063705a0b8805ebf46a445c89253edc5de0","src/metadata.rs":"4c8d6ac2c88646a5b97ecb50ed44b65e5b2865cce6897add85b29ca2ae08c2bb","src/test.rs":"1ec48d1e443a0a4ac8035a2b60ff0321543aa2fa998fee72cf7762a936bf5f8c","src/tests/testanotherlib.pc":"bb4fd942324e6d49ce3becd827aa5c948d1924ca6681904a3695c19b1424eb3c","src/tests/testdata.pc":"43f481e989c03674fed5ef78c6420b3f8d36a2ce001928d86c418d1844acd5e7","src/tests/testlib-2.0.pc":"152eb0c70c14c3d948118408f3d1fd3bb7531b02aa792db85bd957f7db90b45b","src/tests/testlib-3.0.pc":"cd39c2ef88f6828c9291150cc4b624e769abef484674eaebaa4f67979501315f","src/tests/testlib.pc":"75c0d8a5345f65794f583c83e1cf0dbf3385af6e6abea1d61bb86eef707a52db","src/tests/toml-missing-file/no-cargo-toml-here":"6ab4da4b56f15315df6538610cfcd2ba3d0f9a7a8414678ff00ab5a78f7d41fa"},"package":"480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6"}
22\ No newline at end of file
23+{"files":{"Cargo.toml":"56ab5070dc9019b039c5e9904bb466b0879c33a7f69dd030b97abab321b7cc04","LICENSE-APACHE":"a60eea817514531668d7e00765731449fe14d059d3249e0bc93b36de45f759f2","LICENSE-MIT":"23f18e03dc49df91622fe2a76176497404e46ced8a715d9d2b67a7446571cca3","README.md":"3fe7396637bf9233908f41c6001cfcb00a379225e06e36e508c8b3d7264a8aae","src/lib.rs":"594e5f14180590adc9ea0a8ba1cc35f9a8a260322d08de3037efac3ce1dc729b","src/metadata.rs":"4c8d6ac2c88646a5b97ecb50ed44b65e5b2865cce6897add85b29ca2ae08c2bb","src/test.rs":"1ec48d1e443a0a4ac8035a2b60ff0321543aa2fa998fee72cf7762a936bf5f8c","src/tests/testanotherlib.pc":"bb4fd942324e6d49ce3becd827aa5c948d1924ca6681904a3695c19b1424eb3c","src/tests/testdata.pc":"43f481e989c03674fed5ef78c6420b3f8d36a2ce001928d86c418d1844acd5e7","src/tests/testlib-2.0.pc":"152eb0c70c14c3d948118408f3d1fd3bb7531b02aa792db85bd957f7db90b45b","src/tests/testlib-3.0.pc":"cd39c2ef88f6828c9291150cc4b624e769abef484674eaebaa4f67979501315f","src/tests/testlib.pc":"75c0d8a5345f65794f583c83e1cf0dbf3385af6e6abea1d61bb86eef707a52db","src/tests/toml-missing-file/no-cargo-toml-here":"6ab4da4b56f15315df6538610cfcd2ba3d0f9a7a8414678ff00ab5a78f7d41fa"},"package":"480c269f870722b3b08d2f13053ce0c2ab722839f472863c3e2d61ff3a1c2fa6"}
24diff --git a/vendor/system-deps/src/lib.rs b/vendor/system-deps/src/lib.rs
25index a0d4f00..a666817 100644
26--- a/vendor/system-deps/src/lib.rs
27+++ b/vendor/system-deps/src/lib.rs
28@@ -725,21 +725,7 @@ impl Config {
29 }
30
31 fn check_cfg(&self, cfg: &cfg_expr::Expression) -> Result<bool, Error> {
32- use cfg_expr::{targets::get_builtin_target_by_triple, Predicate};
33-
34- let target = self
35- .env
36- .get("TARGET")
37- .expect("no TARGET env variable defined");
38- let target = get_builtin_target_by_triple(&target)
39- .unwrap_or_else(|| panic!("Invalid TARGET: {}", target));
40-
41- let res = cfg.eval(|pred| match pred {
42- Predicate::Target(tp) => Some(tp.matches(target)),
43- _ => None,
44- });
45-
46- res.ok_or_else(|| Error::UnsupportedCfg(cfg.original().to_string()))
47+ Ok(true)
48 }
49 }
50
51--
522.20.1
53
diff --git a/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch b/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
deleted file mode 100644
index 6c23071cd3..0000000000
--- a/meta/recipes-gnome/librsvg/librsvg/gtk-option.patch
+++ /dev/null
@@ -1,60 +0,0 @@
1From 4e0ce3f22d45033a108cbacca3e5ec6728bd44f3 Mon Sep 17 00:00:00 2001
2From: Jussi Kukkonen <jussi.kukkonen@intel.com>
3Date: Tue, 11 Aug 2015 16:25:38 +0300
4Subject: [PATCH] configure: add option to enable/disable use of GTK+
5
6Distro packagers like predictability and automatically detected optional
7dependencies are not predicable. Add a --with-gtk3 option (default to "auto")
8for forcibly controlling whether GTK+ will be used or not.
9
10Upstream-Status: Submitted [https://bugzilla.gnome.org/show_bug.cgi?id=712693]
11
12Signed-off-by: Ross Burton <ross.burton@intel.com>
13Signed-off-by: Jussi Kukkonen <jussi.kukkonen@intel.com>
14---
15 configure.ac | 17 +++++++++++------
16 1 file changed, 11 insertions(+), 6 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index e61a952..c3aae84 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -130,17 +130,22 @@ AC_CHECK_FUNCS(strtok_r)
23 # GTK
24 # ===========================================================================
25
26-PKG_CHECK_MODULES([GTK3],[gtk+-3.0 >= $GTK3_REQUIRED],[have_gtk_3=yes],[have_gtk_3=no])
27-
28 GTK3_BINARY_VERSION=
29
30-if test "$have_gtk_3" = "yes"; then
31- GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
32+AC_MSG_CHECKING([whether to use GTK+ 3])
33+AC_ARG_WITH([gtk3],
34+ [AS_HELP_STRING([--without-gtk3],[Don't build GTK+3 tools (default=auto)])],
35+ [],[PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK3_REQUIRED],[with_gtk3=yes],[with_gtk3=no])])
36+AC_MSG_RESULT([$with_gtk3])
37+
38+if test "$with_gtk3" = "yes"; then
39+ PKG_CHECK_MODULES(GTK3, [gtk+-3.0 >= $GTK3_REQUIRED])
40+ GTK3_BINARY_VERSION="`$PKG_CONFIG --variable=gtk_binary_version gtk+-3.0`"
41 fi
42
43 AC_SUBST([GTK3_BINARY_VERSION])
44
45-AM_CONDITIONAL([HAVE_GTK_3],[test "$have_gtk_3" = "yes"])
46+AM_CONDITIONAL([HAVE_GTK_3],[test "$with_gtk3" = "yes"])
47
48 dnl ===========================================================================
49 dnl GDK-Pixbuf SVG loader
50@@ -298,6 +303,6 @@ librsvg-$VERSION
51 Build introspectable bindings: ${found_introspection}
52 Build Vala bindings: ${enable_vala}
53 Build GdkPixbuf loader: ${enable_pixbuf_loader}
54- GTK+ $GTK3_REQUIRED or later: ${have_gtk_3}
55+ GTK+ $GTK3_REQUIRED or later: ${with_gtk_3}
56 Build miscellaneous tools: ${build_misc_tools}
57 "
58--
592.1.4
60
diff --git a/meta/recipes-gnome/librsvg/librsvg_2.40.21.bb b/meta/recipes-gnome/librsvg/librsvg_2.52.0.bb
index 39b9aeca5d..4e3febc6a2 100644
--- a/meta/recipes-gnome/librsvg/librsvg_2.40.21.bb
+++ b/meta/recipes-gnome/librsvg/librsvg_2.52.0.bb
@@ -6,24 +6,44 @@ the screen or to generate output for printing."
6HOMEPAGE = "https://gitlab.gnome.org/GNOME/librsvg" 6HOMEPAGE = "https://gitlab.gnome.org/GNOME/librsvg"
7BUGTRACKER = "https://gitlab.gnome.org/GNOME/librsvg/issues" 7BUGTRACKER = "https://gitlab.gnome.org/GNOME/librsvg/issues"
8 8
9RECIPE_NO_UPDATE_REASON = "Versions from 2.41.0 requires Rust compiler to build it" 9LICENSE = "LGPLv2.1+"
10 10LIC_FILES_CHKSUM = "file://COPYING.LIB;md5=4fbd65380cdd255951079008b364516c \
11LICENSE = "LGPLv2+" 11 "
12LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f \
13 file://rsvg.h;beginline=3;endline=24;md5=20b4113c4909bbf0d67e006778302bc6"
14 12
15SECTION = "x11/utils" 13SECTION = "x11/utils"
16DEPENDS = "cairo gdk-pixbuf glib-2.0 libcroco libxml2 pango" 14DEPENDS = "cairo gdk-pixbuf glib-2.0 libcroco libxml2 pango"
17BBCLASSEXTEND = "native nativesdk" 15BBCLASSEXTEND = "native nativesdk"
18 16
19inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection 17inherit gnomebase gtk-doc pixbufcache upstream-version-is-even gobject-introspection rust
20 18
21SRC_URI += "file://gtk-option.patch \ 19SRC_URI += " file://0001-Makefile.am-pass-rust-target-to-cargo-also-when-not-.patch \
22 file://0001-Auto-detect-Bsymbolic-fixes-configure-on-macOS.patch \ 20 file://0001-system-deps-src-lib.rs-do-not-probe-into-harcoded-li.patch \
23 file://0001-Remove-non-reproducible-SRCDIR.patch \
24" 21"
25 22
26SRC_URI[archive.sha256sum] = "f7628905f1cada84e87e2b14883ed57d8094dca3281d5bcb24ece4279e9a92ba" 23SRC_URI[archive.sha256sum] = "bd821fb3e16494b61f5185addd23b726b064f203122b3ab4b3d5d7a44e6bf393"
24
25# librsvg is still autotools-based, but is calling cargo from its automake-driven makefiles
26# so we cannot use cargo class directly, but still need bits and pieces from it
27# for cargo to be happy
28BASEDEPENDS:append = " cargo-native"
29
30export RUST_BACKTRACE = "full"
31export RUSTFLAGS
32export RUST_TARGET_PATH
33
34export RUST_TARGET = "${HOST_SYS}"
35
36# rust-cross writes the target linker binary into target json definition without any flags.
37# This breaks here because the linker isn't going to work without at least knowing where
38# the sysroot is. So copy the json to workdir, and patch in the path to wrapper from rust class
39# which supplies the needed flags.
40do_compile:prepend() {
41 cp ${STAGING_LIBDIR_NATIVE}/rustlib/${HOST_SYS}.json ${WORKDIR}
42 cp ${STAGING_LIBDIR_NATIVE}/rustlib/${BUILD_SYS}.json ${WORKDIR}
43 sed -ie 's,"linker": ".*","linker": "${RUST_TARGET_CC}",g' ${WORKDIR}/${HOST_SYS}.json
44 RUST_TARGET_PATH="${WORKDIR}"
45 export RUST_TARGET_PATH
46}
27 47
28# Issue only on windows 48# Issue only on windows
29CVE_CHECK_WHITELIST += "CVE-2018-1000041" 49CVE_CHECK_WHITELIST += "CVE-2018-1000041"
@@ -33,8 +53,6 @@ CACHED_CONFIGUREVARS = "ac_cv_path_GDK_PIXBUF_QUERYLOADERS=${STAGING_LIBDIR_NATI
33PACKAGECONFIG ??= "gdkpixbuf" 53PACKAGECONFIG ??= "gdkpixbuf"
34# The gdk-pixbuf loader 54# The gdk-pixbuf loader
35PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader,gdk-pixbuf-native" 55PACKAGECONFIG[gdkpixbuf] = "--enable-pixbuf-loader,--disable-pixbuf-loader,gdk-pixbuf-native"
36# GTK+ test application (rsvg-view)
37PACKAGECONFIG[gtk] = "--with-gtk3,--without-gtk3,gtk+3"
38 56
39do_install:append() { 57do_install:append() {
40 # Loadable modules don't need .a or .la on Linux 58 # Loadable modules don't need .a or .la on Linux