{
 "app_id": "org.metamuffin.hurrycurry.client",
 "source_url": "https://raw.githubusercontent.com/flathub/org.metamuffin.hurrycurry.client/master/org.metamuffin.hurrycurry.client.yaml",
 "runtime": "org.freedesktop.Platform",
 "runtime_version": "25.08",
 "sdk": "org.freedesktop.Sdk",
 "finish_args": [
  "--share=network",
  "--share=ipc",
  "--socket=x11",
  "--socket=wayland",
  "--socket=pulseaudio",
  "--socket=fallback-x11",
  "--device=all"
 ],
 "module_count": 6,
 "fetched_at": "2026-09-17T16:16:05.499498+00:00",
 "manifest": {
  "app-id": "org.metamuffin.hurrycurry.client",
  "runtime": "org.freedesktop.Platform",
  "runtime-version": "25.08",
  "sdk": "org.freedesktop.Sdk",
  "sdk-extensions": [
   "org.freedesktop.Sdk.Extension.node20",
   "org.freedesktop.Sdk.Extension.rust-stable"
  ],
  "command": "hurrycurry-client",
  "finish-args": [
   "--share=ipc",
   "--socket=wayland",
   "--socket=fallback-x11",
   "--socket=pulseaudio",
   "--device=all",
   "--share=network"
  ],
  "build-options": {
   "arch": {
    "x86_64": {
     "env": {
      "SCONS_FLAGS_EXTRA": "use_lto=yes"
     }
    }
   },
   "env": {
    "BUILD_NAME": "hurrycurry"
   }
  },
  "modules": [
   "shared-modules/glu/glu-9.json",
   {
    "name": "hurrycurry-misc",
    "buildsystem": "simple",
    "sources": [
     {
      "type": "script",
      "dest-filename": "wrapper",
      "commands": [
       "exec /app/bin/godot --main-pack /app/share/hurrycurry/client.pck $@"
      ]
     },
     {
      "type": "archive",
      "sha256": "8636475664ca8cf346567189ce9e27b5c58b06d531df5de613d79f086bf64317",
      "url": "https://codeberg.org/hurrycurry/hurrycurry/archive/v3.1.1-1.tar.gz"
     }
    ],
    "build-commands": [
     "make misc/hurrycurry.desktop misc/hurrycurry.metainfo.xml",
     "sed -i \"s/^Icon=.*/Icon=org.metamuffin.hurrycurry.client/\" misc/hurrycurry.desktop",
     "sed -i \"s/^Exec=hurrycurry/Exec=hurrycurry-client/\" misc/hurrycurry.desktop",
     "install -Dm644 misc/hurrycurry.desktop /app/share/applications/org.metamuffin.hurrycurry.client.desktop",
     "install -Dm644 misc/hurrycurry.metainfo.xml /app/share/metainfo/org.metamuffin.hurrycurry.client.metainfo.xml",
     "install -Dm755 wrapper /app/bin/hurrycurry-client",
     "for size in {32,64,128,256,512}; do\n  ffmpeg -hide_banner -loglevel warning -i client/icons/main.png -vf scale=${size}:${size} -frames:v 1 -update 1 \"$size.png\"\n  install -Dm644 \"$size.png\" \"/app/share/icons/hicolor/${size}x${size}/apps/org.metamuffin.hurrycurry.client.png\"\ndone\n"
    ]
   },
   {
    "name": "hurrycurry-server",
    "buildsystem": "simple",
    "build-options": {
     "append-path": "/usr/lib/sdk/node20/bin:/usr/lib/sdk/rust-stable/bin",
     "env": {
      "HURRYCURRY_DATA_PATH": "/app/share/hurrycurry/data",
      "HURRYCURRY_DISTRIBUTION": "flatpak"
     }
    },
    "sources": [
     {
      "type": "archive",
      "sha256": "8636475664ca8cf346567189ce9e27b5c58b06d531df5de613d79f086bf64317",
      "url": "https://codeberg.org/hurrycurry/hurrycurry/archive/v3.1.1-1.tar.gz"
     },
     "generated-sources.json"
    ],
    "build-commands": [
     "make all_data JSR=node",
     "mkdir -p .cargo && cp cargo/config .cargo/config.toml",
     "cargo --offline fetch --manifest-path Cargo.toml",
     "cargo build --frozen --release --bin hurrycurry-server",
     "cargo build --frozen --release --bin hurrycurry-discover",
     "install -Dm755 target/release/hurrycurry-server /app/bin/hurrycurry-server",
     "install -Dm755 target/release/hurrycurry-discover /app/bin/hurrycurry-discover",
     "install -Dm644 -t /app/share/hurrycurry/data data/{tiles,palettes,index}.yaml",
     "install -Dm644 -t /app/share/hurrycurry/data/recipes data/recipes/*.yaml",
     "install -Dm644 -t /app/share/hurrycurry/data/maps data/maps/*.yaml"
    ]
   },
   {
    "name": "scons",
    "buildsystem": "simple",
    "cleanup": [
     "*"
    ],
    "sources": [
     {
      "type": "archive",
      "sha256": "e2d78aa56e4646e5dbaf50c0758c6d1e4b0418464d8d6d07a09beb6cf257538f",
      "url": "https://downloads.sourceforge.net/project/scons/scons/4.9.1/SCons-4.9.1.tar.gz"
     }
    ],
    "build-commands": [
     "python3 -m pip install --no-index --no-build-isolation --prefix=/app ."
    ]
   },
   {
    "name": "godot",
    "buildsystem": "simple",
    "sources": [
     {
      "type": "archive",
      "sha256": "3465f34ae41cb7d7c17b0516c7cce93cc8a7a4d62331456b7b18e4e1d1b064c2",
      "url": "https://github.com/godotengine/godot/releases/download/4.6.2-stable/godot-4.6.2-stable.tar.xz"
     },
     {
      "type": "file",
      "path": "custom.py"
     }
    ],
    "build-commands": [
     "python3 /app/bin/scons $SCONS_FLAGS_EXTRA profile=custom.py target=editor -j \"$FLATPAK_BUILDER_N_JOBS\"",
     "python3 /app/bin/scons $SCONS_FLAGS_EXTRA profile=custom.py target=template_release -j \"$FLATPAK_BUILDER_N_JOBS\"",
     "install -Dm755 bin/godot.linuxbsd.template_release.* /app/bin/godot",
     "install -Dm755 bin/godot.linuxbsd.editor.* /app/bin/godot-editor"
    ]
   },
   {
    "name": "hurrycurry-client",
    "buildsystem": "simple",
    "sources": [
     {
      "type": "archive",
      "sha256": "8636475664ca8cf346567189ce9e27b5c58b06d531df5de613d79f086bf64317",
      "url": "https://codeberg.org/hurrycurry/hurrycurry/archive/v3.1.1-1.tar.gz"
     }
    ],
    "build-commands": [
     "sed -i \"s/^const DISTRIBUTION := .*/const DISTRIBUTION := \\\"flatpak\\\"/\" client/global.gd",
     "godot-editor --headless --export-pack wasm32-unknown-unknown /app/share/hurrycurry/client.pck client/project.godot",
     "rm /app/bin/godot-editor"
    ]
   }
  ]
 }
}