|
| 1 | +app-id: org.electronjs.fiddle |
| 2 | +runtime: org.freedesktop.Platform |
| 3 | +runtime-version: '25.08' |
| 4 | +sdk: org.freedesktop.Sdk |
| 5 | +# Use the Electron 2 BaseApp, which adds several common libraries we'll need. |
| 6 | +base: org.electronjs.Electron2.BaseApp |
| 7 | +base-version: '25.08' |
| 8 | +separate-locales: false |
| 9 | +# Add the Node SDK extension. |
| 10 | +sdk-extensions: |
| 11 | + - org.freedesktop.Sdk.Extension.node24 |
| 12 | +command: fiddle |
| 13 | +finish-args: |
| 14 | + # These three lines add the permissions needed for graphics. |
| 15 | + - --device=dri |
| 16 | + - --share=ipc |
| 17 | + - --socket=x11 |
| 18 | + - --socket=wayland |
| 19 | + # Sound access. |
| 20 | + - --socket=pulseaudio |
| 21 | + # Network access. |
| 22 | + - --share=network |
| 23 | + # If you need to access the filesystem, also add: |
| 24 | + # - --filesystem=home |
| 25 | +modules: |
| 26 | + # Now is the quickstart module. |
| 27 | + - name: fiddle |
| 28 | + buildsystem: simple |
| 29 | + build-options: |
| 30 | + # Add the node bin directory. |
| 31 | + append-path: /usr/lib/sdk/node24/bin |
| 32 | + env: |
| 33 | + XDG_CACHE_HOME: /run/build/fiddle/flatpak-node/cache |
| 34 | + npm_config_nodedir: /usr/lib/sdk/node24 |
| 35 | + # more verbose |
| 36 | + YARN_ENABLE_INLINE_BUILDS: '1' |
| 37 | + # disable telemetry |
| 38 | + YARN_ENABLE_TELEMETRY: '0' |
| 39 | + # disable network access |
| 40 | + YARN_ENABLE_NETWORK: '0' |
| 41 | + # disable global cache |
| 42 | + YARN_ENABLE_GLOBAL_CACHE: '0' |
| 43 | + # set yarn global folder |
| 44 | + YARN_GLOBAL_FOLDER: /run/build/fiddle/flatpak-node/yarn-berry |
| 45 | + build-commands: |
| 46 | + # print yarn basic info |
| 47 | + - yarn config |
| 48 | + # setup yarn for flatpak |
| 49 | + - yarn plugin import $FLATPAK_BUILDER_BUILDDIR/flatpak-node/flatpak-yarn.js |
| 50 | + # prepare yarn cache |
| 51 | + - yarn convertToZip $(which yarn) |
| 52 | + # Install the packages from our offline cache. |
| 53 | + # --prefix= is the path to our subdirectory (see the electron-quick-start source below). |
| 54 | + - yarn install |
| 55 | + |
| 56 | + - yarn run package |
| 57 | + - mv out/Electron* /app/ElectronFiddle |
| 58 | + - install -Dm755 fiddle.sh /app/bin/fiddle |
| 59 | + sources: |
| 60 | + - type: git |
| 61 | + url: https://github.com/electron/fiddle.git |
| 62 | + commit: 98c0605f804df86df8636a477515bbe178cd3943 |
| 63 | + |
| 64 | + # Add the flatpak-node-generator generated sources. |
| 65 | + - generated-sources.json |
| 66 | + # Our runner script. |
| 67 | + - type: script |
| 68 | + dest-filename: fiddle.sh |
| 69 | + commands: |
| 70 | + # We need to wrap the main binary with Zypak in order for sandboxing |
| 71 | + # to work. Without this, we'll get errors about the "SUID sandbox |
| 72 | + # helper binary". |
| 73 | + - exec zypak-wrapper /app/ElectronFiddle/electron-fiddle |
| 74 | + |
| 75 | + # Sources below are only for fiddle, as it wants to fetch these online |
| 76 | + # prefetch for offline |
| 77 | + - type: file |
| 78 | + url: https://releases.electronjs.org/releases.json |
| 79 | + sha256: badb8576b81b4e43716aa3314724c9563d42eb4140cf06000201ad7a31067dc4 |
| 80 | + # replace to use release.json prefetched |
| 81 | + - type: file |
| 82 | + path: replace/fetch-releases.ts |
| 83 | + dest-filename: fetch-releases.ts |
| 84 | + dest: tools |
| 85 | + # used embed contributors.json |
| 86 | + - type: file |
| 87 | + path: replace/contributors.json |
| 88 | + dest-filename: contributors.json |
| 89 | + dest: static |
0 commit comments