id: org.gajim.Gajim.Plugin.omemo
runtime: org.gajim.Gajim
sdk: org.gnome.Sdk//3.36
build-extension: true
separate-locales: false
appstream-compose: false

build-options:
  env:
    PYTHONPATH: /app/plugins/omemo/lib/python3.7/site-packages/

modules:
  - modules/python3-pillow.yaml

  - name: protobuf
    buildsystem: simple
    build-commands:
      - install -d ${FLATPAK_DEST}/lib/python3.7/site-packages/
      - pip3 install --prefix=${FLATPAK_DEST} protobuf-3.12.2-py2.py3-none-any.whl
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/47/90/27eac528bb6871336e86ed8bcbb72a9b412a4020bf69bb7be71d40e5eab0/protobuf-3.12.2-py2.py3-none-any.whl
        sha256: a96f8fc625e9ff568838e556f6f6ae8eca8b4837cdfb3f90efcb7c00e342a2eb

  - name: python3-axolotl-curve25519
    buildsystem: simple
    build-commands:
      - install -d ${FLATPAK_DEST}/lib/python3.7/site-packages/
      - pip3 install --prefix=${FLATPAK_DEST} .
    sources:
      - type: archive
        url: https://files.pythonhosted.org/packages/59/ca/c8111718bcc8da18e9b9868e784293232a58c57159a5ea18f00ee967258f/python-axolotl-curve25519-0.4.1.post2.tar.gz
        sha256: 0705a66297ebd2f508a60dc94e22881c754301eb81db93963322f6b3bdcb63a3

  - name: python3-axolotl
    buildsystem: simple
    build-commands:
      - install -d ${FLATPAK_DEST}/lib/python3.7/site-packages/
      - pip3 install --prefix=${FLATPAK_DEST} python_axolotl-0.2.3-py3-none-any.whl
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/0f/b3/4a0b0e664435691bba36fac6e366cece506d002294c293bd3dcb40c2b2ba/python_axolotl-0.2.3-py3-none-any.whl
        sha256: 6a22acbf646c3b736ea1a4663ab5c52687fce6612e92ae6a7fe63803c212fb9e

  - name: python3-qrcode
    buildsystem: simple
    build-commands:
      - install -d ${FLATPAK_DEST}/lib/python3.7/site-packages/
      - pip3 install --prefix=${FLATPAK_DEST} qrcode-6.1-py2.py3-none-any.whl
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/42/87/4a3a77e59ab7493d64da1f69bf1c2e899a4cf81e51b2baa855e8cc8115be/qrcode-6.1-py2.py3-none-any.whl
        sha256: 3996ee560fc39532910603704c82980ff6d4d5d629f9c3f25f34174ce8606cf5

  - name: gajim-omemo
    buildsystem: simple
    build-commands:
      - 'cp -R -t ${FLATPAK_DEST} *'
    post-install:
      - install -Dm644 --target-directory=${FLATPAK_DEST}/share/metainfo org.gajim.Gajim.Plugin.omemo.metainfo.xml
      - appstream-compose --basename=org.gajim.Gajim.Plugin.omemo --prefix=${FLATPAK_DEST} --origin=flatpak org.gajim.Gajim.Plugin.omemo
    sources:
      - type: archive
        url: https://ftp.gajim.org/plugins_releases/omemo_2.6.79.zip
        sha256: 98912d328e3d7338149a45e53365b898400b7aecdb4ee85ef18e24c38064d611
