-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
201 additions
and
1 deletion.
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 |
---|---|---|
@@ -0,0 +1,77 @@ | ||
name: Build Snap Image | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_snap: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: snapcore/action-build@v1 | ||
id: snapcraft | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: snap | ||
path: ${{ steps.snapcraft.outputs.snap }} | ||
|
||
install_test: | ||
if: 0 == 1 # disable for now | ||
runs-on: ubuntu-latest | ||
needs: build_snap | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: snap | ||
path: . | ||
- name: Install snap | ||
run: | | ||
sudo snap install --dangerous *.snap | ||
- name: Set up screen dependencies (Linux) | ||
run: | | ||
sudo apt-get -o Acquire::Retries=3 update | ||
sudo apt-get -o Acquire::Retries=3 install libxcb-xinerama0 | ||
sudo apt-get -o Acquire::Retries=3 install libxcb-icccm4 libxcb-image0 libxcb-keysyms1 libxcb-randr0 libxcb-render-util0 libxcb-xfixes0 | ||
sudo apt-get -o Acquire::Retries=3 install libpulse-mainloop-glib0 | ||
sudo apt-get -o Acquire::Retries=3 install libxkbcommon-x11-0 | ||
Xvfb :0 -screen 0 1920x1080x24 -ac & | ||
echo "DISPLAY=:0" >> $GITHUB_ENV | ||
- name: Run snap | ||
run: | | ||
snap run sasview5 & | ||
sleep 60 | ||
upload_snap: | ||
runs-on: ubuntu-latest | ||
needs: install_test | ||
steps: | ||
- uses: actions/download-artifact@v3 | ||
with: | ||
name: snap | ||
path: . | ||
|
||
- name: Get branch names | ||
id: branch-name | ||
uses: tj-actions/branch-names@v6 | ||
|
||
- name: Get snap filename | ||
run: | | ||
echo "SNAP_FILENAME=$(ls *.snap)" >> $GITHUB_ENV | ||
- name: Publish Develop Branch to snapcraft beta | ||
# if: steps.branch-name.outputs.current_branch == 'develop' | ||
if: steps.branch-name.outputs.current_branch == 'snapcraft' # temporarily feature branch will produce snaps | ||
uses: snapcore/action-publish@v1 | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }} | ||
with: | ||
snap: ${{ env.SNAP_FILENAME }} | ||
release: beta | ||
|
||
- name: Publish Main Branch to snapcraft stable | ||
if: steps.branch-name.outputs.current_branch == 'main' | ||
uses: snapcore/action-publish@v1 | ||
env: | ||
SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAP_LOGIN }} | ||
with: | ||
snap: ${{ env.SNAP_FILENAME }} | ||
release: stable |
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,10 @@ | ||
[Desktop Entry] | ||
Name=SasView | ||
GenericName=Python application | ||
Comment=Small Angle Scattering Analysis Software Package. | ||
Exec=sasview | ||
Icon=${SNAP}/meta/gui/sv_logo.svg | ||
Terminal=false | ||
Type=Application | ||
Categories=Education; | ||
StartupNotify=true |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,97 @@ | ||
name: sasview5 | ||
summary: Small Angle Scattering Analysis Software Package. | ||
description: | | ||
open source, collaboratively developed software for the analysis of any small angle scattering data. | ||
adopt-info: build-application | ||
grade: stable | ||
confinement: strict | ||
base: core20 | ||
icon: snap/gui/sv_logo.svg | ||
architectures: | ||
- build-on: [amd64] | ||
|
||
|
||
apps: | ||
sasview5: | ||
command: sasview-wrapper | ||
extensions: [gnome-3-38] | ||
plugs: [network, x11, pulseaudio, opengl, home, ssh-keys, removable-media, shmem] | ||
environment: | ||
PYTHONPATH: $PYTHONPATH:$SNAP | ||
DISABLE_WAYLAND: 1 | ||
|
||
parts: | ||
get-source: | ||
plugin: dump | ||
source: . | ||
|
||
build-application: | ||
plugin: python | ||
source: . | ||
|
||
stage-packages: | ||
- python3.8-venv | ||
- libfreetype6 | ||
- libgomp1 | ||
- libpng16-16 | ||
- libxcb-xinerama0 | ||
- libxkbcommon0 | ||
- libxcb-render0 | ||
- libxcb-randr0 | ||
- libnss3 | ||
- unixodbc-dev | ||
- libpq-dev | ||
- libxcb-icccm4 | ||
- libxkbcommon-x11-0 | ||
- libxcb-xkb1 | ||
- libxcb-render-util0 | ||
- libxcb-shape0 | ||
- libspeechd2 | ||
- libxcb-image0 | ||
- libxcb-keysyms1 | ||
- libxcb-util1 | ||
- libxcb-xfixes0 # To show graphs | ||
- gir1.2-xapp-1.0 # Failed to load module "xapp-gtk3-module" | ||
- libxcb-cursor0 | ||
- libpulse-mainloop-glib0 | ||
- libegl1-mesa | ||
|
||
build-packages: | ||
- python3.8-venv | ||
- python3.8-dev | ||
- git-all | ||
|
||
override-pull: | | ||
snapcraftctl pull | ||
snapcraftctl set-version 6.0.0 | ||
build-environment: | ||
- SNAPCRAFT_PYTHON_INTERPRETER: python3.8 | ||
- PATH: $SNAPCRAFT_PART_INSTALL/bin:$PATH | ||
- PYTHONPATH: '' | ||
override-build: | | ||
# Work around a bug in snapcraft python plugin / gnome 3.38 extension | ||
# https://forum.snapcraft.io/t/build-a-snap-with-any-version-of-python-i-want/10420/8 | ||
rm -rf $SNAPCRAFT_PART_INSTALL/usr/lib/python3.8/distutils | ||
cp -r /usr/lib/python3.8/distutils $SNAPCRAFT_PART_INSTALL/usr/lib/python3.8/distutils | ||
mkdir -p $SNAPCRAFT_PART_INSTALL/usr/include/ | ||
cp -r /usr/include/python3.8 $SNAPCRAFT_PART_INSTALL/usr/include/python3.8 | ||
mkdir -p $SNAPCRAFT_PART_INSTALL/bin | ||
ln -s /usr/bin/python3.8 $SNAPCRAFT_PART_INSTALL/bin/python3.8 | ||
# ln -sf ../usr/lib/libsnapcraft-preload.so $SNAPCRAFT_PART_INSTALL/lib/libsnapcraft-preload.so | ||
snapcraftctl build | ||
# Apply shebang rewrite as done by snapcraft | ||
find $SNAPCRAFT_PART_INSTALL/bin/ -maxdepth 1 -mindepth 1 -type f -executable -exec \ | ||
sed -i \ | ||
"s|^#!${SNAPCRAFT_PART_INSTALL}/bin/python3.8$|#!/usr/bin/env python3|" {} \; | ||
# debug | ||
# find $SNAPCRAFT_PART_INSTALL/bin/ -maxdepth 1 -mindepth 1 -type f -executable -exec head -n 1 {} \; | ||
# /dev/shm access is required for the preload library to work | ||
plugs: | ||
shmem: | ||
interface: shared-memory | ||
private: true |