app-id: io.github.whelanh.scidCommunity
runtime: org.freedesktop.Platform
runtime-version: '25.08'
sdk: org.freedesktop.Sdk
command: scidCommunity

finish-args:
  - --filesystem=xdg-documents  # access Documents folder for chess databases
  - --persist=.scidCommunity    # persistent app data
  - --share=network             # access the network
  - --socket=x11             # show windows with x11
  - --share=ipc              # share IPC namespace with the host (necessary for X11)
  - --device=dri             # OpenGL rendering
  - --socket=pulseaudio      # play sound with PulseAudio

modules:
  - name: tcl # latest stable tcl, required for scid
    sources:
      - type: archive
        url: https://prdownloads.sourceforge.net/tcl/tcl-core8.6.15-src.tar.gz
        sha256: 844775491e435e34d83d6ccfbadd1342f1855f1705253233a86152df0765e78d
    subdir: "unix"
    post-install:
      - chmod 755 /app/lib/libtcl*.so

  - name: tk # latest stable tk, required for scid
    sources:
      - type: archive
        url: https://prdownloads.sourceforge.net/tcl/tk8.6.15-src.tar.gz
        sha256: 550969f35379f952b3020f3ab7b9dd5bfd11c1ef7c9b7c6a75f5c49aca793fec
    subdir: "unix"
    post-install:
      - chmod 755 /app/lib/libtk*.so

  - name: scid # main app
    buildsystem: cmake-ninja
    build-options:
      env:
        CFLAGS: -ffile-prefix-map=../=.
        CXXFLAGS: -ffile-prefix-map=../=.
    sources:
      - type: git
        url: https://github.com/whelanh/scidCommunity.git
        commit: d17b11e9b0f76890900b54ffea7a48879880626f
