You've already forked linuxdeploy-plugin-qt
mirror of
https://github.com/encounter/linuxdeploy-plugin-qt.git
synced 2026-03-30 11:19:03 -07:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 7aa7b68266 |
@@ -1,3 +1,2 @@
|
||||
*build*/
|
||||
.idea/
|
||||
*.AppImage
|
||||
|
||||
@@ -1,6 +1,3 @@
|
||||
[submodule "lib/linuxdeploy"]
|
||||
path = lib/linuxdeploy
|
||||
url = https://github.com/TheAssassin/linuxdeploy
|
||||
[submodule "lib/googletest"]
|
||||
path = lib/googletest
|
||||
url = https://github.com/google/googletest.git
|
||||
|
||||
+28
-63
@@ -1,70 +1,35 @@
|
||||
language: cpp
|
||||
dist: xenial
|
||||
sudo: required
|
||||
|
||||
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*
|
||||
addons:
|
||||
apt:
|
||||
update: true
|
||||
packages:
|
||||
- libmagic-dev
|
||||
- libmagick++-dev
|
||||
- libboost-regex1.55-dev
|
||||
- libboost-filesystem1.55-dev
|
||||
- automake # required for patchelf
|
||||
|
||||
- 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*
|
||||
install:
|
||||
- git clone https://github.com/NixOS/patchelf.git
|
||||
- cd patchelf
|
||||
- ./bootstrap.sh
|
||||
- ./configure --prefix=/usr
|
||||
- make -j$(nproc)
|
||||
- sudo make install
|
||||
- cd ..
|
||||
- rm -rf patchelf
|
||||
|
||||
# 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
|
||||
script:
|
||||
- bash -xe travis/build-appimage.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_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*
|
||||
|
||||
branches:
|
||||
except:
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
cmake_minimum_required(VERSION 3.6)
|
||||
project(linuxdeploy-plugin-qt)
|
||||
|
||||
include(CTest)
|
||||
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_subdirectory(lib)
|
||||
add_subdirectory(src)
|
||||
|
||||
if (BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
||||
@@ -2,62 +2,4 @@
|
||||
|
||||
Plugin for linuxdeploy to bundle Qt dependencies of applications and libraries.
|
||||
|
||||
|
||||
## About
|
||||
|
||||
linuxdeploy is a tool to create and maintain AppDirs, which can be turned into application bundles like AppImages.
|
||||
|
||||
linuxdeploy-plugin-qt is a bundling plugin for linuxdeploy. If an application uses Qt, linuxdeploy-plugin-qt will bundle all the Qt plugins and resources such as QML files or translations.
|
||||
|
||||
As linuxdeploy plugins are standalone applications, this software can also be run standalone. However, usage as a plugin from linuxdeploy is highly encouraged.
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
As all linuxdeploy plugins, linuxdeploy-plugin-qt is a standalone tool implementing the so-called [Plugin Specification](https://github.com/linuxdeploy/linuxdeploy/wiki/Plugin-system). Therefore, there's two ways of using it: in "plugin mode" (i.e., together with linuxdeploy), or "standalone mode" (i.e., calling it directly).
|
||||
|
||||
The most widely and also recommended method is to use it together with linuxdeploy.
|
||||
|
||||
|
||||
### Plugin mode
|
||||
|
||||
Just download the plugin's official AppImage, and put it next to linuxdeploy's AppImage (alternatively, put it into one of the other [search locations](https://github.com/linuxdeploy/linuxdeploy/wiki/Plugin-system#plugin-discovery)). Make sure the AppImage is executable, otherwise it cannot be called by linuxdeploy.
|
||||
|
||||
To enable the plugin, just call linuxdeploy as follows:
|
||||
|
||||
```bash
|
||||
$ ./linuxdeploy-x86_64.AppImage --appdir AppDir [...] --plugin qt [...]
|
||||
```
|
||||
|
||||
That's it! All you have to add is `--plugin qt`, and the plugin will be called by linuxdeploy.
|
||||
|
||||
**Note:** If the application doesn't use Qt, linuxdeploy-plugin-qt will return an error. That's expected behavior, as it might help discover issues when a program is expected to use Qt but suddenly does not any more.
|
||||
|
||||
|
||||
### Standalone mode
|
||||
|
||||
To use linuxdeploy-plugin-standalone, download the official AppImage, make it executable and run it like:
|
||||
|
||||
```bash
|
||||
./linuxdeploy-plugin-qt-x86_64.AppImage --appdir AppDir
|
||||
```
|
||||
|
||||
linuxdeploy-plugin-qt will look for Qt libraries in the library directory `usr/lib/` and deploy the Qt plugins and other resources for these. This means that if linuxdeploy or another tool haven't been run on the AppDir yet, i.e., no Qt libraries have been deployed yet, linuxdeploy-plugin-qt won't be able to recognize which plugins and resources have to be deployed, and will return an error.
|
||||
|
||||
|
||||
|
||||
### Environment variables
|
||||
|
||||
Just like all linuxdeploy plugins, the Qt plugin's behavior can be configured some environment variables.
|
||||
|
||||
**General:**
|
||||
- `$DEBUG=1`: enables verbose output, useful for debugging (equal to linuxdeploy's `-v0`)
|
||||
- `$LD_LIBRARY_PATH=pathA:pathB`: Paths to check for library dependencies (see `man ld.so` for more information)
|
||||
|
||||
**Qt specific:**
|
||||
- `$QMAKE=/path/to/my/qmake`: use another `qmake` binary to detect paths of plugins and other resources (usually doesn't need to be set manually, most Qt environments ship scripts changing `$PATH`)
|
||||
- `$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
|
||||
- `$QML_MODULES_PATHS`: extra directories containing imported QML files (normally doesn't need to be specified)
|
||||
***More information will follow soon!***
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
set(CMAKE_SYSTEM_NAME Linux CACHE STRING "" FORCE)
|
||||
set(CMAKE_SYSTEM_PROCESSOR i386 CACHE STRING "" FORCE)
|
||||
|
||||
set(CMAKE_C_FLAGS "-m32" CACHE STRING "" FORCE)
|
||||
set(CMAKE_CXX_FLAGS "-m32" CACHE STRING "" FORCE)
|
||||
|
||||
set(THREADS_PTHREAD_ARG "2" CACHE STRING "Forcibly set by CMakeLists.txt." FORCE)
|
||||
@@ -1,12 +1 @@
|
||||
add_subdirectory(linuxdeploy EXCLUDE_FROM_ALL)
|
||||
if(NOT TARGET gtest AND BUILD_TESTING)
|
||||
add_subdirectory(googletest EXCLUDE_FROM_ALL)
|
||||
endif()
|
||||
|
||||
# required to properly build nlohmann/json v. 2.0.0 on trusty
|
||||
set(CMAKE_CXX_STANDARD 11)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
|
||||
add_library(json INTERFACE)
|
||||
set_property(TARGET json PROPERTY INTERFACE_INCLUDE_DIRECTORIES ${CMAKE_CURRENT_SOURCE_DIR}/json/include)
|
||||
target_sources(json INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/json/include/json.hpp)
|
||||
|
||||
Submodule lib/googletest deleted from 077ee54cef
File diff suppressed because it is too large
Load Diff
+1
-1
Submodule lib/linuxdeploy updated: 6bc354bacb...9f2218c655
@@ -5,5 +5,3 @@ Icon=linuxdeploy-plugin-qt
|
||||
Terminal=true
|
||||
NoDisplay=true
|
||||
Type=Application
|
||||
Categories=Development;
|
||||
X-AppImage-Integrate=false
|
||||
|
||||
+2
-9
@@ -1,14 +1,7 @@
|
||||
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)
|
||||
|
||||
add_executable(linuxdeploy-plugin-qt main.cpp qt-modules.h qml.cpp qml.h deployment.h)
|
||||
target_link_libraries(linuxdeploy-plugin-qt linuxdeploy_core args json linuxdeploy-plugin-qt_util)
|
||||
add_executable(linuxdeploy-plugin-qt main.cpp qt-modules.h qt_tools_utils.hpp)
|
||||
target_link_libraries(linuxdeploy-plugin-qt linuxdeploy_core args)
|
||||
set_target_properties(linuxdeploy-plugin-qt PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${PROJECT_BINARY_DIR}/bin")
|
||||
|
||||
add_subdirectory(deployers)
|
||||
target_link_libraries(linuxdeploy-plugin-qt deployers)
|
||||
|
||||
install(
|
||||
TARGETS linuxdeploy-plugin-qt
|
||||
RUNTIME DESTINATION bin
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
// system headers
|
||||
#include <utility>
|
||||
|
||||
// library headers
|
||||
#include <linuxdeploy/core/log.h>
|
||||
|
||||
// local headers
|
||||
#include "BasicPluginsDeployer.h"
|
||||
|
||||
using namespace linuxdeploy::core::log;
|
||||
using namespace linuxdeploy::core::appdir;
|
||||
using namespace linuxdeploy::plugin::qt;
|
||||
namespace bf = boost::filesystem;
|
||||
|
||||
BasicPluginsDeployer::BasicPluginsDeployer(std::string moduleName,
|
||||
core::appdir::AppDir& appDir,
|
||||
bf::path qtPluginsPath,
|
||||
bf::path qtLibexecsPath,
|
||||
bf::path installLibsPath,
|
||||
bf::path qtTranslationsPath,
|
||||
bf::path qtDataPath) : moduleName(std::move(moduleName)),
|
||||
appDir(appDir),
|
||||
qtPluginsPath(std::move(qtPluginsPath)),
|
||||
qtLibexecsPath(std::move(qtLibexecsPath)),
|
||||
qtInstallQmlPath(std::move(installLibsPath)),
|
||||
qtTranslationsPath(std::move(qtTranslationsPath)),
|
||||
qtDataPath(std::move(qtDataPath)) {}
|
||||
|
||||
bool BasicPluginsDeployer::deploy() {
|
||||
// currently this is a no-op, but we might add more functionality later on, such as some kinds of default
|
||||
// attempts to copy data based on the moduleName
|
||||
return true;
|
||||
}
|
||||
@@ -1,55 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
// system headers
|
||||
#include <memory>
|
||||
|
||||
// library headers
|
||||
#include <linuxdeploy/core/appdir.h>
|
||||
|
||||
// local headers
|
||||
#include "PluginsDeployer.h"
|
||||
|
||||
|
||||
namespace linuxdeploy {
|
||||
namespace plugin {
|
||||
namespace qt {
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class BasicPluginsDeployer : public PluginsDeployer {
|
||||
protected:
|
||||
std::string moduleName;
|
||||
core::appdir::AppDir& appDir;
|
||||
|
||||
// Qt data
|
||||
const boost::filesystem::path qtPluginsPath;
|
||||
const boost::filesystem::path qtLibexecsPath;
|
||||
const boost::filesystem::path qtInstallQmlPath;
|
||||
const boost::filesystem::path qtTranslationsPath;
|
||||
const boost::filesystem::path qtDataPath;
|
||||
|
||||
public:
|
||||
/**
|
||||
* Default constructor. Constructs a basic deployer for a plugin with the given name.
|
||||
*
|
||||
* @param moduleName
|
||||
*/
|
||||
explicit BasicPluginsDeployer(std::string moduleName, core::appdir::AppDir& appDir,
|
||||
boost::filesystem::path qtPluginsPath,
|
||||
boost::filesystem::path qtLibexecsPath,
|
||||
boost::filesystem::path installLibsPath,
|
||||
boost::filesystem::path qtTranslationsPath,
|
||||
boost::filesystem::path qtDataPath);
|
||||
|
||||
/**
|
||||
* Default destroyer is good enough for this class for now, but in case we need to change this we declare a virtual
|
||||
* one.
|
||||
*/
|
||||
virtual ~BasicPluginsDeployer() = default;
|
||||
|
||||
public:
|
||||
bool deploy() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,26 +0,0 @@
|
||||
// library headers
|
||||
#include <linuxdeploy/core/log.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local headers
|
||||
#include "BearerPluginsDeployer.h"
|
||||
|
||||
using namespace linuxdeploy::plugin::qt;
|
||||
using namespace linuxdeploy::core::log;
|
||||
|
||||
namespace bf = boost::filesystem;
|
||||
|
||||
bool BearerPluginsDeployer::deploy() {
|
||||
// calling the default code is optional, but it won't hurt for now
|
||||
if (!BasicPluginsDeployer::deploy())
|
||||
return false;
|
||||
|
||||
ldLog() << "Deploying bearer plugins" << std::endl;
|
||||
|
||||
for (bf::directory_iterator i(qtPluginsPath / "bearer"); i != bf::directory_iterator(); ++i) {
|
||||
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/bearer/"))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "BasicPluginsDeployer.h"
|
||||
|
||||
namespace linuxdeploy {
|
||||
namespace plugin {
|
||||
namespace qt {
|
||||
class BearerPluginsDeployer : public BasicPluginsDeployer {
|
||||
public:
|
||||
// we can just use the base class's constructor
|
||||
using BasicPluginsDeployer::BasicPluginsDeployer;
|
||||
|
||||
bool deploy() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +0,0 @@
|
||||
cmake_minimum_required(VERSION 3.1)
|
||||
|
||||
set(CLASSES
|
||||
PluginsDeployer
|
||||
PluginsDeployerFactory
|
||||
BasicPluginsDeployer
|
||||
|
||||
PlatformPluginsDeployer
|
||||
XcbglIntegrationPluginsDeployer
|
||||
BearerPluginsDeployer
|
||||
SvgPluginsDeployer
|
||||
SqlPluginsDeployer
|
||||
PositioningPluginsDeployer
|
||||
MultimediaPluginsDeployer
|
||||
WebEnginePluginsDeployer
|
||||
QmlPluginsDeployer
|
||||
Qt3DPluginsDeployer
|
||||
GamepadPluginsDeployer
|
||||
)
|
||||
|
||||
add_library(deployers OBJECT)
|
||||
|
||||
target_link_libraries(deployers PUBLIC linuxdeploy_core linuxdeploy-plugin-qt_util)
|
||||
|
||||
foreach(class ${CLASSES})
|
||||
target_sources(deployers PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/${class}.h)
|
||||
target_sources(deployers PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/${class}.cpp)
|
||||
endforeach()
|
||||
@@ -1,26 +0,0 @@
|
||||
// library headers
|
||||
#include <linuxdeploy/core/log.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local headers
|
||||
#include "GamepadPluginsDeployer.h"
|
||||
|
||||
using namespace linuxdeploy::plugin::qt;
|
||||
using namespace linuxdeploy::core::log;
|
||||
|
||||
namespace bf = boost::filesystem;
|
||||
|
||||
bool GamepadPluginsDeployer::deploy() {
|
||||
// calling the default code is optional, but it won't hurt for now
|
||||
if (!BasicPluginsDeployer::deploy())
|
||||
return false;
|
||||
|
||||
ldLog() << "Deploying Gamepad plugins" << std::endl;
|
||||
|
||||
for (bf::directory_iterator i(qtPluginsPath / "gamepads"); i != bf::directory_iterator(); ++i) {
|
||||
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/gamepads/"))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#pragma once
|
||||
|
||||
#include "BasicPluginsDeployer.h"
|
||||
|
||||
namespace linuxdeploy {
|
||||
namespace plugin {
|
||||
namespace qt {
|
||||
class GamepadPluginsDeployer : public BasicPluginsDeployer {
|
||||
public:
|
||||
// we can just use the base class's constructor
|
||||
using BasicPluginsDeployer::BasicPluginsDeployer;
|
||||
|
||||
bool deploy() override;
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,33 +0,0 @@
|
||||
// library headers
|
||||
#include <linuxdeploy/core/log.h>
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
// local headers
|
||||
#include "MultimediaPluginsDeployer.h"
|
||||
|
||||
using namespace linuxdeploy::plugin::qt;
|
||||
using namespace linuxdeploy::core::log;
|
||||
|
||||
namespace bf = boost::filesystem;
|
||||
|
||||
bool MultimediaPluginsDeployer::deploy() {
|
||||
// calling the default code is optional, but it won't hurt for now
|
||||
if (!BasicPluginsDeployer::deploy())
|
||||
return false;
|
||||
|
||||
ldLog() << "Deploying mediaservice plugins" << std::endl;
|
||||
|
||||
for (bf::directory_iterator i(qtPluginsPath / "mediaservice"); i != bf::directory_iterator(); ++i) {
|
||||
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/mediaservice/"))
|
||||
return false;
|
||||
}
|
||||
|
||||
ldLog() << "Deploying audio plugins" << std::endl;
|
||||
|
||||
for (bf::directory_iterator i(qtPluginsPath / "audio"); i != bf::directory_iterator(); ++i) {
|
||||
if (!appDir.deployLibrary(*i, appDir.path() / "usr/plugins/audio/"))
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user