app-id: org.flamerobin.FlameRobin
runtime: org.freedesktop.Platform
runtime-version: '24.08'
sdk: org.freedesktop.Sdk
command: flamerobin

finish-args:
  - --share=ipc
  - --socket=fallback-x11
  - --socket=wayland
  - --device=dri
  - --filesystem=home
  - --share=network

modules:
  - name: libtommath
    buildsystem: cmake-ninja
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DBUILD_SHARED_LIBS=ON
    sources:
      - type: archive
        url: https://github.com/libtom/libtommath/releases/download/v1.3.0/ltm-1.3.0.tar.xz
        sha256: 296272d93435991308eb73607600c034b558807a07e829e751142e65ccfa9d08

  - name: firebird-client
    buildsystem: simple
    build-commands:
      # The outer tarball contains buildroot.tar.gz (after strip-components: 1).
      # Extract the Firebird client libraries from the inner buildroot.tar.gz.
      - tar -xzf buildroot.tar.gz ./opt/firebird/lib/libfbclient.so.5.0.3 ./opt/firebird/lib/libib_util.so ./opt/firebird/lib/libtomcrypt.so.1.0.1
      - install -Dm755 opt/firebird/lib/libfbclient.so.5.0.3 /app/lib/libfbclient.so.5.0.3
      - ln -sf libfbclient.so.5.0.3 /app/lib/libfbclient.so.2
      - ln -sf libfbclient.so.2 /app/lib/libfbclient.so
      - install -Dm755 opt/firebird/lib/libib_util.so /app/lib/libib_util.so
      - install -Dm755 opt/firebird/lib/libtomcrypt.so.1.0.1 /app/lib/libtomcrypt.so.1.0.1
      - ln -sf libtomcrypt.so.1.0.1 /app/lib/libtomcrypt.so.1
      - ln -sf libtomcrypt.so.1 /app/lib/libtomcrypt.so
    sources:
      - type: archive
        # This tarball contains buildroot.tar.gz; strip-components: 1 places it at the root.
        url: https://github.com/FirebirdSQL/firebird/releases/download/v5.0.3/Firebird-5.0.3.1683-0-linux-x64.tar.gz
        sha256: ef281c53f85756288151a86831375c9ae668caaeccd1b18103d523ba8f444779
        strip-components: 1

  - name: wxWidgets
    buildsystem: cmake-ninja
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
      - -DwxBUILD_SHARED=OFF
    sources:
      - type: archive
        url: https://github.com/wxWidgets/wxWidgets/releases/download/v3.2.6/wxWidgets-3.2.6.tar.bz2
        sha256: 939e5b77ddc5b6092d1d7d29491fe67010a2433cf9b9c0d841ee4d04acb9dce7

  - name: flamerobin
    buildsystem: cmake-ninja
    builddir: true
    config-opts:
      - -DCMAKE_BUILD_TYPE=Release
    sources:
      - type: dir
        path: ..
