app-id: net.zdechov.app.Tunneler
runtime: org.kde.Platform
runtime-version: '5.15-24.08'
sdk: org.kde.Sdk
sdk-extensions:
  - org.freedesktop.Sdk.Extension.freepascal
command: Tunneler
rename-icon: Tunneler
rename-desktop-file: tuneller.desktop
finish-args:
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --socket=pulseaudio
  - --filesystem=home
  - --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: Tunneler
    sources:
      - type: svn
        url: https://svn.zdechov.net/Tunneler/trunk
        revision: r109
    buildsystem: simple
    build-commands:
      - |
        . /usr/lib/sdk/freepascal/enable.sh
        lazbuild --build-mode=Release --ws=qt5 tunneler.lpi
      - install -Dm755 Tunneler -t $FLATPAK_DEST/bin
      - install -Dm644 Install/common/Tunneler.desktop -t $FLATPAK_DEST/share/applications
      - install -Dm644 Images/256x256/Tunneler.png -t $FLATPAK_DEST/share/icons/hicolor/256x256/apps
      - install -Dm644 Languages/*.po -t $FLATPAK_DEST/share/Tunneler/Languages
      - install -Dm644 Packages/Common/Languages/*.po -t $FLATPAK_DEST/share/Tunneler/Languages
      - install -Dm644 Audio/*.wav -t $FLATPAK_DEST/share/Tunneler/Audio
      - install -Dm644 Install/flatpak/${FLATPAK_ID}.metainfo.xml -t $FLATPAK_DEST/share/metainfo
