Skip to content

Instantly share code, notes, and snippets.

@wolsen
Created May 9, 2020 17:19
Show Gist options
  • Save wolsen/e9b2b35a5198cc6ad368f34d27990de1 to your computer and use it in GitHub Desktop.
Save wolsen/e9b2b35a5198cc6ad368f34d27990de1 to your computer and use it in GitHub Desktop.
OpenRocket snapcraft.yaml expanded to include extension information
name: openrocket
adopt-info: openrocket
grade: stable
summary: A free, fully featured model rocket simulator.
description: |
OpenRocket is a free, fully featured model rocket simulator that allows you
to design and simulate your rockets before actually building and flying them.
The main features include
* Six-degree-of-freedom flight simulation
* Automatic design optimization
* Realtime simulated altitude, velocity and acceleration display
* Staging and clustering support
* Cross-platform (Java-based)
* Read more about it on the OpenRocket.info.
license: GPL-3.0
base: core18
confinement: strict
apps:
openrocket:
command: bin/launcher
plugs:
- desktop
- desktop-legacy
- gsettings
- wayland
- x11
- home
- network
- cups-control
- opengl
environment:
JAVA_HOME: $SNAP/usr/lib/jvm/java-11-openjdk-amd64
command-chain:
- snap/command-chain/desktop-launch
parts:
openrocket:
plugin: ant
source: .
ant-build-targets:
- clean
- check
- unittest
- jar
override-pull: |
# Override the pull in order to set the version and the grade.
# In the future, the releases can be annotated tags and snapcraft
# will use those for the version numbers.
#
# This can be extended to other parts of OpenRocket (to use the
# git describe --tags command) but the build should be updated at
# the same time so its consistent across all artifacts. Will defer
# that to a later pull request.
#
# Until then, just use the build.version value
snapcraftctl pull
VERSION=$(cat core/resources/build.properties | awk -F'=' '/build\.version/ { print $2 }')
snapcraftctl set-version "$VERSION"
override-build: |
snapcraftctl build
mv swing/build/jar/OpenRocket.jar $SNAPCRAFT_PART_INSTALL/OpenRocket.jar
build-packages:
- wget
stage-packages:
- openjdk-11-jre
- ca-certificates
- ca-certificates-java
prime:
- -usr/lib/jvm/java-*/lib/security/cacerts
- -usr/lib/jvm/java-*/jre/lib/security/cacerts
launcher:
plugin: dump
source: snap/local
organize:
launcher: bin/
gnome-3-28-extension:
build-packages:
- libgtk-3-dev
plugin: make
source: $SNAPCRAFT_EXTENSIONS_DIR/desktop
source-subdir: gnome
plugs:
gnome-3-28-1804:
default-provider: gnome-3-28-1804
interface: content
target: $SNAP/gnome-platform
gtk-3-themes:
default-provider: gtk-common-themes
interface: content
target: $SNAP/data-dir/themes
icon-themes:
default-provider: gtk-common-themes
interface: content
target: $SNAP/data-dir/icons
sound-themes:
default-provider: gtk-common-themes
interface: content
target: $SNAP/data-dir/sounds
environment:
SNAP_DESKTOP_RUNTIME: $SNAP/gnome-platform
layout:
/usr/bin/gjs:
symlink: $SNAP/gnome-platform/usr/bin/gjs
/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0:
bind: $SNAP/gnome-platform/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/webkit2gtk-4.0
/usr/share/xml/iso-codes:
bind: $SNAP/gnome-platform/usr/share/xml/iso-codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment