- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
1 parent
758b5eb
commit e25250e
Showing
8 changed files
with
92 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,3 +122,4 @@ tests/kimai_server/data/kimai.sqlite | |
|
||
/build/ | ||
/dist/ | ||
*.AppImage |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,49 +1,65 @@ | ||
#!/bin/bash | ||
|
||
set -x | ||
set -e | ||
|
||
# Run this script once Kemai is built. Install and AppImage will be handle here. | ||
# It just need path to Qt and to build directory. | ||
|
||
|
||
# Read args | ||
qt_path=${qt_path:-} | ||
build_path=${build_path:-} | ||
|
||
while [ $# -gt 0 ]; do | ||
if [[ $1 == *"--"* ]]; then | ||
param="${1/--/}" | ||
declare $param="$2" | ||
fi | ||
shift | ||
usage() { echo "Usage: $0 -b <build dir> -o <openssl srcdir> -q <qt dir>"; exit 0; } | ||
|
||
while getopts ":hb:o:q:" o; do | ||
case "${o}" in | ||
b) | ||
BUILD_DIR=${OPTARG} | ||
;; | ||
o) | ||
OPENSSL_DIR=${OPTARG} | ||
;; | ||
q) | ||
QT_DIR=${OPTARG} | ||
;; | ||
h | *) | ||
usage | ||
;; | ||
esac | ||
done | ||
|
||
if [[ -z ${BUILD_DIR+x} ]] || [[ -z ${OPENSSL_DIR+x} ]] || [[ -z ${QT_DIR+x} ]]; then | ||
usage | ||
fi | ||
|
||
# Cleanup | ||
rm $build_path/*.AppImage* || true | ||
APPIMAGE_DESTDIR=${BUILD_DIR}/AppDir | ||
rm -r ${APPIMAGE_DESTDIR} | ||
|
||
# Run install to AppDir and add linux files | ||
DESTDIR=AppDir cmake --build $build_path --target install | ||
cp bundle/linux/kemai.desktop $build_path/AppDir/ | ||
cp bundle/linux/kemai.png $build_path/AppDir/ | ||
DESTDIR=AppDir cmake --build ${BUILD_DIR} --target install || exit 1 | ||
|
||
# Copy sysroot | ||
cp -rv bundle/linux/sysroot/* ${APPIMAGE_DESTDIR}/ | ||
chmod +x ${APPIMAGE_DESTDIR}/usr/bin/kemai-wrapper.sh | ||
|
||
# Gets AppImage tools | ||
pushd "$build_path" | ||
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | ||
chmod +x linuxdeploy*.AppImage | ||
wget -nc -P ${BUILD_DIR}/ https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage | ||
wget -nc -P ${BUILD_DIR}/ https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage | ||
chmod +x ${BUILD_DIR}/linuxdeploy*.AppImage | ||
|
||
# Export vars | ||
export QMAKE=$qt_path/bin/qmake | ||
export LD_LIBRARY_PATH=$qt_path/lib | ||
export VERSION=$(cat version.txt) | ||
export QMAKE=${QT_DIR}/bin/qmake | ||
export LD_LIBRARY_PATH=${QT_DIR}/lib | ||
export VERSION=$(cat ${BUILD_DIR}/version.txt) | ||
export EXTRA_QT_PLUGINS=platforms,iconengines,wayland-decoration-client,wayland-graphics-integration-client,wayland-shell-integration,platformthemes,tls | ||
|
||
# Copy OpenSSLv3 binaries | ||
OPENSSL_APPDIR=${APPIMAGE_DESTDIR}/fallback/libssl.so.3 | ||
mkdir -p ${OPENSSL_APPDIR} | ||
cp -vL ${OPENSSL_DIR}/libssl.so* ${OPENSSL_APPDIR}/ | ||
cp -vL ${OPENSSL_DIR}/libcrypto.so* ${OPENSSL_APPDIR}/ | ||
|
||
# Run appimage builder | ||
./linuxdeploy-x86_64.AppImage \ | ||
${BUILD_DIR}/linuxdeploy-x86_64.AppImage \ | ||
--appimage-extract-and-run \ | ||
--appdir AppDir \ | ||
--appdir ${APPIMAGE_DESTDIR} \ | ||
--plugin qt \ | ||
-d AppDir/kemai.desktop \ | ||
-i AppDir/kemai.png \ | ||
-d ${APPIMAGE_DESTDIR}/kemai-wrapper.desktop \ | ||
-i ${APPIMAGE_DESTDIR}/kemai-wrapper.png \ | ||
--output appimage |
4 changes: 2 additions & 2 deletions
4
bundle/linux/kemai.desktop → bundle/linux/sysroot/kemai-wrapper.desktop
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Name=Kemai | ||
Exec=Kemai | ||
Icon=kemai | ||
Exec=kemai-wrapper.sh | ||
Icon=kemai-wrapper | ||
Categories= |
File renamed without changes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/env bash | ||
|
||
# | ||
# Check if fallback libraries are present on host. If not, add embedded fallback libraries to path | ||
# | ||
function find_library() | ||
{ | ||
# Print full path to a library or return exit status 1 if not found | ||
local library="$1" # take library name as input (e.g. "libfoo.so") | ||
# Look for the library in $LD_LIBRARY_PATH | ||
local dir IFS=':' # split path into array on this separator | ||
for dir in "${LD_LIBRARY_PATH[@]}"; do | ||
if [[ -e "${dir}/${library}" ]]; then | ||
echo "${dir}/${library}" | ||
return # Library found | ||
fi | ||
done | ||
# Not found yet so check system cache | ||
ldconfig -p | awk -v lib="${library}" -v arch="${HOSTTYPE}" \ | ||
' | ||
BEGIN {status=1} | ||
($1 == lib && index($0, arch)) {print $NF; status=0; exit} | ||
END {exit status} | ||
' | ||
} | ||
|
||
fallback_libs="" | ||
for fallback_dir in "${APPDIR}/fallback"/*; do | ||
libname="${fallback_dir##*/}" | ||
if ! find_library "${libname}"; then | ||
echo "${APPIMAGE}: Using fallback for ${libname}" | ||
fallback_libs="${fallback_libs}:${fallback_dir}" | ||
fi | ||
done | ||
|
||
export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}${fallback_libs}" | ||
|
||
# | ||
# Wrapper to run expected embedded Qinertia app | ||
# | ||
${APPDIR}/usr/bin/Kemai |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters