Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add upstream distribution sources for linux + flatpak package #559

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/flatpak-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Flatpak Build

on:
push:
branches: [master]
pull_request:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
container:
image: bilelmoussaoui/flatpak-github-actions:gnome-42
options: --privileged
steps:
- uses: actions/checkout@v4
with:
submodules: true

- name: Build Flatpak bundle
uses: flatpak/flatpak-github-actions/flatpak-builder@v6
with:
bundle: modrinthApp.flatpak
manifest-path: distribution/com.modrinth.ModrinthApp.yml
cache-key: flatpak-builder-${{ github.ref }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,3 +112,6 @@ fabric.properties

theseus.iml

# flatpak
.flatpak-builder
flatbuild
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "distribution/shared-modules"]
path = distribution/shared-modules
url = https://github.com/flathub/shared-modules.git
12 changes: 12 additions & 0 deletions distribution/com.modrinth.ModrinthApp.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
[Desktop Entry]
Name=Modrinth App
Comment=Modrinth's game launcher for creating and playing Modrinth projects
Exec=modrinth-app
Icon=com.modrinth.ModrinthApp
Type=Application
Terminal=false
StartupNotify=true
Categories=Game;ActionGame;AdventureGame;Simulation;
Keywords=game;minecraft;mc;
StartupWMClass=ModrinthApp
Version=1.4
21 changes: 21 additions & 0 deletions distribution/com.modrinth.ModrinthApp.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>com.modrinth.ModrinthApp</id>
<launchable type="desktop-id">com.modrinth.ModrinthApp.desktop</launchable>
<name>Modrinth App</name>
<developer_name>Modrinth</developer_name>
<summary>Modrinth's game launcher for creating and playing Modrinth projects</summary>
<metadata_license>CC0-1.0</metadata_license>
<project_license>GPL-3.0-only</project_license>
<!--<url type="homepage">https://modrinth.com</url>-->
<!--<url type="bugtracker">https://github.com/modrinth/theseus/issues</url>-->
<!--<url type="vcs-browser">https://github.com/modrinth/theseus</url>-->
<!--<url type="contribute">https://github.com/modrinth/theseus</url>-->
<description>
<p>Modrinth's game launcher for creating and playing Modrinth projects</p>
</description>
<content_rating type="oars-1.1">
<content_attribute id="violence-fantasy">moderate</content_attribute>
<content_attribute id="social-chat">intense</content_attribute>
</content_rating>
</component>
81 changes: 81 additions & 0 deletions distribution/com.modrinth.ModrinthApp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
id: com.modrinth.ModrinthApp
runtime: org.gnome.Platform
runtime-version: "42"
sdk: org.gnome.Sdk
sdk-extensions:
- org.freedesktop.Sdk.Extension.rust-stable
- org.freedesktop.Sdk.Extension.node18

command: modrinth-app
finish-args:
- --filesystem=xdg-run/app/com.discordapp.Discord:create # allows for discord rpc
- --device=all
- --share=ipc
- --share=network
- --socket=pulseaudio
- --socket=x11
- --socket=wayland

build-options:
append-path: "/usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/node18/bin"

build-args:
- --share=network

modules:
- shared-modules/libappindicator/libappindicator-gtk3-12.10.json

# for some controller mods (see https://github.com/isXander/Controlify/issues/31)
- shared-modules/libusb/libusb.json

- name: flite
buildsystem: autotools
config-opts:
- --enable-shared
- --with-audio=pulseaudio
sources:
- type: archive
url: https://github.com/festvox/flite/archive/refs/tags/v2.2.tar.gz
sha512: 1ca2f4145651490ef8405fdb830a3b42e885020a7603d965f6a5581b01bed41047d396b38c2ceab138fc0b28d28078db17acd2b5a84c6444cb99d65c581afa72
cleanup:
- '/lib/libflite*.a'

- name: modrinth-app
buildsystem: simple
build-options:
append-path: /run/build/modrinth-app/pnpm
build-commands:
- pnpm config set store-dir .pnpm-store
- cd theseus/theseus_gui && pnpm install
- cd theseus/theseus_gui && pnpm build
- cd theseus && cargo fetch --locked --manifest-path Cargo.toml
- cd theseus && cargo build --locked --release

- install -Dm755 theseus/target/release/theseus_gui /app/bin/modrinth-app

- mkdir -p /app/share/{icons/hicolor/256x256/apps,applications,metainfo}

- cp theseus/theseus_gui/src-tauri/icons/Square284x284Logo.png /app/share/icons/hicolor/256x256/apps/com.modrinth.ModrinthApp.png
- install -Dm644 com.modrinth.ModrinthApp.metainfo.xml /app/share/metainfo/com.modrinth.ModrinthApp.metainfo.xml
- install -Dm644 com.modrinth.ModrinthApp.desktop /app/share/applications/com.modrinth.ModrinthApp.desktop

sources:
- type: archive
url: https://registry.npmjs.org/@pnpm/linux-x64/-/linux-x64-7.33.5.tgz
sha512: d594a9e505b33a5a7b8684645ca762a2c24c6b3e1e477afe8f412d0dd5c8b1b9b9e636e3a19ae0ceeed603d8507f84b081ed12b283ac543bc4bf26d591cab4c5
dest: pnpm
getchoo marked this conversation as resolved.
Show resolved Hide resolved

- type: shell
commands:
- chmod +x pnpm
dest: pnpm

- type: dir
path: ../
dest: theseus

- type: file
path: com.modrinth.ModrinthApp.metainfo.xml

- type: file
path: com.modrinth.ModrinthApp.desktop
1 change: 1 addition & 0 deletions distribution/shared-modules
Submodule shared-modules added at e4f3df