12to11-rpm/README.md

207 lines
7.8 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# 12to11 for Fedora and Enterprise Linux
This repository contains the RPM packaging for [12to11](https://github.com/fish4terrisa-MSDSM/12to11), a Wayland-to-X11 protocol translator. Packages are built in the [andersrh/12to11 COPR project](https://copr.fedorainfracloud.org/coprs/andersrh/12to11/). The repository also builds `12to11-autostart`, a small companion package that launches 12to11 automatically when an X11 session begins.
## What is 12to11?
12to11 is a small Wayland compositor that runs as a regular X11 client. It creates a Wayland socket and displays Wayland applications as normal X11 windows. This makes it possible to run Wayland-only applications, such as [Waydroid](https://waydro.id/), from an X11 session without running Weston as a nested compositor.
The package is built with EGL/OpenGL ES 2.0 rendering enabled. 12to11 also implements the Wayland data-device and X11 selection handling needed for clipboard integration between Wayland applications and the X11 desktop.
This package tracks the actively developed [fish4terrisa-MSDSM fork](https://github.com/fish4terrisa-MSDSM/12to11) and is licensed under GPL-3.0-only.
## Example: Waydroid running through 12to11
The following screenshot shows Waydroid running as a Wayland application through 12to11 on an X11 desktop:
![Waydroid running through 12to11](screenshots/waydroid%20on%2012to11.png)
## Supported targets
The COPR project currently provides builds for:
- Fedora 43, Fedora 44, Fedora 45, and Fedora Rawhide
- EPEL 10
- AlmaLinux 10 with EPEL (x86_64-v2)
The COPR builds are unofficial and are provided as-is.
## Installation from COPR
The `dnf copr` command is provided by `dnf-plugins-core`. Install it first if it is not already available.
### Fedora
```bash
sudo dnf install dnf-plugins-core
sudo dnf copr enable andersrh/12to11
sudo dnf install 12to11
```
### AlmaLinux, RHEL-compatible distributions, and EPEL
The EL builds use `libXpresent` from the [xlibre/xlibre-xserver COPR](https://copr.fedorainfracloud.org/coprs/g/xlibre/xlibre-xserver/), because `libXpresent` is not available in the standard EL repositories.
On AlmaLinux, install and enable EPEL if necessary, then enable both COPR repositories:
```bash
sudo dnf install epel-release dnf-plugins-core
sudo dnf copr enable @xlibre/xlibre-xserver
sudo dnf copr enable andersrh/12to11
sudo dnf install 12to11
```
On RHEL-compatible distributions where `epel-release` is not available directly, enable EPEL using the distribution's documented procedure before installing 12to11.
## Starting 12to11 automatically
The optional `12to11-autostart` package installs `/etc/xdg/autostart/12to11.desktop`, so desktop environments that follow the XDG autostart specification launch 12to11 at the start of each X11 session:
```bash
sudo dnf install 12to11-autostart
```
The entry uses `NoDisplay=true`, so it does not appear in application menus. To disable it for a single user, copy the file to `~/.config/autostart/` and add `Hidden=true`.
When 12to11 is started this way it listens on the first free Wayland socket, normally `wayland-0`.
## Running 12to11 with Waydroid
Start 12to11 in an X11 session. If `12to11-autostart` is installed, 12to11 is already running when the session starts and this step can be skipped. The `-printsocket` option prints the Wayland socket name while the compositor continues running:
```bash
RENDERER=egl 12to11 -printsocket
```
For example, it may print:
```text
wayland-0
```
Keep that process running. In another terminal, use the socket name printed by 12to11:
```bash
export WAYLAND_DISPLAY=wayland-0
waydroid show-full-ui
```
If 12to11 prints a different socket name, use that name instead. Do not assume that the socket is always `wayland-0`.
If the Waydroid session is not already running, start it before showing the UI:
```bash
waydroid session start
```
The exact Waydroid setup still depends on the Android image, kernel support, graphics driver, and whether Google Apps are installed.
### Fixing a very small Waydroid window
If Waydroid appears as a very small window in the lower-left corner, set its display dimensions while the Waydroid session is running. The following example uses a 1920×1080 display; replace these values with your own screen resolution. When choosing the dimensions, account for desktop panels, taskbars, or docks that occupy part of the screen; subtract their height or width where appropriate:
```bash
waydroid prop set persist.waydroid.height 1080
waydroid prop set persist.waydroid.width 1920
```
Restart the Waydroid session and container so the new dimensions take effect:
```bash
waydroid session stop
sudo waydroid container stop
waydroid show-full-ui
```
If you are running 12to11 on a non-default Wayland socket, export the socket name before starting the UI as described above.
## Building the RPM locally
The spec file builds the upstream GitHub release tarball using the project's Makefile, with EGL support enabled (the upstream default).
### 1. Install packaging tools
Fedora:
```bash
sudo dnf install rpm-build rpmdevtools dnf-plugins-core
```
AlmaLinux, RHEL-compatible distributions, and EPEL:
```bash
sudo dnf install epel-release rpm-build rpmdevtools dnf-plugins-core
sudo dnf copr enable @xlibre/xlibre-xserver
```
### 2. Install the build dependencies
Run this from the repository checkout:
```bash
sudo dnf builddep 12to11.spec
```
On EL systems, the xlibre COPR must be enabled first so that `libXpresent-devel` can be resolved.
### 3. Build the package
```bash
rpmdev-setuptree
cp 12to11.spec ~/rpmbuild/SPECS/
spectool -g --directory ~/rpmbuild/SOURCES ~/rpmbuild/SPECS/12to11.spec
rpmbuild -ba ~/rpmbuild/SPECS/12to11.spec
```
`12to11-autostart` needs no downloaded source — its `Source0` is the `12to11.desktop` file in this repository:
```bash
cp 12to11-autostart.spec ~/rpmbuild/SPECS/
cp 12to11.desktop ~/rpmbuild/SOURCES/
rpmbuild -ba ~/rpmbuild/SPECS/12to11-autostart.spec
```
The resulting files are written to:
```text
~/rpmbuild/RPMS/$(uname -m)/
~/rpmbuild/SRPMS/
```
Install the locally built package with:
```bash
sudo dnf install ~/rpmbuild/RPMS/$(uname -m)/12to11-*.rpm
```
`12to11-autostart` is a `noarch` package, so it is written to `~/rpmbuild/RPMS/noarch/` instead:
```bash
sudo dnf install ~/rpmbuild/RPMS/noarch/12to11-autostart-*.rpm
```
### Building in COPR
COPR reads `12to11.spec`, downloads the source archive specified by `Source0`, installs the `BuildRequires`, and builds the package in a clean chroot for each enabled target. The EL builds also have the xlibre/xlibre-xserver COPR configured as an external repository so that `libXpresent-devel` is available during the build.
`12to11-autostart` is built from `12to11-autostart.spec` in the same way. Its `Source0` is the `12to11.desktop` file in this repository rather than a remote archive, so the file must be available alongside the spec file (for example, committed to the same COPR source repository).
To update to a new upstream release, change `Version` in `12to11.spec`, update the changelog, and submit the changed spec file to the COPR project.
## Known limitations
12to11 is not a complete Wayland compositor. According to the upstream project:
- Touchscreen support is not implemented.
- Device switching in DMA-BUF feedback is not implemented.
- It requires X.Org Server 1.20 or later.
- It works best with a compositing window manager that supports the EWMH frame-synchronization protocol.
- Upstream testing has primarily been done with GNOME Shell; other window managers may have compatibility issues.
For Waydroid controlled with a mouse on an X11 desktop, the missing touchscreen support is usually not a problem.
## Links
- [12to11 upstream project](https://github.com/fish4terrisa-MSDSM/12to11)
- [12to11 COPR repository](https://copr.fedorainfracloud.org/coprs/andersrh/12to11/)
- [COPR xlibre/xlibre-xserver repository](https://copr.fedorainfracloud.org/coprs/g/xlibre/xlibre-xserver/)