weston 1: 编译与运行傻瓜教程

注:由于当前Kubuntu 22.10 已经不再提供 更新 ,所以可以参考下面这个连接的系统版本和代码版本,其他操作依据本文即可。

weston 1: 编译与运行傻瓜教程(补充)-CSDN博客 

本人Kubuntu版本是22.04 (最好用 22.10)

sudo apt-get update
sudo apt-get upgrade

进入主目录

cd $HOME/

mkdir install
mkdir works

vim ~/.bashrc

export WLD=$HOME/install

source ~/.bashrc


cd works

=======================wayland===================================

git clone https://gitlab.freedesktop.org/wayland/wayland.git

cd wayland

git checkout main
(
git log
commit 9700155edaae37bf91b55b58c1c2adf2ed142282 (HEAD -> main, origin/main, origin/HEAD)
Author: Mikhail Gusarov
Date:   Thu Oct 20 23:31:33 2022 +0200

    protocol: wl_subsurface::destroy does not remove the role
    Role assigned to wl_surface cannot be removed.
    Delete contradicting text from wl_subsurface::destroy documentation.
    Signed-off-by: Mikhail Gusarov
)

meson build/ --prefix=$WLD
(
Command 'meson' not found, but can be installed with:
sudo apt install meson
)

sudo apt install meson

meson build/ --prefix=$WLD
(
ERROR: Pkg-config binary for machine 1 not found
)
sudo apt install pkg-config

(
Dependency "libffi" not found
)
sudo apt install libffi-dev

(
Dependency "expat" not found
)
sudo apt install libexpat1-dev

(
Dependency "libxml-2.0" not found
)
sudo apt install libxml2-dev

(
Program 'dot' not found or not executable
)
sudo apt install graphviz

(
Program 'doxygen' not found or not executable
)
sudo apt install doxygen

(
Program 'xsltproc' not found or not executable
)
sudo apt install xsltproc

(
Program 'xmlto' not found or not executable
)
sudo apt install xmlto

meson build/ --prefix=$WLD
(
Build targets in project: 60
wayland 1.21.90
  User defined options
    prefix: /home/zzj/install
Found ninja-1.10.1 at /usr/bin/ninja
)

ninja -C build/ install
(
Installing /home/zzj/works/wayland/protocol/wayland.xml to /home/zzj/install/share/wayland
Installing /home/zzj/works/wayland/protocol/wayland.dtd to /home/zzj/install/share/wayland
Installing /home/zzj/works/wayland/wayland-scanner.m4 to /home/zzj/install/share/aclocal
)

=======================wayland===================================
cd ..
=======================wayland-protocols=========================
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols
cd wayland-protocols
git checkout main
(
git log
commit 37a7b9d387f01ae789432872028317488d0000c8 (HEAD -> main, origin/main, origin/HEAD)
Author: Philip Withnall
Date:   Mon Dec 19 12:37:57 2022 +0000

    Fix typo in xdg-activation-v1
    Noticed during review in
    https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/98#note_1003427,
    but not changed at the time.
    Noticed again in https://gitlab.gnome.org/GNOME/glib/-/merge_requests/3090#note_1606895.
    Signed-off-by: Philip Withnall
)

meson build/ --prefix=$WLD
(
Dependency "wayland-scanner" not found
)
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/install/lib/x86_64-linux-gnu/pkgconfig/
(
此处根据个人电脑配置路径
$HOME/install/lib/x86_64-linux-gnu/pkgconfig/
可能为
$HOME/install/lib64/pkgconfig/
)

meson build/ --prefix=$WLD
(
Compiler for C supports link arguments -Wl,--unresolved-symbols=ignore-all: YES
Build targets in project: 236
wayland-protocols 1.31
  User defined options
  prefix: /home/zzj/install
)

ninja -C build/ install
(
Installing /home/zzj/source/wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v5.xml to /home/zzj/install/share/wayland-protocols/unstable/xdg-shell
Installing /home/zzj/source/wayland-protocols/unstable/xdg-shell/xdg-shell-unstable-v6.xml to /home/zzj/install/share/wayland-protocols/unstable/xdg-shell
Installing /home/zzj/source/wayland-protocols/unstable/xwayland-keyboard-grab/xwayland-keyboard-grab-unstable-v1.xml to /home/zzj/install/share/wayland-protocols/unstable/xwayland-keyboard-grab
Installing /home/zzj/source/wayland-protocols/build/wayland-protocols.pc to /home/zzj/install/share/pkgconfig
)
=======================wayland-protocols=========================
cd ..
=======================libinput==================================
git clone https://gitlab.freedesktop.org/libinput/libinput/
cd libinput
git checkout main
(
git log
commit 3b1f86c7c637d5ec4140ec3babc211f1fa6857ac (HEAD -> main, origin/main, origin/HEAD)
Author: Zhangyuan Nie
Date:   Mon Jan 16 18:43:46 2023 -0800

    quicks: invert horizontal scrolling for Logitech MX Master 3S
    Signed-off-by: Zhangyuan Nie
)

meson build/ --prefix=$WLD
(
Dependency "libudev" not found
)
sudo apt install libudev-dev

(
Dependency "mtdev" not found
)
sudo apt install libmtdev-dev

(
Dependency "libevdev" not found
)
sudo apt install libevdev-dev

(
Dependency "libwacom" not found
)
sudo apt install libwacom-dev

(
Dependency "gtk+-3.0" not found
)
sudo apt install libgtk-3-dev

(
Dependency "check" not found
)
sudo apt install check

meson build/ --prefix=$WLD
(
Build targets in project: 40
libinput 1.22.0
  User defined options
  prefix: /home/zzj/install
  Found ninja-1.10.1 at /usr/bin/ninja
)

ninja -C build/ install
(
Installing /home/zzj/works/libinput/build/libinput-replay.1 to /home/zzj/install/share/man/man1
Installing /home/zzj/works/libinput/build/libinput-test.1 to /home/zzj/install/share/man/man1
Installing /home/zzj/works/libinput/build/libinput-quirks-list.1 to /home/zzj/install/share/man/man1
Installing /home/zzj/works/libinput/build/libinput-quirks-validate.1 to /home/zzj/install/share/man/man1
)
=======================libinput==================================

cd ..

由于weston编译启动需要依赖所以配置文件再加入如下配置

vim ~/.bashrc
export LD_LIBRARY_PATH=$WLD/lib/x86_64-linux-gnu
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/install/lib/x86_64-linux-gnu/pkgconfig/:$HOME/install/share/pkgconfig
export PATH=$PATH:$WLD/bin

source  ~/.bashrc

=========配置路径================

此处根据个人电脑配置路径
$HOME/install/lib/x86_64-linux-gnu/pkgconfig/
可能为
$HOME/install/lib64/pkgconfig/


export LD_LIBRARY_PATH=$WLD/lib/x86_64-linux-gnu
可能为
export LD_LIBRARY_PATH=$WLD/lib/ 
主要是为了找到路径下的
libinput.pc      wayland-client.pc  wayland-egl-backend.pc  wayland-scanner.pc  weston.pc
libweston-12.pc  wayland-cursor.pc  wayland-egl.pc          wayland-server.pc

libinput.so                   libwayland-cursor.so.0        libwayland-server.so.0.21.90
libinput.so.10                libwayland-cursor.so.0.21.90  libweston-12
libinput.so.10.13.0           libwayland-egl.so             libweston-12.so
libwayland-client.so          libwayland-egl.so.1           libweston-12.so.0
libwayland-client.so.0        libwayland-egl.so.1.21.90     libweston-12.so.0.0.0
libwayland-client.so.0.21.90  libwayland-server.so          pkgconfig
libwayland-cursor.so          libwayland-server.so.0        weston

=========配置路径================

=======================weston====================================
git clone https://gitlab.freedesktop.org/wayland/weston.git
cd weston
git checkout main
(
git log
commit 35b3cb83b0bf427b7c40ba080bc32b58a68f5b62 (HEAD -> main, origin/main, origin/HEAD)
Author: Loïc Molinari
Date:   Tue Jan 3 20:14:41 2023 +0100
    gl-renderer: Disable vertex attrib arrays in shadow pass
    The blit_shadow_to_output() function leaves the generic vertex attrib
    arrays 0 and 1 enabled. This commit disables them for consistency with
    the other drawing calls of the renderer.
    Signed-off-by: Loïc Molinari
)

meson build/ --prefix=$WLD
(
Dependency "libinput" not found
)
//libinput 路径 需要加入到PKG_CONFIG_PATH
export PKG_CONFIG_PATH=$PKG_CONFIG_PATH:$HOME/install/lib/x86_64-linux-gnu/pkgconfig

(
Dependency "libdrm" not found
)
sudo apt install libdrm-dev

(
Problem encountered: WEBP image loading requires libwebp which was not found. Or, you can use '-Dimage-webp=false'.
)
sudo apt install libwebp-dev

(
C shared or static library 'pam' not found
)
sudo apt install libpam-dev

(
Dependency "libseat" not found
)
sudo apt install libseat-dev

(
ERROR: Could not generate cargs for libseat:
Package libsystemd was not found in the pkg-config search path.
Perhaps you should add the directory containing `libsystemd.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libsystemd', required by 'libseat', not found
)
sudo apt install libsystemd-dev

(
Problem encountered: color-lcms plugin requires lcms2 which was not found. Or, you can use '-Dcolor-management-lcms=false'
)
sudo apt install liblcms2-dev

(
Problem encountered: drm-backend with GL renderer requires gbm which was not found. Or, you can use '-Drenderer-gl=false'.
)
sudo apt-get install  libgbm-dev

(
Problem encountered: VA-API recorder requires libva >= 0.34.0 which was not found. Or, you can use '-Dbackend-drm-screencast-vaapi=false'.
)
sudo apt-get install libva-dev

(
Problem encountered: RDP-backend requires freerdp >= 2.3.0 which was not found. Or, you can use '-Dbackend-rdp=false'.
)
sudo apt install freerdp2-dev

(
Problem encountered: VNC backend requires neatvnc which was not found. Or, you can use '-Dbackend-vnc=false'.
)
sudo apt search neatvnc
sudo apt install libneatvnc-dev

(
Dependency neatvnc found: NO found 0.4.0 but need: '>= 0.5.0' ; matched: '< 0.6.0'
weston 最新版本需要 neatvnc >= 0.5.0
22.10版本Kubuntu以上版本无此问题,直接安装libneatvnc-dev
)
sudo apt install libneatvnc-dev

(
Problem encountered: x11-backend requires x11-xcb which was not found.
)
sudo apt install libx11-xcb-dev

(
Problem encountered: xwayland requires xcb-composite which was not found
)
sudo apt install libxcb-composite0-dev

(
Problem encountered: Remoting plugin requires gstreamer-1.0 which was not found
)
sudo apt install libgstreamer1.0-dev

(
Remoting plugin requires gstreamer-allocators-1.0 which was not found
)
sudo apt install libgstreamer-plugins-base1.0-dev

(
Pipewire plugin requires libpipewire which was not found
)
sudo apt install libpipewire-0.3-dev

meson build/ --prefix=$WLD
(
Message: Documentation will not be built. Use -Ddoc to build it.
Build targets in project: 200
NOTICE: Future-deprecated features used:
 * 0.56.0: {'Dependency.get_pkgconfig_variable'}

  weston 11.0.90
  User defined options
  prefix: /home/zzj/install
  Found ninja-1.10.1 at /usr/bin/ninja
)

ninja -C build/ install
(
Installing /home/zzj/works/weston/build/man/weston-drm.7 to /home/zzj/install/share/man/man7
Installing /home/zzj/works/weston/build/man/weston-rdp.7 to /home/zzj/install/share/man/man7
Installing /home/zzj/works/weston/build/man/weston-vnc.7 to /home/zzj/install/share/man/man7
Installing /home/zzj/works/weston/pam/weston-remote-access to /home/zzj/install/etc/pam.d
)

(
weston: error while loading shared libraries: libweston-12.so.0: cannot open shared object file: No such file or directory
)
//此环境变量放到配置文件里,可在tty3直接运行,启动weston
export LD_LIBRARY_PATH=/home/zzj/install/lib/x86_64-linux-gnu

weston
=======================weston====================================

plasma下

weston 1: 编译与运行傻瓜教程_第1张图片

tty3下

weston 1: 编译与运行傻瓜教程_第2张图片

你可能感兴趣的:(weston,weston,wayland)