Add a flatpak wrapper to start Tuhi on demand

No-one but Arch packages Tuhi at the moment, so let's assume it's not
running/installed, install it and start it up together with TuhiGui and voila,
everything just works as it should be.
pull/145/head
Peter Hutterer 2019-07-16 22:10:09 +10:00
parent 7677ce60eb
commit bd66b8dbd3
4 changed files with 63 additions and 1 deletions

View File

@ -34,6 +34,16 @@ Install TuhiGUI
TuhiGui requires Python v3.6 or above.
Flatpak
-------
```
$> git clone http://github.com/tuhiproject/tuhigui
$> cd tuhigui
$> flatpak-builder flatpak_builddir org.freedesktop.TuhiGui.json --install --user --force-clean
$> flatpak run org.freedesktop.TuhiGui
```
License
-------

View File

@ -104,3 +104,8 @@ if appstream_util.found()
test('appstream-util validate-relax', appstream_util,
args: ['validate-relax', appdata])
endif
# A wrapper to start tuhi at the same time as tuhigui, used by the flatpak
configure_file(input: 'tools/tuhi-gui-flatpak.py',
output: 'tuhi-gui-flatpak.py',
copy: true)

View File

@ -3,11 +3,12 @@
"runtime": "org.gnome.Platform",
"runtime-version": "3.30",
"sdk": "org.gnome.Sdk",
"command": "tuhigui",
"command": "tuhi-gui",
"finish-args": [
"--share=ipc",
"--socket=x11",
"--talk-name=org.freedesktop.tuhi1",
"--own-name=org.freedesktop.tuhi1",
"--system-talk-name=org.bluez"
],
"modules": [
@ -51,6 +52,19 @@
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} ."
]
},
{
"name": "tuhi",
"buildsystem": "simple",
"sources": [
{
"type": "git",
"url": "https://github.com/tuhiproject/tuhi"
}
],
"build-commands": [
"pip3 install --no-index --find-links=\"file://${PWD}\" --prefix=${FLATPAK_DEST} ."
]
},
{
"name": "tuhigui",
"buildsystem": "meson",
@ -59,6 +73,10 @@
"type": "git",
"url": "."
}
],
"post-install": [
"cp tuhi-gui-flatpak.py /app/bin/tuhi-gui",
"chmod +x /app/bin/tuhi-gui"
]
}
]

29
tools/tuhi-gui-flatpak.py Executable file
View File

@ -0,0 +1,29 @@
#!/usr/bin/env python3
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
import subprocess
from multiprocessing import Process
def start_tuhi():
subprocess.run('tuhi')
def start_tuhigui():
subprocess.run('tuhigui')
if __name__ == '__main__':
tuhi = Process(target=start_tuhi)
tuhi.daemon = True
tuhi.start()
tuhigui = Process(target=start_tuhigui)
tuhigui.start()
tuhigui.join()