赞
踩
转载请附上原文出处链接
稀土掘金本文链接:https://juejin.cn/spost/7321540587853529122
CSDN本文链接:https://blog.csdn.net/qq_43252610/article/details/135471633
系统版本:
银河麒麟V10SP1桌面版(2303):Kylin-Desktop-V10-SP1-General-Release-2303-ARM64.iso
uname -a
5.4.18-85-generic #74-KYLINOS SMP Fri Mar 24 11:20:19 UTC 2023 aarch64 aarch64 aarch64 GNU/Linux
cat /etc/.kyinfo [dist] name=Kylin milestone=Desktop-V10-SP1-General-Release-2303 arch=arm64 beta=False time=2023-04-27 15:46:53 dist_id=Kylin-Desktop-V10-SP1-General-Release-2303-arm64-2023-04-27 15:46:53 [servicekey] key=0516013 [os] to= term=2024-08-01
我这次使用的是spice-gtk-0.42
spice-gtk-0.42:https://gitlab.freedesktop.org/spice/spice-gtk/-/tree/v0.42
银河麒麟默认提供了apt
的软件源
cat /etc/apt/sources.list
# 本文件由源管理器管理,会定期检测与修复,请勿修改本文件
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 10.1 main restricted universe multiverse
deb http://archive.kylinos.cn/kylin/KYLIN-ALL 10.1-2303-updates main universe multiverse restricted
deb http://archive2.kylinos.cn/deb/kylin/production/PART-V10-SP1/custom/partner/V10-SP1 default all
拉取软件包列表
sudo apt update
源码编译spice-gtk
需要安装许多依赖
# gtk-3.0 sudo apt install libgtk-3-0 libgtk-3-dev gtk-doc-tools # ninja sudo apt install ninja-build # openssl sudo apt install openssl libssl-dev # pulse sudo apt install libpulse-dev # pixman sudo apt install libpixman-1-dev # gobject-introspection sudo apt install gobject-introspection # zlib sudo apt install zlib1g-dev # libjpeg-turbo sudo apt install libjpeg-turbo8-dev libturbojpeg0-dev # sasl sudo apt install libsasl2-dev # gettext sudo apt install gettext # vala sudo apt install libvala-0.48-dev # python sudo apt install python3 python3-pip python3-pyparsing # gstreamer sudo apt install gstreamer1.0-tools libgstreamer1.0-dev gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-qt5 gstreamer1.0-pulseaudio gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-alsa libgstreamermm-1.0-dev # json-glib sudo apt install libjson-glib-dev # opus sudo apt install libopus-dev # cacard sudo apt install libcacard-dev # asciidoc sudo apt install asciidoc # valgrind sudo apt install valgrind # libva sudo apt install libva-dev # libphodav sudo apt install libphodav-2.0-dev # libusb sudo apt install libusb-1.0-0-dev libusbredirhost-dev libusbredirparser-dev # libcap-ng sudo apt install libcap-ng-dev kwarg # libpolkit-gobject sudo apt install libpolkit-gobject-1-dev # libacl sudo apt install libacl1-dev # vapi sudo apt install valac gobject-introspection libgirepository1.0-dev # liblz4 sudo apt install liblz4-dev # libudev sudo apt install libudev-dev # 汇总 sudo apt install libgtk-3-0 libgtk-3-dev gtk-doc-tools ninja-build openssl libssl-dev libpulse-dev libpixman-1-dev gobject-introspection zlib1g-dev libjpeg-turbo8-dev libturbojpeg0-dev libsasl2-dev gettext libvala-0.48-dev python3 python3-pip python3-pyparsing gstreamer1.0-tools libgstreamer1.0-dev gstreamer1.0-vaapi gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-libav gstreamer1.0-vaapi gstreamer1.0-qt5 gstreamer1.0-pulseaudio gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-alsa libgstreamermm-1.0-dev libjson-glib-dev libopus-dev libcacard-dev asciidoc valgrind libva-dev libphodav-2.0-dev libusb-1.0-0-dev libusbredirhost-dev libusbredirparser-dev libcap-ng-dev libpolkit-gobject-1-dev libacl1-dev valac gobject-introspection libgirepository1.0-dev liblz4-dev libudev-dev
上述命令实际升级了 45 个软件包,新安装了 332 个软件包。
如果存在离线环境需要下载对应的deb
安装包进行离线安装,可以执行下面的命令下载对应的包
apt download asciidoc asciidoc-base asciidoc-common asciidoc-dblatex asciidoc-doc autopoint build-essential dblatex dblatex-doc debhelper dh-autoreconf dh-strip-nondeterminism docbook docbook-dsssl docbook-to-man docbook-utils docbook-xml docbook-xsl dvisvgm dwz fonts-gfs-baskerville fonts-gfs-porson fonts-lato fonts-lmodern fonts-texgyre g++ g++-9 gdb gdbserver gir1.2-atspi-2.0 gir1.2-harfbuzz-0.0 gir1.2-json-1.0 gir1.2-soup-2.4 gobject-introspection gstreamer1.0-gl gstreamer1.0-gtk3 gstreamer1.0-qt5 gtk-doc-tools icu-devtools intltool-debian libacl1-dev libalgorithm-c3-perl libapache-pom-java libarchive-cpio-perl libarchive-zip-perl libatk-bridge2.0-dev libatk1.0-dev libatspi2.0-dev libattr1-dev libauthen-sasl-perl libb-hooks-endofscope-perl libb-hooks-op-check-perl libblkid-dev libbrotli-dev libc6-dbg libcacard-dev libcacard0 libcairo-script-interpreter2 libcairo2-dev libcap-ng-dev libclass-c3-perl libclass-c3-xs-perl libclass-data-inheritable-perl libclass-method-modifiers-perl libclass-xsaccessor-perl libcommons-logging-java libcommons-parent-java libdata-optlist-perl libdatrie-dev libdbus-1-dev libdebhelper-perl libdevel-callchecker-perl libdevel-caller-perl libdevel-globaldestruction-perl libdevel-lexalias-perl libdevel-stacktrace-perl libdist-checkconflicts-perl libdynaloader-functions-perl libegl-dev libegl1-mesa-dev libemail-date-format-perl libepoxy-dev libeval-closure-perl libexception-class-perl libexpat1-dev libffi-dev libfile-homedir-perl libfile-stripnondeterminism-perl libfile-which-perl libfontbox-java libfontconfig1-dev libfreetype-dev libfreetype6-dev libfribidi-dev libgdk-pixbuf2.0-bin libgdk-pixbuf2.0-dev libgirepository1.0-dev libgl-dev libgl1-mesa-dev libgles-dev libgles1 libgles2-mesa-dev libglib2.0-dev libglib2.0-dev-bin libglibmm-2.4-dev libglvnd-dev libglx-dev libgraphene-1.0-0 libgraphite2-dev libgstreamer-plugins-base1.0-dev libgstreamer1.0-dev libgstreamermm-1.0-1 libgstreamermm-1.0-dev libgtk-3-dev libharfbuzz-dev libharfbuzz-gobject0 libice-dev libicu-dev libio-socket-ssl-perl libipc-shareable-perl libjpeg-turbo8-dev libjson-glib-dev liblog-dispatch-perl liblog-log4perl-perl libltdl-dev liblz4-dev libmail-sendmail-perl libmailtools-perl libmime-charset-perl libmime-lite-perl libmime-types-perl libmodule-implementation-perl libmodule-runtime-perl libmount-dev libmro-compat-perl libnamespace-autoclean-perl libnamespace-clean-perl libnet-smtp-ssl-perl libnet-ssleay-perl libnspr4-dev libnss3-dev libopengl-dev libopengl0 libopus-dev liborc-0.4-dev liborc-0.4-dev-bin libosp5 libostyle1c2 libpackage-stash-perl libpackage-stash-xs-perl libpadwalker-perl libpango1.0-dev libparams-classify-perl libparams-util-perl libparams-validationcompiler-perl libpcre16-3 libpcre2-32-0 libpcre2-dev libpcre2-posix2 libpcre3-dev libpcre32-3 libpcrecpp0v5 libpdfbox-java libphodav-2.0-0 libphodav-2.0-common libphodav-2.0-dev libpixman-1-dev libpng-dev libpng-tools libpolkit-gobject-1-dev libpsl-dev libptexenc1 libpthread-stubs0-dev libpulse-dev libpython3-dev libpython3.8-dev libreadonly-perl libref-util-perl libref-util-xs-perl librole-tiny-perl libruby2.7 libsasl2-dev libselinux1-dev libsepol1-dev libset-scalar-perl libsgmls-perl libsigc++-2.0-dev libsm-dev libsombok3 libsoup2.4-dev libspecio-perl libsqlite3-dev libssl-dev libstdc++-9-dev libsub-exporter-perl libsub-exporter-progressive-perl libsub-identify-perl libsub-install-perl libsub-name-perl libsub-override-perl libsub-quote-perl libsys-hostname-long-perl libtcl8.6 libteckit0 libtexlua53 libthai-dev libtimedate-perl libtk8.6 libtool libtry-tiny-perl libturbojpeg libturbojpeg0-dev libudev-dev libunicode-linebreak-perl libusb-1.0-0-dev libusb-1.0-doc libusbredirhost-dev libusbredirhost1 libusbredirparser-dev libusbredirparser1 libva-dev libva-glx2 libvala-0.48-0 libvala-0.48-dev libvalacodegen-0.48-0 libvariable-magic-perl libwayland-bin libwayland-dev libx11-dev libx11-xcb-dev libxau-dev libxcb-render0-dev libxcb-shm0-dev libxcb1-dev libxcomposite-dev libxcursor-dev libxdamage-dev libxdmcp-dev libxext-dev libxfixes-dev libxft-dev libxi-dev libxinerama-dev libxkbcommon-dev libxml++2.6-2v5 libxml++2.6-dev libxml2-dev libxml2-utils libxrandr-dev libxrender-dev libxstring-perl libxtst-dev libyaml-tiny-perl libzzip-0-13 lmodern lynx lynx-common ninja-build openjade opensp pango1.0-tools perl-openssl-defaults pkg-config po-debconf preview-latex-style python-pip-whl python3-dev python3-mako python3-markdown python3-packaging python3-pip python3-pygments python3-pyparsing python3-wheel python3.8-dev rake ruby ruby-minitest ruby-net-telnet ruby-power-assert ruby-test-unit ruby-xmlrpc ruby2.7 rubygems-integration sgml-base sgml-data sgmlspl t1utils tcl tcl8.6 teckit tex-common tex-gyre texlive texlive-base texlive-bibtex-extra texlive-binaries texlive-extra-utils texlive-fonts-recommended texlive-formats-extra texlive-lang-greek texlive-latex-base texlive-latex-extra texlive-latex-recommended texlive-pictures texlive-plain-generic texlive-science texlive-xetex tipa tk tk8.6 uuid-dev valac valac-0.48-vapi valac-bin valgrind vim-addon-manager vim-asciidoc wayland-protocols x11proto-core-dev x11proto-dev x11proto-input-dev x11proto-randr-dev x11proto-record-dev x11proto-xext-dev x11proto-xinerama-dev xml-core xmlto xorg-sgml-doctools xsltproc xtrans-dev zlib1g-dev dbus dbus-x11 gir1.2-gstreamer-1.0 gir1.2-gtk-3.0 gstreamer1.0-tools libblkid1 libc-dev-bin libc6 libc6-dev libdbus-1-3 libfreetype6 libglib2.0-0 libglib2.0-bin libgstreamer1.0-0 libgtk-3-0 libgtk-3-common libharfbuzz-icu0 libharfbuzz0b libmount1 libnss3 libpulse-mainloop-glib0 libpulse0 libpulsedsp libpython3.8 libpython3.8-minimal libpython3.8-stdlib libsqlite3-0 libssl1.1 libudev1 libuuid1 libva-drm2 libva-wayland2 libva-x11-2 libva2 libx11-6 libx11-xcb1 libxml2 openssl pulseaudio pulseaudio-module-bluetooth pulseaudio-utils python3.8 python3.8-minimal sqlite3 udev
系统apt
源提供的meson
版本过低,使用pip3
安装meson
详细排查分析见如下章节
4.1 [meson]ERROR: Unknown method “project_source_root” in object.
sudo pip3 install meson
此时meson
版本为1.3.1
meson -v
1.3.1
离线环境可以下载whl
包进行离线安装
meson:https://pypi.org/simple/meson/meson-1.3.1-py3-none-any.whl
详细排查分析见如下章节
4.3 [meson]ERROR: Dependency lookup for spice-protocol with method ‘pkgconfig’ failed: Invalid version, need ‘spice-protocol’ [‘>= 0.14.3’] found ‘0.14.0’.
下载地址:
spice-protocol:https://gitlab.freedesktop.org/spice/spice-protocol/-/tree/v0.14.3
源码编译spice-protocol-0.14.3
步骤
# 解压源码包
unzip spice-protocol-v0.14.3.zip
# 进入对应目录
cd spice-protocol-v0.14.3/
创建build
目录并检查依赖
meson setup build
The Meson build system
Version: 1.3.1
Source dir: /home/kylin/spice-protocol-v0.14.3
Build dir: /home/kylin/spice-protocol-v0.14.3/build
Build type: native build
Project name: spice-protocol
Project version: 0.14.3
Host machine cpu family: aarch64
Host machine cpu: aarch64
Found pkg-config: YES (/usr/bin/pkg-config) 0.29.1
Build targets in project: 0
Found ninja-1.10.0 at /usr/bin/ninja
安装(只有相关的.h
头文件,不需要编译)
# 进入build目录 cd build # 只有相关的.h头文件,不需要编译 # 安装 sudo ninja install [0/1] Installing files. Installing /home/kylin/spice-protocol-v0.14.3/spice/barrier.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/end-packed.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/enums.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/ipc_ring.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/macros.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/protocol.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/qxl_dev.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/qxl_windows.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/start-packed.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/stats.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/types.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/vd_agent.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/spice/stream-device.h to /usr/local/include/spice-1/spice Installing /home/kylin/spice-protocol-v0.14.3/build/meson-private/spice-protocol.pc to /usr/local/share/pkgconfig
详细排查分析见如下章节
4.4 [meson]DEPRECATION: CMake support for versions ❤️.17 is deprecated since Meson 0.62.0.
下载地址:
cmake:https://github.com/Kitware/CMake/releases/tag/v3.21.0
源码编译cmake-3.21.0
步骤
# 解压源码包
tar -xvf cmake-3.21.0.tar.gz
# 进入对应目录
cd cmake-3.21.0/
./bootstrap
运行bootstrap
工具后,最后会出现如下打印:CMake has bootstrapped. Now run make.
# 编译cmake
make -j8
# 安装
sudo make install
解压源码包并进入对应目录
unzip spice-gtk-v0.42.zip
cd spice-gtk-v0.42/
解压subprojects
的源码包
详细排查分析见如下章节
4.2 [meson]ERROR: Subproject exists but has no meson.build file.
# 进入subprojects文件夹
cd subprojects
# 删除空目录
rm -rf keycodemapdb
rm -rf spice-common
# 拷贝两个子模块的zip包到subprojects文件夹
# 解压
unzip keycodemapdb-14cdba29ecd7448310fe4ff890e67830b1a40f64.zip
unzip spice-common-58d375e5eadc6fb9e587e99fd81adcb95d01e8d6.zip
# 重命名文件夹
mv keycodemapdb-14cdba29ecd7448310fe4ff890e67830b1a40f64 keycodemapdb
mv spice-common-58d375e5eadc6fb9e587e99fd81adcb95d01e8d6 spice-common
修改spice-common
的meson.build
文件
详细排查分析见如下章节
4.11 [meson]WARNING: You should add the boolean check kwarg to the run_command call.
cd spice-common
vim meson.build
# cmd = run_command(python, '-c', 'import @0@'.format(module))
# 增加, check : true
cmd = run_command(python, '-c', 'import @0@'.format(module), check : true)
# 返回上两级目录
cd ../../
创建usbutils.pc
文件
详细排查分析见如下章节
4.10 [meson]Run-time dependency usbutils found: NO (tried pkgconfig and cmake)
sudo vim /usr/lib/aarch64-linux-gnu/pkgconfig/usbutils.pc prefix=/usr exec_prefix=/usr libdir=/usr/lib/aarch64-linux-gnu includedir=/usr/include usbids=/var/lib/usbutils/usb.ids Name: usbutils Description: usbutils This is a collection of USB tools for use on Linux and BSD systems\ to query what type of USB devices are connected to the system. This is to be run on a USB host\ (i.e. a machine you plug USB devices into), not on a USB device (i.e. a device you plug into a USB host.) Version: 012 URL: https://github.com/gregkh/usbutils Requires: libusb-1.0 >= 1.0.14 libudev >= 196 Conflicts: Libs: -L/usr/lib/aarch64-linux-gnu Libs.private: -lusb-1.0 -ludev Cflags: -g -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat=2 -Wtype-limits -O2 -I/usr/include/libusb-1.0
更新一下环境变量
source ~/.bashrc
创建build目录并检查依赖
meson setup build -Dvalgrind=true The Meson build system Version: 1.3.1 Source dir: /home/kylin/spice-gtk-v0.42 Build dir: /home/kylin/spice-gtk-v0.42/build Build type: native build Project name: spice-gtk Project version: UNKNOWN C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10kylin2) 9.3.0") C linker for the host machine: cc ld.bfd 2.34 Host machine cpu family: aarch64 Host machine cpu: aarch64 Executing subproject spice-common spice-common| Project name: spice-common spice-common| Project version: undefined spice-common| C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10kylin2) 9.3.0") spice-common| C linker for the host machine: cc ld.bfd 2.34 spice-common| Has header "alloca.h" : YES spice-common| Has header "arpa/inet.h" : YES spice-common| Has header "dlfcn.h" : YES spice-common| Has header "inttypes.h" : YES spice-common| Has header "netinet/in.h" : YES spice-common| Has header "stdlib.h" : YES spice-common| Has header "sys/socket.h" : YES spice-common| Has header "sys/stat.h" : YES spice-common| Has header "sys/types.h" : YES spice-common| Has header "unistd.h" : YES spice-common| Has header "regex.h" : YES spice-common| Has header "sys/mman.h" : YES spice-common| Checking for function "alloca" : YES spice-common| Checking for function "sigaction" : YES spice-common| Checking for function "drand48" : YES spice-common| Checking for function "setlinebuf" : YES spice-common| Library m found: YES spice-common| Found pkg-config: YES (/usr/bin/pkg-config) 0.29.1 spice-common| Run-time dependency spice-protocol found: YES 0.14.3 spice-common| Run-time dependency glib-2.0 found: YES 2.64.6 spice-common| Run-time dependency pixman-1 found: YES 0.38.4 spice-common| Run-time dependency openssl found: YES 1.1.1f spice-common| Run-time dependency gio-2.0 found: YES 2.64.6 spice-common| Run-time dependency opus found: YES 1.3.1 spice-common| Program python3 found: YES (/usr/bin/python3) spice-common| Message: Checking for python module six spice-common| Message: Checking for python module pyparsing spice-common| Run-time dependency libcacard found: YES 2.6.1 spice-common| Compiler for C supports arguments -DG_LOG_DOMAIN="Spice": YES spice-common| Compiler for C supports arguments -Wno-unused-parameter: YES spice-common| Compiler for C supports arguments -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_38: YES spice-common| Compiler for C supports arguments -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_38: YES spice-common| Run-time dependency gdk-pixbuf-2.0 found: YES 2.40.0 spice-common| Program asciidoc found: YES (/usr/bin/asciidoc) spice-common| Configuring config.h using configuration spice-common| Build targets in project: 16 spice-common| Subproject spice-common finished. Executing subproject keycodemapdb keycodemapdb| Project name: keycodemapdb keycodemapdb| Project version: undefined keycodemapdb| Program tools/keymap-gen found: YES (/home/kylin/spice-gtk-v0.42/subprojects/keycodemapdb/tools/keymap-gen) keycodemapdb| Build targets in project: 16 keycodemapdb| Subproject keycodemapdb finished. Program tools/keymap-gen found: YES (overridden) Has header "termios.h" : YES Has header "X11/XKBlib.h" : YES Has header "sys/socket.h" : YES (cached) Has header "sys/types.h" : YES (cached) Has header "netinet/in.h" : YES (cached) Has header "arpa/inet.h" : YES (cached) Has header "valgrind/valgrind.h" : YES Has header "sys/disk.h" : NO Has header "epoxy/egl.h" : YES Checking for function "clearenv" : YES Checking for function "strtok_r" : YES Dependency spice-protocol found: YES 0.14.3 (cached) Dependency glib-2.0 found: YES 2.64.6 (cached) Dependency gio-2.0 found: YES 2.64.6 (cached) Run-time dependency gobject-2.0 found: YES 2.64.6 Dependency pixman-1 found: YES 0.38.4 (cached) Dependency openssl found: YES 1.1.1f (cached) Run-time dependency libjpeg found: YES 2.0.3 Run-time dependency zlib found: YES 1.2.11 Run-time dependency json-glib-1.0 found: YES 1.4.4 Run-time dependency gio-unix-2.0 found: YES 2.64.6 Dependency opus found: YES 1.3.1 (cached) Run-time dependency gtk+-3.0 found: YES 3.24.23 Run-time dependency epoxy found: YES 1.5.4 Run-time dependency x11 found: YES 1.6.9 Run-time dependency libva-x11 found: YES 1.7.0 Has header "gtk-3.0/gdk/gdkwayland.h" : YES Run-time dependency wayland-protocols found: YES 1.20 Build-time dependency wayland-scanner found: YES 1.18.0 Program /usr/bin/wayland-scanner found: YES (/usr/bin/wayland-scanner) Run-time dependency wayland-server found: YES 1.18.0 Run-time dependency wayland-cursor found: YES 1.18.0 Run-time dependency wayland-client found: YES 1.18.0 Found CMake: /usr/local/bin/cmake (3.21.0) Run-time dependency libphodav-3.0 found: NO (tried pkgconfig and cmake) Run-time dependency libphodav-2.0 found: YES 2.4 Run-time dependency libsoup-2.4 found: YES 2.70.0 Run-time dependency gstreamer-1.0 found: YES 1.16.3 Run-time dependency gstreamer-base-1.0 found: YES 1.16.3 Run-time dependency gstreamer-app-1.0 found: YES 1.16.3 Run-time dependency gstreamer-audio-1.0 found: YES 1.16.3 Run-time dependency gstreamer-video-1.0 found: YES 1.16.3 Run-time dependency libusbredirparser-0.5 found: YES 0.8.0 Run-time dependency libusbredirhost found: YES 0.8.0 Run-time dependency libusb-1.0 found: YES 1.0.23 Run-time dependency libcap-ng found: YES 0.7.9 Run-time dependency polkit-gobject-1 found: YES 0.105 Checking for function "acl_get_file" : NO Library acl found: YES Checking for function "acl_get_file" with dependency -lacl: YES Dependency gio-unix-2.0 found: YES 2.64.6 (cached) Run-time dependency usbutils found: YES 012 Checking for function "makecontext" : YES Checking for function "swapcontext" : YES Checking for function "getcontext" : YES Run-time dependency gobject-introspection-1.0 found: YES 1.64.0 Run-time dependency vapigen found: YES 0.48.3 Run-time dependency liblz4 found: YES 1.9.2 Run-time dependency libsasl2 found: YES 2.1.27 Dependency libcacard found: YES 2.6.1 (cached) Compiler for C supports arguments -DHAVE_CONFIG_H: YES Compiler for C supports arguments -DSPICE_COMPILATION: YES Compiler for C supports arguments -DG_LOG_DOMAIN="GSpice": YES Compiler for C supports arguments -Wno-sign-compare: YES Compiler for C supports arguments -Wno-unused-parameter: YES (cached) Compiler for C supports arguments -Wno-cast-function-type: YES Compiler for C supports arguments -DGLIB_VERSION_MIN_REQUIRED=GLIB_VERSION_2_52: YES Compiler for C supports arguments -DGLIB_VERSION_MAX_ALLOWED=GLIB_VERSION_2_52: YES Compiler for C supports arguments -DGDK_VERSION_MIN_REQUIRED=GDK_VERSION_3_22: YES Compiler for C supports arguments -DGDK_VERSION_MAX_ALLOWED=GDK_VERSION_3_22: YES Configuring config.h using configuration Configuring spice-version.h using configuration Dependency glib-2.0 found: YES 2.64.6 (cached) Program /usr/bin/glib-genmarshal found: YES (/usr/bin/glib-genmarshal) Dependency glib-2.0 found: YES 2.64.6 (cached) Program /usr/bin/glib-mkenums found: YES (/usr/bin/glib-mkenums) Dependency glib-2.0 found: YES 2.64.6 (cached) Program /usr/bin/glib-mkenums found: YES (/usr/bin/glib-mkenums) Compiler for C supports link arguments -Wl,--version-script=/home/kylin/spice-gtk-v0.42/src/map-file: YES Dependency gobject-introspection-1.0 found: YES 1.64.0 (cached) Dependency gobject-introspection-1.0 found: YES 1.64.0 (cached) Program /usr/bin/g-ir-scanner found: YES (/usr/bin/g-ir-scanner) Dependency gobject-introspection-1.0 found: YES 1.64.0 (cached) Program /usr/bin/g-ir-compiler found: YES (/usr/bin/g-ir-compiler) Dependency glib-2.0 found: YES 2.64.6 (cached) Program /usr/bin/glib-mkenums found: YES (/usr/bin/glib-mkenums) Dependency glib-2.0 found: YES 2.64.6 (cached) Program /usr/bin/glib-mkenums found: YES (/usr/bin/glib-mkenums) Program gtkdoc-scan found: YES (/usr/bin/gtkdoc-scan) Dependency glib-2.0 found: YES 2.64.6 (cached) Dependency gtk+-3.0 found: YES 3.24.23 (cached) Program gtkdoc-scan found: YES (/usr/bin/gtkdoc-scan) Program gtkdoc-scangobj found: YES (/usr/bin/gtkdoc-scangobj) Program gtkdoc-mkdb found: YES (/usr/bin/gtkdoc-mkdb) Program gtkdoc-mkhtml found: YES (/usr/bin/gtkdoc-mkhtml) Program gtkdoc-fixxref found: YES (/usr/bin/gtkdoc-fixxref) Program pod2man found: YES (/usr/bin/pod2man) Program msgfmt found: YES (/usr/bin/msgfmt) Program msginit found: YES (/usr/bin/msginit) Program msgmerge found: YES (/usr/bin/msgmerge) Program xgettext found: YES (/usr/bin/xgettext) Program vapigen found: YES (/usr/bin/vapigen) Program vapigen found: YES (/usr/bin/vapigen) Build targets in project: 69 spice-gtk UNKNOWN prefix : /usr/local opus : YES gtk : YES wayland-protocols : YES webdav : YES builtin-mjpeg : YES usbredir : YES libcap-ng : YES polkit : YES pie : YES usb-acl-helper-dir : /usr/local/libexec usb-ids-path : /var/lib/usbutils/usb.ids coroutine : ucontext introspection : YES vapi : YES lz4 : YES sasl : YES smartcard : YES valgrind : YES libspice-client-glib.so version: 8.8.2 libspice-client-gtk.so version : 5.1.1 gtk_doc : YES Subprojects keycodemapdb : YES spice-common : YES User defined options valgrind : true
进入build
目录并编译
cd build ninja -j8 [13/166] Generating subprojects/spice-common/tests/test_marshallers with a custom command Wrote subprojects/spice-common/tests/generated_test_marshallers.c [14/166] Generating subprojects/spice-common/common/client_demarshallers with a custom command Wrote subprojects/spice-common/common/generated_messages.h Wrote subprojects/spice-common/common/generated_client_demarshallers.c [15/166] Generating subprojects/spice-common/tests/test_marshallers_h with a custom command Wrote subprojects/spice-common/tests/generated_test_marshallers.h [16/166] Generating subprojects/spice-common/tests/test_demarshallers with a custom command Wrote /home/kylin/spice-gtk-v0.42/build/subprojects/spice-common/tests/generated_test_messages.h Wrote subprojects/spice-common/tests/generated_test_demarshallers.c [17/166] Generating subprojects/spice-common/tests/test_enums_h with a custom command Wrote subprojects/spice-common/tests/generated_test_enums.h [22/166] Generating subprojects/spice-common/common/client_marshallers with a custom command Wrote subprojects/spice-common/common/generated_client_marshallers.c Wrote subprojects/spice-common/common/generated_client_marshallers.h [27/166] Generating glib marshaller header src/spice-marshal_h INFO: Reading ../src/spice-marshal.txt... [28/166] Generating glib marshaller source src/spice-marshal_c INFO: Reading ../src/spice-marshal.txt... [74/166] Compiling C object src/libspice-client-glib-2.0.so.8.8.2.p/continuation.c.o ../src/continuation.c: In function ‘continuation_trampoline’: ../src/continuation.c:55:21: warning: variable ‘arg’ might be clobbered by ‘longjmp’ or ‘vfork’ [-Wclobbered] 55 | const union cc_arg arg = {{ i0, i1 }}; | ^~~ [163/166] Generating vapi/spice-client-glib-2.0.vapi with a custom command SpiceClientGLib-2.0.gir:56.7-59.25: warning: Creation method of abstract class cannot be public. [166/166] Generating vapi/spice-client-gtk-3.0.vapi with a custom command spice-client-glib-2.0.vapi:9.3-9.14: warning: Creation method of abstract class cannot be public.
安装
sudo ninja install
此时meson
版本为1.3.1
完整的打印为
The Meson build system
Version: 0.53.2
Source dir: /home/kylin/spice-gtk-v0.42
Build dir: /home/kylin/spice-gtk-v0.42/build
Build type: native build
meson.build:4:0: ERROR: Unknown method "project_source_root" in object.
A full log can be found at /home/kylin/spice-gtk-v0.42/build/meson-logs/meson-log.txt
project_source_root
方法在meson
的0.56.0
版本开始支持,详情见meson-0.56.0
版本信息:https://mesonbuild.com/Release-notes-for-0-56-0.html
但是该系统apt
源自带的meson
版本为0.53.2
meson -v
0.53.2
通过apt
源安装的meson
版本过低,需要升级
使用pip
去安装meson
# 安装python-pip
sudo apt install python3 python3-pip
# 安装meson
sudo pip3 install meson
此时meson
版本为1.3.1
meson -v
1.3.1
完整的打印为
The Meson build system
Version: 1.3.1
Source dir: /home/kylin/spice-gtk-v0.42
Build dir: /home/kylin/spice-gtk-v0.42/build
Build type: native build
Project name: spice-gtk
Project version: UNKNOWN
C compiler for the host machine: cc (gcc 9.3.0 "cc (Ubuntu 9.3.0-10kylin2) 9.3.0")
C linker for the host machine: cc ld.bfd 2.34
Host machine cpu family: aarch64
Host machine cpu: aarch64
meson.build:43:15: ERROR: Subproject exists but has no meson.build file.
A full log can be found at /home/kylin/spice-gtk-v0.42/build/meson-logs/meson-log.txt
查看meson.build
文件43行附近
#
# Set up subprojects
#
spice_common = subproject('spice-common',
default_options : [
'generate-code=client',
'spice-protocol-version=@0@'.format(spice_protocol_version),
])
spice_gtk_config_data.merge_from(spice_common.get_variable('spice_common_config_data'))
spice_glib_deps += spice_common.get_variable('spice_common_client_dep')
spice_protocol_version = spice_common.get_variable('spice_protocol_version')
发现是在编译subprojects-spice-common
时出错了
进入subproject
文件夹,发现子模块没有下载
源码没有通过git
拉取,直接下载的zip
包没有包含子模块
下面是spice-gtk-0.42
对应的两个子模块
keycodemap
:https://gitlab.com/keycodemap/keycodemapdb/-/tree/14cdba29ecd7448310fe4ff890e67830b1a40f64
spice-common
:https://gitlab.freedesktop.org/spice/spice-common/-/tree/58d375e5eadc6fb9e587e99fd81adcb95d01e8d6
下载并解压子模块源码到subprojects
文件夹中
# 进入subprojects文件夹
cd spice-gtk-v0.42/subprojects
# 删除空目录
rm -rf keycodemapdb
rm -rf spice-common
# 拷贝两个子模块的zip包到subprojects文件夹
# 解压
unzip keycodemapdb-14cdba29ecd7448310fe4ff890e67830b1a40f64.zip
unzip spice-common-58d375e5eadc6fb9e587e99fd81adcb95d01e8d6.zip
# 重命名文件夹
mv keycodemapdb-14cdba29ecd7448310fe4ff890e67830b1a40f64 keycodemapdb
mv spice-common-58d375e5eadc6fb9e587e99fd81adcb95d01e8d6 spice-common
根据打印信息,spice-protocol
版本过低
spice-protocol
版本过低,源码编译spice-protocol
的0.14.3
版本
spice-protocol:https://gitlab.freedesktop.org/spice/spice-protocol/-/tree/v0.14.3
编译和安装步骤在3 编译与安装章节描述
完整打印为
spice-common| Found CMake: /usr/bin/cmake (3.16.3)
spice-common| DEPRECATION: CMake support for versions <3.17 is deprecated since Meson 0.62.0.
spice-common| |
spice-common| | However, Meson was only able to find CMake 3.16.3.
spice-common| |
spice-common| | Support for all CMake versions below 3.17.0 will be removed once
spice-common| | newer CMake versions are more widely adopted. If you encounter
spice-common| | any errors please try upgrading CMake to a newer version first.
cmake
版本过低,源码编译cmake
的3.21.0
版本
cmake:https://github.com/Kitware/CMake/releases/tag/v3.21.0
编译和安装步骤在3 编译与安装章节描述
根据打印信息,没找到json-glib-1.0
的环境
安装相关包
sudo apt install libjson-glib-dev
根据打印信息,没找到gstreamer-app-1.0
的环境
安装相关包
sudo apt install libgstreamermm-1.0-dev
根据打印信息,没找到acl
的库
安装相关包
sudo apt install libacl1-dev
查看附近的打印
Run-time dependency gobject-introspection-1.0 found: NO (tried pkgconfig and cmake)
Run-time dependency vapigen found: YES 0.48.3
meson.build:358:4: ERROR: Problem encountered: VAPI support requested without introspection
其实是开启的VAPI
的编译选项,但是gobject-introspection-1.0
没找到
安装相关包gobject-introspection
,还需要额外安装libgirepository1.0-dev
sudo apt install gobject-introspection libgirepository1.0-dev
这个sys/disk.h
头文件找不到
一般来说sys
文件夹下的头文件,有可能是属于内核开发包里面
用命令查看系统下也确实安装了对应的内核开发包
dpkg -l | grep linux-headers
ii linux-headers-5.4.18-85 5.4.18-85.74 all Header files related to Linux kernel version 5.4.18
ii linux-headers-5.4.18-85-generic 5.4.18-85.74 arm64 Linux kernel headers for version 5.4.18 on ARMv8 SMP
ii linux-headers-generic 5.4.18.85.74 arm64 Generic Linux kernel headers
看一下源码中这个头文件引用
spice-gtk-v0.42/src/usb-device-cd.c:41
#if defined(__APPLE__) && defined(HAVE_SYS_DISK_H)
#include <sys/disk.h>
#include <fcntl.h>
可以看出这个是mac
系统特有的头文件
mac
系统特有的头文件,没有也没问题
usbutils
这个包已经安装了,为啥还是找不到呢?
dpkg -l | grep usbutils
ii usbutils 1:012-2kylin1 arm64 Linux USB utilities
看一下完整的meson
日志:build/meson-logs/meson-log.txt
Determining dependency 'usbutils' with pkg-config executable '/usr/bin/pkg-config'
env[PKG_CONFIG_PATH]:
env[PKG_CONFIG]: /usr/bin/pkg-config
-----------
Called: `/usr/bin/pkg-config --modversion usbutils` -> 1
stderr:
Package usbutils was not found in the pkg-config search path.
Perhaps you should add the directory containing `usbutils.pc'
to the PKG_CONFIG_PATH environment variable
No package 'usbutils' found
-----------
CMake binary for host machine is cached.
Preliminary CMake check failed. Aborting.
Run-time dependency usbutils found: NO (tried pkgconfig and cmake)
meson
是通过pkg-config
来找依赖,pkg-config
是通过三方库提供的.pc
文件来保存库信息。usbutils
包应该提供usbutils.pc
的文件。
系统默认的位置为:/usr/lib/aarch64-linux-gnu/pkgconfig/
查看一下usbutils
包的安装的文件和路径
dpkg -L usbutils /. /usr /usr/bin /usr/bin/lsusb /usr/bin/usb-devices /usr/bin/usbhid-dump /usr/bin/usbreset /usr/share /usr/share/bug /usr/share/bug/usbutils /usr/share/bug/usbutils/presubj /usr/share/doc /usr/share/doc/usbutils /usr/share/doc/usbutils/changelog.Debian.gz /usr/share/doc/usbutils/copyright /usr/share/man /usr/share/man/man1 /usr/share/man/man1/usb-devices.1.gz /usr/share/man/man8 /usr/share/man/man8/lsusb.8.gz /usr/share/man/man8/usbhid-dump.8.gz
发现并没有usbutils.pc
的文件,那pkg-config
自然也找不到。
usbutils
是开源的工具,可以尝试进行源码编译,看源码编译的版本是否会生成usbutils.pc
的文件。
为了尽量保持版本一致,先查看usbutils
的包详细信息及版本
apt-cache show usbutils Package: usbutils Architecture: arm64 Version: 1:012-2kylin1 Multi-Arch: foreign Priority: optional Section: universe/utils Origin: Ubuntu Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> Original-Maintainer: Aurelien Jarno <aurel32@debian.org> Bugs: https://bugs.launchpad.net/ubuntu/+filebug Installed-Size: 312 Depends: libc6 (>= 2.17), libudev1 (>= 196), libusb-1.0-0 (>= 2:1.0.22), usb.ids Filename: pool/universe/u/usbutils/usbutils_012-2kylin1_arm64.deb Size: 76876 MD5sum: cdb15d8c0e06ad9f702de1ae25346ed8 SHA1: 443d901154b802d07b1d6b6dcded271a5b0e9e90 SHA256: 73dbff66e6f559416c52ad9e48ffa244843fd4c4bf1d4a1ae3d2f70f1fe5717a SHA512: e9ddee02cb347089b4b257f3f3eddd830338a257d8d22840364e338ba058f3104f8ea6ada2ed558dc0281ca715f1ab26b77216e5ef95d7c3ad32113756757225 Homepage: https://github.com/gregkh/usbutils Description: Linux USB utilities This package contains the lsusb utility for inspecting the devices connected to the USB bus. It shows a graphical representation of the devices that are currently plugged in, showing the topology of the USB bus. It also displays information on each individual device on the bus. Description-md5: 928f8c65aee445506dc03a844a66adac cert_subject_cn: 麒麟软件有限公司 cert_subject_o: 麒麟软件有限公司 cert_subject_ou: DS120G321040301
下载usbutils-012
的源码包
usbutils:https://github.com/gregkh/usbutils/releases/tag/v012
源码编译usbutils-012
# 安装依赖
sudo apt install libudev-dev
# 解压源码包
tar -xvf usbutils-012.tar.gz
# 进入目录
cd usbutils-012/
# 运行脚本检查依赖并生成Makefile文件
./autogen.sh
# 编译
make -j8
编译完成之后,发现并没有生成usbutils.pc
文件
从github
上面拉取usbutils
的源码,看一下提交信息
2017-11-26 03:59:12
有一个commit
删除了usbutils.pc
文件
SHA-1: 9340f4f8aecde252254eb70194c028239de79cff
* Do not create and install usbutils.pc
The usbutils pkgconfig file defines where the usb.ids database is
installed. Given usbutils does not ship with usb.ids and does not
install it anymore, it makes no sense to install such a pkgconfig
anymore. Remove it.
Signed-off-by: Aurelien Jarno <aurelien@aurel32.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
大概意思是usbutils
没有提供usb.ids
,但是usbutils.pc
中却又指定了usb.ids
安装后的位置,他认为这样的usbutils.pc
是没有意义的,所以需要去掉该文件。
dpkg-query -S usb.ids
usb.ids: /usr/share/doc/usb.ids/copyright
usb.ids: /usr/share/doc/usb.ids/changelog.Debian.gz
usb.ids: /usr/share/misc/usb.ids
usb.ids: /usr/share/doc/usb.ids
usb.ids: /var/lib/usbutils/usb.ids
usb.ids
是由usb.ids
软件包提供,并不是usbutils
但奇怪的是
2023-04-28 02:59:25
有一个commit
又增加了usbutils.pc
文件
SHA-1: 2996e23d5866d5d692acdba1d68bcaea2808ef71
* Generate usbutils.pc pkgconfig file
Allow buildsystems using pkgconfig to find usb-utils.
I think some library I was using was trying to find usb.ids using pkgconfig.
Signed-off-by: Hannes Weisbach <hannesweisbach@gmail.com>
大概是很多构建系统从pkgconfig
来判断是否安装了usb-utils
,没有提供usbutils.pc
文件,导致了很多问题,最后还是妥协了,把usbutils.pc
加回来了。我编译的spice-gtk-0.42
属于比较新的版本,但是用的银河麒麟内核版本不算很新,配套的usbutils
版本也比较老,导致出现这个问题。
usbutils-016
的release
版本包含该commit
,源码编译该版本,修改生成的usbutils.pc
文件拷贝到/usr/lib/aarch64-linux-gnu/pkgconfig/
即可。
usbutils-016
生成的usbutils.pc
文件
prefix=/usr exec_prefix=/usr libdir=/usr/lib64 includedir=/usr/include usbids=${prefix}/share/usb.ids Name: usbutils Description: usbutils This is a collection of USB tools for use on Linux and BSD systems\ to query what type of USB devices are connected to the system. This is to be run on a USB host\ (i.e. a machine you plug USB devices into), not on a USB device (i.e. a device you plug into a USB host.) Version: 016 URL: https://github.com/gregkh/usbutils Requires: libusb-1.0 >= 1.0.14 libudev >= 196 Conflicts: Libs: -L/usr/lib64 Libs.private: -lusb-1.0 -ludev Cflags: -g -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat=2 -Wtype-limits -O2 -I/usr/include/libusb-1.0
修改后的usbutils.pc
文件
prefix=/usr exec_prefix=/usr libdir=/usr/lib/aarch64-linux-gnu includedir=/usr/include usbids=/var/lib/usbutils/usb.ids Name: usbutils Description: usbutils This is a collection of USB tools for use on Linux and BSD systems\ to query what type of USB devices are connected to the system. This is to be run on a USB host\ (i.e. a machine you plug USB devices into), not on a USB device (i.e. a device you plug into a USB host.) Version: 012 URL: https://github.com/gregkh/usbutils Requires: libusb-1.0 >= 1.0.14 libudev >= 196 Conflicts: Libs: -L/usr/lib/aarch64-linux-gnu Libs.private: -lusb-1.0 -ludev Cflags: -g -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat=2 -Wtype-limits -O2 -I/usr/include/libusb-1.0
创建usbutils.pc
文件
vim usbutils.pc prefix=/usr exec_prefix=/usr libdir=/usr/lib/aarch64-linux-gnu includedir=/usr/include usbids=/var/lib/usbutils/usb.ids Name: usbutils Description: usbutils This is a collection of USB tools for use on Linux and BSD systems\ to query what type of USB devices are connected to the system. This is to be run on a USB host\ (i.e. a machine you plug USB devices into), not on a USB device (i.e. a device you plug into a USB host.) Version: 012 URL: https://github.com/gregkh/usbutils Requires: libusb-1.0 >= 1.0.14 libudev >= 196 Conflicts: Libs: -L/usr/lib/aarch64-linux-gnu Libs.private: -lusb-1.0 -ludev Cflags: -g -Wall -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Wpointer-arith -Wsign-compare -Wchar-subscripts -Wstrict-prototypes -Wshadow -Wformat=2 -Wtype-limits -O2 -I/usr/include/libusb-1.0
拷贝到对应路径/usr/lib/aarch64-linux-gnu/pkgconfig/
sudo cp usbutils.pc /usr/lib/aarch64-linux-gnu/pkgconfig/
# 更新一下环境变量
source ~/.bashrc
查看附近的打印
spice-common| WARNING: You should add the boolean check kwarg to the run_command call.
spice-common| It currently defaults to false,
spice-common| but it will default to true in future releases of meson.
spice-common| See also: https://github.com/mesonbuild/meson/issues/9300
run_command
函数应该传入检查参数,此时默认为false
,后续版本可能为true
关于默认参数是true
还是false
的讨论可以看这个issues
https://github.com/mesonbuild/meson/issues/9300
查看一下spice-common
的meson.build
文件
# Python
if spice_common_generate_client_code or spice_common_generate_server_code
py_module = import('python')
python = py_module.find_installation('python3')
if get_option('python-checks')
foreach module : ['six', 'pyparsing']
message('Checking for python module @0@'.format(module))
cmd = run_command(python, '-c', 'import @0@'.format(module))
if cmd.returncode() != 0
error('Python module @0@ not found'.format(module))
endif
endforeach
endif
endif
run_command
确实没有传入检查参数
修改spice-common
的meson.build
文件,run_command
传入检查参数
修改完成后如下
cmd = run_command(python, '-c', 'import @0@'.format(module), check : true)
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。