Предыдущая заметка была посвящена сборке пакетов приложений, созданных в среде Lazarus. В этой заметке дается описание сборки установочного пакета ArchLinux другой популярной среды разработки Qt Creator.
Установочный пакет нужен для поставки исправного приложения конечному пользователю.
sudo pacman -S qtcreator
cd /home/username/qt-example/hello-qt
ls
Выведет список файлов:
CMakeLists.txt CMakeLists.txt.user main.cpp mainwindow.cpp mainwindow.h mainwindow.uitouch PKGBUILD
Вставляем в редакторе
(о приемах работы в vi есть заметка на сайте)
vi PKGPUILD
следующий шаблон# Maintainer: Artem Nazarov <artem@nazarow.ru>
pkgname=hello-qt
pkgver=0.0.1
pkgrel=1
pkgdesc='Test app'
arch=('x86_64')
url=""
license=('LGPL3')
depends=()
makedepends=()
conflicts=()
provides=()
groups=()
source=("hello-qt.pro" "main.cpp" "mainwindow.cpp" "mainwindow.h" "mainwindow.ui")
sha512sums=("SKIP" "SKIP" "SKIP" "SKIP" "SKIP")
build() {
qmake PREFIX=/usr
make
}
package() {
make install
}
touch hello-qt.pro
Вставляем строки , используя редактор vi hello-qt.pro
# Tells build system that project uses Qt Core and Qt GUI modules.
QT += core gui
# Prior to Qt 5 widgets were part of Qt GUI module. In Qt 5 we need to add Qt Widgets module.
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
# Specifies name of the binary.
TARGET = hello-qt
# Denotes that project is an application.
TEMPLATE = app
# List of source files (note: Qt Creator will take care about this list, you don't need to update is manually).
SOURCES += main.cpp\
mainwindow.cpp
# List of header files (note: Qt Creator will take care about this list).
HEADERS += mainwindow.h
# List of "ui" files for a tool called Qt Designer, which is embedded into Qt Creator in newer versions of IDE (note: Qt Creator will take care about this li
st).
FORMS += mainwindow.ui
makepkg -si
ls
), появился установочный файл пакета
hello-qt-0.0.1-1-x86_64.pkg.tar.zstПользователь может установить программу из пакета так
sudo pacman -U hello-qt-0.0.1-1-x86_64.pkg.tar.zst
hello-qt
which hello-qt
/bin/hello-qtsudo pacman -R hello-qt