Skip to content

Commit

Permalink
Snapping (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
fenollp authored Sep 10, 2020
1 parent 12c8340 commit 96e6276
Show file tree
Hide file tree
Showing 5 changed files with 117 additions and 30 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/snapcraft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
on: push
name: Snap
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BAZELISK_GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
build_snap:
name: Build snap on ubuntu
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- uses: samuelmeuli/action-snapcraft@v1
with:
use_lxd: true

- name: Build snap
run: sg lxd -c 'snapcraft --use-lxd'

- uses: actions/upload-artifact@v2
with:
name: snapped
path: '*.snap'
if-no-files-found: error
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ addons:
packages:
- cppcheck

script:
# - mv -v bazel-bin/voidstar/voidstar "bazel-bin/voidstar/voidstar-$(git describe --abbrev --dirty --always --tags)-$TRAVIS_OS_NAME-$(basename $CC)"
- cppcheck --error-exitcode=1 --enable=all -Ivoidstar/include/ voids tar/
script: []
# - cppcheck --error-exitcode=1 --enable=all voidstar/
14 changes: 14 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
BAZEL = ./bazelisk

voidstar: $(BAZEL)
$(BAZEL) build $@

$(BAZEL):
curl -fsSLo $@ https://github.com/bazelbuild/bazelisk/releases/download/v1.6.1/bazelisk-linux-amd64 && chmod +x $@

install: DESTDIR ?= .
install:
cp -v bazel-bin/voidstar/voidstar $(DESTDIR)/

debug:
snapcraft
77 changes: 77 additions & 0 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: voidstar
version: git
summary: void* casts files onto 2D/3D colored spaces for your mind blowing needs # 79 char long summary
description: |
Usage:
voidstar [OPTIONS] FILE...
-l, --list list backends
-u, --ui choose ui mode
-a, --algorithm algorithm to apply
-x, --width window width
-y, --height window height
-f, --fullscreen start on fullscreen
--keep-chrome show title bar & allow resizing
-w, --sliding length of sliding window
-s, --slide-step amount of points slid
-m, --move move sliding window forward
-n, --spin don't spin shape on itself
-b, --begin begin offset for the range
-e, --end end offset for the range (0: till end of file)
-h, --help this help
# Press H and L to switch between files
# Use A W S D Z X and your mouse to move in the 3D space
# Press F for full screen
# Use the arrows to slide and enlarge the sliding window
# Press M to slide the window to the end
# Use > to slide faster, < to slow down
# SPACE to toggle spinning the shape
# Press O to reset the camera position
# ESC to quit
grade: stable
base: core20
# confinement: strict
confinement: devmode

apps:
voidstar:
command: voidstar
environment:
# https://forum.snapcraft.io/t/opengl-error-mesa-loader-fails/15197/2
LD_LIBRARY_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/mesa-gl:$SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/xorg
LIBGL_DRIVERS_PATH: $SNAP/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/dri
plugs:
- home # to read files in $HOME
- network # to read URLs
- opengl # to access rendering hardware
- optical-drive # to read CDs
- removable-media # to read USB keys
- wayland
- x11 # to create windows

parts:
voidstar:
plugin: make
source: .
build-packages:
- curl
- g++
- libgl1-mesa-dev
- make
- xorg-dev
stage-packages:
- libdri2-1
- libdrm2
- libgl1-mesa-dev
- libgl1-mesa-glx
- libgles2-mesa
- xorg-dev
# after:
# - desktop-glib-only # https://snapcraft.io/docs/gpu-support
27 changes: 0 additions & 27 deletions snap/snapcraft.yml

This file was deleted.

0 comments on commit 96e6276

Please sign in to comment.