3 Commits

Author SHA1 Message Date
TheAssassin 3919cb0eba Make AppImageUpdate work 2019-09-28 17:03:06 +02:00
TheAssassin 59430de4d1 Fix travis config, mk. 1 2019-09-28 16:48:12 +02:00
TheAssassin a716e088e5 Build on CentOS 6 2019-09-28 16:41:16 +02:00
29 changed files with 194 additions and 502 deletions
-99
View File
@@ -1,99 +0,0 @@
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
appimage-x86_64:
name: Build x86_64 AppImage on CentOS 7
runs-on: ubuntu-latest
env:
ARCH: x86_64
BUILD_TYPE: centos7
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build AppImage in CentOS 7
run: ci/build-centos7-docker.sh
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: AppImage x86_64
path: linuxdeploy-plugin-qt*.AppImage*
appimage-i386:
name: Build i386 AppImage on CentOS 7
runs-on: ubuntu-latest
env:
ARCH: i386
BUILD_TYPE: centos7
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Build AppImage in CentOS 7
run: ci/build-centos7-docker.sh
- name: Archive artifacts
uses: actions/upload-artifact@v2
with:
name: AppImage i386
path: linuxdeploy-plugin-qt*.AppImage*
# TODO: build and test on i386 as well!
build-text-xenial-x86_64:
name: Build and test on Ubuntu xenial x86_64 (no binaries uploaded)
runs-on: ubuntu-16.04
env:
ARCH: x86_64
BUILD_TYPE: test
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: bash ci/install-dependencies.sh
- name: Build and install patchelf
run: bash -ex ci/install-patchelf.sh
- name: Build and test AppImage
run: |
bash -ex ci/build.sh
bash -xe ci/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage
# TODO: build and test on i386 as well!
build-text-bionic-x86_64:
name: Build and test on Ubuntu bionic x86_64 (no binaries uploaded)
runs-on: ubuntu-18.04
env:
ARCH: x86_64
BUILD_TYPE: test
steps:
- uses: actions/checkout@v2
with:
submodules: recursive
- name: Install dependencies
run: bash ci/install-dependencies.sh
- name: Build and install patchelf
run: bash -ex ci/install-patchelf.sh
- name: Build and test AppImage
run: |
bash -ex ci/build.sh
bash -xe ci/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage
upload:
name: Create release and upload artifacts
needs:
- appimage-x86_64
- appimage-i386
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Inspect directory after downloading artifacts
run: ls -alFR
- name: Create release and upload artifacts
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
wget -q https://github.com/TheAssassin/pyuploadtool/releases/download/continuous/pyuploadtool-x86_64.AppImage
chmod +x pyuploadtool-x86_64.AppImage
./pyuploadtool-x86_64.AppImage **/linuxdeploy-plugin-qt*.AppImage*
-2
View File
@@ -1,5 +1,3 @@
*build*/
.idea/
*.AppImage
*.zsync
*.swp
+72
View File
@@ -0,0 +1,72 @@
language: cpp
dist: xenial
matrix:
include:
- name: Build x86_64 AppImage on CentOS 6
services:
- docker
env: ARCH=x86_64 BUILD_TYPE=centos6
script: travis/build-centos6-docker.sh
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy*.AppImage*
- name: Build i386 AppImage on CentOS 6
services:
- docker
env: ARCH=i386 BUILD_TYPE=centos6
script: travis/build-centos6-docker.sh
after_success:
- ls -lh
# make sure only pushes to rewrite create a new release, otherwise pretend PR and upload to transfer.sh
- if [ "$TRAVIS_TAG" != "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BRANCH" != "master" ]; then export TRAVIS_EVENT_TYPE=pull_request; fi
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh linuxdeploy*.AppImage*
# TODO: build and test on i386 as well!
- name: Build and test on Ubuntu xenial (no binaries uploaded)
dist: xenial
sudo: required
env: ARCH=x86_64 BUILD_TYPE=test
addons:
apt:
update: true
sources:
- sourceline: 'ppa:beineri/opt-qt-5.12.3-xenial'
packages:
- libmagic-dev
- libjpeg-dev
- libpng-dev
- cimg-dev
- automake # required for patchelf
- gcc
- g++
# Packages below are only required by the test srcipt
- qt512-meta-minimal
- qt512declarative
- qt512webengine
- mesa-common-dev
- libgl1-mesa-dev # <-- that's for xenial to provide the x86_64-linux-gnu/libGL.so symlink
- # libglvnd-dev # <-- that's for bionic to provide aforementioned symlink
install:
- git clone https://github.com/NixOS/patchelf.git -b 0.8
- cd patchelf
- ./bootstrap.sh
- if [ "$ARCH" == "i386" ]; then export EXTRA_CONFIGURE_ARGS=("--build=i686-pc-linux-gnu" "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32"); fi
- ./configure --prefix=/usr "${EXTRA_CONFIGURE_ARGS[@]}"
- make -j$(nproc)
- sudo make install
- cd ..
- rm -rf patchelf
script:
- bash -xe travis/build.sh
- bash -xe travis/test.sh linuxdeploy-plugin-qt-"$ARCH".AppImage
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)$/
+3 -3
View File
@@ -1,6 +1,6 @@
# linuxdeploy-plugin-qt
Plugin for linuxdeploy to bundle Qt dependencies of applications and libraries. It supports the Qt versions 5 and 6.
Plugin for linuxdeploy to bundle Qt dependencies of applications and libraries.
## About
@@ -59,5 +59,5 @@ Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured so
- `$EXTRA_QT_PLUGINS=pluginA;pluginB`: Plugins to deploy even if not found automatically by linuxdeploy-plugin-qt
QML related:
- `$QML_SOURCES_PATHS`: directory containing the application's QML files — useful/needed if QML files are "baked" into the binaries. `$QT_INSTALL_QML` is prepended to this list internally.
- `$QML_MODULES_PATHS`: extra directories containing imported QML files (normally doesn't need to be specified).
- `$QML_SOURCES_PATHS`: directory containing the application's QML files -- useful/needed if QML files are "baked" into the binaries
- `$QML_MODULES_PATHS`: extra directories containing imported QML files (normally doesn't need to be specified)
-27
View File
@@ -1,27 +0,0 @@
#! /bin/bash
set -e
set -x
ubuntu_release="$(cat /etc/*release | grep -E '^DISTRIB_CODENAME=' | cut -d= -f2-)"
sudo add-apt-repository -y ppa:beineri/opt-qt-5.14.2-"$ubuntu_release"
sudo apt-get update
packages=(
libmagic-dev libjpeg-dev libpng-dev cimg-dev mesa-common-dev
# dependencies of patchelf
automake gcc g++
# up to date Qt with required plugins
qt514-meta-minimal qt514declarative qt514webengine
)
if [[ "$ubuntu_release" == "xenial" ]]; then
packages+=(libgl1-mesa-dev)
else
packages+=(libglvnd-dev)
fi
sudo apt-get install -y "${packages[@]}"
-36
View File
@@ -1,36 +0,0 @@
#! /bin/bash
if [[ "$CI" == "" ]]; then
echo "Error: this script is supposed to be run in a (disposable) CI environment"
exit 2
fi
if [[ "$ARCH" == "" ]]; then
echo "Usage: env ARCH=... bash $0"
exit 3
fi
build_dir="$(mktemp -d /tmp/patchelf-build-XXXXX)"
cleanup() {
rm -rf "$build_dir"
}
trap cleanup EXIT
pushd "$build_dir"
git clone https://github.com/NixOS/patchelf.git -b 0.8 .
./bootstrap.sh
EXTRA_CONFIGURE_ARGS=()
if [ "$ARCH" == "i386" ]; then
export EXTRA_CONFIGURE_ARGS=("--build=i686-pc-linux-gnu" "CFLAGS=-m32" "CXXFLAGS=-m32" "LDFLAGS=-m32")
fi
./configure --prefix=/usr "${EXTRA_CONFIGURE_ARGS[@]}"
make -j$(nproc)
sudo make install
+1 -2
View File
@@ -1,5 +1,4 @@
# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries
add_library(linuxdeploy-plugin-qt_util STATIC util.cpp util.h)
add_library(linuxdeploy-plugin-qt_util OBJECT util.cpp util.h)
target_include_directories(linuxdeploy-plugin-qt_util PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(linuxdeploy-plugin-qt_util linuxdeploy_core args)
+1 -4
View File
@@ -16,12 +16,9 @@ set(CLASSES
QmlPluginsDeployer
Qt3DPluginsDeployer
GamepadPluginsDeployer
PrintSupportPluginsDeployer
TextToSpeechPluginsDeployer
)
# TODO: CMake <= 3.7 (at least!) doesn't allow for using OBJECT libraries with target_link_libraries
add_library(deployers STATIC)
add_library(deployers OBJECT)
target_link_libraries(deployers PUBLIC linuxdeploy_core linuxdeploy-plugin-qt_util)
+13 -14
View File
@@ -57,26 +57,25 @@ bool PlatformPluginsDeployer::deploy() {
// either loading succeeds, then the system Gtk shall be used anyway, otherwise loading fails and Qt will fall
// back to the default UI theme
// we don't care whether this works (it's an experimental feature), therefore we ignore the return values
const auto libqgtk2Path = platformThemesPath / "libqgtk2.so";
const auto libqgtk3Path = platformThemesPath / "libqgtk3.so";
const auto libqxdgPath = platformThemesPath / "libqxdgdesktopportal.so";
const auto libqgtk2Filename = "libqgtk2.so";
const auto libqgtk2styleFilename = "libqgtk2style.so";
for (const auto &file : {libqgtk2Path, libqgtk3Path, libqxdgPath}) {
// we need to check whether the files exist at least, otherwise the deferred deployment operation fails
if (bf::is_regular_file(file)) {
ldLog() << "Attempting to deploy" << file.filename() << "found at path" << file.parent_path() << std::endl;
appDir.deployFile(file, platformThemesDestination);
} else {
ldLog() << "Could not find" << file.filename() << "on system, skipping deployment" << std::endl;
}
const auto libqgtk2Path = platformThemesPath / libqgtk2Filename;
const auto libqgtk2stylePath = stylesPath / libqgtk2styleFilename;
// we need to check whether the files exist at least, otherwise the deferred deployment operation fails
if (bf::is_regular_file(libqgtk2Path)) {
ldLog() << "Attempting to deploy" << libqgtk2Filename << "found at path" << libqgtk2Path << std::endl;
appDir.deployFile(libqgtk2Path, platformThemesDestination);
} else {
ldLog() << "Could not find" << libqgtk2Filename << "on system, skipping deployment" << std::endl;
}
const auto libqgtk2stylePath = stylesPath / "libqgtk2style.so";
if (bf::is_regular_file(libqgtk2stylePath)) {
ldLog() << "Attempting to deploy" << libqgtk2stylePath.filename() << "found at path" << libqgtk2stylePath << std::endl;
ldLog() << "Attempting to deploy" << libqgtk2styleFilename << "found at path" << libqgtk2stylePath << std::endl;
appDir.deployFile(libqgtk2stylePath, stylesDestination);
} else {
ldLog() << "Could not find" << libqgtk2stylePath.filename() << "on system, skipping deployment" << std::endl;
ldLog() << "Could not find" << libqgtk2styleFilename << "on system, skipping deployment" << std::endl;
}
}
+18 -31
View File
@@ -5,15 +5,12 @@
#include "BearerPluginsDeployer.h"
#include "GamepadPluginsDeployer.h"
#include "MultimediaPluginsDeployer.h"
#include "PrintSupportPluginsDeployer.h"
#include "PositioningPluginsDeployer.h"
#include "QmlPluginsDeployer.h"
#include "Qt3DPluginsDeployer.h"
#include "SqlPluginsDeployer.h"
#include "SvgPluginsDeployer.h"
#include "TextToSpeechPluginsDeployer.h"
#include "WebEnginePluginsDeployer.h"
#include "XcbglIntegrationPluginsDeployer.h"
using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::appdir;
@@ -24,68 +21,58 @@ PluginsDeployerFactory::PluginsDeployerFactory(AppDir& appDir,
bf::path qtLibexecsPath,
bf::path qtInstallQmlPath,
bf::path qtTranslationsPath,
bf::path qtDataPath,
int qtMajorVersion) : appDir(appDir),
bf::path qtDataPath) : appDir(appDir),
qtPluginsPath(std::move(qtPluginsPath)),
qtLibexecsPath(std::move(qtLibexecsPath)),
qtInstallQmlPath(std::move(qtInstallQmlPath)),
qtTranslationsPath(std::move(qtTranslationsPath)),
qtDataPath(std::move(qtDataPath)),
qtMajorVersion(qtMajorVersion) {}
qtDataPath(std::move(qtDataPath)) {}
std::vector<std::shared_ptr<PluginsDeployer>> PluginsDeployerFactory::getDeployers(const std::string& moduleName) {
std::shared_ptr<PluginsDeployer> PluginsDeployerFactory::getInstance(const std::string& moduleName) {
if (moduleName == "gui") {
return {getInstance<PlatformPluginsDeployer>(moduleName), getInstance<XcbglIntegrationPluginsDeployer>(moduleName)};
return getInstance<PlatformPluginsDeployer>(moduleName);
}
if (moduleName == "opengl" || moduleName == "xcbqpa") {
return {getInstance<XcbglIntegrationPluginsDeployer>(moduleName)};
if (moduleName == "opengl" || moduleName == "gui" || moduleName == "xcbqpa") {
return getInstance<PlatformPluginsDeployer>(moduleName);
}
if (moduleName == "network" && qtMajorVersion < 6) {
return {getInstance<BearerPluginsDeployer>(moduleName)};
if (moduleName == "network") {
return getInstance<BearerPluginsDeployer>(moduleName);
}
if (moduleName == "svg") {
return {getInstance<SvgPluginsDeployer>(moduleName)};
return getInstance<SvgPluginsDeployer>(moduleName);
}
if (moduleName == "sql") {
return {getInstance<SqlPluginsDeployer>(moduleName)};
return getInstance<SqlPluginsDeployer>(moduleName);
}
if (moduleName == "positioning") {
return {getInstance<PositioningPluginsDeployer>(moduleName)};
return getInstance<PositioningPluginsDeployer>(moduleName);
}
if (moduleName == "multimedia") {
return {getInstance<MultimediaPluginsDeployer>(moduleName)};
return getInstance<MultimediaPluginsDeployer>(moduleName);
}
if (moduleName == "webenginecore") {
return {getInstance<WebEnginePluginsDeployer>(moduleName)};
return getInstance<WebEnginePluginsDeployer>(moduleName);
}
if (moduleName == "qml") {
return {getInstance<QmlPluginsDeployer>(moduleName)};
return getInstance<QmlPluginsDeployer>(moduleName);
}
if (moduleName == "3dquickrender" || moduleName == "3drender") {
return {getInstance<Qt3DPluginsDeployer>(moduleName)};
if (moduleName == "3dquickrender") {
return getInstance<Qt3DPluginsDeployer>(moduleName);
}
if (moduleName == "gamepad") {
return {getInstance<GamepadPluginsDeployer>(moduleName)};
}
if (moduleName == "printsupport") {
return {getInstance<PrintSupportPluginsDeployer>(moduleName)};
}
if (moduleName == "texttospeech") {
return {getInstance<TextToSpeechPluginsDeployer>(moduleName)};
return getInstance<GamepadPluginsDeployer>(moduleName);
}
// fallback
return {getInstance<BasicPluginsDeployer>(moduleName)};
return getInstance<BasicPluginsDeployer>(moduleName);
}
+2 -4
View File
@@ -23,7 +23,6 @@ namespace linuxdeploy {
const boost::filesystem::path qtInstallQmlPath;
const boost::filesystem::path qtTranslationsPath;
const boost::filesystem::path qtDataPath;
const int qtMajorVersion;
template<typename T>
std::shared_ptr<PluginsDeployer> getInstance(const std::string& moduleName) {
@@ -46,10 +45,9 @@ namespace linuxdeploy {
boost::filesystem::path qtLibexecsPath,
boost::filesystem::path qtInstallQmlPath,
boost::filesystem::path qtTranslationsPath,
boost::filesystem::path qtDataPath,
int qtMajorVersion);
boost::filesystem::path qtDataPath);
std::vector<std::shared_ptr<PluginsDeployer>> getDeployers(const std::string& moduleName);
std::shared_ptr<PluginsDeployer> getInstance(const std::string& moduleName);
};
}
}
@@ -1,26 +0,0 @@
// library headers
#include <linuxdeploy/core/log.h>
#include <boost/filesystem.hpp>
// local headers
#include "PrintSupportPluginsDeployer.h"
using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;
namespace bf = boost::filesystem;
bool PrintSupportPluginsDeployer::deploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;
ldLog() << "Deploying printsupport plugins" << std::endl;
for (bf::directory_iterator i(qtPluginsPath / "printsupport"); i != bf::directory_iterator(); ++i) {
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/printsupport/"))
return false;
}
return true;
}
@@ -1,17 +0,0 @@
#pragma once
#include "BasicPluginsDeployer.h"
namespace linuxdeploy {
namespace plugin {
namespace qt {
class PrintSupportPluginsDeployer : public BasicPluginsDeployer {
public:
// we can just use the base class's constructor
using BasicPluginsDeployer::BasicPluginsDeployer;
bool deploy() override;
};
}
}
}
@@ -1,36 +0,0 @@
// library headers
#include <linuxdeploy/core/log.h>
#include <boost/filesystem.hpp>
// local headers
#include "TextToSpeechPluginsDeployer.h"
using namespace linuxdeploy::plugin::qt;
using namespace linuxdeploy::core::log;
namespace bf = boost::filesystem;
bool TextToSpeechPluginsDeployer::deploy() {
// calling the default code is optional, but it won't hurt for now
if (!BasicPluginsDeployer::deploy())
return false;
const std::string pluginsName = "texttospeech";
ldLog() << "Deploying" << pluginsName << "plugins" << std::endl;
for (bf::directory_iterator i(qtPluginsPath / pluginsName); i != bf::directory_iterator(); ++i) {
if (i->path().extension() == ".debug") {
ldLog() << LD_DEBUG << "skipping .debug file:" << i->path() << std::endl;
continue;
}
// terminate with a "/" to make sure the deployer will deploy the file into the target directory properly
// has to be cast to string, unfortunately, as boost::filesystem doesn't allow for adding a terminating /
const auto targetPath = (appDir.path() / "usr/plugins/" / pluginsName).string() + "/";
if (!appDir.deployLibrary(*i, targetPath))
return false;
}
return true;
}
@@ -1,17 +0,0 @@
#pragma once
#include "BasicPluginsDeployer.h"
namespace linuxdeploy {
namespace plugin {
namespace qt {
class TextToSpeechPluginsDeployer : public BasicPluginsDeployer {
public:
// we can just use the base class's constructor
using BasicPluginsDeployer::BasicPluginsDeployer;
bool deploy() override;
};
}
}
}
+4 -6
View File
@@ -92,16 +92,14 @@ inline bool createAppRunHook(appdir::AppDir &appDir) {
return false;
}
// Old Qt versions only ship gtk2, new versions only gtk3. No Qt version had both.
const bool haveGtk3 = bf::exists(appDir.path() / "usr/plugins/platformthemes" / "libqgtk3.so");
ofs << "# generated by linuxdeploy-plugin-qt" << std::endl
<< std::endl
<< "# try to make Qt apps more \"native looking\" on Gtk-based desktops, if possible" << std::endl
<< "# see https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
<< "# try to make Qt apps more \"native looking\", if possible" << std::endl
<< "# see also https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
<< "# and https://github.com/AppImage/AppImageKit/issues/977#issue-462374883" << std::endl
<< "case \"${XDG_CURRENT_DESKTOP}\" in" << std::endl
<< " *GNOME*|*gnome*|*XFCE*)" << std::endl
<< " export QT_QPA_PLATFORMTHEME=" << (haveGtk3 ? "gtk3" : "gtk2") << std::endl
<< " export QT_QPA_PLATFORMTHEME=gtk2" << std::endl
<< " ;;" << std::endl
<< "esac" << std::endl;
+37 -58
View File
@@ -70,53 +70,6 @@ int main(const int argc, const char *const *const argv) {
return 1;
}
auto qmakePath = findQmake();
if (qmakePath.empty()) {
ldLog() << LD_ERROR << "Could not find qmake, please install or provide path using $QMAKE" << std::endl;
return 1;
}
if (!bf::exists(qmakePath)) {
ldLog() << LD_ERROR << "No such file or directory:" << qmakePath << std::endl;
return 1;
}
ldLog() << "Using qmake:" << qmakePath << std::endl;
auto qmakeVars = queryQmake(qmakePath);
if (qmakeVars.empty()) {
ldLog() << LD_ERROR << "Failed to query Qt paths using qmake -query" << std::endl;
return 1;
}
const bf::path qtPluginsPath = qmakeVars["QT_INSTALL_PLUGINS"];
const bf::path qtLibexecsPath = qmakeVars["QT_INSTALL_LIBEXECS"];
const bf::path qtDataPath = qmakeVars["QT_INSTALL_DATA"];
const bf::path qtTranslationsPath = qmakeVars["QT_INSTALL_TRANSLATIONS"];
const bf::path qtBinsPath = qmakeVars["QT_INSTALL_BINS"];
const bf::path qtLibsPath = qmakeVars["QT_INSTALL_LIBS"];
const bf::path qtInstallQmlPath = qmakeVars["QT_INSTALL_QML"];
const std::string qtVersion = qmakeVars["QT_VERSION"];
if (qtVersion.empty()) {
ldLog() << LD_ERROR << "Failed to query QT_VERSION using qmake -query" << std::endl;
return 1;
}
int qtMajorVersion = std::stoi(qtVersion, nullptr, 10);
if (qtMajorVersion < 5) {
ldLog() << std::endl << LD_WARNING << "Minimum Qt version supported is 5" << std::endl;
qtMajorVersion = 5;
}
else if (qtMajorVersion > 6) {
ldLog() << std::endl << LD_WARNING << "Maximum Qt version supported is 6" << std::endl;
qtMajorVersion = 6;
}
ldLog() << std::endl << "Using Qt version: " << qtVersion << " (" << qtMajorVersion << ")" << std::endl;
appdir::AppDir appDir(appDirPath.Get());
// allow disabling copyright files deployment via environment variable
@@ -172,9 +125,7 @@ int main(const int argc, const char *const *const argv) {
return false;
};
const std::vector<QtModule>& qtModules = getQtModules(qtMajorVersion);
std::copy_if(qtModules.begin(), qtModules.end(), std::back_inserter(foundQtModules),
std::copy_if(QtModules.begin(), QtModules.end(), std::back_inserter(foundQtModules),
[&matchesQtModule, &libraryNames](const QtModule &module) {
return std::find_if(libraryNames.begin(), libraryNames.end(),
[&matchesQtModule, &module](const std::string &libraryName) {
@@ -185,10 +136,10 @@ int main(const int argc, const char *const *const argv) {
std::vector<std::string> extraPluginsFromEnv;
const auto* const extraPluginsFromEnvData = getenv("EXTRA_QT_PLUGINS");
if (extraPluginsFromEnvData != nullptr)
extraPluginsFromEnv = linuxdeploy::util::split(std::string(extraPluginsFromEnvData), ';');
extraPluginsFromEnv = linuxdeploy::util::split(std::string(extraPluginsFromEnvData, ';'));
for (const auto& pluginsList : {static_cast<std::vector<std::string>>(extraPlugins.Get()), extraPluginsFromEnv}) {
std::copy_if(qtModules.begin(), qtModules.end(), std::back_inserter(extraQtModules),
std::copy_if(QtModules.begin(), QtModules.end(), std::back_inserter(extraQtModules),
[&matchesQtModule, &libraryNames, &pluginsList](const QtModule &module) {
return std::find_if(pluginsList.begin(), pluginsList.end(),
[&matchesQtModule, &module](const std::string &libraryName) {
@@ -219,6 +170,35 @@ int main(const int argc, const char *const *const argv) {
return 1;
}
auto qmakePath = findQmake();
if (qmakePath.empty()) {
ldLog() << LD_ERROR << "Could not find qmake, please install or provide path using $QMAKE" << std::endl;
return 1;
}
if (!bf::exists(qmakePath)) {
ldLog() << LD_ERROR << "No such file or directory:" << qmakePath << std::endl;
return 1;
}
ldLog() << "Using qmake:" << qmakePath << std::endl;
auto qmakeVars = queryQmake(qmakePath);
if (qmakeVars.empty()) {
ldLog() << LD_ERROR << "Failed to query Qt paths using qmake -query" << std::endl;
return 1;
}
const bf::path qtPluginsPath = qmakeVars["QT_INSTALL_PLUGINS"];
const bf::path qtLibexecsPath = qmakeVars["QT_INSTALL_LIBEXECS"];
const bf::path qtDataPath = qmakeVars["QT_INSTALL_DATA"];
const bf::path qtTranslationsPath = qmakeVars["QT_INSTALL_TRANSLATIONS"];
const bf::path qtBinsPath = qmakeVars["QT_INSTALL_BINS"];
const bf::path qtLibsPath = qmakeVars["QT_INSTALL_LIBS"];
const bf::path qtInstallQmlPath = qmakeVars["QT_INSTALL_QML"];
ldLog() << std::endl;
ldLog() << "QT_INSTALL_LIBS:" << qtLibsPath << std::endl;
std::ostringstream newLibraryPath;
@@ -243,18 +223,17 @@ int main(const int argc, const char *const *const argv) {
qtLibexecsPath,
qtInstallQmlPath,
qtTranslationsPath,
qtDataPath,
qtMajorVersion
qtDataPath
);
for (const auto& module : qtModulesToDeploy) {
ldLog() << std::endl << "-- Deploying module:" << module.name << "--" << std::endl;
auto deployers = deployerFactory.getDeployers(module.name);
auto deployer = deployerFactory.getInstance(module.name);
for (const auto& deployer : deployers)
if (!deployer->deploy())
return 1;
if (!deployer->deploy()) {
return 1;
}
}
ldLog() << std::endl << "-- Deploying translations --" << std::endl;
+2 -3
View File
@@ -112,7 +112,7 @@ std::vector<QmlModuleImport> getQmlImports(const bf::path &projectRootPath, cons
std::vector<QmlModuleImport> moduleImports;
auto qmlImportPaths = getExtraQmlModulesPaths();
qmlImportPaths.emplace(qmlImportPaths.begin(), installQmlPath);
qmlImportPaths.emplace_back(installQmlPath);
ldLog() << "QML imports search path: ";
for (const auto& path : qmlImportPaths)
ldLog() << " " << path;
@@ -173,8 +173,7 @@ void deployQml(appdir::AppDir &appDir, const boost::filesystem::path &installQml
const auto &entry = *i;
if (!bf::is_directory(entry)) {
// lexically relative doesn't resolve symlinks, so the paths stay correct
auto relativeFilePath = qmlImport.relativePath / entry.path().lexically_relative(qmlImport.path);
auto relativeFilePath = qmlImport.relativePath / bf::relative(entry.path(), qmlImport.path);
try {
elf::ElfFile file(entry.path());
appDir.deployLibrary(entry.path(), targetQmlModulesPath / relativeFilePath);
+1 -99
View File
@@ -2,7 +2,6 @@
#include <string>
#include <tuple>
#include <vector>
#include <stdexcept>
#pragma once
@@ -18,13 +17,12 @@ class QtModule {
};
// TODO: the list of translation file prefixes is probably incomplete
static const std::vector<QtModule> Qt5Modules = {
static const std::vector<QtModule> QtModules = {
{"3danimation", "libQt53DAnimation", ""},
{"3dcore", "libQt53DCore", ""},
{"3dextras", "libQt53DExtras", ""},
{"3dinput", "libQt53DInput", ""},
{"3dlogic", "libQt53DLogic", ""},
{"3drender", "libQt53DRender", ""},
{"3dquickanimation", "libQt53DQuickAnimation", ""},
{"3dquickextras", "libQt53DQuickExtras", ""},
{"3dquickinput", "libQt53DQuickInput", ""},
@@ -81,99 +79,3 @@ static const std::vector<QtModule> Qt5Modules = {
{"xmlpatterns", "libQt5XmlPatterns", "qtxmlpatterns"},
{"xml", "libQt5Xml", "qtbase"},
};
static const std::vector<QtModule> Qt6Modules = {
{"concurrent", "libQt6Concurrent", "qtbase"},
{"core5compat", "libQt6Core5Compat", "qtbase"},
{"core", "libQt6Core", "qtbase"},
{"dbus", "libQt6DBus", ""},
{"designercomponents", "libQt6DesignerComponents", ""},
{"designer", "libQt6Designer", ""},
{"eglfsdeviceintegration", "libQt6EglFSDeviceIntegration", ""},
{"eglfskmssupport", "libQt6EglFsKmsSupport", ""},
{"gui", "libQt6Gui", "qtbase"},
{"help", "libQt6Help", "qt_help"},
{"network", "libQt6Network", "qtbase"},
{"opengl", "libQt6OpenGL", ""},
{"openglwidgets", "libQt6OpenGLWidgets", ""},
{"printsupport", "libQt6PrintSupport", ""},
{"qmlmodels", "libQt6QmlModels", ""},
{"qml", "libQt6Qml", "qtdeclarative"},
{"qmlworkerscript", "libQt6QmlWorkerScript", ""},
{"quick3dassetimport", "libQt6Quick3DAssetImport", ""},
{"quick3druntimerender", "libQt6Quick3DRuntimeRender", ""},
{"quick3d", "libQt6Quick3D", ""},
{"quick3dutils", "libQt6Quick3DUtils", ""},
{"quickcontrols2impl", "libQt6QuickControls2Impl", ""},
{"quickcontrols2", "libQt6QuickControls2", ""},
{"quickparticles", "libQt6QuickParticles", ""},
{"quickshapes", "libQt6QuickShapes", ""},
{"quick", "libQt6Quick", "qtdeclarative"},
{"quicktemplates2", "libQt6QuickTemplates2", ""},
{"quicktest", "libQt6QuickTest", ""},
{"quickwidgets", "libQt6QuickWidgets", ""},
{"shadertools", "libQt6ShaderTools", ""},
{"sql", "libQt6Sql", "qtbase"},
{"svg", "libQt6Svg", ""},
{"svgwidgets", "libQt6SvgWidgets", ""},
{"test", "libQt6Test", "qtbase"},
{"uitools", "libQt6UiTools", ""},
{"waylandclient", "libQt6WaylandClient", ""},
{"waylandcompositor", "libQt6WaylandCompositor", ""},
{"widgets", "libQt6Widgets", "qtbase"},
{"xcbqpa", "libQt6XcbQpa", ""},
{"xml", "libQt6Xml", "qtbase"},
/* Not Included in Qt6.0.0, maybe some of them will be added back in 6.1, 6.2
{"3danimation", "libQt63DAnimation", ""},
{"3dcore", "libQt63DCore", ""},
{"3dextras", "libQt63DExtras", ""},
{"3dinput", "libQt63DInput", ""},
{"3dlogic", "libQt63DLogic", ""},
{"3drender", "libQt63DRender", ""},
{"3dquickanimation", "libQt63DQuickAnimation", ""},
{"3dquickextras", "libQt63DQuickExtras", ""},
{"3dquickinput", "libQt63DQuickInput", ""},
{"3dquickrender", "libQt63DQuickRender", ""},
{"3dquickscene2d", "libQt63DQuickScene2D", ""},
{"3dquick", "libQt63DQuick", ""},
{"bluetooth", "libQt6Bluetooth", ""},
{"clucene", "libQt6CLucene", "qt_help"},
{"declarative", "libQt6Declarative", "qtquick1"},
{"gamepad", "libQt6Gamepad", ""},
{"location", "libQt6Location", ""},
{"multimediagsttools", "libQt6MultimediaGstTools", "qtmultimedia"},
{"multimediaquick", "libQt6MultimediaQuick", "qtmultimedia"},
{"multimedia", "libQt6Multimedia", "qtmultimedia"},
{"multimediawidgets", "libQt6MultimediaWidgets", "qtmultimedia"},
{"nfc", "libQt6Nfc", ""},
{"positioning", "libQt6Positioning", ""},
{"remoteobjects", "libQt6RemoteObjects", ""},
{"script", "libQt6Script", "qtscript"},
{"scripttools", "libQt6ScriptTools", "qtscript"},
{"scxml", "libQt6Scxml", ""},
{"sensors", "libQt6Sensors", ""},
{"serialbus", "libQt6SerialBus", ""},
{"serialport", "libQt6SerialPort", "qtserialport"},
{"texttospeech", "libQt6TextToSpeech", ""},
{"webchannel", "libQt6WebChannel", ""},
{"webenginecore", "libQt6WebEngineCore", ""},
{"webengine", "libQt6WebEngine", "qtwebengine"},
{"webenginewidgets", "libQt6WebEngineWidgets", ""},
{"websockets", "libQt6WebSockets", "qtwebsockets"},
{"x11extras", "libQt6X11Extras", ""},
{"xmlpatterns", "libQt6XmlPatterns", "qtxmlpatterns"},
*/
};
inline const std::vector<QtModule>& getQtModules(const int version) {
if (version == 5) {
return Qt5Modules;
}
else if (version == 6) {
return Qt6Modules;
}
throw std::runtime_error("Unknown Qt version: " + std::to_string(version));
}

Some files were not shown because too many files have changed in this diff Show More