-
Notifications
You must be signed in to change notification settings - Fork 3
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
4 changed files
with
274 additions
and
9 deletions.
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,30 @@ | ||
on: | ||
push: | ||
branches: [master] | ||
pull_request: | ||
workflow_dispatch: | ||
name: Snap | ||
jobs: | ||
my-job: | ||
name: Snapcraft Build | ||
runs-on: ubuntu-latest | ||
# env: | ||
# SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_TOKEN }} | ||
steps: | ||
- name: Check out Git repository | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Snapcraft | ||
uses: samuelmeuli/action-snapcraft@v2 | ||
|
||
- name: Install LXD | ||
uses: canonical/setup-lxd@main | ||
|
||
- name: Snapcraft Build | ||
run: snapcraft | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: Redot.snap | ||
path: redot*.snap |
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,239 @@ | ||
name: redot | ||
confinement: strict | ||
base: core22 | ||
adopt-info: metainfo | ||
architectures: | ||
- build-on: amd64 | ||
source-code: https://github.com/Redot-Engine/org.redotengine.Redot | ||
icon: icon.svg | ||
license: MIT | ||
title: Redot | ||
type: app | ||
|
||
package-repositories: | ||
- type: apt | ||
url: http://archive.ubuntu.com/ubuntu/ | ||
suites: [jammy] | ||
components: [main, universe] | ||
architectures: [amd64] | ||
key-id: F6ECB3762474EDA9D21B7022871920D1991BC93C | ||
key-server: keyserver.ubuntu.com | ||
|
||
parts: | ||
# extensible-hooks: | ||
# plugin: dump | ||
# source: https://github.com/diddlesnaps/snapcraft-utils-library.git | ||
# source-subdir: snapcraft-assets/extensible-hooks | ||
# | ||
# # Allows Redot and our tools to load faster by pre-caching its dependencies. | ||
# # This should go after everything that actually has a dependency at snap runtime | ||
# # (so things like executables or libraries, not our metainfo stuff). | ||
# ld-precache: | ||
# after: | ||
# - extensible-hooks | ||
# - redot | ||
# - redot-runtime | ||
# - vulkan | ||
# - tools | ||
# plugin: dump | ||
# source: https://github.com/diddlesnaps/snapcraft-utils-library.git | ||
# source-subdir: snapcraft-assets/ld-precache | ||
|
||
redot: | ||
plugin: dump | ||
source: https://github.com/Redot-Engine/redot-engine/releases/download/redot-4.3-beta.1/Redot_v4.3-beta.1_linux.x86_64.zip | ||
# Handles scons build+installation accounting for the differences in Redot 3 | ||
# and Redot 4 automatically. | ||
override-build: | | ||
craftctl default | ||
ls -la $CRAFT_PART_INSTALL $CRAFT_PART_INSTALL/bin | ||
cp Redot_*_linux.* bin/redot | ||
cp -r bin $CRAFT_PART_INSTALL/bin | ||
organize: | ||
Redot_*: bin/redot | ||
icon.svg: meta/gui/redot.svg | ||
stage: | ||
- bin/redot | ||
- meta/gui/redot.svg | ||
# prime: | ||
# - -version.py | ||
|
||
redot-runtime: | ||
plugin: nil | ||
stage-packages: | ||
- libgl1-mesa-glx | ||
- libpulse0 | ||
- libudev1 | ||
- libx11-6 | ||
- libxcursor1 | ||
- libxi6 | ||
- libxinerama1 | ||
- libxrandr2 | ||
- libgl1-mesa-dri | ||
|
||
# Used for metainfo | ||
description: | ||
plugin: dump | ||
source: . | ||
source-type: local | ||
stage: | ||
- README.md | ||
prime: | ||
- -README.md | ||
|
||
# This section is designed to minimize changes needed for different versions and channels of Redot. | ||
# | ||
# The `parse-info` file only needs to be present in one of the pull, build, or install stages. | ||
# Therefore, we only need to generate our `metainfo.xml` file during the build stage and then | ||
# disregard it. We choose the build stage because our `after` dependencies have already staged | ||
# their components, allowing us to gather everything we need from `$CRAFT_STAGE`. | ||
# | ||
# The complexity arises from two main reasons: | ||
# 1. We need to generate a desktop file with a different display name for Redot 3 and 4, and indicate | ||
# whether it's a beta version. | ||
# 2. There is no `craftctl set description=foo` command like there is for `version` and `grade`. | ||
# This necessitates the creation of a `metainfo.xml` file, significantly complicating the process. | ||
# | ||
# The first issue could be addressed with a simpler script if the second issue were resolved. | ||
metainfo: | ||
plugin: nil | ||
source: . | ||
source-type: local | ||
after: [redot, description] | ||
parse-info: [org.redotengine.Redot.appdata.xml] | ||
# For finding `version.py` | ||
build-environment: | ||
- PYTHONPATH: $CRAFT_STAGE | ||
override-build: | | ||
git clone [email protected]:Redot-Engine/redot-engine.git | ||
cp redot-engine/misc/dist/linux/* ./ | ||
organize: | ||
org.redotengine.Redot.desktop: meta/gui/org.redotengine.Redot.desktop | ||
|
||
alsa-mixin: | ||
plugin: dump | ||
source: https://github.com/diddlesnaps/snapcraft-alsa.git | ||
source-subdir: snapcraft-assets | ||
build-packages: | ||
- libasound2-dev | ||
stage-packages: | ||
- libasound2 | ||
- libasound2-plugins | ||
stage: | ||
- etc/asound.conf | ||
- snap/command-chain/alsa-launch | ||
- usr/bin/yad* | ||
- usr/lib/*/alsa-lib | ||
- usr/lib/*/libFLAC* | ||
- usr/lib/*/libasound* | ||
- usr/lib/*/libasyncns* | ||
- usr/lib/*/libdnsfile* | ||
- usr/lib/*/libjack* | ||
- usr/lib/*/libpulse* | ||
- usr/lib/*/libsamplerate* | ||
- usr/lib/*/libsndfile* | ||
- usr/lib/*/libspeex* | ||
- usr/lib/*/libvorbis* | ||
- usr/lib/*/pulseaudio | ||
- usr/share/alsa | ||
|
||
vulkan: | ||
plugin: nil | ||
stage-packages: | ||
- mesa-vulkan-drivers | ||
- libwayland-client0 | ||
prime: | ||
- usr/bin/mesa-overlay-control.py | ||
- usr/lib/*/libLLVM* | ||
- usr/lib/*/libVkLayer* | ||
- usr/lib/*/libvulkan* | ||
- usr/lib/*/libxcb-randr* | ||
- usr/lib/x86_64-linux-gnu/libwayland-client* | ||
- usr/share/drirc.d | ||
- usr/share/vulkan | ||
|
||
# Debugging | ||
tools: | ||
plugin: nil | ||
stage-packages: | ||
- vulkan-tools | ||
- mesa-utils | ||
- pciutils | ||
prime: | ||
- usr/bin/glxgears* | ||
- usr/bin/glxinfo* | ||
- usr/bin/lspci | ||
- usr/bin/vkcube | ||
- usr/bin/vkcubepp | ||
- usr/lib/*/libpci* | ||
|
||
layout: | ||
# Audio | ||
/usr/lib/x86_64-linux-gnu/alsa-lib: | ||
bind: $SNAP/usr/lib/x86_64-linux-gnu/alsa-lib | ||
/usr/share/alsa: | ||
bind: $SNAP/usr/share/alsa | ||
/usr/share/vulkan: | ||
bind: $SNAP/usr/share/vulkan | ||
# Vulkan | ||
/usr/lib/x86_64-linux-gnu/libvulkan_intel.so: | ||
bind-file: $SNAP/usr/lib/x86_64-linux-gnu/libvulkan_intel.so | ||
/usr/lib/x86_64-linux-gnu/libvulkan_lvp.so: | ||
bind-file: $SNAP/usr/lib/x86_64-linux-gnu/libvulkan_lvp.so | ||
/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so: | ||
bind-file: $SNAP/usr/lib/x86_64-linux-gnu/libvulkan_radeon.so | ||
/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0.0.0: | ||
bind-file: $SNAP/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0.0.0 | ||
/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0: | ||
symlink: $SNAP/usr/lib/x86_64-linux-gnu/libxcb-dri3.so.0.0.0 | ||
/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0: | ||
bind-file: $SNAP/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 | ||
/usr/lib/x86_64-linux-gnu/libxcb.so: | ||
symlink: $SNAP/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 | ||
/usr/lib/x86_64-linux-gnu/libxcb.so.1: | ||
symlink: $SNAP/usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0 | ||
/etc/ld.so.cache: | ||
bind-file: $SNAP_DATA/etc/ld.so.cache | ||
|
||
environment: | ||
HOME: $SNAP_USER_COMMON | ||
VK_ICD_FILENAMES: /var/lib/snapd/lib/vulkan/icd.d/nvidia_icd.json:$SNAP/usr/share/vulkan/icd.d/radeon_icd.x86_64.json:$SNAP/usr/share/vulkan/icd.d/intel_icd.x86_64.json | ||
|
||
apps: | ||
redot: | ||
command-chain: [snap/command-chain/alsa-launch] | ||
command: bin/redot | ||
common-id: org.redotengine.Redot | ||
plugs: | ||
- alsa | ||
- audio-playback | ||
- audio-record | ||
- browser-support | ||
- daemon-notify | ||
- desktop | ||
- desktop-legacy | ||
- gsettings | ||
- hardware-observe | ||
- home | ||
- io-ports-control | ||
- joystick | ||
- kvm | ||
- libvirt | ||
- mount-observe | ||
- network | ||
- network-bind | ||
- network-manager | ||
- opengl | ||
- pulseaudio | ||
- removable-media | ||
- screen-inhibit-control | ||
- wayland | ||
- x11 | ||
|
||
# For debugging | ||
vkcube: | ||
command: usr/bin/vkcube | ||
glxinfo: | ||
command: usr/bin/glxinfo | ||
glxgears: | ||
command: usr/bin/glxgears |