-
Notifications
You must be signed in to change notification settings - Fork 270
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
Initial set of changes required for publishing to Flathub #293
base: develop
Are you sure you want to change the base?
Changes from all commits
eb39349
f8dd16a
183cae3
f0fddda
05e1dac
0479d95
6703f6b
7885b86
b18fb71
149d470
702f8e7
6be315d
2e76778
5c6e13d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
[Desktop Entry] | ||
Type=Application | ||
Name=${FLATPAK_APPNAME} | ||
Icon=${FLATPAK_ID} | ||
Exec=element %U | ||
Categories=Network;InstantMessaging;Chat;VideoConference; | ||
MimeType=x-scheme-handler/element; | ||
StartupWMClass=element | ||
Keywords=Matrix;matrix.org;chat;irc;communications;talk;riot;vector; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
env TMPDIR="$XDG_RUNTIME_DIR/app/${FLATPAK_ID}" /app/element/element-desktop --no-sandbox "$@" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm guessing the |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,40 @@ | ||||||
<?xml version="1.0" encoding="UTF-8"?> | ||||||
<component type="desktop"> | ||||||
<id>${FLATPAK_ID}</id> | ||||||
<name>${FLATPAK_APPNAME}</name> | ||||||
<project_license>Apache-2.0</project_license> | ||||||
<developer_name>New Vector Ltd</developer_name> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probably wants to be 'Element' (ie. the same as the author in package.json) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<summary>Create, share, communicate, chat and call securely, and bridge to other apps</summary> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can probably find some copy for this: I would guess the "Secure and independent communication, connected via Matrix" from the homepage. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
<metadata_license>CC0-1.0</metadata_license> | ||||||
<url type="homepage">https://element.io/</url> | ||||||
<url type="help">https://element.io/help</url> | ||||||
<url type="translate">https://translate.element.io/</url> | ||||||
<description> | ||||||
<p>More than group chat: communication</p> | ||||||
<ul> | ||||||
<li>Communicate with your team and out of network colleagues more efficiently: use dedicated rooms which persist information from their creation and forever.</li> | ||||||
<li>Forget group emails: join or create rooms per topic, per team, per event… Decide the level of transparency you want to provide across the organisation or project.</li> | ||||||
<li>Cut through the noise by creating notifications that are customised by you and for you.</li> | ||||||
<li>Grab the attention of your colleague by calling out their name and don’t miss a thing with keyword alerts.</li> | ||||||
<li>Deploy bots for fun or practical use with our integrations store.</li> | ||||||
</ul> | ||||||
</description> | ||||||
<screenshots> | ||||||
<screenshot> | ||||||
<caption>Element logged-in frontend</caption> | ||||||
<image type="source">https://user-images.githubusercontent.com/2221064/137519256-655fe0f9-55f0-44a4-b681-83711654fff0.png</image> | ||||||
</screenshot> | ||||||
</screenshots> | ||||||
<releases> | ||||||
<release version="${FLATPAK_VERSION}" date="${FLATPAK_DATE}"/> | ||||||
</releases> | ||||||
<content_rating type="oars-1.1"> | ||||||
<content_attribute id="social-chat">intense</content_attribute> | ||||||
<content_attribute id="social-audio">intense</content_attribute> | ||||||
<content_attribute id="social-contacts">intense</content_attribute> | ||||||
</content_rating> | ||||||
<provides> | ||||||
<id>im.riot.Riot</id> | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are we stuck with this from historical precedent? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, kind of, keep in mind that this entry basically says "I provide the same capabilities as the app with the identifier |
||||||
</provides> | ||||||
<launchable type="desktop-id">${FLATPAK_ID}.desktop</launchable> | ||||||
</component> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,7 @@ | ||
FROM buildpack-deps:xenial-curl | ||
FROM buildpack-deps:bionic-curl | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
RUN curl -L https://yarnpkg.com/latest.tar.gz | tar xvz && mv yarn-* /yarn && ln -s /yarn/bin/yarn /usr/bin/yarn | ||
RUN apt-get -qq update && apt-get -qq dist-upgrade && \ | ||
# add repo for git-lfs | ||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | ||
|
@@ -17,7 +16,13 @@ RUN apt-get -qq update && apt-get -qq dist-upgrade && \ | |
libsqlcipher-dev && \ | ||
# git-lfs | ||
git lfs install && \ | ||
apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/* | ||
# used by flathub client \ | ||
apt-get -qq install -y --no-install-recommends flatpak ostree gettext appstream-util curl && \ | ||
apt-get -qq install -y python3 python3-dev python3-pip libgirepository1.0-dev gir1.2-ostree-1.0 libcairo2-dev && \ | ||
curl -sSL https://raw.githubusercontent.com/flatpak/flat-manager/master/flat-manager-client -o /usr/local/bin/flat-manager-client && \ | ||
chmod +x /usr/local/bin/flat-manager-client && \ | ||
pip3 install aiohttp tenacity PyGObject && \ | ||
apt-get purge -y --auto-remove && rm -rf /var/lib/apt/lists/ | ||
Comment on lines
+19
to
+25
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is there not a preexisting docker image for building flatpaks? Looks like the steps are separate, so it doesn't need to be the same docker image that runs electron build. |
||
|
||
WORKDIR /project | ||
|
||
|
@@ -36,7 +41,8 @@ ENV NODE_VERSION 14.17.0 | |
RUN curl -L https://nodejs.org/dist/v$NODE_VERSION/node-v$NODE_VERSION-linux-x64.tar.gz | tar xz -C /usr/local --strip-components=1 && \ | ||
unlink /usr/local/CHANGELOG.md && unlink /usr/local/LICENSE && unlink /usr/local/README.md && \ | ||
# https://github.com/npm/npm/issues/4531 | ||
npm config set unsafe-perm true | ||
npm config set unsafe-perm true && \ | ||
npm install --global yarn | ||
|
||
ENV RUSTUP_HOME=/usr/local/rustup \ | ||
CARGO_HOME=/usr/local/cargo \ | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,8 @@ | |
"docker:install": "scripts/in-docker.sh yarn install", | ||
"debrepo": "scripts/mkrepo.sh", | ||
"clean": "rimraf webapp.asar dist packages deploys lib", | ||
"hak": "ts-node scripts/hak/index.ts" | ||
"hak": "ts-node scripts/hak/index.ts", | ||
"flatpak": "yarn build && scripts/in-docker.sh scripts/build-flatpak.sh" | ||
}, | ||
"dependencies": { | ||
"auto-launch": "^5.0.5", | ||
|
@@ -104,7 +105,7 @@ | |
"webapp.asar" | ||
], | ||
"linux": { | ||
"target": "deb", | ||
"target": ["deb", "dir"], | ||
"category": "Network;InstantMessaging;Chat", | ||
"maintainer": "[email protected]", | ||
"desktop": { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
#!/bin/bash | ||
|
||
set -eu | ||
|
||
: "${FLATPAK_ID:=io.element.ElementNightly}" | ||
: "${FLATPAK_APPNAME:=Element Nightly}" | ||
: "${FLATPAK_VERSION:="0.0.0-nightly$(date +%Y%m%d)"}" | ||
: "${FLATPAK_DATE:="$(date +%Y-%m-%d)"}" | ||
: "${FLATPAK_BRANCH:=nightly}" | ||
|
||
export FLATPAK_ID FLATPAK_APPNAME FLATPAK_VERSION FLATPAK_DATE FLATPAK_BRANCH | ||
|
||
[[ -d dist/flatpak ]] && rm -rf dist/flatpak | ||
install -d dist/flatpak/ | ||
install -d dist/flatpak/build/files | ||
|
||
cd dist/flatpak | ||
|
||
cat <<EOF > build/metadata | ||
[Application] | ||
name=${FLATPAK_ID} | ||
runtime=org.freedesktop.Platform/x86_64/21.08 | ||
sdk=org.freedesktop.Sdk/x86_64/21.08 | ||
EOF | ||
|
||
cp -r ../linux-unpacked build/files/element | ||
install -d build/files/share/applications build/files/share/metainfo | ||
install -Dm755 ../../build/flatpak/element.sh build/files/bin/element | ||
install -Dm644 ../../build/icons/512x512.png build/files/share/icons/hicolor/512x512/apps/${FLATPAK_ID}.png | ||
envsubst < ../../build/flatpak/element.desktop.in > build/files/share/applications/${FLATPAK_ID}.desktop | ||
envsubst < ../../build/flatpak/metainfo.xml.in > build/files/share/metainfo/${FLATPAK_ID}.metainfo.xml | ||
|
||
appstream-compose --prefix=build/files --origin=flatpak --basename=${FLATPAK_ID} ${FLATPAK_ID} | ||
appstream-util mirror-screenshots build/files/share/app-info/xmls/${FLATPAK_ID}.xml.gz \ | ||
"https://dl.flathub.org/repo/screenshots/${FLATPAK_ID}-${FLATPAK_BRANCH}" \ | ||
build/screenshots "build/screeshots/${FLATPAK_ID}-${FLATPAK_BRANCH}" | ||
|
||
# TODO: baseapp with deps | ||
# TODO: zypak-wrapper | ||
|
||
flatpak build-finish build \ | ||
--socket=x11 \ | ||
--share=ipc \ | ||
--socket=pulseaudio \ | ||
--device=all \ | ||
--share=network \ | ||
--filesystem=xdg-download \ | ||
--talk-name=org.freedesktop.Notifications \ | ||
--talk-name=org.kde.StatusNotifierWatcher \ | ||
--talk-name=org.freedesktop.ScreenSaver \ | ||
--own-name='org.kde.*' \ | ||
--talk-name=org.freedesktop.portal.Fcitx \ | ||
--filesystem=xdg-run/keyring \ | ||
--command=element | ||
|
||
flatpak build-export repo build $FLATPAK_BRANCH | ||
flatpak build-update-repo --generate-static-deltas repo | ||
flatpak build-bundle --runtime-repo=https://dl.flathub.org/repo/flathub.flatpakrepo \ | ||
repo ../element.flatpak $FLATPAK_ID $FLATPAK_BRANCH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The
build
directory is (confusingly) for electron-builder's config, so we should keep things unrelated to electron builder somewhere else. Probably just a top-levelflatpak
directory?