app-id: net.zdechov.app.xTactics
runtime: org.kde.Platform
runtime-version: '5.15-24.08'
sdk: org.kde.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.freepascal
command: xTactics
rename-icon: xtactics
rename-desktop-file: xtactics.desktop
finish-args:
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --device=dri
modules:
  - name: qt5pas
    buildsystem: qmake
    config-opts:
      - -after
      - target.path=/app/lib
    sources:
      - type: shell
        commands:
          - cp -r /usr/lib/sdk/freepascal/share/lazarus/lcl/interfaces/qt5/cbindings/. .
  - name: xTactics
    sources:
      - type: svn
        url: https://svn.zdechov.net/xtactics/trunk
        revision: r189
    buildsystem: simple
    build-commands:
      - |
        . /usr/lib/sdk/freepascal/enable.sh
        lazbuild --build-mode=Release --ws=qt5 xtactics.lpi
      - install -Dm755 xtactics -t $FLATPAK_DEST/share/xTactics
      - install -d $FLATPAK_DEST/bin
      - ln -s $FLATPAK_DEST/share/xTactics/xtactics $FLATPAK_DEST/bin/xtactics
      - install -Dm644 Install/deb/xtactics.desktop -t $FLATPAK_DEST/share/applications
      - install -Dm644 Images/64x64/xtactics.png  $FLATPAK_DEST/share/icons/hicolor/64x64/apps/xtactics.png
      - install -Dm644 Languages/*.po -t $FLATPAK_DEST/share/xTactics/Languages
      - install -Dm644 Packages/Common/Languages/*.po -t $FLATPAK_DEST/share/xTactics/Languages
      - install -Dm644 Packages/CoolStreaming/Languages/*.po -t $FLATPAK_DEST/share/xTactics/Languages
      - install -Dm644 Install/snap/local/lazpaint.xml $FLATPAK_DEST/share/mime/packages/$FLAPTAK_ID.xml
      - install -Dm644 Install/flatpak/${FLATPAK_ID}.metainfo.xml -t $FLATPAK_DEST/share/metainfo
