Skip to content

Commit 8d9148d

Browse files
committed
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).
1 parent 528fac6 commit 8d9148d

File tree

4 files changed

+127
-0
lines changed

4 files changed

+127
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ var/
2424
*.egg-info/
2525
.installed.cfg
2626
*.egg
27+
.flatpak-builder
2728

2829
# Bluemix vendored packages
2930
vendor/
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<component type="desktop-application">
3+
<id>mu.codewith.Editor</id>
4+
<metadata_license>CC-BY-SA</metadata_license>
5+
<name>Mu Editor</name>
6+
<summary>A simple editor for beginner Python programmers</summary>
7+
<description>
8+
<p>
9+
Mu is a simple code editor for beginner programmers based on extensive feedback from teachers and learners.
10+
Having said that, Mu is for anyone who wants to use a simple "no frills" editor.
11+
</p>
12+
<p>Mu is a modal editor with modes for many different ways to use Python to create cool and interesting things.</p>
13+
<p>
14+
Mu is written in Python and works on Windows, macOS, Linux and Raspberry Pi. The project's public facing website is https://codewith.mu/.
15+
We celebrate the work done by users of mu at https://madewith.mu/.
16+
</p>
17+
</description>
18+
<url type="homepage">https://codewith.mu/</url>
19+
<url type="bugtracker">https://github.com/mu-editor/mu/issues/</url>
20+
<url type="help">https://codewith.mu/en/howto/1.1/</url>
21+
<launchable type="desktop-id">mu.codewith.Editor.desktop</launchable>
22+
<releases>
23+
<release version="1.1.1" date="2022-02-22">
24+
<description>
25+
<p>
26+
This is the first stable release of the 1.1.* version of Mu.
27+
</p>
28+
</description>
29+
</release>
30+
</releases>
31+
<project_license>GPL-3.0-or-later</project_license>
32+
<developer_name>Nicholas H.Tollervey</developer_name>
33+
<screenshots>
34+
<screenshot type="default">
35+
<image type="source">https://codewith.mu/img/en/tutorials/mu_ui.png</image>
36+
</screenshot>
37+
<screenshot>
38+
<image type="source">https://codewith.mu/img/en/tutorials/mode_selector1-1.png</image>
39+
</screenshot>
40+
</screenshots>
41+
<content_rating type="oars-1.1"/>
42+
</component>

flatpak/mu.codewith.Editor.desktop

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[Desktop Entry]
2+
Name=Mu Editor
3+
GenericName=A simple editor for beginner Python programmers
4+
Exec=/app/python-build-standalone/install/bin/mu-editor
5+
Terminal=false
6+
Icon=mu.codewith.Editor
7+
Type=Application
8+
Categories=Development;IDE;
9+
X-Desktop-File-Install-Version=1.1.1
10+
StartupWMClass=mu-editor

flatpak/mu.codewith.Editor.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Build using `flatpak-builder --user --install --force-clean build-dir mu.codewith.Editor.yml`.
2+
# Then run using `flatpak run mu.codewith.Editor`.
3+
4+
app-id: mu.codewith.Editor
5+
6+
runtime: org.freedesktop.Platform
7+
runtime-version: '21.08'
8+
sdk: org.freedesktop.Sdk
9+
10+
command: /app/python-build-standalone/install/bin/mu-editor
11+
12+
finish-args:
13+
- --filesystem=home
14+
# X11/Wayland
15+
- --share=ipc
16+
- --socket=x11
17+
- --socket=wayland
18+
- --device=dri
19+
- --socket=pulseaudio
20+
# Network access for Mu users
21+
- --share=network
22+
# MicroPython devices connect over USB
23+
- --device=all
24+
25+
modules:
26+
# Use python-build-standalone since this is what `pup` uses for Windows and macOS.
27+
# This should make the builds more homogenous across platforms.
28+
- name: python-build-standalone
29+
buildsystem: simple
30+
build-options:
31+
build-args:
32+
- --share=network
33+
build-commands:
34+
- cp -pr . /app/python-build-standalone
35+
sources:
36+
- type: archive
37+
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
38+
sha256: 217fd3deccdc59e074800a2d90ea9176395d1630e1e24f84c062e6d5bf3e03a3
39+
40+
- name: mu
41+
buildsystem: simple
42+
build-options:
43+
build-args:
44+
- --share=network
45+
build-commands:
46+
- /app/python-build-standalone/install/bin/pip install --upgrade pip
47+
- /app/python-build-standalone/install/bin/pip install .
48+
- /app/python-build-standalone/install/bin/pip install pyserial
49+
# Prefetch wheels used in the user virtual environment.
50+
# Changes directory to `cd /tmp` in order to avoid importing `mu.wheels`
51+
# from the git repository.
52+
- cd /tmp && /app/python-build-standalone/install/bin/python3 -m mu.wheels
53+
sources:
54+
- type: archive
55+
url: https://github.com/mu-editor/mu/archive/refs/tags/v1.1.1.tar.gz
56+
sha256: 6ea06d09ba0ed15a2bdd87b62ad1c18a0b1edc7000956209720fcc4ad290458e
57+
58+
- name: desktop-integration
59+
buildsystem: simple
60+
build-options:
61+
build-args:
62+
- --share=network
63+
build-commands:
64+
- install -Dm644 -t /app/share/applications mu.codewith.Editor.desktop
65+
- install -Dm644 -t /app/share/metainfo mu.codewith.Editor.appdata.xml
66+
- install -Dm644 -t /app/share/icons/hicolor/scalable/apps mu.codewith.Editor.svg
67+
sources:
68+
- type: file
69+
path: mu.codewith.Editor.desktop
70+
- type: file
71+
path: mu.codewith.Editor.appdata.xml
72+
- type: file
73+
path: mu.codewith.Editor.svg
74+

0 commit comments

Comments
 (0)