From 8d9148d54d8c11bd2e871e57714d45b6ef231ad9 Mon Sep 17 00:00:00 2001 From: Hugo Herter Date: Sun, 17 Jul 2022 14:39:50 +0100 Subject: [PATCH] Feature: Linux users could not run Mu using Flatpak Solution: Add a manifest file for flatpak-builder Known issues: - Icon does not display correctly on my KDE desktop - Mu does not detect device vendor and properties, failing to connect via serial (overriding the code makes it work). --- .gitignore | 1 + flatpak/mu.codewith.Editor.appdata.xml | 42 +++++++++++++++ flatpak/mu.codewith.Editor.desktop | 10 ++++ flatpak/mu.codewith.Editor.yml | 74 ++++++++++++++++++++++++++ 4 files changed, 127 insertions(+) create mode 100644 flatpak/mu.codewith.Editor.appdata.xml create mode 100644 flatpak/mu.codewith.Editor.desktop create mode 100644 flatpak/mu.codewith.Editor.yml diff --git a/.gitignore b/.gitignore index 1d13dd682..6be0909f9 100644 --- a/.gitignore +++ b/.gitignore @@ -24,6 +24,7 @@ var/ *.egg-info/ .installed.cfg *.egg +.flatpak-builder # Bluemix vendored packages vendor/ diff --git a/flatpak/mu.codewith.Editor.appdata.xml b/flatpak/mu.codewith.Editor.appdata.xml new file mode 100644 index 000000000..4aa7b9669 --- /dev/null +++ b/flatpak/mu.codewith.Editor.appdata.xml @@ -0,0 +1,42 @@ + + + mu.codewith.Editor + CC-BY-SA + Mu Editor + A simple editor for beginner Python programmers + +

+ Mu is a simple code editor for beginner programmers based on extensive feedback from teachers and learners. + Having said that, Mu is for anyone who wants to use a simple "no frills" editor. +

+

Mu is a modal editor with modes for many different ways to use Python to create cool and interesting things.

+

+ Mu is written in Python and works on Windows, macOS, Linux and Raspberry Pi. The project's public facing website is https://codewith.mu/. + We celebrate the work done by users of mu at https://madewith.mu/. +

+
+ https://codewith.mu/ + https://github.com/mu-editor/mu/issues/ + https://codewith.mu/en/howto/1.1/ + mu.codewith.Editor.desktop + + + +

+ This is the first stable release of the 1.1.* version of Mu. +

+
+
+
+ GPL-3.0-or-later + Nicholas H.Tollervey + + + https://codewith.mu/img/en/tutorials/mu_ui.png + + + https://codewith.mu/img/en/tutorials/mode_selector1-1.png + + + +
diff --git a/flatpak/mu.codewith.Editor.desktop b/flatpak/mu.codewith.Editor.desktop new file mode 100644 index 000000000..163f229bd --- /dev/null +++ b/flatpak/mu.codewith.Editor.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Mu Editor +GenericName=A simple editor for beginner Python programmers +Exec=/app/python-build-standalone/install/bin/mu-editor +Terminal=false +Icon=mu.codewith.Editor +Type=Application +Categories=Development;IDE; +X-Desktop-File-Install-Version=1.1.1 +StartupWMClass=mu-editor diff --git a/flatpak/mu.codewith.Editor.yml b/flatpak/mu.codewith.Editor.yml new file mode 100644 index 000000000..313c8cb98 --- /dev/null +++ b/flatpak/mu.codewith.Editor.yml @@ -0,0 +1,74 @@ +# Build using `flatpak-builder --user --install --force-clean build-dir mu.codewith.Editor.yml`. +# Then run using `flatpak run mu.codewith.Editor`. + +app-id: mu.codewith.Editor + +runtime: org.freedesktop.Platform +runtime-version: '21.08' +sdk: org.freedesktop.Sdk + +command: /app/python-build-standalone/install/bin/mu-editor + +finish-args: + - --filesystem=home + # X11/Wayland + - --share=ipc + - --socket=x11 + - --socket=wayland + - --device=dri + - --socket=pulseaudio + # Network access for Mu users + - --share=network + # MicroPython devices connect over USB + - --device=all + +modules: + # Use python-build-standalone since this is what `pup` uses for Windows and macOS. + # This should make the builds more homogenous across platforms. + - name: python-build-standalone + buildsystem: simple + build-options: + build-args: + - --share=network + build-commands: + - cp -pr . /app/python-build-standalone + sources: + - type: archive + url: https://github.com/indygreg/python-build-standalone/releases/download/20220630/cpython-3.8.13+20220630-x86_64-unknown-linux-gnu-lto-full.tar.zst + sha256: 217fd3deccdc59e074800a2d90ea9176395d1630e1e24f84c062e6d5bf3e03a3 + + - name: mu + buildsystem: simple + build-options: + build-args: + - --share=network + build-commands: + - /app/python-build-standalone/install/bin/pip install --upgrade pip + - /app/python-build-standalone/install/bin/pip install . + - /app/python-build-standalone/install/bin/pip install pyserial + # Prefetch wheels used in the user virtual environment. + # Changes directory to `cd /tmp` in order to avoid importing `mu.wheels` + # from the git repository. + - cd /tmp && /app/python-build-standalone/install/bin/python3 -m mu.wheels + sources: + - type: archive + url: https://github.com/mu-editor/mu/archive/refs/tags/v1.1.1.tar.gz + sha256: 6ea06d09ba0ed15a2bdd87b62ad1c18a0b1edc7000956209720fcc4ad290458e + + - name: desktop-integration + buildsystem: simple + build-options: + build-args: + - --share=network + build-commands: + - install -Dm644 -t /app/share/applications mu.codewith.Editor.desktop + - install -Dm644 -t /app/share/metainfo mu.codewith.Editor.appdata.xml + - install -Dm644 -t /app/share/icons/hicolor/scalable/apps mu.codewith.Editor.svg + sources: + - type: file + path: mu.codewith.Editor.desktop + - type: file + path: mu.codewith.Editor.appdata.xml + - type: file + path: mu.codewith.Editor.svg +