Amulet-Map-Editor icon indicating copy to clipboard operation
Amulet-Map-Editor copied to clipboard

Distrobute Amulet as a flatpak

Open GamzeeRakoon opened this issue 3 years ago • 11 comments

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

GamzeeRakoon avatar Jan 02 '22 20:01 GamzeeRakoon

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

oneechanhax avatar Jan 16 '22 21:01 oneechanhax

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

kargaroc avatar Feb 10 '23 00:02 kargaroc

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.

PixelRave avatar Apr 21 '23 16:04 PixelRave

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

gentlegiantJGC avatar Apr 22 '23 08:04 gentlegiantJGC

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

nl255 avatar Dec 22 '23 01:12 nl255

Any news on this?

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

JakobDev avatar Feb 06 '24 10:02 JakobDev

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.

nl255 avatar Feb 06 '24 16:02 nl255

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: https://github.com/Amulet-Team/Amulet-Map-Editor/issues/449

Xalalau avatar Mar 10 '24 01:03 Xalalau