Skip to contentSkip to conversation

rxvt-unicode: change virtual/x-terminal-emulator PROVIDES to RPROVIDES

PATCH New Ross Burton 1 participant 8 messages Nov 13, 2024

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/8 rxvt-unicode: change virtual/x-terminal-emulator PROVIDES to RPROVIDES

The point of the virtual-x-terminal-emulator alternative was to provide a single binary that executes whatever terminal has been installed. This is a runtime choice, so should be RPROVIDES.

This doesn't need built-time PROVIDES, which actively get in the way when multiple recipes are being built with the same PROVIDES.

---
 meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc +1 -1
index 5193eebb0bc..2ee3edefa76 100644
@@ -15,7 +15,7 @@ SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2
 
 inherit autotools pkgconfig update-alternatives
 
-PROVIDES = "virtual/x-terminal-emulator"
+RPROVIDES:${PN} = "virtual-x-terminal-emulator"
 ALTERNATIVE:${PN} = "x-terminal-emulator"
 ALTERNATIVE_TARGET[x-terminal-emulator] = "${bindir}/rxvt"
 
Signature · 1 line
2.34.1
#1 lore raw

PATCH v2 2/8 rxvt-unicode: add x11 DISTRO_FEATURE check

rxvt is a classic X11 application, so add the feature check so it doesn't get pulled into world builds without x11.

---
 meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
meta/recipes-sato/rxvt-unicode/rxvt-unicode.inc +3 -1
index 2ee3edefa76..8cd41f33923 100644
@@ -13,7 +13,9 @@ SRC_URI = "http://dist.schmorp.de/rxvt-unicode/Attic/rxvt-unicode-${PV}.tar.bz2
 	   file://rxvt.desktop \
 	   file://rxvt.png"
 
-inherit autotools pkgconfig update-alternatives
+inherit autotools features_check pkgconfig update-alternatives
+
+REQUIRED_DISTRO_FEATURES = "x11"
 
 RPROVIDES:${PN} = "virtual-x-terminal-emulator"
 ALTERNATIVE:${PN} = "x-terminal-emulator"
Signature · 1 line
2.34.1
#2 lore raw

PATCH v2 3/8 matchbox-terminal: add x-terminal-emulator RPROVIDES and alternative

In reply to Ross Burton

Add a RPROVIDES for virtual-x-terminal-emulator, so that:
- Packages can RDEPEND on virtual-x-terminal-emulator and know that they have installed a terminal
- The x-terminal-emulator binary will (via alternatives) run a terminal

We don't bother with PROVIDES because nobody needs to DEPEND on a terminal, the entire point of this is that the actual binary is interchangable.

---
 .../matchbox-terminal/matchbox-terminal_0.2.bb             | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
meta/recipes-sato/matchbox-terminal/matchbox-terminal_0.2.bb +6 -1
index f91c593f784..c9b01b3cfd9 100644
@@ -16,6 +16,11 @@ PV = "0.2+git"
 
 S = "${WORKDIR}/git"
 
-inherit autotools pkgconfig features_check
+inherit autotools pkgconfig features_check update-alternatives
 
 ANY_OF_DISTRO_FEATURES = "${GTK3DISTROFEATURES}"
+
+RPROVIDES:${PN} = "virtual-x-terminal-emulator"
+ALTERNATIVE:${PN} = "x-terminal-emulator"
+ALTERNATIVE_TARGET[x-terminal-emulator] = "${bindir}/matchbox-terminal"
+ALTERNATIVE_PRIORITY[x-terminal-emulator] = "20"
Signature · 1 line
2.34.1
#3 lore raw

PATCH v2 4/8 default-providers.conf: add virtual-x-terminal-emulator

In reply to Ross Burton

We have multiple recipes in core that RPROVIDE virtual-x-terminal-emulator, so we should pick one to be the default for deterministic builds.

Pick rxvt, as it's the lightest. Sato can depend on matchbox-terminal explicitly and rxvt will not be added.

---
 meta/conf/distro/include/default-providers.inc | 2 ++
 1 file changed, 2 insertions(+)
meta/conf/distro/include/default-providers.inc +2 -0
index d18173c7449..b32c4e0d254 100644
@@ -59,3 +59,5 @@ PREFERRED_PROVIDER_pkgconfig-native ?= "pkgconfig-native"
 PREFERRED_RPROVIDER_initd-functions ?= "initscripts"
 
 PREFERRED_PROVIDER_nativesdk-mesa ?= "nativesdk-mesa"
+
+PREFERRED_RPROVIDER_virtual-x-terminal-emulator ?= "rxvt-unicode"
Signature · 1 line
2.34.1
#4 lore raw

PATCH v2 5/8 packagegroup-core-x11-base: use virtual-x-terminal-emulator

In reply to Ross Burton

Instead of depending on matchbox-terminal explicitly, just depend on the virtual name.

core-image-x11 then uses rxvt instead of matchbox-terminal, as that is the default, removing the entire GTK+ stack from the image.

core-image-sato and friends are unchanged as the sato packagegroup pulls in matchbox-terminal explicitly, so rxvt isn't needed.

---
 .../packagegroups/packagegroup-core-x11-base.bb                 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/packagegroups/packagegroup-core-x11-base.bb +1 -1
index db6242af335..d82d318368e 100644
@@ -8,8 +8,8 @@ REQUIRED_DISTRO_FEATURES = "x11"
 RDEPENDS:${PN} = "\
     packagegroup-core-x11-xserver \
     packagegroup-core-x11-utils \
-    matchbox-terminal \
     matchbox-wm \
     mini-x-session \
+    virtual-x-terminal-emulator \
     liberation-fonts \
     "
Signature · 1 line
2.34.1
#5 lore raw

PATCH v2 6/8 xinit: use x-terminal-emulator as the fallback terminal

In reply to Ross Burton

Instead of using rxvt as the fallback terminal use x-terminal-emulator.

Also add a recommends on something providing that name, as previously it tried to use rxvt but that wasn't necessarily present.

---
 meta/recipes-graphics/xorg-app/xinit_1.4.2.bb | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
meta/recipes-graphics/xorg-app/xinit_1.4.2.bb +3 -4
index 82c0b0d8335..8a8367c6888 100644
@@ -18,9 +18,8 @@ SRC_URI_EXT = "xz"
 
 SRC_URI[sha256sum] = "b7d8dc8d22ef9f15985a10b606ee4f2aad6828befa437359934647e88d331f23"
 
-EXTRA_OECONF = "ac_cv_path_MCOOKIE=${bindir}/mcookie"
-
-PACKAGECONFIG ??= "rxvt"
-PACKAGECONFIG[rxvt] = "--with-xterm=rxvt,,,rxvt-unicode"
+EXTRA_OECONF = "ac_cv_path_MCOOKIE=${bindir}/mcookie \
+                --with-xterm=x-terminal-emulator"
 
 RDEPENDS:${PN} += "util-linux-mcookie"
+RRECOMMENDS:${PN} += "virtual-x-terminal-emulator"
Signature · 1 line
2.34.1
#6 lore raw

PATCH v2 7/8 builder: use x-terminal-emulator

In reply to Ross Burton

Don't hardcode matchbox-terminal, but use the alternative.

---
 meta/recipes-graphics/builder/files/builder_session.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-graphics/builder/files/builder_session.sh +1 -1
index 4e509a701ac..a59c5ce84b6 100644
@@ -30,4 +30,4 @@ fi
 cd /home/builder/poky
 . ./oe-init-build-env
 
-matchbox-terminal&
+x-terminal-emulator &
Signature · 1 line
2.34.1
#7 lore raw

PATCH v2 8/8 mini-x-session: use x-terminal-emulator

In reply to Ross Burton

Don't hardcode matchbox-terminal, but use the alternative.

---
 meta/recipes-graphics/mini-x-session/files/mini-x-session | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
meta/recipes-graphics/mini-x-session/files/mini-x-session +2 -1
index dca655a9139..181e995337b 100644
@@ -35,5 +35,6 @@ xrandr -s 1024x768
 # Default files to run if $HOME/.mini_x/session or /etc/mini_x/session
 # dont exist. 
 
-matchbox-terminal&
+x-terminal-emulator &
+
 exec matchbox-window-manager
Signature · 1 line
2.34.1