app-id: org.electronjs.fiddle runtime: org.freedesktop.Platform runtime-version: '25.08' sdk: org.freedesktop.Sdk # Use the Electron 2 BaseApp, which adds several common libraries we'll need. base: org.electronjs.Electron2.BaseApp base-version: '25.08' separate-locales: false # Add the Node SDK extension. sdk-extensions: - org.freedesktop.Sdk.Extension.node24 command: fiddle finish-args: # These three lines add the permissions needed for graphics. - --device=dri - --share=ipc - --socket=x11 - --socket=wayland # Sound access. - --socket=pulseaudio # Network access. - --share=network # If you need to access the filesystem, also add: # - --filesystem=home modules: # Now is the quickstart module. - name: fiddle buildsystem: simple build-options: # Add the node bin directory. append-path: /usr/lib/sdk/node24/bin env: XDG_CACHE_HOME: /run/build/fiddle/flatpak-node/cache npm_config_nodedir: /usr/lib/sdk/node24 # more verbose YARN_ENABLE_INLINE_BUILDS: '1' # disable telemetry YARN_ENABLE_TELEMETRY: '0' # disable network access YARN_ENABLE_NETWORK: '0' # disable global cache YARN_ENABLE_GLOBAL_CACHE: '0' # set yarn global folder YARN_GLOBAL_FOLDER: /run/build/fiddle/flatpak-node/yarn-berry build-commands: # print yarn basic info - yarn config # setup yarn for flatpak - yarn plugin import $FLATPAK_BUILDER_BUILDDIR/flatpak-node/flatpak-yarn.js # prepare yarn cache - yarn convertToZip $(which yarn) # Install the packages from our offline cache. # --prefix= is the path to our subdirectory (see the electron-quick-start source below). - yarn install - yarn run package - mv out/Electron* /app/ElectronFiddle - install -Dm755 fiddle.sh /app/bin/fiddle sources: - type: git url: https://github.com/electron/fiddle.git commit: 98c0605f804df86df8636a477515bbe178cd3943 # Add the flatpak-node-generator generated sources. - generated-sources.json # Our runner script. - type: script dest-filename: fiddle.sh commands: # We need to wrap the main binary with Zypak in order for sandboxing # to work. Without this, we'll get errors about the "SUID sandbox # helper binary". - exec zypak-wrapper /app/ElectronFiddle/electron-fiddle # Sources below are only for fiddle, as it wants to fetch these online # prefetch for offline - type: file url: https://releases.electronjs.org/releases.json sha256: badb8576b81b4e43716aa3314724c9563d42eb4140cf06000201ad7a31067dc4 # replace to use release.json prefetched - type: file path: replace/fetch-releases.ts dest-filename: fetch-releases.ts dest: tools # used embed contributors.json - type: file path: replace/contributors.json dest-filename: contributors.json dest: static