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

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

modules:
  - name: python3-pygments
    buildsystem: simple
    build-commands:
      - install -d ${FLATPAK_DEST}/lib/python3.7/site-packages/
      - pip3 install --prefix=${FLATPAK_DEST} --ignore-installed Pygments-2.6.1-py3-none-any.whl
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/2d/68/106af3ae51daf807e9cdcba6a90e518954eb8b70341cee52995540a53ead/Pygments-2.6.1-py3-none-any.whl
        sha256: ff7a40b4860b727ab48fad6360eb351cc1b33cbf9b15a0f689ca5353e9463324

  - name: gajim-syntax_highlight
    buildsystem: simple
    build-commands:
      - 'cp -R -t ${FLATPAK_DEST} *'
    post-install:
      - install -Dm644 --target-directory=${FLATPAK_DEST}/share/metainfo org.gajim.Gajim.Plugin.syntax_highlight.metainfo.xml
      - appstream-compose --basename=org.gajim.Gajim.Devel.Plugin.syntax_highlight --prefix=${FLATPAK_DEST} --origin=flatpak org.gajim.Gajim.Plugin.syntax_highlight
    sources:
      - type: archive
        url: https://ftp.gajim.org/plugins_releases/syntax_highlight_1.2.5.zip
        sha256: cae16ea749ac3a12341591078c1eb4b6fc6e7dc8123c0964a77adba8285d68dc
      - type: file
        path: ../syntax_highlight/org.gajim.Gajim.Plugin.syntax_highlight.metainfo.xml
        sha256: 46bff3ab0a5d97a252652b5d2224e973f4f9e5bdffb9a7a9196b07fca0255957
      - type: shell
        commands:
          - sed -i "s+org.gajim.Gajim+org.gajim.Gajim.Devel+" org.gajim.Gajim.Plugin.*.metainfo.xml
