1 Commits

Author SHA1 Message Date
Alexis López Zubieta 7aa7b68266 Patch prefix path in libQt5Core 2018-06-26 07:23:11 -05:00
69 changed files with 653 additions and 12571 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*
-3
View File
@@ -1,5 +1,2 @@
*build*/ *build*/
.idea/ .idea/
*.AppImage
*.zsync
*.swp
-3
View File
@@ -1,6 +1,3 @@
[submodule "lib/linuxdeploy"] [submodule "lib/linuxdeploy"]
path = lib/linuxdeploy path = lib/linuxdeploy
url = https://github.com/TheAssassin/linuxdeploy url = https://github.com/TheAssassin/linuxdeploy
[submodule "lib/googletest"]
path = lib/googletest
url = https://github.com/google/googletest.git
+37
View File
@@ -0,0 +1,37 @@
language: cpp
sudo: required
addons:
apt:
update: true
packages:
- libmagic-dev
- libmagick++-dev
- libboost-regex1.55-dev
- libboost-filesystem1.55-dev
- automake # required for patchelf
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
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:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)$/
-6
View File
@@ -1,14 +1,8 @@
cmake_minimum_required(VERSION 3.6) cmake_minimum_required(VERSION 3.6)
project(linuxdeploy-plugin-qt) project(linuxdeploy-plugin-qt)
include(CTest)
set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_CXX_STANDARD_REQUIRED ON)
add_subdirectory(lib) add_subdirectory(lib)
add_subdirectory(src) add_subdirectory(src)
if (BUILD_TESTING)
add_subdirectory(tests)
endif()
+2 -60
View File
@@ -1,63 +1,5 @@
# linuxdeploy-plugin-qt # 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.
***More information will follow soon!***
## 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. `$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).
-23
View File
@@ -1,23 +0,0 @@
FROM centos:7
RUN yum install -y centos-release-scl && \
yum install -y devtoolset-8 wget curl patchelf vim-common fuse libfuse2 libtool autoconf automake zlib-devel libjpeg-devel libpng-devel nano git file gcc-c++ && \
wget https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.19.1-centos7-x86_64.tar.gz -O- | tar xz --strip-components=1 -C/usr/local
ENV ARCH=x86_64
COPY entrypoint.sh /
SHELL ["/entrypoint.sh", "bash", "-x", "-c"]
ENTRYPOINT ["/entrypoint.sh"]
RUN git clone https://github.com/NixOS/patchelf.git && \
pushd patchelf && \
# cannot use -b since it's not supported in really old versions of git
git checkout 0.8 && \
./bootstrap.sh && \
./configure --prefix=/usr/local && \
make -j $(nproc) && \
make install && \
popd && \
rm -r patchelf/
CMD ["bash"]
-35
View File
@@ -1,35 +0,0 @@
FROM i386/centos:7
SHELL ["/bin/bash", "-x", "-c"]
# during Docker build, yum doesn't detect it's an i386 environment on x86_64 machines, and tries to install x86_64 packages, which can't work
# this little command fixes this
RUN sed -i 's/$basearch/i386/g' /etc/yum.repos.d/CentOS-Base.repo
# thanks CloudLinux, you're really helping us poor AppImage creators seeking for maximum compatibility by providing devtoolset i386 builds
RUN yum install -y yum-utils && \
rpm --import https://repo.cloudlinux.com/cloudlinux/security/RPM-GPG-KEY-CloudLinux && \
yum-config-manager --add-repo https://www.repo.cloudlinux.com/cloudlinux/7/sclo/devtoolset-8/i386/ && \
yum install -y devtoolset-8 wget curl patchelf vim-common fuse libfuse2 libtool autoconf automake zlib-evel libjpeg-devel libpng-devel nano git make file gcc-c++
# the shell wrapper takes care of enabling devtoolset and running a shell properly
# unfortunately this is the easiest and most solid workaround to the limitations of the scl command
COPY entrypoint.sh /
ENV ARCH=i386
ENTRYPOINT ["/entrypoint.sh"]
SHELL ["/entrypoint.sh", "bash", "-x", "-c"]
RUN wget https://artifacts.assassinate-you.net/prebuilt-cmake/cmake-v3.19.1-centos7-i386.tar.gz -O- | tar xz --strip-components=1 -C/usr/local
RUN git clone https://github.com/NixOS/patchelf.git && \
pushd patchelf && \
# cannot use -b since it's not supported in really old versions of git
git checkout 0.8 && \
./bootstrap.sh && \
./configure --prefix=/usr/local && \
make -j $(nproc) && \
make install && \
popd && \
rm -r patchelf/
CMD ["bash"]
-18
View File
@@ -1,18 +0,0 @@
#! /bin/bash
set -xe
old_cwd=$(readlink -f .)
here=$(readlink -f $(dirname "$0"))
DOCKERFILE="$here"/Dockerfile.centos7
IMAGE=linuxdeploy-build-centos7
if [ "$ARCH" == "i386" ]; then
DOCKERFILE="$DOCKERFILE"-i386
IMAGE="$IMAGE"-i386
fi
(cd "$here" && docker build -f "$DOCKERFILE" -t "$IMAGE" .)
docker run --rm -i -v "$here"/..:/ws:ro -v "$old_cwd":/out -e CI=1 -e OUTDIR_OWNER=$(id -u) "$IMAGE" /bin/bash -xe -c "cd /out && /ws/ci/build-centos7.sh"
-73
View File
@@ -1,73 +0,0 @@
#! /bin/bash
set -e
set -x
if [ "$ARCH" == "" ]; then
echo 'Error: $ARCH is not set'
exit 1
fi
# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-qt-build-XXXXXX)
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
# store repo root as variable
REPO_ROOT=$(readlink -f $(dirname $(dirname "$0")))
OLD_CWD=$(readlink -f .)
pushd "$BUILD_DIR"
if [ "$ARCH" == "i386" ]; then
EXTRA_CMAKE_ARGS=("-DCMAKE_TOOLCHAIN_FILE=$REPO_ROOT/cmake/toolchains/i386-linux-gnu.cmake" "-DUSE_SYSTEM_CIMG=OFF")
fi
cmake "$REPO_ROOT" -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=RelWithDebInfo "${EXTRA_CMAKE_ARGS[@]}"
make -j$(nproc)
ctest -V
make install DESTDIR=AppDir
strip_path=$(which strip)
if [ "$ARCH" == "i386" ]; then
# download i386 strip for i386 AppImage
# https://github.com/linuxdeploy/linuxdeploy/issues/59
wget http://security.ubuntu.com/ubuntu/pool/main/b/binutils/binutils-multiarch_2.24-5ubuntu14.2_i386.deb
echo "0106f170cebf5800e863a558cad039e4f16a76d3424ae943209c3f6b0cacd511 binutils-multiarch_2.24-5ubuntu14.2_i386.deb" | sha256sum -c
wget http://security.ubuntu.com/ubuntu/pool/main/b/binutils/binutils-multiarch-dev_2.24-5ubuntu14.2_i386.deb
echo "ed9ca4fbbf492233228f79fae6b349a2ed2ee3e0927bdc795425fccf5fae648e binutils-multiarch-dev_2.24-5ubuntu14.2_i386.deb" | sha256sum -c
dpkg -x binutils-multiarch_2.24-5ubuntu14.2_i386.deb out/
dpkg -x binutils-multiarch-dev_2.24-5ubuntu14.2_i386.deb out/
rm binutils-multiarch*.deb
strip_path=$(readlink -f out/usr/bin/strip)
export LD_LIBRARY_PATH=$(readlink -f out/usr/lib)
fi
export UPD_INFO="gh-releases-zsync|linuxdeploy|linuxdeploy-plugin-qt|continuous|linuxdeploy-plugin-qt-$ARCH.AppImage"
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
chmod +x linuxdeploy*.AppImage
./linuxdeploy-"$ARCH".AppImage --appdir AppDir \
-d "$REPO_ROOT"/resources/linuxdeploy-plugin-qt.desktop \
-i "$REPO_ROOT"/resources/linuxdeploy-plugin-qt.svg \
-e $(which patchelf) \
-e "$strip_path" \
--output appimage
mv linuxdeploy-plugin-qt-"$ARCH".AppImage* "$OLD_CWD"/
-9
View File
@@ -1,9 +0,0 @@
#! /bin/bash
# get a compiler that allows for using modern-ish C++ (>= 11) on a distro that doesn't normally support it
# before you ask: yes, the binaries will work on CentOS 6 even without devtoolset (they somehow partially link C++
# things statically while using others from the system...)
# so, basically, it's magic!
source /opt/rh/devtoolset-*/enable
exec "$@"
-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
-95
View File
@@ -1,95 +0,0 @@
#!/usr/bin/env bash
set -e
set -x
if [ "$ARCH" == "" ]; then
echo 'Error: $ARCH is not set'
exit 1
fi
TARGET="$1"
if [ "$TARGET" == "" ]; then
echo 'Error: $TARGET is not set'
exit 1
fi
# use RAM disk if possible
if [ "$CI" == "" ] && [ -d /dev/shm ]; then
TEMP_BASE=/dev/shm
else
TEMP_BASE=/tmp
fi
BUILD_DIR=$(mktemp -d -p "$TEMP_BASE" linuxdeploy-plugin-qt-build-XXXXXX)
cleanup () {
if [ -d "$BUILD_DIR" ]; then
rm -rf "$BUILD_DIR"
fi
}
trap cleanup EXIT
wget -N https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-"$ARCH".AppImage
export LINUXDEPLOY_BIN="$PWD"/linuxdeploy-"$ARCH".AppImage
chmod +x "$LINUXDEPLOY_BIN"
pushd "$BUILD_DIR"
git clone --depth=1 https://github.com/linuxdeploy/linuxdeploy-plugin-qt-examples.git
source /opt/qt5*/bin/qt5*-env.sh || echo "" # hack required, the script returns 1 for some reason
qt5_ver=$(echo "$QT_BASE_DIR" | cut -d/ -f3 | cut -d5 -f2-)
mkdir -p "$HOME"/.config/qtchooser
echo "${QTDIR}/bin" > "$HOME"/.config/qtchooser/qt5."$qt5_ver".conf
echo "${QTDIR}/lib" >> "$HOME"/.config/qtchooser/qt5."$qt5_ver".conf
export CMAKE_PREFIX_PATH="$QTDIR"/lib/cmake
export QT_SELECT=qt5."$qt5_ver"
## Build projects
pushd linuxdeploy-plugin-qt-examples/QtQuickControls2Application
# This env variable is used by the qt plugin to search the qml sources in other paths than the AppDir
# it's mandatory to use when your qml files are embed as Qt resources into the main binary.
export QML_SOURCES_PATHS="$PWD"/src
mkdir build
pushd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr || exit 1
DESTDIR="$PWD"/AppDir make install || exit 1
"$LINUXDEPLOY_BIN" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$BUILD_DIR" || exit 1
popd
popd
pushd linuxdeploy-plugin-qt-examples/QtWebEngineApplication
export QML_SOURCES_PATHS="$PWD"
mkdir build
pushd build
qmake CONFIG+=release PREFIX=/usr ../QtWebEngineApplication.pro || exit 1
INSTALL_ROOT="$PWD"/AppDir make install || exit 1
# Include libnss related files
mkdir -p "$PWD"/AppDir/usr/lib/
cp -r /usr/lib/x86_64-linux-gnu/nss "$PWD"/AppDir/usr/lib/
"$LINUXDEPLOY_BIN" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$BUILD_DIR" || exit 1
popd
popd
pushd linuxdeploy-plugin-qt-examples/QtWidgetsApplication
mkdir build
pushd build
qmake CONFIG+=release PREFIX=/usr ../QtWidgetsApplication.pro || exit 1
INSTALL_ROOT="$PWD"/AppDir make install || exit 1
"$LINUXDEPLOY_BIN" --appdir "$PWD"/AppDir --plugin qt --output appimage || exit 1
mv -v *AppImage "$BUILD_DIR" || exit 1
popd
popd
-7
View File
@@ -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)
-11
View File
@@ -1,12 +1 @@
add_subdirectory(linuxdeploy EXCLUDE_FROM_ALL) 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
-2
View File
@@ -5,5 +5,3 @@ Icon=linuxdeploy-plugin-qt
Terminal=true Terminal=true
NoDisplay=true NoDisplay=true
Type=Application Type=Application
Categories=Development;
X-AppImage-Integrate=false

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