本文记录的是在ubuntu 20.04 环境下,编译weston 的过程,主要步骤是参考weston的官方编译说明:Building Weston (wayland.freedesktop.org)

  1. 使用docker 创建一个干净的编译环境,配置好APT源,安装依赖包:

    1docker run --name weston-dev -it ubuntu:20.04 bash 2# 进入容器后 3sed -i s/ports.ubuntu.com/mirrors.ustc.edu.cn/g /etc/apt/sources.list 4sed -i s/'# deb-src'/deb-src/g /etc/apt/sources.list 5apt update && apt install -y vim git python3-pip 6pip3 install meson==0.63.0 -i https://mirrors.aliyun.com/pypi/simple 7apt build-dep weston 8mkdir /workspaces
  2. 编译 wayland:

    1cd /workspaces 2git clone https://gitlab.freedesktop.org/wayland/wayland.git 3cd wayland 4export WLD=/usr/local 5meson build/ --prefix=$WLD --buildtype=release -Ddocumentation=false 6ninja -C build/ install
  3. 编译 wayland protocols:

    1cd /workspaces 2git clone https://gitlab.freedesktop.org/wayland/wayland-protocols.git 3cd wayland-protocols 4meson build/ --prefix=$WLD --buildtype=release 5ninja -C build/ install
  4. 编译 drm:

    1cd /workspaces 2git clone https://gitlab.freedesktop.org/mesa/drm.git 3cd drm 4meson build/ --prefix=$WLD --buildtype=release 5ninja -C build/ install
  5. 编译 libseat:

    1cd /workspaces 2git clone https://github.com/kennylevinsen/seatd.git 3cd seatd 4meson build/ --prefix=$WLD --buildtype=release 5ninja -C build/ install
  6. 编译 weston:

    1cd /workspaces 2git clone https://gitlab.freedesktop.org/wayland/weston.git -b 12.0.1 3cd weston 4apt install -y libxcb-cursor-dev 5meson build/ --prefix=$WLD --buildtype=release -Dbackend-pipewire=false -Dbackend-rdp=false -Dbackend-vnc=false -Dpipewire=false 6ninja -C build/ install