deathkiller / jazz2-native

🎮 · Jazz² Resurrection: Native C++ reimplementation of Jazz Jackrabbit 2
https://deat.tk/jazz2/
GNU General Public License v3.0
549 stars 37 forks source link

Flatpak Build #41

Closed The-King-of-Toasters closed 10 months ago

The-King-of-Toasters commented 11 months ago

In issue #19 you mentioned wanting to build a Flatpak version, but didn't know how do do so. Well, here it is: gh-fork-dump/tk.deat.Jazz2Resurrection. It's very easy to build using flatpak-builder and runs great on my Linux desktop and Steam Deck.

I'd like to submit this to Flathub, and I need two things:

I used flathub's Submission documentation as a guide when building. You can get away with just installing flatpak using your distro's package manager for everything.

Some notes when doing this:

deathkiller commented 11 months ago

Thank you for contribution! Flatpak is requested for very long time.

Your permission.

Sure, permission granted.

At least 3 screenshots of the game running.

I added some screenshots to the GitHub repo and also added them to the file: https://github.com/deathkiller/jazz2-native/blob/master/Sources/project.metainfo.xml#L45-L49

I created an appinfo file which contains program information like...

According to this, AppData file should be named .metainfo.xml now, so I renamed it and added it to the repo (https://github.com/deathkiller/jazz2-native/blob/master/Sources/project.metainfo.xml) and CMake. If you add -DNCINE_BUILD_FLATPAK=ON to the yml file, it will automatically install it to share/metainfo/tk.deat.Jazz2Resurrection.metainfo.xml and it will also rename .desktop file to tk.deat.Jazz2Resurrection.desktop and all icons too, so rename-desktop-file and rename-icon shouldn't be necessary now. -DNCINE_BUILD_FLATPAK=ON will also set -DNCINE_OVERRIDE_CONTENT_PATH automatically, so you can remove it, and 1024px icon is excluded, so rm -rf ${FLATPAK_DEST}/share/icons/hicolor/1024x1024 line could be also removed.

Regarding the licensing, is jazz2-native GPL 3 only or GPL 3+?

AFAIK there is no GPL4, so I don't know what the consequences would be. But it will be probably fine as GPL3+.

Here is full tk.deat.Jazz2Resurrection.yml file I used for testing:

app-id: tk.deat.Jazz2Resurrection
runtime: org.freedesktop.Platform
runtime-version: "23.08"
sdk: org.freedesktop.Sdk
command: jazz2
finish-args:
  - --share=ipc
  - --socket=wayland
  - --socket=fallback-x11
  - --socket=pulseaudio
  - --device=all

modules:
  - name: libopenmpt
    config-opts:
      - --disable-examples
      - --disable-openmpt123
      - --disable-static
      - --disable-tests
      - --without-portaudio
      - --without-portaudiocpp
    cleanup:
      - /include
      - /lib/*.la
      - /lib/*.so
      - /lib/pkgconfig
      - /share/doc
    sources:
      - type: archive
        url: https://lib.openmpt.org/files/libopenmpt/src/libopenmpt-0.7.3+release.autotools.tar.gz
        sha256: 2cf8369b7916b09264f3f14b9fb6cef35a6e9bee0328dec4f49d98211ccfd722
  - name: jazz2-native
    buildsystem: cmake-ninja
    config-opts:
      - -DNCINE_BUILD_FLATPAK=ON
      - -DNCINE_DOWNLOAD_DEPENDENCIES=OFF
      - -DNCINE_PREFERRED_BACKEND=SDL2
      - -DLIBOPENMPT_INCLUDE_DIR=/app/include/libopenmpt
    sources:
      - type: git
        url: https://github.com/deathkiller/jazz2-native.git
        commit: a33ee2c8afe41f964ca4e571c0d5bb5cb714af27

Can you check it if everything is correct, please? Then I will have to create a GIT tag (release a new version) to be able to submit it, right?

The-King-of-Toasters commented 11 months ago

I've modified my flatpak manifest based on your changes, everything works great. When #43 gets merged you can cut a new release and I'll modify the manifest accordingly. Don't forget to add a new release line in the appinfo file!

deathkiller commented 11 months ago

Thanks! Everything should be fine now. 2.4.1 tag is created.

deathkiller commented 11 months ago

I see flathub build failed because of screenshot captions. I fixed the captions and moved the 2.4.1 tag to the new commit. I hope it will be fine now.

deathkiller commented 11 months ago

And also added developer_name (I don't know why it's there twice, but I don't have time to test it now) and moved tag again.

The-King-of-Toasters commented 10 months ago

It's out!. I think you got a link to be a contributor to the flathub repo. You may also want to do the verification process to get a check mark on flathub.

deathkiller commented 10 months ago

Great! I verified it now.