Skip to content

Commit 1808e64

Browse files
authored
Merge pull request #5 from sugarlabs/electron-flatpak
switch to electron for app viewer
2 parents 2ca3d6c + 961e970 commit 1808e64

File tree

6 files changed

+80
-97
lines changed

6 files changed

+80
-97
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ $ flatpak install flathub org.gnome.Platform//3.36 org.gnome.Sdk//3.36
1616

1717
```
1818
$ flatpak-builder --force-clean --repo=repo build org.sugarlabs.MusicBlocks.json
19-
$ flatpak build-bundle repo musicblocks.flatpak org.sugarlabs.MusicBlocks
19+
$ flatpak build-bundle repo musicblocks.flatpak org.sugarlabs.MusicBlocks stable
2020
$ flatpak install musicblocks.flatpak
2121
```
2222

data/org.sugarlabs.MusicBlocks.desktop

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[Desktop Entry]
22
Name=Music Blocks
3-
Exec=launcher
3+
Exec=run.sh
44
Type=Application
55
Icon=org.sugarlabs.MusicBlocks
66
Categories=Education;ComputerScience;Art;Music;

data/org.sugarlabs.MusicBlocks.json

Lines changed: 77 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,50 @@
11
{
22
"app-id": "org.sugarlabs.MusicBlocks",
3-
"runtime": "org.gnome.Platform",
4-
"runtime-version": "3.36",
5-
"sdk": "org.gnome.Sdk",
6-
"command": "launcher",
3+
"runtime": "org.freedesktop.Platform",
4+
"runtime-version": "19.08",
5+
"branch": "stable",
6+
"sdk": "org.freedesktop.Sdk",
7+
"base": "io.atom.electron.BaseApp",
8+
"base-version": "stable",
9+
"command": "run.sh",
10+
"separate-locales": false,
711
"finish-args": [
812
"--share=network",
9-
"--socket=wayland",
10-
"--socket=fallback-x11",
13+
"--socket=x11",
1114
"--socket=pulseaudio",
1215
"--device=dri",
16+
"--filesystem=home",
1317
"--env=MUSICBLOCKS_PATH=/app/share/musicblocks"
1418
],
19+
"build-options" : {
20+
"cflags": "-O2 -g",
21+
"cxxflags": "-O2 -g",
22+
"env": {
23+
"NPM_CONFIG_LOGLEVEL": "info"
24+
}
25+
},
1526
"modules": [
1627
{
17-
"name": "launcher",
28+
"name": "nodejs",
29+
"cleanup": [
30+
"/include",
31+
"/share",
32+
"/app/lib/node_modules/npm/changelogs",
33+
"/app/lib/node_modules/npm/doc",
34+
"/app/lib/node_modules/npm/html",
35+
"/app/lib/node_modules/npm/man",
36+
"/app/lib/node_modules/npm/scripts"
37+
],
38+
"sources": [
39+
{
40+
"type": "archive",
41+
"url": "https://nodejs.org/dist/v14.7.0/node-v14.7.0.tar.xz",
42+
"sha256": "ca2f1c63f3f2bf22247d7386bfc31e0295caa953f39f7079210170a886288e6f"
43+
}
44+
]
45+
},
46+
{
47+
"name": "mb-launcher",
1848
"buildsystem": "simple",
1949
"build-commands": [
2050
"python3 setup.py install --prefix=${FLATPAK_DEST}"
@@ -38,21 +68,59 @@
3868
"rm -rf musicblocks/charts",
3969
"rm -rf musicblocks/mouse-art",
4070
"rm -rf musicblocks/screenshots",
71+
"rm musicblocks/package*",
72+
"mkdir /app/share/musicblocks",
4173
"cp -ra musicblocks/* /app/share/musicblocks"
4274
],
4375
"sources": [
4476
{
4577
"type": "git",
4678
"url": "https://github.com/sugarlabs/musicblocks",
47-
"tag": "v3.1",
48-
"commit": "5a0e5fc244acd8fa806f78a937165cc2a528e68e",
79+
"tag": "v3.2",
80+
"commit": "010d7f90cd68ac25c3c07886f1f5955ef2f196dc",
4981
"dest": "musicblocks"
5082
},
5183
{
5284
"type": "patch",
5385
"path": "save-interface.patch"
5486
}
5587
]
88+
},
89+
{
90+
"name": "electron-app",
91+
"build-options": {
92+
"env": {
93+
"electron_config_cache": "/run/build/electron-app/flatpak-node/npm-cache"
94+
},
95+
"build-args": [ "--share=network" ]
96+
},
97+
"buildsystem": "simple",
98+
"build-commands": [
99+
"npm install --prefix=main --offline --cache=/run/build/electron-app/flatpak-node/npm-cache/",
100+
"cp -ra main/* /app/share/musicblocks/",
101+
"install run.sh /app/bin/"
102+
],
103+
"sources": [
104+
{
105+
"type": "git",
106+
"url": "https://github.com/srevinsaju/musicblocks-app",
107+
"tag": "continuous",
108+
"commit": "844eabe9b9e668f9f645a9af49517e83cb738d80",
109+
"dest": "main"
110+
},
111+
{
112+
"type": "patch",
113+
"path": "electron-app.patch"
114+
},
115+
"generated-sources.json",
116+
{
117+
"type": "script",
118+
"dest-filename": "run.sh",
119+
"commands": [
120+
"npm start --prefix=/app/share/musicblocks"
121+
]
122+
}
123+
]
56124
}
57125
]
58126
}

data/org.sugarlabs.MusicBlocks.ui

Lines changed: 0 additions & 30 deletions
This file was deleted.

launcher

Lines changed: 0 additions & 53 deletions
This file was deleted.

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,12 @@
22
import os
33

44
setup(name='Music Blocks Launcher',
5-
version='1.0',
5+
version='1.1.0',
66
description='Flatpak launcher for Music Blocks',
77
url="https://github.com/sugarlabs/musicblocks-launcher",
88
data_files=[
99
('share/metainfo', ['data/org.sugarlabs.MusicBlocks.appdata.xml']),
1010
('share/icons/hicolor/scalable/apps', ['data/org.sugarlabs.MusicBlocks.svg']),
1111
('share/applications', ['data/org.sugarlabs.MusicBlocks.desktop']),
12-
('share/musicblocks', ['data/org.sugarlabs.MusicBlocks.ui']),
13-
('bin', ['launcher'])
1412
]
1513
)

0 commit comments

Comments
 (0)