Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support files for Flatpak builds #3723

Closed
wants to merge 10 commits into from
23 changes: 23 additions & 0 deletions electron_app/build/flatpak-Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

ICON_FILES = $(wildcard electron_app/build/icons/*.png)
ICON_SIZES = $(patsubst electron_app/build/icons/%.png,%,$(ICON_FILES))

all:
npm install
npm run build
./node_modules/.bin/build -l --dir

install:
install -dm755 /app/bin
cp -ar electron_app/dist/linux-unpacked/* /app/bin/
for size in $(ICON_SIZES) ; do \
install -dm755 /app/share/icons/hicolor/$${size}/apps/ ; \
install -Dm644 electron_app/build/icons/$${size}.png \
/app/share/icons/hicolor/$${size}/apps/im.vector.Riot.png ; \
done
install -dm755 /app/share/applications
install -Dm644 im.vector.Riot.desktop /app/share/applications
install -dm755 /app/share/appdata
install -Dm644 im.vector.Riot.appdata.xml /app/share/appdata

.PHONY: install all
32 changes: 32 additions & 0 deletions electron_app/build/im.vector.Riot.appdata.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>im.vector.Riot.desktop</id>
<metadata_license>Apache-2.0</metadata_license>
<project_license>Apache-2.0</project_license>
<name>Riot</name>
<url type="homepage">https://riot.im</url>
<url type="bugtracker">https://github.com/vector-im/riot-web/issues</url>
<summary>Client for the Matrix network</summary>
<description>
<p>
Riot allows teams to communicate across a wide range of
collaboration apps. If some team members use Riot while others
use IRC, Slack or Gitter, Riot will allow these team members to
seamlessly work together. Riot offers the richest network of
communication bridges.
</p>
<p>
Riot is built on top of Matrix. Matrix is an open network for
secure, decentralized communication delivering a community of
users, bridged networks, integrated bots and applications plus
full end-to-end encryption.
</p>
</description>
<categories>
<category>Network</category>
<category>Chat</category>
<category>InstantMessaging</category>
<category>VideoConference</category>
</categories>
<!-- TODO: Have at least one screenshot -->
</component>
9 changes: 9 additions & 0 deletions electron_app/build/im.vector.Riot.desktop
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[Desktop Entry]
Name=Riot
Comment=A feature-rich client for Matrix.org
Exec=riot-web
Terminal=false
Type=Application
Icon=im.vector.Riot
StartupWMClass="Riot"
Categories=Network;InstantMessaging;Chat;
64 changes: 64 additions & 0 deletions electron_app/build/im.vector.Riot.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
{
"id": "im.vector.Riot",
"version": "stable",
"base": "io.atom.electron.BaseApp",
"base-version": "master",
"runtime": "org.freedesktop.Platform",
"runtime-version": "1.4",
"sdk": "org.freedesktop.Sdk",
"command": "riot-web",
"finish-args": [
"--device=dri",
"--filesystem=home",
"--filesystem=/tmp",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should set $TMPDIR at runtime to $XDG_CACHE_HOME

"--share=ipc",
"--share=network",
"--socket=pulseaudio",
"--socket=x11",
"--talk-name=org.freedesktop.Notifications"
],
"modules": [
{
"name": "node",
"cleanup": [
"*"
],
"sources": [
{
"type": "archive",
"url": "https://nodejs.org/dist/v7.9.0/node-v7.9.0.tar.gz",
"sha256": "5cc131bb16f7ca688c29634a18b3c6a7816609a431a509f31baedf7caf25d626"
}
]
},
{
"name": "riot-web",
"no-autogen": true,
"build-options": {
"build-args": [
"--share=network"
]
},
"sources": [
{
"type": "archive",
"url": "https://github.com/vector-im/riot-web/archive/v0.12.2.tar.gz",
"sha256": "d31713f6efcd07366bf0d3b7364f547504c958a35d07a37bed809ef71789e2bf"
},
{
"type": "file",
"path": "flatpak-Makefile",
"dest-filename": "Makefile"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In general these are avoided these days. You can do:

{
  "name": "riot-web",
  "buildsystem": "simple",
  "build-commands": [
    "install -Dm644 foo /app/share/foo",
    "etc"
  ]
}

},
{
"type": "file",
"path": "im.vector.Riot.desktop"
},
{
"type": "file",
"path": "im.vector.Riot.appdata.xml"
}
]
}
]
}