[Exchange and share] 在V32版本上安装kdeconnect的deb包
Tofloor
poster avatar
qiuz
deepin
2023-10-08 23:54
Author

本文参考了@川顺页 的 DeepinV23 beta2编译KDE connect 帖子,并且本篇文章的大部分操作也是基于该文章进行衍生的。

原帖地址

但是川顺页的文章中有一个问题,就是所有的额外库kirigami-addons、pulseaudio-qt、kpeoplevcard都是通过make && make install进行安装的,这种操作方式导致了没法进行很方便的二进制分发,也就是说,如果其他人要安装kdeconnect,就需要重新把上面的流程整个重新走一遍。那么我就想有没有一种方式能够直接解决上面的依赖问题呢?其他我们只需要参考debian中对应的库版本,提取出对应的debian目录,就可以自己编译出kdeconnect的deb包了。完整操作如下:

安装依赖

sudo apt install git gcc g++ cmake clang-format appstream qtbase5-dev qt5-default qtdeclarative5-dev qtquickcontrols2-5-dev libqt5svg5-dev qttools5-dev-tools qttools5-dev qtbase5-private-dev  libkf5package-dev qtwayland5-dev-tools libwayland-dev libqt5waylandclient5-dev wayland-protocols libdbus-1-dev qtmultimedia5-dev libqt5x11extras5-dev gperf libxcb1-dev libxcb-keysyms1-dev libxcb-res0-dev libxfixes-dev libxcb-icccm4-dev libphonon4qt5-dev libxml2-utils libxslt1-dev libxml2-dev docbook-xml docbook-xsl libfakekey-dev libboost1.74-dev libgl1-mesa-dev libx11-xcb-dev libxcb-randr0-dev libxcb-xinerama0-dev libxcb-xinput-dev libxcb-xkb-dev libqca-qt5-2-dev libxss-dev gettext autoconf libtool libnma-dev libpipewire-0.3-dev libavcodec-dev libavformat-dev libgbm-dev libswscale-dev libepoxy-dev libdrm-dev modemmanager-dev libfam-dev libudev-dev libcanberra-dev libacl1-dev qml-module-qtquick-controls2 kirigami2-dev qml-module-org-kde-kirigami2 libkf5i18n-dev libkf5i18n5 qml-module-org-kde-i18n-localedata libkf5i18nlocaledata5 libkf5coreaddons-dev libkf5coreaddons5 qml-module-org-kde-kcoreaddons libkf5codecs-dev libkf5codecs5 qml-module-org-kde-kconfig libkf5config-dev libkf5kcmutils-dev libkf5configwidgets-dev plasma-wayland-protocols libkf5guiaddons-dev libkf5widgetsaddons-dev libkf5auth5 libkf5auth-dev libkf5configwidgets-dev libkf5configwidgets5 libkf5dbusaddons-dev libkf5dbusaddons5 libkf5archive-dev libkf5archive5 libkf5iconthemes-dev libkf5windowsystem-dev libkf5windowsystem5 qml-module-org-kde-kwindowsystem libkf5notifications-dev libkf5service-dev qml-module-org-kde-solid libkf5solid-dev libkf5solid-bin libkf5crash-dev libkf5crash5 libkf5itemviews-dev  libkf5itemviews5 libkf5itemmodels5 libkf5itemmodels-dev libkf5globalaccel-dev libkf5globalaccel5 libkf5xmlgui-dev libkf5bookmarks-dev libkf5bookmarks5 libkf5completion-dev libkf5completion5 libkf5jobwidgets-dev sonnet-plugins libkf5sonnetui5 libkf5sonnet-dev libkf5sonnet-dev-bin libkf5sonnetcore5 qml-module-org-kde-sonnet libkf5textwidgets-dev qml-module-org-kde-kio qml-module-org-kde-kio libkf5kio-dev libkf5package5 libkf5package-dev libkf5declarative-dev libkf5kcmutils5 libkf5kcmutils-dev qml-module-org-kde-people libkf5people-dev libkf5peoplebackend5 libkf5peoplewidgets5 libkf5contacts-dev libkf5contacts5 modemmanager-dev libkf5doctools-dev libkf5doctools5 kdoctools5 libkf5qqc2desktopstyle-dev qml-module-org-kde-qqc2desktopstyle libpulse-dev libkf5wayland-dev qml-module-qtquick-particles2

以上基本都是编译依赖,这一步参考了@川顺页的依赖列表,额外添加了qtbase5-dev。

下面的是安装依赖:

sudo apt install libqca-qt5-2-plugins qml-module-org-kde-people qml-module-qtquick-particles2

安装kpeoplevcard

直接使用debian仓库里面现成的,依赖关系都满足,直接安装就行

wget https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/k/kpeoplevcard/kpeople-vcard_0.1-3_amd64.deb
sudo dpkg -i kpeople-vcard_0.1-3_amd64.deb

安装pulseaudio-qt和pulseaudio-qt-dev

同上,直接使用debian仓库里面的:

wget https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/p/pulseaudio-qt/libkf5pulseaudioqt-dev_1.3-2%2Bb1_amd64.deb
wget https://mirrors.tuna.tsinghua.edu.cn/debian/pool/main/p/pulseaudio-qt/libkf5pulseaudioqt3_1.3-2%2Bb1_amd64.deb
sudo dpkg -i libkf5pulseaudioqt*.deb

编译kdeconnect

git clone https://invent.kde.org/network/kdeconnect-kde.git -b v22.04.3

源代码的版本依赖@川顺页的帖子中已经分析的很清楚了,此处不做过多介绍。

我们剩下的就是需要下载kdeconnect的debian目录。我们从debian上游找到了一个kdeconnect的debian目录工程,clone下来后,将debian目录移到kdeconnect工程中:

git clone https://salsa.debian.org/qt-kde-team/kde/kdeconnect.git
mv kdeconnect/debian kdeconnect-kde/
cd kdeconnect-kde

之后我们就可以在kdeconnect-kde目录下面编译deb包了。直接编译的话,会提示kf5的版本冲突,我们吧debian/control中的关于kf5的版本全都修改成 5.89.0

image.png

为了解决打包locale文件的时候出现失败,我们吧locale相关的安装目录注释掉

即注释掉usr/share/locale这一行。

debian中的版本号我就懒得改了,虽然写的是22.12.3,但是我们下载的源代码实际上是22.04.3,但是并不影响正常运行。

然后就可以正常进行编译了。我们接下来开始编译:

apt build-dep .
dpkg-buildpackage -b -us -uc

执行上面两条命令后,不出意外的话,就能够生成kdeconnect的deb包了

$ ls -al |grep kdeconnect
-rw-r--r--  1 xml  xml        21603 10月 8日 14:53 kdeconnect_22.12.3-1_amd64.buildinfo
-rw-r--r--  1 xml  xml         1898 10月 8日 14:53 kdeconnect_22.12.3-1_amd64.changes
-rw-r--r--  1 xml  xml       686380 10月 8日 14:53 kdeconnect_22.12.3-1_amd64.deb
-rw-r--r--  1 xml  xml     22626092 10月 8日 14:53 kdeconnect-dbgsym_22.12.3-1_amd64.deb
drwxr-xr-x 30 xml  xml         4096 10月 8日 14:52 kdeconnect-kde
-rw-r--r--  1 xml  xml         9252 10月 8日 14:53 nautilus-kdeconnect_22.12.3-1_all.deb

安装

sudo dpkg -i kdeconnect_22.12.3-1_amd64.deb

如果还有依赖关系,请参考错误提示自行安装依赖。

懒人版

我把所有的deb包作为附件上传,只需要下载下来,手动通过dpkg -i安装就行,缺少什么依赖自行安装提示安装:

sudo dpkg -i *.deb

kdeconnect.tar.gz
image.png

Reply Favorite View the author
All Replies
川顺页
deepin
2023-10-09 08:20
#1

agree

Reply View the author