编译前期准备:
1、更换国内源:
#添加阿里源
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
#添加清华源
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse multiverse
2、安装依赖:
sudo apt update
sudo apt install python3-pip git ninja-build cmake
sudo apt install meson
sudo apt install g++
pip3 install --user meson
sudo apt install -y libffi-dev libxml2-dev graphviz doxygen xsltproc xmlto
sudo apt-get install libgstreamer-plugins-base1.0-dev
sudo apt-get install libmount-dev
sudo apt-get install libexpat1-dev
sudo apt-get install -y libpipewire-0.2 libgstreamer1.0 libcolord-dev liblcms2-dev libva-dev libsystemd-dev libwebp-dev libjpeg-dev
sudo apt-get install libxkbcommon-x11-dev
sudo apt-get install libpixman-1-dev
sudo apt install libinput-tools xdotool
sudo apt install libinput-dev
sudo apt install libdrm-dev
sudo apt install libcairo-dev
sudo apt install libdbus-1-dev
sudo apt-get install libpam0g-dev
sudo apt-get install libgbm-dev
sudo apt-get install libfreerdp2-dev
sudo apt-get install libxcb-composite0-dev
sudo apt-get install libxcursor-dev
sudo apt-get install libcairo2-dev libpango1.0-dev
3、安装ninja
git clone https://gitee.com/rogerbowu/ninja.git
cd ninja
./configure.py --bootstrap
cp ./ninja /usr/bin/
4、配置环境
//安装在某路径下,不安装在系统中,方便引用开发。
export WLD=$HOME/install
export LD_LIBRARY_PATH=$WLD/lib
export PKG_CONFIG_PATH=$WLD/lib/pkgconfig/:$WLD/share/pkgconfig/
export PATH=$WLD/bin:$PATH
5、默认Ubuntu20.04的cmake是3.16.3,升级到3.17.0即可;
sudo wget https://cmake.org/files/v3.17/cmake-3.17.0-Linux-x86_64.tar.gz
tar -zvxf cmake-3.17.0-Linux-x86_64.tar.gz
sudo mv cmake-3.17.0-Linux-x86_64 /opt/cmake-3.17.0
sudo ln -sf /opt/cmake-3.17.0/bin/* /usr/bin/
cmake --version
6、下载wayland源码,编译
git clone https://gitee.com/ccyin/wayland.git
cd wayland
meson build/ --prefix=$WLD
ninja -C build/ install
7、下载wayland-protocols源码编译
git clone https://gitee.com/openeuler-graphics/wayland-protocols.git
cd wayland-protocols
meson build/ --prefix=$WLD
ninja -C build/ install
8、下载weston源码编译
git clone https://gitee.com/mirrors/weston.git
cd weston
git checkout remotes/origin/master
meson build/ --prefix=$WLD
ninja -C build/ install
9、运行:
export LD_LIBRARY_PATH=/root/install/lib/x86_64-linux-gnu:$LD_LIBRARY_PATH
export XDG_RUNTIME_DIR=/usr/lib/
cd /root/install/bin
./weston
文章来源:https://www.toymoban.com/news/detail-500250.html
文章来源地址https://www.toymoban.com/news/detail-500250.html
到了这里,关于Ubuntu 20.04 X86成功编译运行wayland、wayland-protocols、weston,亲测有效,踩了很多坑,完美解决。的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!