EmptyEpsilon icon indicating copy to clipboard operation
EmptyEpsilon copied to clipboard

Package EmptyEpsilon via Flatpack and publish on Flathub

Open Flowdalic opened this issue 1 year ago • 10 comments

EmptyEpsilon is a great game. Unfortunately it is not easily accessible since it is not widely packaged.

Therefore, please consider to package EmptyEpsilon via Flatpack and publish it on Flathub. Thanks.

Flowdalic avatar Apr 13 '23 08:04 Flowdalic

That would be great! I want to try this game on SteamDeck, and since it's Arch Linux, .deb file doesn't help very much. With Flathub it would be as easy as just click "Install".

pavelsinkevich avatar Apr 20 '23 09:04 pavelsinkevich

If someone figures out how to build a flatpak from the EE source and posts easy to follow steps I wouldn't mind building it as part of my usual build steps. It's not like EE is difficult to build or anything, it doesn't have a ton of external dependencies. But I'm not going to invest my own time to figure out another build system right now.

daid avatar Apr 20 '23 13:04 daid

Instructions as adapted and condensed from Linuxconfig:

  • Install Free desktop runtime flatpak install flathub org.freedesktop.Platform//22.08 org.freedesktop.Sdk//22.08
  • Create manifest (not sure about contents here)
    • Slightly modified sample
app-id: org.flatpak.EmptyEpsilon
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: EmptyEpsilon
modules:
  - name: EmptyEpsilon
    buildsystem: simple
    build-commands:
      - install -D hello.sh /app/bin/hello.sh
    sources:
      - type: file
        path: hello.sh
  • Original sample (based on a one line shell script app: hello.sh)
app-id: org.flatpak.Hello
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: hello.sh
modules:
  - name: hello
    buildsystem: simple
    build-commands:
      - install -D hello.sh /app/bin/hello.sh
    sources:
      - type: file
        path: hello.sh
  • Save manifest as org.flatpak.EmptyEpsilon.yml
  • Create application flatpak-builder build-dir org.flatpak.EmptyEpsilon.yml
  • Test application flatpak-builder --user --install --force-clean build-dir org.flatpak.EmptyEpsilon.yml
  • Run application flatpak run org.flatpak.EmptyEpsilon
  • Add to repository. Example here is for myrepo. FlatHub may have other guidelines to follow
    • Make repository flatpak-builder --repo=myrepo --force-clean build-dir org.flatpak.EmptyEpsilon.yml
    • Add to repository flatpak --user remote-add --no-gpg-verify myrepo myrepo
    • Install from repository flatpak --user install myrepo org.flatpak.EmptyEpsilon

Xansta avatar Sep 05 '23 15:09 Xansta

hello.sh?

daid avatar Sep 06 '23 07:09 daid

That was the example application in the instructions, hello.sh. I did not try to create a manifest for Empty Epsilon, because I don't know it that well. So, yes, I did not provide comprehensive instructions, I just provided the outline, particularly the instructions directly related to Flatpack. There still needs work creating a manifest document. If you don't have the time, @daid, I was hoping someone else familiar with the package would, perhaps the people asking for the Flatpack distribution in the first place (@Flowdalic and @pavelsinkevich - I'm looking at you)

Xansta avatar Sep 08 '23 18:09 Xansta

I got it to compile with this yaml. But I don't have a non-headless box setup to test with flatpak right now.

id: org.flatpak.emptyepsilon
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
finish-args:
  - --share=network
command: EmptyEpsilon
modules:
  - name: EmptyEpsilon
    buildsystem: cmake-ninja
    build-options:
      build-args:
        - "--share=network"
    config-opts:
      - "-DSERIOUS_PROTON_DIR=./SeriousProton"
    sources:
      - type: git
        url: https://github.com/daid/EmptyEpsilon.git
      - type: git
        url: https://github.com/daid/SeriousProton.git
        dest: SeriousProton

gwaland avatar Sep 10 '23 19:09 gwaland

@oznogon tested and it built, but it did not run. Turns out permissions needed to be enabled. See this link for details.

finish-args:
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # GPU acceleration if needed
  - --device=dri
  # Needs to talk to the network:
  - --share=network

Additional parameter also suggested: --socket=pulseaudio ...to enable sound.

Thanks Oznogon

Xansta avatar Nov 17 '23 21:11 Xansta

Yep. To confirm, here's the verbatim manifest I used on Fedora 39, which is just @gwaland's with the extra permissions:

id: org.flatpak.EmptyEpsilon
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
finish-args:
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # GPU acceleration if needed
  - --device=dri
  # Needs to talk to the network
  - --share=network
  # Audio if needed
  - --socket=pulseaudio
command: EmptyEpsilon
modules:
  - name: EmptyEpsilon
    buildsystem: cmake-ninja
    build-options:
      build-args:
        - "--share=network"
    config-opts:
      - "-DSERIOUS_PROTON_DIR=./SeriousProton"
    sources:
      - type: git
        url: https://github.com/daid/EmptyEpsilon.git
      - type: git
        url: https://github.com/daid/SeriousProton.git
        dest: SeriousProton

Here are the build steps:

  1. Put the above YAML file into a file named org.flatpak.EmptyEpsilon.yml.
  2. Run flatpak-builder build-dir org.flatpak.EmptyEpsilon.yml
  3. Run flatpak-builder --user --install --force-clean build-dir org.flatpak.EmptyEpsilon.yml
  4. Run flatpak run org.flatpak.EmptyEpsilon.

Permissions confirmed using Flatseal. App launched and ran with sound and network access. 3D worked fine and felt fast. Didn't do any real testing, no multiplayer connections or full games.

Still missing:

  • An icon for the app. KDE used the X11 icon on my X11 desktop. No idea what happens on Wayland. Flatseal shows a generic icon.

oznogon avatar Nov 17 '23 21:11 oznogon

I built on Fedora 39 too, and extended @gwaland's and @oznogon's manifest with:

  • The 1024x1024 PNG icon throws an error (the 1024x1024 icon exceeds the flatpak spec, so I resized the existing one with: magick '~/EmptyEpsilon/logo.png' -resize 512x512 logo.png), but flatpak-builder doesn't complain with the addition of a valid icon. (I don't know why the SVG didn't work and couldn't find an answer).
  • changed the id (the id is supposed to uniquely identify, but I don't know if flathub will be hosting or ... ? If so, change it back)
  • permissions on ~/.emptyepsilon/ and ~/logs/ folders
  • Set the version for interoperability with other clients (the source tag, commit, and the label within EmptyEpsilon) and a version.cmake file
  • appdata.xml for the app data

io.github.daid.EmptyEpsilon.yml

id: io.github.daid.EmptyEpsilon
runtime: org.freedesktop.Platform
runtime-version: '23.08'
sdk: org.freedesktop.Sdk
rename-desktop-file: EmptyEpsilon.desktop
rename-icon: EmptyEpsilon
finish-args:
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # GPU acceleration if needed
  - --device=dri
  # Needs to talk to the network
  - --share=network
  # Audio if needed
  - --socket=pulseaudio
  # Specific folders
  - --filesystem=~/logs
  - --filesystem=~/.emptyepsilon
command: EmptyEpsilon
modules:
  - name: EmptyEpsilon
    buildsystem: cmake-ninja
    build-options:
      build-args:
        - "--share=network"
    config-opts:
      - "-DSERIOUS_PROTON_DIR=./SeriousProton" 
      - "-DCMAKE_PROJECT_EmptyEpsilon_INCLUDE=version.cmake"
    post-install:
       - install -Dm0644 logo.png "${FLATPAK_DEST}/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png"
       - install -Dm0644 appdata.xml "${FLATPAK_DEST}/share/metainfo/${FLATPAK_ID}.metainfo.xml"
    sources:
      - type: git
        url: https://github.com/daid/EmptyEpsilon.git
        tag: "EE-2023.06.17"
        commit: "f8145cc236c0cca3f3941a8c78b3d94858e16b01"
      - type: git
        url: https://github.com/daid/SeriousProton.git
        tag: "EE-2023.06.17"
        commit: "588da4ba32aa33670d6a7f6cfe0cecc0fe17e690"
        dest: SeriousProton
      - type: file
        path: appdata.xml
      - type: file
        path: logo.png
      - type: file
        path: version.cmake

appdata.xml

<component type="desktop-application">
  <id>io.github.daid.EmptyEpsilon</id>
  
  <name>EmptyEpsilon</name>
  <summary>Open source spaceship bridge simulator</summary>
  
  <metadata_license>CC0-1.0</metadata_license>
  <project_license>GPL-2.0-only</project_license>
  <releases>
  <release version="EE-2023-06-17" date="2023-06-17" type="stable"/>
  </releases>
  <description>
    <p>
      EmptyEpsilon places you in the roles of a spaceship&apos;s bridge officers, like those seen in Star Trek. While you can play EmptyEpsilon alone or with friends, the best experience involves 6 players working together on each ship.
    </p>
    <p>
      Each officer fills a unique role: Captain, Helms, Weapons, Relay, Science, and Engineering. Except for the Captain, each officer operates part of the ship through a specialized screen. The Captain relies on their trusty crew to report information and follow orders.
    </p>
  </description>
  
  <launchable type="desktop-id">EmptyEpsilon.desktop</launchable>
  <screenshots>
    <screenshot type="default">
      <image>https://daid.github.io/EmptyEpsilon/screenshots/mainscreen.png</image>
    </screenshot>
    <screenshot>
      <image>https://daid.github.io/EmptyEpsilon/screenshots/helms.png</image>
    </screenshot>
    <screenshot>
      <image>https://daid.github.io/EmptyEpsilon/screenshots/engineering.png</image>
    </screenshot>
  </screenshots>
</component>

version.cmake

set(PROJECT_VERSION_MAJOR 2023)
set(PROJECT_VERSION_MINOR 06)
set(PROJECT_VERSION_PATCH 17)

Here are the build steps:

  1. Put appdata.xml, io.github.daid.EmptyEpsilon.yml, version.cmake and the 512x512 logo.png at the same location that flatpak-builder will be run in (the files should probably be in the EmptyEpsilon project eventually if/when flatpak is supported).
  2. Execute flatpak-builder --user --install --force-clean --repo=repo --disable-cache build-dir io.github.daid.EmptyEpsilon.yml
  3. Run flatpak run io.github.daid.EmptyEpsilon

Appears to run fine. I haven't figured out how to get this onto a USB drive (flatpak create-usb throws an error), but maybe some others can chip in, too? If I can get an EmptyEpsilon flatpak repo on a USB drive, I may be able to do more testing.

TheDavii avatar Dec 02 '23 21:12 TheDavii

But I'm not going to invest my own time to figure out another build system right now.

That is unfortunate to hear, but it also shows that there is maybe a misunderstanding. Strictly speaking, flatpak is not a build system, but a packaging system.

Packaging via flatpak would most likely have a significant impact regarding EmptyEpsilon's availability to users, thereby creating the potential to increase EmptyEpsilon's popularity. If this is a goal of yours, then you may want to re-consider if creating an official flatpak build for EmptyEpsilon would not be worth it.

Flowdalic avatar Mar 24 '24 15:03 Flowdalic