This commit is contained in:
mathusummut 2019-04-23 00:06:51 +02:00
commit e70a2ca465
4 changed files with 87 additions and 37 deletions

View File

@ -54,36 +54,56 @@ before_install:
- $CXX --version
- cmake --version
script:
# ALL THE BUILD COMMANDS HERE
# version 6 skipped here. Below, it's used to test use of FORCE_EMBEDDED_LIBS option
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version != "6" ]; then
script: |
# ALL THE BUILD COMMANDS HERE
# version 6 skipped here. Below, it's used to test use of FORCE_EMBEDDED_LIBS option
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version != "6" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local;
make && make install;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
fi
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" != "" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local;
make && make install;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
fi
- if [ "$TRAVIS_OS_NAME" = "osx" ]; then
if [ "$TRAVIS_OS_NAME" = "osx" ]; then
mkdir build;
cd build;
cmake .. -DCMAKE_INSTALL_PREFIX=$PWD/local;
make && make install;
cmake .. -DCMAKE_INSTALL_PREFIX=/usr;
echo 'Dependencies:';
otool -L glest;
fi
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version = "6" ]; then
if [ "$TRAVIS_OS_NAME" = "linux" ] && [ "$(echo "$CC" | grep 'clang')" = "" ] && [ $Tr_Compiler_Version = "6" ]; then
mkdir build;
cd build;
cmake .. -DFORCE_EMBEDDED_LIBS=ON -DCMAKE_INSTALL_PREFIX=$PWD/local;
make && make install;
cmake .. -DFORCE_EMBEDDED_LIBS=ON -DCMAKE_INSTALL_PREFIX=/usr;
fi
if [ "$TRAVIS_OS_NAME" = "linux" ]; then
make -j$(nproc) && make install DESTDIR=../Glest;
cd ..;
rm -rf build;
# Get the data for the appimage build.
git clone https://github.com/glest/glest-data.git;
mkdir build;
cd build;
cmake ../glest-data -DCMAKE_INSTALL_PREFIX=/usr;
make && make install DESTDIR=../Glest;
cd ..;
rm -rf build;
# Remove useless metainfo.
rm Glest/usr/share/metainfo/io.glest.Editor.appdata.xml;
find Glest/;
# Build the appimage.
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/pulseaudio/:/usr/lib/i386-linux-gnu/pulseaudio/:$LD_LIBRARY_PATH;
wget -c -nv "https://github.com/probonopd/linuxdeployqt/releases/download/continuous/linuxdeployqt-continuous-x86_64.AppImage";
chmod a+x linuxdeployqt-continuous-x86_64.AppImage;
unset QTDIR; unset QT_PLUGIN_PATH ; unset LD_LIBRARY_PATH;
export VERSION="2.0"; # linuxdeployqt uses this for naming the file
./linuxdeployqt-continuous-x86_64.AppImage Glest/usr/share/applications/io.glest.Glest.desktop -appimage;
fi
# https://docs.travis-ci.com/user/notifications/#IRC-notification
notifications:
irc:
@ -96,3 +116,26 @@ notifications:
on_failure: change
template:
- "[%{repository_name}#%{branch}@%{commit}] %{author}: %{message} %{build_url}"
after_success:
# find appdir -executable -type f -exec ldd {} \; | grep " => /usr" | cut -d " " -f 2-3 | sort | uniq # for debugging
# curl --upload-file APPNAME*.AppImage https://transfer.sh/APPNAME-git.$(git rev-parse --short HEAD)-x86_64.AppImage
- wget -c https://github.com/probonopd/uploadtool/raw/master/upload.sh
- bash upload.sh Glest*.AppImage*
# Notify discord.
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh success $WEBHOOK_URL
after_failure:
# Notify discord.
- wget https://raw.githubusercontent.com/DiscordHooks/travis-ci-discord-webhook/master/send.sh
- chmod +x send.sh
- ./send.sh failure $WEBHOOK_URL
branches:
except:
- # Do not build tags that we create when we upload to GitHub Releases
- /^(?i:continuous)/

View File

@ -26,26 +26,17 @@ instructions](https://github.com/Glest/glest-source/blob/master/mk/windows/READM
## Downloads for linux
Glest can be installed using [Snapcraft](https://snapcraft.io/) or [Flatpak](https://flatpak.org/):
Three distro-agnostic options are available for Glest on linux:
1. (Recommended) Install Glest using Snapcraft:
snap install --devmode --edge glest
Fix for a bug currently in Glest:
mkdir ~/snap/glest/1/.glest/
Run Glest:
glest
2. Install using Flatpak: https://github.com/glest/io.glest.Glest
1. [![Get it from the Snap Store](https://snapcraft.io/static/images/badges/en/snap-store-black.svg)](https://snapcraft.io/glest)
2. Download the AppImage here: https://github.com/glest/glest-source/releases
To run, set the `.AppImage` file to executable with `chmod +x Glest.AppImage`, then just execute it.
3. Install using Flatpak: https://github.com/glest/io.glest.Glest
## Quick Build Guide for Linux
If you can't use Snap or flatpak, you can build Glest from source.
Using the build script:
git clone https://github.com/Glest/glest-source.git glest; sudo glest/mk/linux/setup.sh

View File

@ -24,7 +24,7 @@ echo
echo "Getting and installing data..."
../../linux/clone-data.sh
cmake -DCMAKE_INSTALL_PREFIX=/usr ../../linux/../data
cmake -DCMAKE_INSTALL_PREFIX=/usr ../../linux/build/data
make && make install DESTDIR=../Glest
cd ..
rm -rf build
@ -45,4 +45,4 @@ chmod +x linuxdeploy-x86_64.AppImage
chmod +x Glest*.AppImage
echo
echo "done!"
echo "Done!"

View File

@ -23,11 +23,25 @@ apps:
- pulseaudio
- x11
Glest.mapeditor:
Glest-mapeditor:
command: glest_editor
environment:
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
plugs:
- home
- opengl
- pulseaudio
- x11
Glest.g3dviewer:
Glest-g3dviewer:
command: glest_g3dviewer
environment:
LD_LIBRARY_PATH: $LD_LIBRARY_PATH:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/pulseaudio
plugs:
- home
- opengl
- pulseaudio
- x11
parts:
glest:
@ -111,5 +125,7 @@ parts:
#source: glest-data
source-type: git
source: https://github.com/glest/glest-data.git
override-build: |
snapcraftctl build
sed -i 's|Icon=glest|Icon=/usr/share/icons/hicolor/256x256/apps/glest\.png|' $SNAPCRAFT_PART_INSTALL/usr/share/applications/io.glest.Glest.desktop