1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142
|
#!/usr/bin/env bash
#
# Helper script to install the non-Python Wayland dependencies on Ubuntu. This
# is required because most of the time the wlroots version we depend on is more
# recent than that which can be found in the Ubuntu package repository. This
# script is used for CI on GitHub and the ReadTheDocs environment.
set -e
mkdir -p cache
# The versions we want
WAYLAND=1.24.0
WAYLAND_PROTOCOLS=1.41
WLROOTS=0.19.0
SEATD=0.6.4
LIBDRM=2.4.122
PIXMAN=0.43.0
XWAYLAND=22.1.9
HWDATA=0.364
fetch_source() {
url=$1
filename=$2
if [ -f "cache/$filename" ]; then
echo "$filename found, skipping download."
else
wget -P cache "$url"
fi
}
# Packaged dependencies
sudo apt update
sudo apt-get install -y --no-install-recommends \
libepoxy-dev \
libegl1-mesa-dev \
libgbm-dev \
libgles2-mesa-dev \
libinput-dev \
libpciaccess-dev \
libxcb-composite0-dev \
libxcb-dri3-dev \
libxcb-ewmh-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-present-dev \
libxcb-render0-dev \
libxcb-res0-dev \
libxcb-xfixes0-dev \
libxcb-xinput-dev \
libxcb1-dev \
libxfont-dev \
libxkbcommon-dev \
libxshmfence-dev \
libtirpc-dev \
xfonts-utils \
xserver-xorg-dev \
ninja-build \
meson
# Build wayland
tarball="wayland-$WAYLAND.tar.xz"
fetch_source "https://gitlab.freedesktop.org/wayland/wayland/-/releases/$WAYLAND/downloads/$tarball" "$tarball"
tar -xJf "cache/$tarball"
cd wayland-$WAYLAND
meson setup build -Ddocumentation=false --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build wayland-protocols
tarball="wayland-protocols-$WAYLAND_PROTOCOLS.tar.xz"
fetch_source "https://gitlab.freedesktop.org/wayland/wayland-protocols/-/releases/$WAYLAND_PROTOCOLS/downloads/$tarball" "$tarball"
tar -xJf "cache/$tarball"
cd wayland-protocols-$WAYLAND_PROTOCOLS
meson setup build -Dtests=false --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build libdrm
tarball="libdrm-libdrm-$LIBDRM.tar.gz"
fetch_source "https://gitlab.freedesktop.org/mesa/libdrm/-/archive/libdrm-$LIBDRM/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd libdrm-libdrm-$LIBDRM
meson setup build --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build seatd
tarball="$SEATD.tar.gz"
fetch_source "https://github.com/kennylevinsen/seatd/archive/refs/tags/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd seatd-$SEATD
meson setup build --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build pixman
tarball="pixman-pixman-$PIXMAN.tar.gz"
fetch_source "https://gitlab.freedesktop.org/pixman/pixman/-/archive/pixman-$PIXMAN/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd pixman-pixman-$PIXMAN
meson setup build --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build hwdata
tarball="v$HWDATA.tar.gz"
fetch_source "https://github.com/vcrhonek/hwdata/archive/refs/tags/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd hwdata-$HWDATA
./configure --prefix=/usr --libdir=/lib --datadir=/usr/share
make
sudo make install
cd ../
# Build xwayland
tarball="xserver-xwayland-$XWAYLAND.tar.gz"
fetch_source "https://gitlab.freedesktop.org/xorg/xserver/-/archive/xwayland-$XWAYLAND/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd xserver-xwayland-$XWAYLAND
meson setup build --prefix=/usr
ninja -C build
sudo ninja -C build install
cd ../
# Build wlroots
tarball="wlroots-$WLROOTS.tar.gz"
fetch_source "https://gitlab.freedesktop.org/wlroots/wlroots/-/archive/$WLROOTS/$tarball" "$tarball"
tar -xzf "cache/$tarball"
cd wlroots-$WLROOTS
meson setup build -Dexamples=false --prefix=/usr -Dxwayland=enabled
ninja -C build
sudo ninja -C build install
cd ../
|