Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
Qt程序自依赖AppImage打包教材3/4(以TheNewPlayerFree为例)
社区开发
1.4w
views ·
0
replies ·
To
floor
Go
已退deepin
deepin
2020-07-11 17:12
Author
本帖最后由 user0001 于 2020-7-11 15:38 编辑
1/4
https://bbs.deepin.org/post/196995
2/4
https://bbs.deepin.org/post/196996
3/4
https://bbs.deepin.org/post/196998
4/4 (end)
https://bbs.deepin.org/post/196999
准备部署动态库
前往下面的网址下载linuxdeployqt工具
https://github.com/probonopd/linuxdeployqt
下载后得到linuxdeployqt.AppImage
chmod +x
linuxdeployqt.AppImage
sudo mv linuxdeployqt.AppImage /usr/local/bin/linuxdeployqt
同时还需要安装patchelf工具等()这一步请参考七主页
cd thenewplayerfree.AppDir/usr/local/thenewplayerfree
linuxdeployqt bin/thenewplayerfree -no-strip -unsupported-allow-new-glibc -always-overwrite -bundle-non-qt-libs -no-translations
rm AppRun #我们不需要这个
rm bin/qt.conf
cd bin
ln -s ../etc/qt.conf qt.conf #使用我们自己的配置
对二进制的绝对路径进行转换
sed -i -e 's#/usr#././#g'
thenewplayerfree.AppDir/usr/local/thenewplayerfree/bin/thenewplayerfree
#检查,因为没有输出为正确
strings thenewplayerfree.AppDir/usr/local/thenewplayerfree/bin/thenewplayerfree|grep /usr
find usr/local/thenewplayerfree/lib -type f -exec sed -i -e 's#/usr#././#g' {} \;
strings thenewplayerfree.AppDir/usr/local/thenewplayerfree/lib/*|grep /usr #检查
#处理GDK依赖
#
https://docs.appimage.org/packaging-guide/manual.html
sh bundle-gtk2.sh thenewplayerfree.AppDir
# 请使用我提供的bundle-gtk2.sh脚本进行自动化处理
bundle-gtk2.tar
export APPDIR=$PWD/thenewplayerfree.AppDir
#
# 处理Theme引擎
(获得更好的兼容性)
#
mkdir -p "$APPDIR/usr/lib/gtk-2.0"
GTK_LIBDIR
=$(pkg-config --variable=libdir gtk+-2.0)
GTK_BINARY_VERSION
=$(pkg-config --variable=gtk_binary_version gtk+-2.0)
cp -a "${GTK_LIBDIR}/gtk-2.0/${GTK_BINARY_VERSION}"/* "$APPDIR/usr/lib/gtk-2.0"
#
# 处理RSVG依赖(获得更好的兼容性)
#
mkdir -p "$APPDIR/usr/lib"
RSVG_LIBDIR
=$(pkg-config --variable=libdir librsvg-2.0)
if [ x"${RSVG_LIBDIR}" != "x" ]; then
export
GDK_PIXBUF_MODULE_FILE
="${APPDIR}/usr/lib/gdk-pixbuf-2.0/loaders.cache"
echo "cp -a ${RSVG_LIBDIR}/librsvg*.so* $APPDIR/usr/lib"
cp -a "${RSVG_LIBDIR}"/librsvg*.so* "$APPDIR/usr/lib"
fi
Reply
Like 0
Favorite
View the author
All Replies
No replies yet
Please
sign
in first
Featured Collection
Change
[Tutorial] deepin25 WSL Offline Installation Guide
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Events
More
1/4
https://bbs.deepin.org/post/196995
2/4
https://bbs.deepin.org/post/196996
3/4
https://bbs.deepin.org/post/196998
4/4 (end)
https://bbs.deepin.org/post/196999
准备部署动态库