mirror of https://github.com/Syncplay/syncplay
Add AppImage support
This commit is contained in:
parent
7788e533eb
commit
f90a674707
15
.travis.yml
15
.travis.yml
|
@ -5,6 +5,12 @@ matrix:
|
||||||
- language: bash
|
- language: bash
|
||||||
sudo: required
|
sudo: required
|
||||||
dist: xenial
|
dist: xenial
|
||||||
|
env: BUILD_DESTINATION=snapcraft
|
||||||
|
- language: python
|
||||||
|
sudo: required
|
||||||
|
dist: xenial
|
||||||
|
python: 3.6
|
||||||
|
env: BUILD_DESTINATION=appimage
|
||||||
|
|
||||||
branches:
|
branches:
|
||||||
only:
|
only:
|
||||||
|
@ -12,11 +18,13 @@ branches:
|
||||||
|
|
||||||
script:
|
script:
|
||||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then python3 buildPy2app.py py2app ; fi
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then sudo snapcraft cleanbuild ; fi
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then sudo snapcraft cleanbuild ; fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then travis/appimage-script.sh ; fi
|
||||||
|
|
||||||
install:
|
install:
|
||||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-install.sh ; fi
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then travis/linux-install.sh ; fi
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then travis/snapcraft-install.sh ; fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then ls -al ; fi
|
||||||
|
|
||||||
before_deploy:
|
before_deploy:
|
||||||
- ls -al
|
- ls -al
|
||||||
|
@ -24,7 +32,8 @@ before_deploy:
|
||||||
- python3 bintray_version.py
|
- python3 bintray_version.py
|
||||||
- mkdir dist_bintray
|
- mkdir dist_bintray
|
||||||
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-deploy.sh ; fi
|
- if [ "$TRAVIS_OS_NAME" == "osx" ]; then travis/macos-deploy.sh ; fi
|
||||||
- if [ "$TRAVIS_OS_NAME" == "linux" ]; then mv syncplay_build_amd64.snap dist_bintray/syncplay_${VER}_amd64.snap ; fi
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "snapcraft" ]; then mv syncplay_build_amd64.snap dist_bintray/syncplay_${VER}_amd64.snap ; fi
|
||||||
|
- if [ "$TRAVIS_OS_NAME" == "linux" ] && [ "$BUILD_DESTINATION" == "appimage" ]; then mv Syncplay*.AppImage dist_bintray/ ; fi
|
||||||
|
|
||||||
deploy:
|
deploy:
|
||||||
skip_cleanup: true
|
skip_cleanup: true
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
set -x
|
||||||
|
set -e
|
||||||
|
|
||||||
|
# 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" appimagelint-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")))
|
||||||
|
#REPO_ROOT="."
|
||||||
|
OLD_CWD=$(readlink -f .)
|
||||||
|
|
||||||
|
pushd "$BUILD_DIR"
|
||||||
|
|
||||||
|
wget https://github.com/TheAssassin/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
|
||||||
|
wget https://raw.githubusercontent.com/linuxdeploy/linuxdeploy-plugin-conda/master/linuxdeploy-plugin-conda.sh
|
||||||
|
|
||||||
|
chmod +x linuxdeploy*.AppImage
|
||||||
|
chmod +x linuxdeploy*.sh
|
||||||
|
|
||||||
|
# set up custom AppRun script
|
||||||
|
cat > AppRun.sh <<\EAT
|
||||||
|
#! /bin/sh
|
||||||
|
# make sure to set APPDIR when run directly from the AppDir
|
||||||
|
if [ -z $APPDIR ]; then APPDIR=$(readlink -f $(dirname "$0")); fi
|
||||||
|
export LD_LIBRARY_PATH="$APPDIR"/usr/lib
|
||||||
|
export PATH="$PATH":"$APPDIR"/usr/bin
|
||||||
|
|
||||||
|
exec "$APPDIR"/usr/bin/python "$APPDIR"/usr/bin/syncplay "$@"
|
||||||
|
EAT
|
||||||
|
chmod +x AppRun.sh
|
||||||
|
|
||||||
|
#export CONDA_PACKAGES="Pillow"
|
||||||
|
export PIP_REQUIREMENTS="."
|
||||||
|
export PIP_WORKDIR="$REPO_ROOT"
|
||||||
|
export VERSION="$(cat $REPO_ROOT/syncplay/__init__.py | awk '/version/ {gsub("\047", "", $3); print $NF}')"
|
||||||
|
export OUTPUT=Syncplay-$VERSION-x86_64.AppImage
|
||||||
|
|
||||||
|
./linuxdeploy-x86_64.AppImage --appdir AppDir --plugin conda \
|
||||||
|
-e $(which readelf) \
|
||||||
|
-i "$REPO_ROOT"/syncplay/resources/syncplay.png -d "$REPO_ROOT"/syncplay/resources/syncplay.desktop \
|
||||||
|
--output appimage --custom-apprun AppRun.sh
|
||||||
|
|
||||||
|
mv Syncplay*.AppImage "$OLD_CWD"
|
Loading…
Reference in New Issue