{
 "app_id": "com.heroicgameslauncher.hgl",
 "source_url": "https://raw.githubusercontent.com/flathub/com.heroicgameslauncher.hgl/master/com.heroicgameslauncher.hgl.yml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=ipc",
  "--share=network",
  "--socket=pulseaudio",
  "--socket=wayland",
  "--socket=x11",
  "--device=all",
  "--filesystem=/run/media",
  "--filesystem=~/.local/share/applications",
  "--filesystem=/run/udev:ro",
  "--filesystem=xdg-run/gamescope-0",
  "--filesystem=~/.local/share/lutris",
  "--filesystem=~/.steam/steam",
  "--filesystem=/mnt",
  "--filesystem=~/Games/Heroic:create",
  "--filesystem=xdg-documents",
  "--filesystem=/media",
  "--filesystem=~/.var/app/com.valvesoftware.Steam",
  "--filesystem=xdg-desktop",
  "--filesystem=xdg-config/MangoHud:ro",
  "--filesystem=xdg-run/app/com.discordapp.Discord:create",
  "--filesystem=xdg-data/umu:create",
  "--filesystem=~/.steam",
  "--allow=bluetooth",
  "--allow=devel",
  "--allow=multiarch",
  "--allow=per-app-dev-shm",
  "--talk-name=org.kde.StatusNotifierWatcher",
  "--talk-name=org.freedesktop.Notifications",
  "--talk-name=org.freedesktop.ScreenSaver",
  "--talk-name=org.gnome.SettingsDaemon.MediaKeys",
  "--talk-name=org.freedesktop.PowerManagement",
  "--talk-name=com.canonical.Unity",
  "--system-talk-name=org.freedesktop.UPower",
  "--system-talk-name=org.freedesktop.UDisks2",
  "--unset-env=ALSA_CONFIG_PATH",
  "--unset-env=TZ",
  "--unset-env=STEAM_RUNTIME_PREFER_HOST_LIBRARIES",
  "--unset-env=STEAM_RUNTIME",
  "--unset-env=SDL_VIDEODRIVER",
  "--unset-env=MESA_GLSL_CACHE_DIR"
 ],
 "module_count": 10,
 "fetched_at": "2026-09-17T16:08:01.346109+00:00",
 "manifest": {
  "id": "com.heroicgameslauncher.hgl",
  "sdk": "org.freedesktop.Sdk",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "base": "org.electronjs.Electron2.BaseApp",
  "base-version": "25.08",
  "command": "heroic-run",
  "separate-locales": false,
  "cleanup": [
   "/share/docs",
   "/share/man"
  ],
  "sdk-extensions": [
   "org.freedesktop.Sdk.Compat.i386",
   "org.freedesktop.Sdk.Extension.toolchain-i386"
  ],
  "finish-args": [
   "--allow=devel",
   "--allow=multiarch",
   "--allow=bluetooth",
   "--allow=per-app-dev-shm",
   "--device=all",
   "--env=PATH=/app/bin:/usr/bin:/usr/lib/extensions/vulkan/MangoHud/bin:/usr/lib/extensions/vulkan/gamescope/bin:/usr/lib/extensions/vulkan/OBSVkCapture/bin:/app/bin/heroic/resources/app.asar.unpacked/build/bin/linux",
   "--env=LD_LIBRARY_PATH=/usr/lib/extensions/vulkan/gamescope/lib",
   "--filesystem=~/.local/share/lutris:rw",
   "--filesystem=~/.steam/steam:rw",
   "--filesystem=~/.local/share/applications:rw",
   "--filesystem=~/.steam:rw",
   "--filesystem=~/Games/Heroic:create",
   "--filesystem=~/.var/app/com.valvesoftware.Steam:rw",
   "--filesystem=xdg-documents",
   "--filesystem=xdg-desktop",
   "--filesystem=xdg-run/gamescope-0:rw",
   "--filesystem=/run/media",
   "--filesystem=/mnt",
   "--filesystem=/media",
   "--filesystem=/run/udev:ro",
   "--filesystem=xdg-run/app/com.discordapp.Discord:create",
   "--filesystem=xdg-data/umu:create",
   "--filesystem=xdg-config/MangoHud:ro",
   "--persist=.",
   "--share=ipc",
   "--share=network",
   "--socket=x11",
   "--socket=wayland",
   "--socket=pulseaudio",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--talk-name=com.canonical.Unity",
   "--talk-name=org.freedesktop.ScreenSaver",
   "--system-talk-name=org.freedesktop.UDisks2",
   "--talk-name=org.gnome.SettingsDaemon.MediaKeys",
   "--system-talk-name=org.freedesktop.UDisks2",
   "--talk-name=org.kde.StatusNotifierWatcher",
   "--system-talk-name=org.freedesktop.UPower",
   "--talk-name=org.freedesktop.PowerManagement",
   "--talk-name=org.freedesktop.Notifications",
   "--env=TZ=",
   "--unset-env=TZ",
   "--env=LC_ADDRESS=C",
   "--env=LC_COLLATE=C",
   "--env=LC_MONETARY=C",
   "--env=LC_MEASUREMENT=C",
   "--env=LC_NAME=C",
   "--env=LC_NUMERIC=C",
   "--env=LC_TELEPHONE=C",
   "--env=ALSA_CONFIG_PATH=",
   "--unset-env=ALSA_CONFIG_PATH",
   "--env=MESA_GLSL_CACHE_DIR=",
   "--unset-env=MESA_GLSL_CACHE_DIR",
   "--env=STEAM_RUNTIME_PREFER_HOST_LIBRARIES=",
   "--unset-env=STEAM_RUNTIME_PREFER_HOST_LIBRARIES",
   "--env=STEAM_RUNTIME=",
   "--unset-env=STEAM_RUNTIME",
   "--env=SDL_VIDEODRIVER=",
   "--unset-env=SDL_VIDEODRIVER",
   "--env=DBUS_FATAL_WARNINGS=0",
   "--env=PROTON_DEBUG_DIR=/var/tmp",
   "--env=XDG_CONFIG_DIRS=/etc/xdg:/usr/lib/x86_64-linux-gnu/GL:/usr/lib/i386-linux-gnu/GL",
   "--env=XDG_DATA_DIRS=/app/share:/usr/lib/extensions/vulkan/share:/usr/share:/usr/share/runtime/share:/run/host/user-share:/run/host/share:/usr/lib/pressure-vessel/overrides/share",
   "--env=GST_PLUGIN_SYSTEM_PATH=/app/lib/gstreamer-1.0:/app/lib32/gstreamer-1.0:/usr/lib/extensions/gstreamer-1.0:/usr/lib/x86_64-linux-gnu/gstreamer-1.0:/usr/lib/i386-linux-gnu/gstreamer-1.0"
  ],
  "add-extensions": {
   "org.freedesktop.Platform.Compat.i386": {
    "directory": "lib/i386-linux-gnu",
    "version": "25.08"
   },
   "org.freedesktop.Platform.Compat.i386.Debug": {
    "directory": "lib/debug/lib/i386-linux-gnu",
    "version": "25.08",
    "no-autodownload": true
   },
   "org.freedesktop.Platform.GL32": {
    "directory": "lib/i386-linux-gnu/GL",
    "version": "1.4",
    "versions": "25.08;1.4",
    "subdirectories": true,
    "no-autodownload": true,
    "autodelete": false,
    "add-ld-path": "lib",
    "merge-dirs": "vulkan/icd.d;glvnd/egl_vendor.d;OpenCL/vendors;lib/dri;lib/d3d;vulkan/explicit_layer.d;vulkan/implicit_layer.d",
    "download-if": "active-gl-driver",
    "enable-if": "active-gl-driver",
    "autoprune-unless": "active-gl-driver"
   },
   "org.freedesktop.Platform.VAAPI.Intel.i386": {
    "directory": "lib/i386-linux-gnu/dri/intel-vaapi-driver",
    "version": "25.08",
    "versions": "25.08",
    "autodelete": false,
    "no-autodownload": true,
    "add-ld-path": "lib",
    "download-if": "have-intel-gpu",
    "autoprune-unless": "have-intel-gpu"
   }
  },
  "modules": [
   {
    "name": "vulkan-tools",
    "buildsystem": "cmake-ninja",
    "config-opts": [
     "-DVULKAN_HEADERS_INSTALL_DIR=/usr",
     "-DCMAKE_BUILD_TYPE=Release"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/KhronosGroup/Vulkan-Tools.git",
      "tag": "v1.4.362",
      "commit": "532e2c0e1bce627c5188ed2c90819af2f52a12e1",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      }
     }
    ],
    "modules": [
     {
      "name": "vulkan-headers",
      "buildsystem": "cmake-ninja",
      "sources": [
       {
        "type": "git",
        "url": "https://github.com/KhronosGroup/Vulkan-Headers.git",
        "tag": "v1.4.362",
        "commit": "ee2ec5fd83dafce291024683b50dc89219333076",
        "x-checker-data": {
         "type": "git",
         "tag-pattern": "^v([\\d.]+)$"
        }
       }
      ]
     }
    ]
   },
   {
    "name": "rsync",
    "config-opts": [
     "--prefix=${FLATPAK_DEST}",
     "--with-included-popt",
     "--with-included-zlib",
     "--host=x86",
     "--disable-xxhash",
     "--disable-md2man"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/RsyncProject/rsync.git",
      "tag": "v3.5.0",
      "commit": "471e17dc0d68233db84db11be82c9f62f4661214",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "heroic",
    "buildsystem": "simple",
    "build-commands": [
     "chmod +x Heroic-*.AppImage",
     "./Heroic-*.AppImage --appimage-extract",
     "mv squashfs-root /app/bin/heroic",
     "install -D heroic-run -t /app/bin",
     "patch-electron-desktop-filename ${FLATPAK_DEST}/bin/heroic/resources/app.asar"
    ],
    "sources": [
     {
      "type": "script",
      "dest-filename": "heroic-run",
      "commands": [
       "for i in {0..9}; do",
       "test -S $XDG_RUNTIME_DIR/discord-ipc-$i || ln -sf {app/com.discordapp.Discord,$XDG_RUNTIME_DIR}/discord-ipc-$i;",
       "done",
       "export TMPDIR=\"$XDG_RUNTIME_DIR/app/$FLATPAK_ID\"",
       "zypak-wrapper /app/bin/heroic/heroic \"$@\""
      ]
     },
     {
      "type": "file",
      "url": "https://github.com/Heroic-Games-Launcher/HeroicGamesLauncher/releases/download/v2.22.3/Heroic-2.22.3-linux-x86_64.AppImage",
      "sha512": "a4c0e71425cd4504be2c916f5590f1f2e84e1d39ba2935b7076c00ce3da622650cd223bd2c55fefb5a1f9ad1e59c2cff41db22672fee8c4c2ae1a0760025e534"
     }
    ]
   },
   {
    "name": "platform-bootstrap",
    "buildsystem": "simple",
    "build-commands": [
     "set -e\nmkdir -p /app/bin\nmkdir -p /app/lib/i386-linux-gnu\nmkdir -p /app/lib/debug/lib/i386-linux-gnu\nmkdir -p /app/lib/i386-linux-gnu/GL\nmkdir -p /app/lib/i386-linux-gnu/dri/intel-vaapi-driver\ninstall -Dm644 com.heroicgameslauncher.hgl.png /app/share/icons/hicolor/128x128/apps/com.heroicgameslauncher.hgl.png\ninstall -Dm644 com.heroicgameslauncher.hgl.desktop /app/share/applications/${FLATPAK_ID}.desktop\ninstall -Dm644 -t /app/etc ld.so.conf\ninstall -Dm644 $FLATPAK_ID.metainfo.xml /app/share/metainfo/$FLATPAK_ID.appdata.xml\n"
    ],
    "sources": [
     {
      "type": "inline",
      "dest-filename": "ld.so.conf",
      "contents": "/app/lib32\n/app/lib/i386-linux-gnu\n"
     },
     {
      "type": "file",
      "path": "com.heroicgameslauncher.hgl.metainfo.xml"
     },
     {
      "type": "file",
      "path": "com.heroicgameslauncher.hgl.png"
     },
     {
      "type": "file",
      "path": "com.heroicgameslauncher.hgl.desktop"
     }
    ]
   },
   {
    "name": "7zip",
    "buildsystem": "simple",
    "subdir": "CPP/7zip/Bundles/Alone2",
    "build-commands": [
     "make -j $FLATPAK_BUILDER_N_JOBS -f makefile.gcc",
     "install -Dm755 ./_o/7zz -t /app/bin",
     "ln -s /app/bin/7zz /app/bin/7za",
     "ln -s /app/bin/7zz /app/bin/7z"
    ],
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/ip7z/7zip.git",
      "tag": "26.03",
      "commit": "0766b733fe3e06dd2a7f9a3cfbf2108ac73abd17",
      "x-checker-data": {
       "type": "git"
      }
     }
    ]
   },
   {
    "name": "cabextract",
    "buildsystem": "simple",
    "build-commands": [
     "autoreconf -I /usr/share/gettext/m4 || true",
     "aclocal -I /usr/share/gettext/m4",
     "automake --add-missing",
     "autoreconf -I /usr/share/gettext/m4",
     "./configure --prefix $FLATPAK_DEST",
     "make",
     "make install"
    ],
    "build-options": {
     "strip": true
    },
    "subdir": "cabextract",
    "sources": [
     {
      "type": "git",
      "url": "https://github.com/kyz/libmspack.git",
      "tag": "v1.11",
      "commit": "305907723a4e7ab2018e58040059ffb5e77db837",
      "x-checker-data": {
       "type": "git",
       "tag-pattern": "^v([\\d.]+)$"
      }
     }
    ]
   },
   {
    "name": "unrar",
    "no-autogen": true,
    "build-options": {
     "strip": true
    },
    "make-install-args": [
     "DESTDIR=$(FLATPAK_DEST)"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://www.rarlab.com/rar/unrarsrc-7.3.1.tar.gz",
      "sha256": "634900842a3737d9cc15bbcc71d4c74cc713437e0bca296a573424fe5f2660ab",
      "x-checker-data": {
       "type": "anitya",
       "project-id": 13306,
       "url-template": "https://www.rarlab.com/rar/unrarsrc-$version.tar.gz"
      }
     }
    ]
   },
   {
    "name": "timidity",
    "buildsystem": "autotools",
    "build-options": {
     "cflags": "-Wno-error=incompatible-pointer-types -Wno-error=implicit-function-declaration"
    },
    "config-opts": [
     "--enable-alsa",
     "--enable-alsaseq",
     "--enable-audio=alsa,pulse",
     "--enable-interface=server,alsaseq"
    ],
    "cleanup": [
     "*.la",
     "*.a",
     "/include",
     "/lib/pkgconfig",
     "/share/man",
     "/share/doc"
    ],
    "sources": [
     {
      "type": "archive",
      "url": "https://sourceforge.net/projects/timidity/files/TiMidity++/TiMidity++-2.15.0/TiMidity++-2.15.0.tar.bz2",
      "sha256": "161fc0395af16b51f7117ad007c3e434c825a308fa29ad44b626ee8f9bb1c8f5"
     },
     {
      "type": "shell",
      "commands": [
       "sed -i '/int line_fold();/d' utils/nkflib.c"
      ]
     },
     {
      "type": "inline",
      "dest-filename": "custom-timidity.cfg",
      "contents": "dir /app/share/soundfonts\nsource /app/share/soundfonts/fluid3gm.cfg\nopt EFresamp=d\nopt EFvlpf=d\nopt EFreverb=d\n"
     },
     {
      "type": "patch",
      "path": "patches/0001-timidity-fix-missing-includes.patch"
     },
     {
      "type": "inline",
      "dest-filename": "heroic-midi-wrapper",
      "contents": "#!/bin/bash\n\ndetect_midi_game() {\n  local game_dir=\"$1\"\n  if [[ ! -d \"$game_dir\" ]]; then return 1; fi\n  if find \"$game_dir\" -iname \"*.mid\" -o -iname \"*.midi\" | grep -q .; then\n    echo \"Found MIDI files in game directory\"\n    return 0\n  fi\n  if find \"$game_dir\" -name \"*.cfg\" -o -name \"*.conf\" -o -name \"*.ini\" | \\\n    xargs grep -l -i \"midi\\|timidity\\|mpu-401\\|sound.*midi\" 2>/dev/null | grep -q .; then\n    echo \"Found MIDI configuration references\"  \n    return 0\n  fi\n  return 1\n}\n\nstart_timidity() {\n  if ! pgrep -f \"timidity.*-iA\" > /dev/null; then\n    echo \"Auto-starting TiMidity++ for MIDI-enabled game\"\n    /app/bin/timidity -iA &\n    TIMIDITY_PID=$!\n    sleep 2\n    echo \"TiMidity++ ready for MIDI playback\"\n  fi\n}\n\ncleanup() {\n  if [[ -n \"$TIMIDITY_PID\" ]] && kill -0 \"$TIMIDITY_PID\" 2>/dev/null; then\n    echo \"Stopping TiMidity++ (PID: $TIMIDITY_PID)\"\n    kill \"$TIMIDITY_PID\" 2>/dev/null\n  fi\n}\n\ntrap cleanup EXIT INT TERM\n\nif [[ -n \"$STEAM_COMPAT_INSTALL_PATH\" ]]; then\n  if detect_midi_game \"$STEAM_COMPAT_INSTALL_PATH\"; then\n    start_timidity\n  fi\nfi\n\n/usr/bin/gamemoderun \"$@\" &\nGAME_PID=$!\n\nwait $GAME_PID\nGAME_EXIT_CODE=$?\n\ncleanup\nexit $GAME_EXIT_CODE\n"
     }
    ],
    "post-install": [
     "install -d ${FLATPAK_DEST}/share/timidity",
     "install -Dm644 custom-timidity.cfg ${FLATPAK_DEST}/share/timidity/timidity.cfg",
     "install -Dm755 heroic-midi-wrapper ${FLATPAK_DEST}/bin/gamemoderun",
     "install -d ${FLATPAK_DEST}/share/alsa",
     "cp -ar /usr/share/alsa/* ${FLATPAK_DEST}/share/alsa/",
     "install -d ${FLATPAK_DEST}/etc",
     "ln -sf /app/share/alsa/alsa.conf ${FLATPAK_DEST}/etc/asound.conf",
     "install -d ${FLATPAK_DEST}/lib/x86_64-linux-gnu/alsa-lib",
     "cp -a /usr/lib/x86_64-linux-gnu/alsa-lib/*.so ${FLATPAK_DEST}/lib/x86_64-linux-gnu/alsa-lib/",
     "install -d ${FLATPAK_DEST}/lib/i386-linux-gnu/alsa-lib",
     "cp -a /usr/lib/i386-linux-gnu/alsa-lib/*.so ${FLATPAK_DEST}/lib/i386-linux-gnu/alsa-lib/",
     "install -d ${FLATPAK_DEST}/lib/x86_64-linux-gnu",
     "cp -a /usr/lib/x86_64-linux-gnu/libpulse.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "cp -a /usr/lib/x86_64-linux-gnu/libsndfile.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "cp -a /usr/lib/x86_64-linux-gnu/libogg.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "cp -a /usr/lib/x86_64-linux-gnu/libvorbis*.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "cp -a /usr/lib/x86_64-linux-gnu/libFLAC.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "cp -a /usr/lib/x86_64-linux-gnu/libopus.so* ${FLATPAK_DEST}/lib/x86_64-linux-gnu/",
     "install -d ${FLATPAK_DEST}/lib/x86_64-linux-gnu/pulseaudio",
     "cp -a /usr/lib/x86_64-linux-gnu/pulseaudio/libpulsecommon*.so ${FLATPAK_DEST}/lib/x86_64-linux-gnu/pulseaudio/"
    ]
   },
   {
    "name": "fluidr3-soundfont",
    "buildsystem": "simple",
    "build-commands": [
     "tar -xzf fluid-soundfont.tar.gz -C . \"FluidR3 GM2-2.SF2\"",
     "install -d ${FLATPAK_DEST}/share/soundfonts",
     "install -Dm644 \"FluidR3 GM2-2.SF2\" ${FLATPAK_DEST}/share/soundfonts/FluidR3_GM.sf2",
     "echo \"soundfont FluidR3_GM.sf2\" > fluid3gm.cfg",
     "install -Dm644 fluid3gm.cfg ${FLATPAK_DEST}/share/soundfonts/fluid3gm.cfg"
    ],
    "sources": [
     {
      "type": "file",
      "url": "https://ftp.osuosl.org/pub/musescore/soundfont/fluid-soundfont.tar.gz",
      "sha256": "c815769e44d86f1507b946a6c48c997c7f650699aea1ec4b11ba66e3415c26b9"
     }
    ]
   }
  ]
 }
}