{
 "app_id": "net.sonic_pi.SonicPi",
 "source_url": "https://raw.githubusercontent.com/flathub/net.sonic_pi.SonicPi/master/net.sonic_pi.SonicPi.json",
 "runtime": "org.kde.Platform",
 "runtime_version": "6.11",
 "sdk": "org.kde.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=fallback-x11",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--device=dri",
  "--filesystem=xdg-run/pipewire-0:ro",
  "--filesystem=home",
  "--filesystem=xdg-config/kdeglobals:ro",
  "--talk-name=com.canonical.AppMenu.Registrar",
  "--talk-name=org.kde.kconfig.notify",
  "--talk-name=org.kde.KGlobalSettings"
 ],
 "module_count": 4,
 "fetched_at": "2026-09-17T16:13:42.311107+00:00",
 "manifest": {
  "id": "net.sonic_pi.SonicPi",
  "runtime": "org.kde.Platform",
  "runtime-version": "6.11",
  "sdk": "org.kde.Sdk",
  "command": "sonic-pi",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.rust-stable"
  ],
  "finish-args": [
   "--share=ipc",
   "--socket=fallback-x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--device=dri",
   "--share=network",
   "--filesystem=xdg-run/pipewire-0:ro",
   "--filesystem=home",
   "--env=TMPDIR=/var/tmp"
  ],
  "cleanup": [
   "/include",
   "/lib/cmake",
   "/lib/pkgconfig",
   "/lib/qt5",
   "/share/man",
   "/share/pkgconfig"
  ],
  "modules": [
   {
    "name": "ruby",
    "build-options": {
     "cflags": "-std=gnu17"
    },
    "config-opts": [
     "--enable-shared"
    ],
    "cleanup": [
     "/include"
    ],
    "post-install": [
     "cp /usr/lib/${FLATPAK_ARCH}-linux-gnu/libyaml-0.so* ${FLATPAK_DEST}/lib"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://cache.ruby-lang.org/pub/ruby/3.1/ruby-3.1.2.tar.gz",
      "sha256": "61843112389f02b735428b53bb64cf988ad9fb81858b8248e22e57336f24a83e"
     }
    ]
   },
   {
    "name": "aubio",
    "buildsystem": "simple",
    "build-commands": [
     "python3 ./waf configure --prefix=$FLATPAK_DEST --libdir=/app/lib --disable-avcodec build -j $FLATPAK_BUILDER_N_JOBS",
     "python3 ./waf install"
    ],
    "cleanup": [
     "/bin",
     "/include",
     "/lib/pkgconfig",
     "/share/doc",
     "*.a"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://aubio.org/pub/aubio-0.4.9.tar.bz2",
      "disable-http-decompression": true,
      "sha256": "d48282ae4dab83b3dc94c16cf011bcb63835c1c02b515490e1883049c3d1f3da"
     },
     {
      "type": "patch",
      "path": "patches/aubio-python.patch"
     }
    ]
   },
   {
    "name": "qscintilla",
    "buildsystem": "qmake",
    "subdir": "src",
    "sources": [
     {
      "type": "archive",
      "url": "https://www.riverbankcomputing.com/static/Downloads/QScintilla/2.14.0/QScintilla_src-2.14.0.tar.gz",
      "sha256": "449353928340300804c47b3785c3e62096f918a723d5eed8a5439764e6507f4c"
     },
     {
      "type": "patch",
      "path": "patches/qscintilla-lib-paths.patch"
     }
    ]
   },
   {
    "name": "sonicpi",
    "buildsystem": "cmake-ninja",
    "builddir": true,
    "subdir": "app",
    "build-options": {
     "append-path": "/usr/lib/sdk/rust-stable/bin",
     "env": {
      "CARGO_HOME": "/run/build/sonicpi/cargo-home"
     }
    },
    "config-opts": [
     "-DCMAKE_BUILD_TYPE=RelWithDebInfo",
     "-DSONIC_PI_INSTALL_ROOT=/app/sonic-pi",
     "-DSUPERSONIC_SYSTEM_SNDFILE=ON",
     "-DFETCHCONTENT_FULLY_DISCONNECTED=ON",
     "-DSUPERSONIC_CARGO_OFFLINE=ON",
     "-DFETCHCONTENT_SOURCE_DIR_ABLETONLINK=/run/build/sonicpi/link"
    ],
    "cleanup": [
     "/sonic-pi/server/ruby/rb-native",
     "/sonic-pi/app/server/ruby/vendor/concurrent-ruby-*/examples",
     "/sonic-pi/app/server/ruby/vendor/concurrent-ruby-*/ext/concurrent-ruby",
     "/sonic-pi/app/server/ruby/vendor/concurrent-ruby-*/ext/concurrent-ruby-extext/concurrent-ruby-extbin",
     "/sonic-pi/app/server/ruby/vendor/gettext-*/samples",
     "/sonic-pi/app/server/ruby/vendor/gettext-*/test",
     "/sonic-pi/app/server/ruby/vendor/i18n-*/test",
     "/sonic-pi/app/server/ruby/vendor/kramdown-*/benchmark",
     "/sonic-pi/app/server/ruby/vendor/kramdown-*/doc",
     "/sonic-pi/app/server/ruby/vendor/kramdown-*/test",
     "/sonic-pi/app/server/ruby/vendor/locale-*/test",
     "/sonic-pi/app/server/ruby/vendor/locale-*/samples",
     "/sonic-pi/app/server/ruby/vendor/memoist-*/test",
     "/sonic-pi/app/server/ruby/vendor/metaclass-*/test",
     "/sonic-pi/app/server/ruby/vendor/minitest-*/test",
     "/sonic-pi/app/server/ruby/vendor/mocha-*/test",
     "/sonic-pi/app/server/ruby/vendor/rugged-*/test",
     "/sonic-pi/app/server/ruby/vendor/rugged-*/ext/ruggedext/ruggedext/ruggedvendor/libgit2",
     "/sonic-pi/app/server/ruby/vendor/tomlrb-*/test",
     "/sonic-pi/app/server/ruby/vendor/tzinfo-*/test",
     "/sonic-pi/app/server/ruby/vendor/wavefile-*/examples",
     "/sonic-pi/app/server/ruby/vendor/wavefile-*/test",
     "/sonic-pi/app/server/ruby/vendor/wavefile-*/tools",
     ".github"
    ],
    "post-install": [
     "install -Dm755 gui/sonic-pi -t ${FLATPAK_DEST}/bin",
     "install -d ${FLATPAK_DEST}/sonic-pi/app/gui",
     "cp -R ../gui/theme ${FLATPAK_DEST}/sonic-pi/app/gui/",
     "install -Dm644 ../../VERSION ${FLATPAK_DEST}/sonic-pi/",
     "install -d ${FLATPAK_DEST}/sonic-pi/app/server/native/",
     "cp -R ../server/native/* ${FLATPAK_DEST}/sonic-pi/app/server/native/",
     "install -d ${FLATPAK_DEST}/sonic-pi/app/server/ruby/",
     "cp -R ../server/ruby/* ${FLATPAK_DEST}/sonic-pi/app/server/ruby/",
     "install -d ${FLATPAK_DEST}/sonic-pi/etc/synthdefs/",
     "cp -R ../../etc/synthdefs/compiled ${FLATPAK_DEST}/sonic-pi/etc/synthdefs/",
     "cp -R ../../etc/examples ${FLATPAK_DEST}/sonic-pi/etc/",
     "cp -R ../../etc/snippets ${FLATPAK_DEST}/sonic-pi/etc/",
     "install -Dm644 ../../etc/buffers/*.wav -t ${FLATPAK_DEST}/sonic-pi/etc/buffers",
     "install -Dm644 ../../etc/samples/*.flac -t ${FLATPAK_DEST}/sonic-pi/etc/samples",
     "install -Dm644 ../../net.sonic_pi.SonicPi.metainfo.xml -t $FLATPAK_DEST/share/metainfo",
     "install -Dm644 ../gui/images/icon-smaller.png $FLATPAK_DEST/share/icons/hicolor/256x256/apps/$FLATPAK_ID.png",
     "install -Dm644 ../../net.sonic_pi.SonicPi.desktop -t $FLATPAK_DEST/share/applications"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://github.com/sonic-pi-net/sonic-pi/archive/refs/tags/v5.0.0.zip",
      "sha256": "3b60b70559e46ef6680d8922776b49b04abf767c47d1279cf0edda6bfa8ca284"
     },
     {
      "type": "git",
      "url": "https://github.com/samaaron/supersonic",
      "commit": "2652a28eb6cb51a4fb696fca2f04b3e073bd26c2",
      "dest": "app/external/supersonic"
     },
     {
      "type": "git",
      "url": "https://github.com/Ableton/link.git",
      "tag": "Link-4.0",
      "commit": "e9a2e414d63f55f1aad158370b007a6fbdc1eeb9",
      "dest": "link"
     },
     {
      "type": "inline",
      "dest": "cargo-home",
      "dest-filename": "config.toml",
      "contents": "[source.crates-io]\nreplace-with = \"vendored-sources\"\n\n[source.vendored-sources]\ndirectory = \"/run/build/sonicpi/cargo/vendor\""
     },
     "cargo-sources.json",
     {
      "type": "patch",
      "paths": [
       "patches/sonic-pi-build-fixes.patch"
      ]
     },
     {
      "type": "file",
      "path": "net.sonic_pi.SonicPi.desktop"
     },
     {
      "type": "file",
      "path": "net.sonic_pi.SonicPi.metainfo.xml"
     },
     {
      "type": "shell",
      "commands": [
       "./app/linux-pre-translations.sh",
       "cd link && git apply --ignore-whitespace ../app/external/supersonic/external/link-loopback-mode.patch",
       "cd link && git apply --ignore-whitespace ../app/external/supersonic/external/link-peer-enumeration.patch",
       "cd link && git apply --ignore-whitespace ../app/external/supersonic/external/link-monotonic-commit-timestamp.patch",
       "cd link && git apply --ignore-whitespace ../app/external/supersonic/external/link-linkaudio-teardown-race.patch"
      ]
     }
    ]
   }
  ]
 }
}