pro文件的内容
----------------------------------------------
QT += core gui network
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = myapp
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
include(src/src.pri)
linux-g++ {
isEmpty(PREFIX) {
PREFIX = /usr
}
target.path = $$PREFIX/bin
desktop.path = $$PREFIX/share/applications/
desktop.files += myapp.desktop
INSTALLS += target desktop
}
----------------------------------------------------
src.pri的内容(省略了部分文件名)
SOURCES += \
$$PWD/main.cpp \
$$PWD/maindialog.cpp \
$$PWD/settingsdialog.cpp \
...
HEADERS += \
$$PWD/maindialog.h \
$$PWD/settingsdialog.h \
...
FORMS += \
$$PWD/maindialog.ui \
$$PWD/settingsdialog.ui \
...
RESOURCES += $$PWD/src.qrc
因为本机环境是Ubuntu20.04, linuxdeployqt不支持, 用了a12e/docker-qt:5.14-gcc_64进行发
布. 命令是按
https://hub.docker.com/r/a12e/docker-qt 页面上的指示来的, 因为有fuse:
device not found 的错误, 所以加了 --appimage-extract-and-run 参数
git clone
https://somewhere/myapp.gitmkdir build
cd build/
qmake -r ../myapp/
make
make install INSTALL_ROOT=~/appdir
cd ~
linuxdeployqt --appimage-extract-and-run appdir/usr/share/applications/*.desktop
-bundle-non-qt-libs
到这一步之后, 查看appdir目录的大小有71M, 其中appdir/usr/lib 目录大小就有64M, 尺寸最大的几
个文件
~/appdir/usr/lib$ ll -S
total 65172
-rwxr-xr-x 1 user user 25047704 May 17 11:32 libicudata.so.56*
-rwxr-xr-x 1 user user 8636920 May 17 11:32 libQt5Gui.so.5*
-rwxr-xr-x 1 user user 8080600 May 17 11:32 libQt5Widgets.so.5*
-rwxr-xr-x 1 user user 6927520 May 17 11:32 libQt5Core.so.5*
-rwxr-xr-x 1 user user 2718616 May 17 11:32 libicui18n.so.56*
-rwxr-xr-x 1 user user 2205160 May 17 11:32 libQt5Network.so.5*
-rwxr-xr-x 1 user user 2001136 May 17 11:32 libQt5XcbQpa.so.5*
-rwxr-xr-x 1 user user 1792616 May 17 11:32 libicuuc.so.56*
-rw-r--r-- 1 user user 927040 May 17 11:32 libgcrypt.so.20
-rw-r--r-- 1 user user 884056 May 17 11:32 libkrb5.so.3
有没有什么精简的手段? 第一个libicudata这个包我想查是因为哪个依赖引进来的, 如何能查?
--
FROM 223.72.64.*