Compare commits

...
Sign in to create a new pull request.

1 commit

Author SHA1 Message Date
Dominique Martinet
2130fc4351 WIP: Update to 0.10.4, switch to rust 2025-08-15 22:35:15 +09:00
5 changed files with 278 additions and 172 deletions

1
.gitignore vendored
View file

@ -8,3 +8,4 @@
/waypipe-v0.8.6.tar.gz
/waypipe-v0.9.0.tar.gz
/waypipe-v0.9.1.tar.gz
/waypipe-v0.10.4.tar.gz

18
license.patch Normal file
View file

@ -0,0 +1,18 @@
From 2c16f24a53f79b010a677288d0c91ea4a8683a4a Mon Sep 17 00:00:00 2001
From: Dominique Martinet <asmadeus@codewreck.org>
Date: Fri, 15 Aug 2025 21:05:34 +0900
Subject: [PATCH] license
diff --git a/Cargo.toml b/Cargo.toml
index 8674dfab1f62..5d627e37ae23 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -6,6 +6,7 @@ version = "0.10.4"
edition = "2021"
rust-version = "1.77.0"
default-run = "waypipe"
+license = "GPLv3-or-later"
[[bin]]
name = "waypipe"

View file

@ -1 +1 @@
SHA512 (waypipe-v0.9.1.tar.gz) = aa9f43f12ce8ae9107c8bb9967d6b4cef1540bacdac13604624272e5257d8892df2690809f4a5b03f051536960da29ffff7cfd1f7ac6eb1aeef4b437fa277ef1
SHA512 (waypipe-v0.10.4.tar.gz) = 85fcbed39f64ae3c814416b50eb75bcacad74201b82a632631c6078e31335557145e60183c1046d2064ae558a5384544c92e8bfcc13be43eb7772ec02c123582

320
waypipe.1
View file

@ -1,99 +1,93 @@
.\" Generated by scdoc 1.11.2
.\" Generated by scdoc 1.11.3
.\" Complete documentation for this program is not available as a GNU info page
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.nh
.ad l
.\" Begin generated content:
.TH "waypipe" "1" "2022-11-02"
.P
.TH "waypipe" "1" "2025-08-15"
.PP
.SH NAME
.P
.PP
waypipe - A transparent proxy for Wayland applications
.P
.PP
.SH SYNOPSIS
.P
.PP
\fBwaypipe\fR [options.\&.\&.\&] \fBssh\fR [ssh options] \fIdestination\fR \fIcommand.\&.\&.\&\fR
.P
.PP
\fBwaypipe\fR [options.\&.\&.\&] \fBclient\fR
.br
\fBwaypipe\fR [options.\&.\&.\&] \fBserver\fR -- \fIcommand.\&.\&.\&\fR
.br
\fBwaypipe\fR \fBrecon\fR \fIcontrol_pipe\fR \fInew_socket_path\fR
.br
\fBwaypipe\fR \fBbench\fR \fIbandwidth\fR
\fBwaypipe\fR \fBbench\fR
.br
\fBwaypipe\fR [\fB--version\fR] [\fB-h\fR, \fB--help\fR]
.P
[options.\&.\&.\&] = [\fB-c\fR, \fB--compress\fR C] [\fB-d\fR, \fB--debug\fR] [\fB-n\fR, \fB--no-gpu\fR] [\fB-o\fR, \fB--oneshot\fR] [\fB-s\fR, \fB--socket\fR S] [\fB--allow-tiled\fR] [\fB--control\fR C] [\fB--display\fR D] [\fB--drm-node\fR R] [\fB--remote-node\fR R] [\fB--remote-bin\fR R] [\fB--login-shell\fR] [\fB--threads\fR T] [\fB--unlink-socket\fR] [\fB--video\fR[=V]]
.P
.P
.PP
[options.\&.\&.\&] = [\fB-c\fR, \fB--compress\fR C] [\fB-d\fR, \fB--debug\fR] [\fB-n\fR, \fB--no-gpu\fR] [\fB-o\fR, \fB--oneshot\fR] [\fB-s\fR, \fB--socket\fR S] [\fB--display\fR D] [\fB--drm-node\fR R] [\fB--remote-node\fR R] [\fB--remote-bin\fR R] [\fB--login-shell\fR] [\fB--threads\fR T] [\fB--title-prefix\fR P] [\fB--unlink-socket\fR] [\fB--video\fR V] [\fB--vsock\fR] [\fB--secctx S\fR]
.PP
.PP
.SH DESCRIPTION
.P
.PP
Waypipe is a proxy for Wayland clients, with the aim of supporting behavior
like \fBssh -X\fR.\&
.P
.PP
Prefixing an \fBssh .\&.\&.\&\fR command to become \fBwaypipe ssh .\&.\&.\&\fR will automatically
run \fBwaypipe\fR both locally and remotely, and modify the ssh command to set up
forwarding between the two instances of \fBwaypipe\fR.\& The remote instance
will act like a Wayland compositor, letting Wayland applications that are
run remotely be displayed locally.\&
.P
.PP
When run as \fBwaypipe client\fR, it will open a socket (by default at
\fI/tmp/waypipe-client.\&sock\fR) and will connect to the local Wayland compositor
and forward all Wayland applications which were linked to it over the socket
by a matching \fBwaypipe server\fR instance.\&
.P
.PP
When run as \fBwaypipe server\fR, it will run the command that follows in its
command line invocation, set up its own Wayland compositor socket, and
try to connect to its matching \fBwaypipe client\fR socket (by default
\fI/tmp/waypipe-server.\&sock\fR) and try to forward all the Wayland clients
that connect to fake compositor socket to the matching \fBwaypipe client\fR.\&
.P
The \fBwaypipe recon\fR mode is used to reconnect a \fBwaypipe server\fR instance
which has had a control pipe (option \fB--control\fR) set.\& The new socket path
should indicate a Unix socket whose connections are forwarded to the \fBwaypipe
client\fR that the \fBwaypipe server\fR was initially connected to.\&
.P
The \fBwaypipe bench\fR mode can be used to estimate, given a specific
connection \fIbandwidth\fR in MB/sec, which compression options produce the
lowest latency.\& It tests two synthetic images, one made to be roughly as
.PP
The \fBwaypipe bench\fR mode can be used to estimate which compression options
produce the lowest latency, for a given connection bandwidth and number of
threads.\& It tests two synthetic images, one made to be roughly as
compressible as images containing text, and one made to be roughly as
compressible as images containing pictures.\&
.P
.PP
.SH OPTIONS
.P
.PP
\fB-c C, --compress C\fR
.RS 4
Select the compression method applied to data transfers.\& Options are
\fInone\fR (for high-bandwidth networks), \fIlz4\fR (intermediate), \fIzstd\fR
(slow connection).\& The default compression is \fInone\fR.\&† The compression
(slow connection).\& The default compression is \fIlz4\fR.\&† The compression
level can be chosen by appending = followed by a number.\& For example,
if \fBC\fR is \fIzstd=7\fR, waypipe will use level 7 Zstd compression.\&
.P
† In a future version, the default will change to \fIlz4\fR.\&
.P
.PP
† Unless \fBwaypipe\fR is built without LZ4 support, in which case the default
compression will be \fInone\fR.\&
.PP
.RE
\fB-d, --debug\fR
.RS 4
Print debug log messages.\&
.P
.PP
.RE
\fB-h, --help\fR
.RS 4
Show help message and quit.\&
.P
.PP
.RE
\fB-n, --no-gpu\fR
.RS 4
Block protocols like wayland-drm and linux-dmabuf which require access
to e.\&g.\& render nodes.\&
.P
.PP
.RE
\fB-o, --oneshot\fR
.RS 4
Only permit a single connection, and exit when it is closed.\&
.P
.PP
.RE
\fB-s S, --socket S\fR
.RS 4
@ -102,34 +96,16 @@ server mode is \fI/tmp/waypipe-server.\&sock\fR; for client mode, it is
\fI/tmp/waypipe-client.\&sock\fR; and in ssh mode, \fBS\fR gives the prefix used by
both the client and the server for their socket paths.\& The default prefix
in ssh mode is \fI/tmp/waypipe\fR.\&
.P
.PP
When vsock is enabled use \fBS\fR to specify a CID and a port number.\&
.PP
.RE
\fB--version\fR
.RS 4
Briefly describe Waypipe'\&s version and the features it was built with,
then quit.\& Possible features: LZ4 compression support, ZSTD compression
support, ability to transfer DMABUFs, video compression support, VAAPI
hardware video de/encoding support.\&
.P
.RE
\fB--allow-tiled\fR
.RS 4
By default, waypipe filters out all advertised DMABUF formats which have
format layout modifiers, as CPU access to these formats may be very slow.\&
Setting this flag disables the filtering.\& Since tiled images often permit
faster GPU operations, most OpenGL applications will select tiling modifiers
when they are available.\&
.P
.RE
\fB--control C\fR
.RS 4
For server or ssh mode, provide the path to the "control pipe" that will
be created the the server.\& Writing (with \fBwaypipe recon C T\fR, or
\&'\&echo -n T > C'\&) a new socket path to this pipe will make the server
instance replace all running connections with connections to the new
Unix socket.\& The new socket should ultimately forward data to the same
waypipe client that the server was connected to before.\&
.P
support, ability to transfer DMABUFs, video compression support.\&
.PP
.RE
\fB--display D\fR
.RS 4
@ -137,31 +113,31 @@ For server or ssh mode, provide \fIWAYLAND_DISPLAY\fR and let waypipe configure
its Wayland display socket to have a matching path.\& (If \fBD\fR is not an
absolute path, the socket will be created in the folder given by the
environment variable \fIXDG_RUNTIME_DIR\fR.\&)
.P
.PP
.RE
\fB--drm-node R\fR
.RS 4
Specify the path \fBR\fR to the drm device that this instance of waypipe should
use and (in server mode) notify connecting applications about.\&
.P
.PP
.RE
\fB--remote-node R\fR
.RS 4
In ssh mode, specify the path \fBR\fR to the drm device that the remote instance
of waypipe (running in server mode) should use.\&
.P
.PP
.RE
\fB--remote-bin R\fR
.RS 4
In ssh mode, specify the path \fBR\fR to the waypipe binary on the remote
computer, or its name if it is available in \fIPATH\fR.\& It defaults to
\fBwaypipe\fR if this option isnt passed.\&
.P
.PP
.RE
\fB--login-shell\fR
.RS 4
Only for server mode; if no command is being run, open a login shell.\&
.P
.PP
.RE
\fB--threads T\fR
.RS 4
@ -171,68 +147,100 @@ operations.\& This flag is passed on to \fBwaypipe server\fR when given to \fBwa
ssh\fR.\& The flag also controls the thread count for \fBwaypipe bench\fR.\& The default
behavior (choosable by setting \fBT\fR to \fI0\fR) is to use half as many threads
as the computer has hardware threads available.\&
.P
.PP
.RE
\fB--title-prefix P\fR
.RS 4
Prepend \fBP\fR to any window titles specified using the XDG shell protocol.\& In
ssh mode, the prefix is applied only on the client side.\&
.PP
.RE
\fB--unlink-socket\fR
.RS 4
Only for server mode; on shutdown, unlink the Unix socket that waypipe connects to.\&
.P
.PP
.RE
\fB--video[=V]\fR
\fB--video V\fR
.RS 4
Compress specific DMABUF formats using a lossy video codec.\& Opaque, 10-bit, and
multiplanar formats, among others, are not supported.\& \fBV\fR is a comma separated
list of options to control the video encoding.\& Using the \fB--video\fR flag without
setting any options is equivalent to using the default setting of:
\fB--video=sw,bpf=120000,h264\fR.\& Later options supersede earlier ones.\&
.P
\fBsw\fR
list of options to control the video encoding.\& (For example: \fB--video av1,hw\fR.\&)
Later options supersede earlier ones.\&
.PP
\fBnone\fR
.RS 4
Use software encoding and decoding.\&
.P
.RE
\fBhw\fR
.RS 4
Use hardware (VAAPI) encoding and decoding, if available.\& This can be finicky
and may only work with specific window buffer formats and sizes.\&
.P
Do not use video encoding.\&
.PP
.RE
\fBh264\fR
.RS 4
Use H.\&264 encoded video.\&
.P
.PP
.RE
\fBvp9\fR
.RS 4
Use VP9 encoded video.\&
.P
.PP
.RE
\fBav1\fR
.RS 4
Use VP9 encoded video.\&
.PP
.RE
\fBsw\fR, \fBswenc\fR, \fBswdec\fR
.RS 4
Use software encoding or decoding, when available.\&
.PP
.RE
\fBhw\fR, \fBhwenc\fR, \fBhwdec\fR
.RS 4
Use hardware encoding or decoding, when available.\&
.PP
.RE
\fBbpf=B\fR
.RS 4
Set the target bit rate of the video encoder, in units of bits per frame.\&
\fBB\fR can be written as an integer or with exponential notation; thus
\fB--video=bpf=7.\&5e5\fR is equivalent to \fB--video=bpf=750000\fR.\&
.P
.PP
.RE
.RE
\fB--hwvideo\fR
\fB--vsock\fR
.RS 4
Deprecated option, equivalent to --video=hw .\&
.P
Use vsock instead of unix sockets.\& This is used when waypipe is running in
virtual machines.\& With this option enabled specify a CID and a port number in \fBS\fR.\&
CID is only used in the server mode and can be omitted when connecting from a
guest virtual machine to host.\&
.PP
.RE
\fB--secctx S\fR
.RS 4
Enable the Wayland security context protocol (client or ssh modes).\& Specify
an application ID \fBS\fR that will be attached to the security context.\&
.PP
.RE
\fB--control C\fR
.br
\fB--hwvideo\fR
.br
\fB--allow-tiled\fR
.RS 4
Options present in older versions of Waypipe that were removed.\&
.PP
.RE
.SH EXAMPLE
.P
.PP
The following \fBwaypipe ssh\fR subcommand will attempt to run \fBweston-flower\fR on
the server \fIexserv\fR, displaying the result on the local system.\&
.P
.PP
.nf
.RS 4
waypipe ssh user@exserv weston-flower
.fi
.RE
.P
.PP
One can obtain similar behavior by explicitly running waypipe and ssh:
.P
.PP
.nf
.RS 4
waypipe --socket /tmp/socket-client client &
@ -241,10 +249,10 @@ One can obtain similar behavior by explicitly running waypipe and ssh:
kill %1
.fi
.RE
.P
.PP
Waypipe may be run locally without an SSH connection by specifying matching
socket paths.\& For example:
.P
.PP
.nf
.RS 4
waypipe --socket /tmp/waypipe\&.sock client &
@ -253,10 +261,10 @@ socket paths.\& For example:
rm /tmp/waypipe\&.sock
.fi
.RE
.P
.PP
Using transports other than SSH is a bit more complicated.\& A recipe with ncat
to connect to \fIremote\fR from computer \fIlocal\fR:
.P
.PP
.nf
.RS 4
$ waypipe --socket /tmp/waypipe-remote\&.sock client &
@ -269,10 +277,10 @@ to connect to \fIremote\fR from computer \fIlocal\fR:
> WAYLAND_DISPLAY=wayland-local application
.fi
.RE
.P
.PP
Given a certificate file, socat can also provide an encrypted connection
(remove '\&verify=0'\& to check certificates):
.P
.PP
.nf
.RS 4
$ waypipe --socket /tmp/waypipe-remote\&.sock client &
@ -285,87 +293,133 @@ Given a certificate file, socat can also provide an encrypted connection
> waypipe --socket /tmp/waypipe-local\&.sock server -- application
.fi
.RE
.P
.PP
Many applications require specific environment variables to use Wayland instead
of X11.\& If ssh isn'\&t configured to support loading \fI~/.\&ssh/environment\fR, or
to allow specific variables to be set with \fIAcceptEnv\fR/\fISetEnv\fR, one can run
\fBwaypipe ssh\fR without a command (and thereby open a login shell), or use \fBenv\fR
to set the needed variables each time:
.P
.PP
.nf
.RS 4
waypipe ssh user@host env XDG_SESSION_TYPE=wayland dolphin
.fi
.RE
.P
.PP
In some cases, one may wish to set environment variables for the \fBwaypipe
server\fR process itself; the above trick with \fBenv\fR will not do this, because the
\fBenv\fR process will be a child of \fBwaypipe server\fR, not the other way around.\&
Instead, one can use \fI~/.\&ssh/environment\fR, or use the \fB--remote-bin\fR option to
change the remote Waypipe instance to a shell script that sets the environment
before running the actual \fBwaypipe\fR program.\&
.P
Waypipe has support for reconnecting a \fBwaypipe client\fR and a \fBwaypipe server\fR
instance when whatever was used to transfer data between their sockets fails.\&
For this to work, waypipe must still be running on both sides of the connection.\&
As the \fBwaypipe ssh\fR wrapper will automatically close both the \fBwaypipe client\fR
and the \fBwaypipe server\fR when the connection fails, the client and server modes
must be run seprately.\& For example, to persistently forward applications running
on server \fIrserv\fR to a local Wayland compositor running on \fIlserv\fR, one would
first set up a waypipe client instance on \fIlserv\fR,
.P
.PP
.SS Running waypipe in virtual machines
.PP
When running waypipe in virtual machines on the same host it is possible to use vsock
for efficient inter-vm communication.\& The following scenarios are supported:
.PP
.PD 0
.IP \(bu 4
Running applications on host from guest.\&
.PD
.PP
.nf
.RS 4
waypipe -s /tmp/waypipe\&.sock client &
host> waypipe --vsock -s 1234 client
guest> waypipe --vsock -s 1234 server weston-terminal
.fi
.RE
.P
and on server \fIrserv\fR, establish socket forwarding and run the server
.P
.PP
.PD 0
.IP \(bu 4
Running applications in a guest virtual machine from host.\&
.PD
.PP
.nf
.RS 4
ssh -fN -L /tmp/waypipe-lserv\&.sock:/tmp/waypipe\&.sock user@lserv
waypipe -s /tmp/waypipe-lserv\&.sock --control /tmp/ctrl-lserv\&.pipe \\
--display wayland-lserv server -- sleep inf &
guest> waypipe --vsock -s 1234 client
host> waypipe --vsock -s 3:1234 server weston-terminal
.fi
.RE
.P
then set \fIWAYLAND_DISPLAY=wayland-lserv\fR and run the desired applications.\&
When the ssh forwarding breaks, on \fIrserv\fR, reconnect with
.P
.PP
In this example waypipe server connects to a virtual machine with CID 3 on port 1234.\&
.PP
.PD 0
.IP \(bu 4
Running applications in a guest virtual machine from other guest virtual machines.\&
.PD
When running both client and server in virtual machines it is possble to enable the
VMADDR_FLAG_TO_HOST flag for sibling communication by prefixing the CID with an s:
.PP
.nf
.RS 4
ssh -fN -L /tmp/waypipe-lserv-2\&.sock:/tmp/waypipe\&.sock user@lserv
waypipe recon /tmp/ctrl-lserv\&.pipe /tmp/waypipe-lserv-2\&.sock
guest> waypipe --vsock -s 1234 client
guest> waypipe --vsock -s s3:1234 server weston-terminal
.fi
.RE
.P
.PP
In this case all packets will be routed to host where they can be forwarded to another
virtual machine with a vhost-device-vsock device or some other utility.\&
.PP
.SH ENVIRONMENT
.P
.PP
When running as a server, by default \fIWAYLAND_DISPLAY\fR will be set for the
invoked process.\&
.P
.PP
If the \fB--oneshot\fR flag is set, waypipe will instead set \fIWAYLAND_SOCKET\fR and
inherit an already connected socketpair file descriptor to the invoked (child)
process.\& Some programs open and close a Wayland connection repeatedly as part
of their initialization, and will not work correctly with this flag.\&
.P
.PP
.SH EXIT STATUS
.P
.PP
\fBwaypipe ssh\fR will exit with the exit status code from the remote command, or
with return code 1 if there has been an error.\&
.P
.PP
.SH SECURITY
.PP
Waypipe does not provide any strong security guarantees, and connecting to
untrusted servers is not recommended.\& It does not filter which Wayland
protocols the compositor makes available to the client (with a few exceptions
for protocols that require file descriptors which Waypipe cannot yet handle).\&
For example, if a Wayland compositor gives all its clients access to a
screenshot or lock-screen protocol, then proxied clients run under Waypipe
can also make screenshots or lock the screen.\&
.PP
In general, applications are not well tested against malicious compositors,
and compositors are not well tested against malicious clients.\& Waypipe can
connect the two, and may blindly forward denial-of-service and other attacks.\&
.PP
Waypipe itself is written in C and links to compression, graphics, and video
libraries; both it and these libraries may have security bugs.\& Some risk
can be avoided by building Waypipe with DMABUF support turned off, or
running Waypipe with the \fB--no-gpu\fR flag so that it does not expose graphics
libraries.\&
.PP
\fBwaypipe ssh\fR has no explicit protections against timing attacks; an observer
to the resulting network traffic may, by studying the size and timing of
packets, learn information about the user'\&s interaction with a Wayland client
proxied through \fBwaypipe ssh\fR.\& For example: a lack of activity suggests the
user is not currently using the application, while an intermittant stream of
messages from the compositor to the client may indicate mouse movement (or
maybe something else: the contents of the messages are protected by \fBssh\fR.\&)
.PP
The memory used by Waypipe processes may, at a given time, include Wayland
messages encoding user input, and the contents of current and recent frames
drawn for application windows.\& Swap should be encrypted to prevent this data
from being leaked to disk.\&
.PP
.SH BUGS
.P
.PP
File bug reports at: https://gitlab.\&freedesktop.\&org/mstoeckl/waypipe/
.P
.PP
Some programs (gnome-terminal, firefox, kate, among others) have special
mechanisms to ensure that only one process is running at a time.\& Starting
those programs under Waypipe while they are running under a different
Wayland compositor may silently open a window or tab in the original
instance of the program.\& Such programs may have a command line argument
to create a new instance.\&
.P
.PP
.SH SEE ALSO
.P
.PP
\fBweston\fR(1), \fBssh\fR(1), \fBsocat(1)\fR, \fBncat(1)\fR

View file

@ -1,65 +1,98 @@
Name: waypipe
Version: 0.9.1
Release: %autorelease
Summary: Wayland forwarding proxy
# Generated by rust2rpm 27
%bcond check 1
License: MIT
URL: https://gitlab.freedesktop.org/mstoeckl/%{name}
Source0: https://gitlab.freedesktop.org/mstoeckl/%{name}/-/archive/v%{version}/%{name}-v%{version}.tar.gz
Source1: waypipe.1
# prevent library files from being installed
%global cargo_install_lib 0
BuildRequires: gcc
BuildRequires: meson
Name: waypipe
Version: 0.10.4
Release: %autorelease
Summary: Wayland forwarding proxy
SourceLicense: GPLv3-or-later
# GPLv3-or-later
# ISC
# MIT
# MIT OR Apache-2.0
# (also MIT for the protocols/ directory)
License: (Apache-2.0 OR MIT) AND ISC AND MIT AND (MIT OR Apache-2.0)
# LICENSE.dependencies contains a full license breakdown
URL: https://gitlab.freedesktop.org/mstoeckl/waypipe
Source0: waypipe-v0.10.4.tar.gz
Source1: waypipe.1
Patch1: license.patch
BuildRequires: cargo-rpm-macros >= 26
BuildRequires: bindgen-cli
BuildRequires: gcc
# required for bindgen to resolve some include paths..
BuildRequires: clang
BuildRequires: meson
%if !0%{?rhel}
BuildRequires: scdoc
BuildRequires: scdoc
%endif
BuildRequires: pkgconfig(gbm)
BuildRequires: pkgconfig(gbm)
%if !0%{?rhel}
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libswscale)
BuildRequires: pkgconfig(libavcodec)
BuildRequires: pkgconfig(libavutil)
BuildRequires: pkgconfig(libswscale)
# not sure if needed without ffmpeg?
BuildRequires: glslc
BuildRequires: vulkan-headers
%endif
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-server)
BuildRequires: pkgconfig(libdrm)
BuildRequires: pkgconfig(liblz4)
BuildRequires: pkgconfig(libzstd)
BuildRequires: pkgconfig(libva)
BuildRequires: pkgconfig(wayland-protocols)
BuildRequires: pkgconfig(wayland-client)
BuildRequires: pkgconfig(wayland-server)
# This one is not automatically detected properly...
BuildRequires: rust-pkg-config+default-devel
%description
Waypipe is a proxy for Wayland clients. It forwards Wayland messages and
serializes changes to shared memory buffers over a single socket. This makes
application forwarding similar to "ssh -X" feasible.
%global _description %{expand:
%{summary}.}
%description %{_description}
%prep
%autosetup -n %{name}-v%{version}
%autosetup -n waypipe-v%{version} -p1
%cargo_prep
%generate_buildrequires
%cargo_generate_buildrequires
%build
%meson -Dwerror=false %{?rhel:-Dwith_video=disabled -Dman-pages=disabled}
%meson_build
%install
%meson_install
%if 0%{?rhel}
mkdir -p %{buildroot}%{_mandir}/man1/
install -m 644 %{SOURCE1} %{buildroot}%{_mandir}/man1/
%cargo_build
%{cargo_license_summary}
%{cargo_license} > LICENSE.dependencies
%if !0%{?rhel}
scdoc < waypipe.scd > waypipe.1
%endif
%install
%cargo_install
# Is there a better way to build only `--bin waypipe` ?
rm -f %{buildroot}%{_bindir}/test_proto
%if !0%{?rhel}
install -D -p -m 0644 waypipe.1 %{buildroot}%{_mandir}/man1/waypipe.1
%else
install -D -p -m 0644 %{SOURCE1} %{buildroot}%{_mandir}/man1/waypipe.1
%endif
%if %{with check}
%check
%meson_test
%cargo_test
%endif
%files
%{_bindir}/waypipe
%{_mandir}/man1/waypipe.1*
%doc CONTRIBUTING.md README.md
%license COPYING
%license LICENSE.GPLv3
%license LICENSE.MIT
%license LICENSE.dependencies
%changelog
%autochangelog