id: io.github.galister.wlx-overlay-s
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.rust-stable
  - org.freedesktop.Sdk.Extension.llvm19
command: wlx-overlay-s

build-options:
  append-path: /usr/lib/sdk/rust-stable/bin:/usr/lib/sdk/llvm19/bin
  append-ld-library-path: /usr/lib/sdk/llvm19/lib

finish-args:
  # PipeWire & Notifications
  - --socket=session-bus
  # uinput requires device=all
  - --device=all
  # X11 + XShm access
  - --share=ipc
  - --socket=fallback-x11
  # Wayland access
  - --socket=wayland
  # Pipewire
  - --filesystem=xdg-run/pipewire-0
  # Get the active OpenXR runtime
  - --filesystem=xdg-config/openxr:ro
  # WiVRn and Monado install locations
  - --filesystem=/opt/wivrn:ro
  - --filesystem=/opt/monado:ro
  - --filesystem=/usr/lib/monado:ro
  - --filesystem=/usr/lib64/monado:ro
  - --filesystem=/usr/lib/wivrn:ro
  - --filesystem=/usr/lib64/wivrn:ro
  - --filesystem=/var/lib/flatpak/app/io.github.wivrn.wivrn:ro
  - --filesystem=~/.var/app/io.github.wivrn.wivrn:ro
  - --filesystem=xdg-data/envision/prefixes:ro
  # Access WiVRn/Monado sockets
  - --filesystem=xdg-run/wivrn:ro
  - --filesystem=xdg-run/monado_comp_ipc:ro
  - --filesystem=/tmp/wlx.log:create

cleanup:
  - /lib/pkgconfig
  - /share/pkgconfig
  - /include
  - /share/man
  - '*.a'

modules:
  # wayvr goes here
  - name: wlx-overlay-s
    buildsystem: simple
    build-options:
      env:
        CARGO_HOME: /run/build/wlx-overlay-s/cargo
    build-commands:
      - cargo --offline fetch --manifest-path Cargo.toml --verbose
      - cargo --offline build --release --no-default-features --features=openxr,x11,wayland --verbose
      - install -Dm755 ./target/release/wlx-overlay-s -t /app/bin/
    sources:
      - type: dir
        path: ..
      - sources-wlx-overlay-s.json

