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

Distrobute Amulet as a flatpak #525

Open
GamzeeRakoon opened this issue Jan 2, 2022 · 11 comments
Open

Distrobute Amulet as a flatpak #525

GamzeeRakoon opened this issue Jan 2, 2022 · 11 comments

Comments

@GamzeeRakoon
Copy link

Is your feature request related to a problem? Please describe.
its very annoying to install Amulet on linux without using the terminal and it taking a very long time to compile, with a flatpak you it will be very easy to install Amulet and you wont need to worry about what distro someone is using because flatpaks work on almost all populair distros see https://flatpak.org/setup/

Describe the solution you'd like
add an Amulet as an Flatpak
https://github.com/flathub/flathub/wiki/App-Submission

Describe alternatives you've considered
provide an .deb and or .rpm file which are both distro limited but better then nothing

@Podshot Podshot added type: enhancement New feature or request OS: Linux labels Jan 2, 2022
@oneechanhax
Copy link

oneechanhax commented Jan 16, 2022

I made a very simple build script. It doesn't do proper build sandboxing but I did it mainly for .file/general clutter containment and sandboxing. Build at your own risk!!!
You may try flatpak-pip-generator but I had issues around numpy being weird with amulet-nbt so I gave up with the sandboxing.

$ cat com.amulet.AmuletMC.json
{
    "app-id": "com.amulet.AmuletMC",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "21.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "amuletmc-flatpak-entry.sh",
    "finish-args": [
        "--socket=x11",
        "--socket=wayland",
        "--device=dri",
        "--filesystem=~/.minecraft/saves",
        "--filesystem=~/.var/app/org.polymc.PolyMC/data/polymc/instances"
    ],
    "modules": [{
        "name": "python3-amulet-map-editor",
        "buildsystem": "simple",
        "build-commands": [
           "pip3 install --verbose --prefix=/app amulet-map-editor"
        ],
        "build-options": {
           "build-args": [ "--share=network" ]
        },
        "sources": []
    }, {
        "name": "amuletmc-flatpak-entry",
        "buildsystem": "simple",
        "build-commands": [
            "install -D amuletmc-flatpak-entry.sh /app/bin/amuletmc-flatpak-entry.sh"
        ],
        "sources": [{
            "type": "file",
            "path": "amuletmc-flatpak-entry.sh"
        }]
    }]
}
$ cat amuletmc-flatpak-entry.sh
#!/bin/bash
export PYTHONPATH="/app"

python3 -m amulet_map_editor

Ran with flatpak-builder --user --install --force-clean tmp/ com.amulet.AmuletMC.json
GPL3 pls

Also, Im not sure if the install script is broken, permissions, or my gpu but I do get an error when the 3d editor is opened.
Could be how its installed to a nonstandard folder but I don't know much about how python likes its file layouts with pip.

<class 'wx._glcanvas.GLAttributes'> returned a result with an error set
NotImplementedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/framework/pages/world_page.py", line 155, in _enable_active
    self._extensions[self.GetSelection()].enable()
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/edit.py", line 50, in enable
    self._canvas = EditCanvas(self, self._world, self._close_self_callback)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/edit_canvas.py", line 92, in __init__
    super().__init__(parent, world)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/base_edit_canvas.py", line 58, in __init__
    super().__init__(parent)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/event_canvas.py", line 12, in __init__
    super().__init__(parent)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/canvas.py", line 23, in __init__
    display_attributes = wx.glcanvas.GLAttributes()
SystemError: <class 'wx._glcanvas.GLAttributes'> returned a result with an error set

/app/bin/amuletmc-flatpak-entry.sh: line 4:     3 Segmentation fault      (core dumped) python3 -m amulet_map_editor

@kargaroc
Copy link

This is sorely needed on systems where the bundled python interpreter is too new

@PixelRave
Copy link

Having a flatpak would make this much easier to distribute to Linux. On top of automatic updates. It would be a no brainier to use.

@gentlegiantJGC
Copy link
Member

We are in the process of rebuilding Amulet in Qt (a different UI library) and I will implement this there.
We are not currently implementing new functionality for the current Amulet implementation.

We have this which should be able to make these files
https://github.com/Amulet-Team/python-build-tool

@nl255
Copy link

nl255 commented Dec 22, 2023

Having a flatpak would also make it much easier to run on the Steam Deck.

@JakobDev
Copy link

JakobDev commented Feb 6, 2024

Any news on this?

I have experience in Flatpak, so I can help you, if you want.

@nl255
Copy link

nl255 commented Feb 6, 2024

I will say that I was unable to install this normally on the Steam Deck at all since it requires so many packages (gcc, all sorts of headers and -dev library packages, etc) to be installed that I eventually gave up even after disabling the read only filesystem and installing a bunch of stuff with pacman.

@Xalalau
Copy link

Xalalau commented Mar 10, 2024

I made a very simple build script. It doesn't do proper build sandboxing but I did it mainly for .file/general clutter containment and sandboxing. Build at your own risk!!! You may try flatpak-pip-generator but I had issues around numpy being weird with amulet-nbt so I gave up with the sandboxing.

$ cat com.amulet.AmuletMC.json
{
    "app-id": "com.amulet.AmuletMC",
    "runtime": "org.freedesktop.Platform",
    "runtime-version": "21.08",
    "sdk": "org.freedesktop.Sdk",
    "command": "amuletmc-flatpak-entry.sh",
    "finish-args": [
        "--socket=x11",
        "--socket=wayland",
        "--device=dri",
        "--filesystem=~/.minecraft/saves",
        "--filesystem=~/.var/app/org.polymc.PolyMC/data/polymc/instances"
    ],
    "modules": [{
        "name": "python3-amulet-map-editor",
        "buildsystem": "simple",
        "build-commands": [
           "pip3 install --verbose --prefix=/app amulet-map-editor"
        ],
        "build-options": {
           "build-args": [ "--share=network" ]
        },
        "sources": []
    }, {
        "name": "amuletmc-flatpak-entry",
        "buildsystem": "simple",
        "build-commands": [
            "install -D amuletmc-flatpak-entry.sh /app/bin/amuletmc-flatpak-entry.sh"
        ],
        "sources": [{
            "type": "file",
            "path": "amuletmc-flatpak-entry.sh"
        }]
    }]
}
$ cat amuletmc-flatpak-entry.sh
#!/bin/bash
export PYTHONPATH="/app"

python3 -m amulet_map_editor

Ran with flatpak-builder --user --install --force-clean tmp/ com.amulet.AmuletMC.json GPL3 pls

Also, Im not sure if the install script is broken, permissions, or my gpu but I do get an error when the 3d editor is opened. Could be how its installed to a nonstandard folder but I don't know much about how python likes its file layouts with pip.

<class 'wx._glcanvas.GLAttributes'> returned a result with an error set
NotImplementedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/framework/pages/world_page.py", line 155, in _enable_active
    self._extensions[self.GetSelection()].enable()
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/edit.py", line 50, in enable
    self._canvas = EditCanvas(self, self._world, self._close_self_callback)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/edit_canvas.py", line 92, in __init__
    super().__init__(parent, world)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/programs/edit/api/canvas/base_edit_canvas.py", line 58, in __init__
    super().__init__(parent)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/event_canvas.py", line 12, in __init__
    super().__init__(parent)
  File "/app/lib/python3.9/site-packages/amulet_map_editor/api/opengl/canvas/canvas.py", line 23, in __init__
    display_attributes = wx.glcanvas.GLAttributes()
SystemError: <class 'wx._glcanvas.GLAttributes'> returned a result with an error set

/app/bin/amuletmc-flatpak-entry.sh: line 4:     3 Segmentation fault      (core dumped) python3 -m amulet_map_editor

The SystemError: <class 'wx._glcanvas.GLAttributes'> returned a result with an error set issue was solved here:
#449

@bokov
Copy link

bokov commented Aug 19, 2024

We are in the process of rebuilding Amulet in Qt (a different UI library) and I will implement this there. We are not currently implementing new functionality for the current Amulet implementation.

We have this which should be able to make these files https://github.com/Amulet-Team/python-build-tool

Sorry for being dense and needing things spelled out. I'm not used to dealing with multiple versions of Python.

Is the current workaround to follow the steps in #525 (comment) ? If so, how does the python-build-tool fit into this?

Or do you recommend downloading the latest development snapshot of your QT version? If so, which repo/branch is that?

Thank you.

@gentlegiantJGC
Copy link
Member

Check out #1070

@EvilSupahFly
Copy link

As noted in #1070, I did manage to make a Flatpak build of Amulet (see https://github.com/EvilSupahFly/Amulet-Flatpak), currently based on Amulet 0.10.36

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests