{
 "app_id": "com.pocoguy.Muse",
 "source_url": "https://raw.githubusercontent.com/m-obeid/Mixtapes/main/com.pocoguy.Muse.yaml",
 "runtime": "org.gnome.Platform",
 "runtime_version": "50",
 "sdk": "org.gnome.Sdk",
 "finish_args": [
  "--share=ipc",
  "--socket=fallback-x11",
  "--socket=wayland",
  "--socket=pulseaudio",
  "--share=network",
  "--persist=.",
  "--device=dri",
  "--socket=session-bus",
  "--filesystem=xdg-music",
  "--filesystem=xdg-run/app/com.discordapp.Discord",
  "--filesystem=xdg-run/discord-ipc-0"
 ],
 "module_count": 4,
 "fetched_at": "2026-09-20T13:02:50.398885+00:00",
 "manifest": {
  "app-id": "com.pocoguy.Muse",
  "runtime": "org.gnome.Platform",
  "runtime-version": "50",
  "sdk": "org.gnome.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node24"
  ],
  "command": "muse",
  "build-options": {
   "append-path": "/usr/lib/sdk/node24/bin",
   "env": {
    "NODEJS_DIR": "/usr/lib/sdk/node24",
    "FLATPAK_ENABLE_SDK_EXT": "node24"
   },
   "build-args": [
    "--share=network"
   ]
  },
  "finish-args": [
   "--share=ipc",
   "--socket=fallback-x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--share=network",
   "--persist=.",
   "--device=dri",
   "--socket=session-bus",
   "--filesystem=xdg-music",
   "--filesystem=xdg-run/app/com.discordapp.Discord",
   "--filesystem=xdg-run/discord-ipc-0"
  ],
  "modules": [
   {
    "name": "nodejs-runtime",
    "buildsystem": "simple",
    "build-options": {
     "no-debuginfo": true
    },
    "build-commands": [
     "install -Dm755 /usr/lib/sdk/node24/bin/node ${FLATPAK_DEST}/bin/node",
     "cp -ra /usr/lib/sdk/node24/lib ${FLATPAK_DEST}/ || true"
    ],
    "sources": []
   },
   {
    "name": "rustypipe-botguard",
    "buildsystem": "simple",
    "build-options": {
     "no-debuginfo": true
    },
    "build-commands": [
     "set -eu\ncase \"$(uname -m)\" in\n  x86_64)  triple=x86_64-unknown-linux-gnu;  sha=4f2ec561e8f9fadece7deadc6ce0624fbdedd852222c3eb194c22153b1323129 ;;\n  aarch64) triple=aarch64-unknown-linux-gnu; sha=4d038857374a69aea9be8ded981d93a776dc88d4e254f5c6d292746099abf69a ;;\n  *) echo \"rustypipe-botguard: unsupported arch $(uname -m)\" >&2; exit 1 ;;\nesac\ntarball=\"rustypipe-botguard-v0.1.2-${triple}.tar.xz\"\nif [ -f \"$tarball\" ]; then\n  cp \"$tarball\" bg.tar.xz\nelse\n  url=\"https://codeberg.org/ThetaDev/rustypipe-botguard/releases/download/v0.1.2/${tarball}\"\n  if command -v curl >/dev/null 2>&1; then\n    curl -fL --retry 6 --retry-delay 5 --connect-timeout 30 -o bg.tar.xz \"$url\"\n  else\n    wget -t 6 --waitretry=5 --retry-on-http-error=429,500,502,503,504 -O bg.tar.xz \"$url\"\n  fi\nfi\necho \"${sha}  bg.tar.xz\" | sha256sum -c -\ntar -xf bg.tar.xz\ninstall -Dm755 rustypipe-botguard ${FLATPAK_DEST}/bin/rustypipe-botguard\n"
    ],
    "sources": [
     {
      "type": "file",
      "only-arches": [
       "x86_64"
      ],
      "path": "vendor/rustypipe-botguard/rustypipe-botguard-v0.1.2-x86_64-unknown-linux-gnu.tar.xz",
      "sha256": "4f2ec561e8f9fadece7deadc6ce0624fbdedd852222c3eb194c22153b1323129"
     },
     {
      "type": "file",
      "only-arches": [
       "aarch64"
      ],
      "path": "vendor/rustypipe-botguard/rustypipe-botguard-v0.1.2-aarch64-unknown-linux-gnu.tar.xz",
      "sha256": "4d038857374a69aea9be8ded981d93a776dc88d4e254f5c6d292746099abf69a"
     }
    ]
   },
   {
    "name": "python-dependencies",
    "buildsystem": "simple",
    "build-options": {
     "no-debuginfo": true
    },
    "build-commands": [
     "pip3 install --prefix=${FLATPAK_DEST} --no-cache-dir -r requirements.txt",
     "pip3 install --prefix=${FLATPAK_DEST} --no-cache-dir --upgrade \"yt-dlp[default]\"",
     "pip3 install --prefix=${FLATPAK_DEST} --no-cache-dir \"yt-dlp-ejs\""
    ],
    "sources": [
     {
      "type": "file",
      "path": "requirements.txt"
     }
    ]
   },
   {
    "name": "muse",
    "buildsystem": "simple",
    "build-commands": [
     "pip3 install --no-cache-dir --target=nuitka-tools nuitka",
     "glib-compile-resources --sourcedir=. src/muse.gresource.xml --target=src/muse.gresource",
     "set -eu\nroot=\"$PWD\"\ncd src\nPYTHONPATH=\"$root/nuitka-tools:${PYTHONPATH:-}\" \\\npython3 -m nuitka \\\n  --file-reference-choice=runtime \\\n  --include-package=ui \\\n  --include-package=api \\\n  --include-package=player \\\n  --include-module=logger \\\n  --output-filename=muse \\\n  --jobs=\"$(nproc)\" \\\n  --assume-yes-for-downloads \\\n  main.py\n",
     "install -Dm755 src/muse ${FLATPAK_DEST}/lib/muse/src/muse",
     "install -Dm644 src/muse.gresource ${FLATPAK_DEST}/lib/muse/src/muse.gresource",
     "install -Dm644 src/ui/style.css ${FLATPAK_DEST}/lib/muse/src/ui/style.css",
     "cp -r assets ${FLATPAK_DEST}/lib/muse/",
     "install -Dm644 com.pocoguy.Muse.desktop ${FLATPAK_DEST}/share/applications/com.pocoguy.Muse.desktop",
     "install -Dm644 com.pocoguy.Muse.metainfo.xml ${FLATPAK_DEST}/share/metainfo/com.pocoguy.Muse.metainfo.xml",
     "install -Dm644 assets/icons/hicolor/scalable/apps/com.pocoguy.Muse.svg ${FLATPAK_DEST}/share/icons/hicolor/scalable/apps/com.pocoguy.Muse.svg",
     "install -Dm644 assets/icons/hicolor/symbolic/apps/com.pocoguy.Muse-symbolic.svg ${FLATPAK_DEST}/share/icons/hicolor/symbolic/apps/com.pocoguy.Muse-symbolic.svg",
     "install -d ${FLATPAK_DEST}/bin",
     "cat > ${FLATPAK_DEST}/bin/muse << 'EOF'\n#!/bin/sh\nmkdir -p \"${XDG_DATA_HOME:-$HOME/.local/share}/muse\"\ncd \"${XDG_DATA_HOME:-$HOME/.local/share}/muse\"\nexec /app/lib/muse/src/muse \"$@\"\nEOF\n",
     "chmod +x ${FLATPAK_DEST}/bin/muse"
    ],
    "sources": [
     {
      "type": "dir",
      "path": ".",
      "skip": [
       ".venv",
       ".git",
       ".ccache",
       "build-dir",
       ".flatpak-builder",
       "src/main.build"
      ]
     },
     {
      "type": "file",
      "path": "com.pocoguy.Muse.desktop"
     },
     {
      "type": "file",
      "path": "com.pocoguy.Muse.metainfo.xml"
     }
    ]
   }
  ]
 }
}