Merge pull request #569 from tinywrkb/flatpak_fix
Flatpak: Repackage deb release instead of building from source
This commit is contained in:
commit
f1ead8a9db
3 changed files with 52 additions and 9508 deletions
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
@ -1,84 +1,67 @@
|
||||||
app-id: org.cidercollective.cider
|
app-id: org.cidercollective.cider
|
||||||
branch: main
|
|
||||||
runtime: org.freedesktop.Platform
|
runtime: org.freedesktop.Platform
|
||||||
runtime-version: '21.08'
|
runtime-version: '21.08'
|
||||||
sdk: org.freedesktop.Sdk
|
sdk: org.freedesktop.Sdk
|
||||||
# Use the Electron 2 BaseApp, which adds several common libraries we'll need.
|
|
||||||
base: org.electronjs.Electron2.BaseApp
|
base: org.electronjs.Electron2.BaseApp
|
||||||
base-version: '21.08'
|
base-version: '21.08'
|
||||||
# Add the Node 10 SDK extension.
|
|
||||||
sdk-extensions:
|
|
||||||
- org.freedesktop.Sdk.Extension.node14
|
|
||||||
# Electron doesn't use a traditional locale format so separate-locales is useless.
|
|
||||||
separate-locales: false
|
|
||||||
command: cider
|
command: cider
|
||||||
|
rename-desktop-file: cider.desktop
|
||||||
|
rename-icon: cider
|
||||||
finish-args:
|
finish-args:
|
||||||
# These two lines add Xorg access for graphics.
|
- --device=dri
|
||||||
- '--share=ipc'
|
- --filesystem=xdg-music
|
||||||
- '--socket=x11'
|
- --own-name=org.mpris.MediaPlayer2.Cider
|
||||||
# Sound access.
|
- --share=ipc
|
||||||
- '--socket=pulseaudio'
|
- --share=network
|
||||||
# Network access.
|
- --socket=pulseaudio
|
||||||
- '--share=network'
|
# needs electron v11 (chromium v87) or newer with ozone enabled
|
||||||
# If you need to access the filesystem, also add:
|
# https://github.com/electron/electron/issues/10915
|
||||||
# - '--filesystem=home'
|
# - --socket=wayland
|
||||||
|
- --socket=x11
|
||||||
|
- --system-talk-name=org.freedesktop.UPower
|
||||||
|
- --talk-name=com.canonical.AppMenu.Registrar
|
||||||
|
- --talk-name=com.canonical.dbusmenu
|
||||||
|
- --talk-name=org.freedesktop.Notifications
|
||||||
|
- --talk-name=org.kde.StatusNotifierWatcher
|
||||||
modules:
|
modules:
|
||||||
# With electron-webpack and electron-builder we don't install Node to /app/node,
|
|
||||||
# because electron-builder will bundle everything for us in one piece.
|
|
||||||
# Instead we jump straight to the quick start module.
|
|
||||||
|
|
||||||
# However, since this quick start uses yarn, we do have to install that.
|
|
||||||
- name: yarn
|
|
||||||
buildsystem: simple
|
|
||||||
build-commands:
|
|
||||||
- 'cp -a * /app'
|
|
||||||
# Only used for building, so clean it up afterwards.
|
|
||||||
cleanup:
|
|
||||||
- '*'
|
|
||||||
sources:
|
|
||||||
- type: archive
|
|
||||||
url: https://github.com/yarnpkg/yarn/releases/download/v1.22.17/yarn-v1.22.17.tar.gz
|
|
||||||
sha256: 267982c61119a055ba2b23d9cf90b02d3d16c202c03cb0c3a53b9633eae37249
|
|
||||||
|
|
||||||
- name: cider
|
- name: cider
|
||||||
buildsystem: simple
|
buildsystem: simple
|
||||||
build-options:
|
|
||||||
# Add the node bin directory & yarn directory.
|
|
||||||
append-path: '/usr/lib/sdk/node14/bin:/app/yarn/bin'
|
|
||||||
env:
|
|
||||||
# Set the Electron cache directory.
|
|
||||||
# (The directory format is: /run/build/MODULE_NAME/flatpak-node/electron-cache)
|
|
||||||
ELECTRON_CACHE: '/run/build/cider/flatpak-node/electron-cache'
|
|
||||||
# Sets the directory where Node is located so way npm won't download the headers.
|
|
||||||
npm_config_nodedir: '/usr/lib/sdk/node14'
|
|
||||||
build-commands:
|
build-commands:
|
||||||
# Have Yarn use the offline mirror.
|
- install -dm755 ${FLATPAK_DEST}/cider
|
||||||
- 'HOME=$PWD yarn config --offline set yarn-offline-mirror $FLATPAK_BUILDER_BUILDDIR/flatpak-node/yarn-mirror'
|
- |
|
||||||
# Download the packages.
|
bsdtar -Oxf cider.deb 'data.tar*' |
|
||||||
- 'yarn install --offline'
|
bsdtar -xf - \
|
||||||
# If you were using npm with electron-webpack/electron-builder, then the above two commands
|
-C ${FLATPAK_DEST}/cider \
|
||||||
# would look more like the npm commands in the vanilla-quick-start manifest, just without
|
--strip-components=3 \
|
||||||
# the --prefix.
|
./opt/Cider
|
||||||
|
- |
|
||||||
# Run electron-builder, passing the architecture arguments to it.
|
bsdtar -Oxf cider.deb 'data.tar*' |
|
||||||
# Note that the -- is important; without that, the argument will be passed to
|
bsdtar -xf - \
|
||||||
# yarn instead of electron-builder.
|
-C ${FLATPAK_DEST} \
|
||||||
- '. flatpak-node/electron-builder-arch-args.sh; yarn run --offline electron-builder build --linux dir -- $ELECTRON_BUILDER_ARCH_ARGS'
|
--strip-components=2 \
|
||||||
# Copy the resulting, unpacked directory to /app.
|
--exclude=./usr/share/doc \
|
||||||
# (A glob is used because the directory name may contain the current arch.)
|
./usr/share
|
||||||
- 'cp -r dist/linux*unpacked /app/cider'
|
- desktop-file-edit --set-key=Exec --set-value=cider ${FLATPAK_DEST}/share/applications/cider.desktop
|
||||||
# If you passed --electron-non-patented-ffmpeg, you could install it like this:
|
- install -Dm755 stub_sandbox ${FLATPAK_DEST}/cider/chrome-sandbox
|
||||||
# - 'install -Dm 755 flatpak-node/libffmpeg.so -t /app/electron-webpack-quick-start'
|
- install -Dm755 cider -t ${FLATPAK_DEST}/bin/
|
||||||
# Install the wrapper script to start it.
|
|
||||||
- 'install -Dm 755 cider.sh /app/bin/cider'
|
|
||||||
sources:
|
sources:
|
||||||
- type: git
|
- type: file
|
||||||
url: https://github.com/ciderapp/cider
|
dest-filename: cider.deb
|
||||||
branch: main
|
url: https://1308-429851205-gh.circle-artifacts.com/0/~/Cider/dist/artifacts/cider_1.3.1308_amd64.deb
|
||||||
# Add the flatpak-node-generator generated sources.
|
sha256: 342abde96bac9668e7238860ba435171edd72077ed9f4b385a3546c4d8f96995
|
||||||
- generated-sources.json
|
x-checker-data:
|
||||||
# Our runner script.
|
type: html
|
||||||
|
url: https://circleci.com/api/v1.1/project/gh/ciderapp/Cider/latest/artifacts?branch=main&filter=successful
|
||||||
|
pattern: (https://.*circle-artifacts.com/.+/cider_([\d\.]+)_amd64.deb)
|
||||||
- type: script
|
- type: script
|
||||||
dest-filename: cider.sh
|
dest-filename: cider
|
||||||
commands:
|
commands:
|
||||||
- '/app/cider/cider'
|
# share chromium singleton between multiple session, needed for flatpak<1.11.1
|
||||||
|
- export TMPDIR=$XDG_RUNTIME_DIR/app/$FLATPAK_ID
|
||||||
|
- exec zypak-wrapper /app/cider/cider "$@"
|
||||||
|
- type: script
|
||||||
|
dest-filename: stub_sandbox
|
||||||
|
commands:
|
||||||
|
- |
|
||||||
|
echo Stub sandbox ignoring command: $@
|
||||||
|
exit 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue