Skip to content

Commit

Permalink
Build snap on Travis with Qt5.9
Browse files Browse the repository at this point in the history
  • Loading branch information
dragly committed May 3, 2017
1 parent 902eeff commit c6419f7
Show file tree
Hide file tree
Showing 11 changed files with 71 additions and 152 deletions.
6 changes: 6 additions & 0 deletions .snapcraft/bin/custom-qt-helper
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#/bin/sh
export QT_PLUGIN_PATH="$SNAP/plugins"
export QML2_IMPORT_PATH="$SNAP/qml"
export PATH="$SNAP/bin:$PATH"
export LD_LIBRARY_PATH="$SNAP/lib:$LD_LIBRARY_PATH"
exec "$@"
Binary file modified .snapcraft/travis_snapcraft.cfg
Binary file not shown.
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@ sudo: required
services: docker
compiler: gcc
install:
- docker run -v $(pwd):/app snapcore/snapcraft bash -c "cd /app/ && .travis/ubuntu.sh"
- docker build .travis -t atomify
script:
- docker run -v $(pwd):/app -t atomify bash .travis/ubuntu.sh
after_success:
- openssl aes-256-cbc -K $encrypted_06a73dfebfd3_key -iv $encrypted_06a73dfebfd3_iv
- openssl aes-256-cbc -K $encrypted_082f9a3f227a_key -iv $encrypted_082f9a3f227a_iv
-in .snapcraft/travis_snapcraft.cfg -out .snapcraft/snapcraft.cfg -d
deploy:
on:
branch: dev
'on':
branch: travis-tests
provider: script
script: docker run -v $(pwd):$(pwd) -t ubuntu:xenial sh -c "apt update -qq && apt
install snapcraft -y && cd $(pwd) && snapcraft && snapcraft push *.snap --release
script: docker run -v $(pwd):/app -t atomify sh -c "cd /app/ && snapcraft && snapcraft push *.snap --release
edge"
skip_cleanup: true
11 changes: 11 additions & 0 deletions .travis/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM ubuntu:16.04

WORKDIR /app

RUN apt-get -qq update
RUN apt-get install -qq sudo apt-utils

RUN sudo apt-get update -qq
RUN sudo apt-get install -qq curl p7zip-full git build-essential python snapcraft qt5-default
ADD qt5-ubuntu.sh /qt5-ubuntu.sh
RUN bash /qt5-ubuntu.sh /opt/qt5 extra-datavis3d extra-charts gamepad 3d base declarative graphicaleffects imageformats multimedia quickcontrols quickcontrols2 sensors svg tools translations xmlpatterns
7 changes: 4 additions & 3 deletions .travis/qt5-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,21 @@ for x in ${@:2}; do
exit 1
fi

curl -L -o /tmp/qt5.7z $DOWNLOAD_URL
echo "Downloading $x"
curl -L -o /tmp/qt5.7z $DOWNLOAD_URL > /dev/null
DOWNLOAD_HASH=$(shasum -a 1 /tmp/qt5.7z)
if [[ $DOWNLOAD_HASH != $DOWNLOAD_HASH ]]; then
echo "ERROR: Hash missmatch for $x" 1>&2
exit 1
fi

7z x -aoa "-o$1" /tmp/qt5.7z 1>&2
7z x -aoa "-o$1" /tmp/qt5.7z > /dev/null
rm /tmp/qt5.7z
done

DOWNLOAD_URL="https://download.qt.io/online/qtsdkrepository/linux_x64/desktop/qt5_5${QT5_MAJOR}/qt.5${QT5_MAJOR}.gcc_64/5.${QT5_MAJOR}.${QT5_MINOR}-${QT5_PATCH}icu-${QT5_LINUX_VERSION_2}-x64.7z"
curl -L -o /tmp/qt5.7z $DOWNLOAD_URL
7z x -aoa "-o$1" /tmp/qt5.7z 1>&2
7z x -aoa "-o$1" /tmp/qt5.7z > /dev/null
rm /tmp/qt5.7z

# Minimal Qt Configuration File
Expand Down
21 changes: 11 additions & 10 deletions .travis/ubuntu.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
#!/bin/bash
sudo apt-get update -qq
sudo apt-get install -qq curl p7zip-full git
sudo apt-get -qq build-dep qt5-default
bash .travis/qt5-ubuntu.sh $(pwd) extra-charts 3d base declarative graphicaleffects imageformats multimedia quickcontrols quickcontrols2 sensors svg tools translations xmlpatterns
export QTDIR=$(pwd)/5.7/gcc_64/
export QTDIR=/opt/qt5/5.9/gcc_64
export PATH=$QTDIR/bin:$PATH
SNAP_DUMP=snapdump
python configure.py
qmake
make
cp -r $QTDIR/lib .snapcraft/
cp -r $QTDIR/plugins .snapcraft/
cp -r $QTDIR/qml .snapcraft/
cp neuronify .snapcraft/
make -j8
mkdir -p ${SNAP_DUMP}
cp -r $QTDIR/bin ${SNAP_DUMP}/
cp -r $QTDIR/lib ${SNAP_DUMP}/
cp -r $QTDIR/plugins ${SNAP_DUMP}/
cp -r $QTDIR/plugins/platforms ${SNAP_DUMP}/
cp -r $QTDIR/qml ${SNAP_DUMP}/
cp atomify-lammps/atomify-lammps ${SNAP_DUMP}/bin/atomify
8 changes: 4 additions & 4 deletions snap/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
Add the following to this folder before you snap:
Add the following to the "./snapdump" folder before you snap:

- neuronify (binary file)
- atomify (binary file)
- Qt lib directory
- Qt plugins directory
- Qt qml directory

Run the following commands:

snapcraft snap
sudo snap install neuronify*.snap
neuronify
sudo snap install atomify*.snap
atomify

If everything works as expected, neuronify should run now.
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
Type=Application
Name=Atomify LAMMPS
Comment=Editor for the molecular dynamics simulator LAMMPS
Exec=atomify-lammps
Icon=${SNAP}/meta/gui/atomify-lammps.png
Exec=atomify
Icon=${SNAP}/meta/gui/atomify.png
Terminal=false
Categories=Education;
Keywords=lammps;molecules;atoms;atom;molecule;lammps;
File renamed without changes
84 changes: 0 additions & 84 deletions snap/plugins/qt57.py

This file was deleted.

69 changes: 26 additions & 43 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,50 +1,33 @@
name: atomify-lammps
version: "2.0.4"
name: atomify
version: "2.0.5"
summary: Atomify LAMMPS
description: Editor for the molecular dynamics simulator LAMMPS
confinement: strict
grade: stable

apps:
neuronify:
command: atomify-lammps
plugs: ['unity7', 'x11', 'opengl', 'network', 'network-bind', 'home']
atomify:
command: desktop-launch custom-qt-helper atomify
plugs: ['unity7', 'x11', 'opengl', 'network', 'network-bind', 'home']

parts:
qml:
plugin: qt57

move:
plugin: copy
files:
atomify-lammps: atomify-lammps
lib: lib
qml: qml
plugins: plugins

dep:
plugin: nil
stage-packages:
- libc-bin
- libxkbcommon0
- ttf-ubuntu-font-family
- dmz-cursor-theme
- light-themes
- shared-mime-info
- libgdk-pixbuf2.0-0
- libx11-xcb1
- libgl1-mesa-dev
- libegl1-mesa
- libxrender-dev
- libgpg-error0
- libgcrypt20
- liblzma5
- libselinux1
- libpcre3
- zlib1g
- libexpat1
- libc6
- libgcc1
- libgcc-5-dev
- libstdc++6
- libxi6
- libuuid1
move:
plugin: dump
source: snapdump
stage:
- bin
- lib
- plugins
- qml
conf:
plugin: dump
source: .snapcraft
stage:
- bin
helpers:
plugin: nil
after:
- move # NOTE move and conf must be here due install error for desktop-qt5 otherwise
- conf
- desktop-qt5

0 comments on commit c6419f7

Please sign in to comment.