AwesomeBump icon indicating copy to clipboard operation
AwesomeBump copied to clipboard

Create Flatpak image for AwesomeBump

Open hcw70 opened this issue 5 years ago • 6 comments

To create a Flatpak image for AwesomeBump would be a good way to provide an unified binary for all linux variants and lower the entry barriers for using a great tool more easily....

See also https://github.com/flatpak/flatpak/issues/875

hcw70 avatar Sep 05 '19 07:09 hcw70

I have managed to create a working manifest file for flatpak-builder. However, I'm still not sure how to publish the image to fluthub etc. Here is mine first iteration of the manifest file:

{
    "app-id": "org.kde.AwesomeBump",
    "branch": "Release",
    "build-options": {
        "no-debuginfo": true,
        "strip": true
    },
    "command": "awesomebump",
    "finish-args": [
        "--share=ipc",
        "--socket=x11",
        "--socket=system-bus",
        "--device=dri",
        "--filesystem=home",
        "--own-name=org.kde.AwesomeBump"
    ],
    "modules": [
        {
            "name": "AwesomeBump",
            "no-autogen": true,
            "no-make-install": false,
            "no-parallel-make": false,
            "sources": [
                {
                    "branch": "Release",
                    "type": "git",
                    "url": "https://github.com/kmkolasinski/AwesomeBump"
                },
                {
                    "commands": [
                       "qmake ./AwesomeBump.pro 'CONFIG+=gl330'", "make clean", "make -j 8"
                    ],
                    "dest-filename": "configure",
                    "type": "script"
                }
            ],
            "build-commands": [
                "install -D /run/build/AwesomeBump/workdir/linux-g++-gl3/bin/AwesomeBump /app/bin/AwesomeBump",
                "cp -r /run/build/AwesomeBump/Bin/Configs /app/bin/Configs",
                "cp -r /run/build/AwesomeBump/Bin/Core /app/bin/Core", 
                "echo '#!/bin/bash\ncd /app/bin/\n./AwesomeBump' > /app/bin/awesomebump", "chmod +x /app/bin/awesomebump"
            ]
        }
    ],
    "runtime": "org.kde.Platform",
    "runtime-version": "5.12",
    "sdk": "org.kde.Sdk",
    "separate-locales": false
}

Build with:

flatpak-builder --force-clean  build manifest.json

I'm not sure how to deal with different runtimes versions e.g. Gnome and KDE and the same for AB versions like 5.1,5.2 etc, as well as with GL330 binary: AwesomeBump vs AwesomeBumpGL330.

kmkolasinski avatar Sep 12 '19 02:09 kmkolasinski

Great news! For submitting to flathub, see https://github.com/flathub/flathub/wiki/App-Submission#how-to-submit-an-app . Regarding different runtime versions: The thing of flatpak is that your app comes with its own fitting runtime environment (so with a correct NVIDIA driver). About GL330 i dont know what the diff is between those two, if they obey different runtime requirements, this is not an issue since you bring your own runtime with your app.

If the issue is with NVIDIA / non NVIDIA cards, maybe you should define variants of your app, i.e. AB-NVidida, AB-Radeon... (dunno the details here since i didnt yet build a flatpak yet)..... Maybe you can also include a runtime which includes all graphics drivers already.

Maybe a mesa-only variant may be needed also.... See i.e. https://askubuntu.com/questions/1114324/why-do-i-need-to-install-nvidia-driver-for-flatpak-applications or https://www.linuxuprising.com/2018/06/how-to-get-flatpak-apps-and-games-built.html ...

hcw70 avatar Sep 12 '19 08:09 hcw70

You could include both AwesomeBump binaries in the same Flatpak. Users whose hardware doesn't support OpenGL 4.x can run the AwesomeBumpGL330 binary manually using flatpak run. This way, you only create a single app manifest.

Since OpenGL 4.x is supported on most hardware by now (including Mesa drivers), it should probably be fine.

Calinou avatar Sep 12 '19 18:09 Calinou

I made a PR to flathub https://github.com/flathub/flathub/pull/1161

kmkolasinski avatar Sep 15 '19 02:09 kmkolasinski

Build fails:

flatpak-builder --download-only --no-shallow-clone --allow-missing-runtimes --state-dir=/srv/buildbot/sources /srv/buildbot/sources/.builddir ""
 in dir /srv/buildbot/worker/download-sources/build (timeout 3600 secs)
 watching logfiles {}
 argv: [b'flatpak-builder', b'--download-only', b'--no-shallow-clone', b'--allow-missing-runtimes', b'--state-dir=/srv/buildbot/sources', b'/srv/buildbot/sources/.builddir', b'']
 using PTY: True
Can't load '': Error reading file “/srv/buildbot/worker/download-sources/build”: Is a directory
program finished with exit code 1
elapsedTime=0.044290

hcw70 avatar Sep 16 '19 10:09 hcw70

Thanks, I saw it, but now I have no time to dig into this problem. Do you guys have idea where is the problem:

Can't load '': Error reading file “/srv/buildbot/worker/download-sources/build”: Is a directory

kmkolasinski avatar Sep 16 '19 10:09 kmkolasinski