version: 1

project:
  name: de.volle_kraft_voraus.kraft.desktop
  version_command: git describe --tags

build:
  cmake:

scripts:
  post_build:
    # make sure weasyprint can be launched from a path next to the kraft binary
    # this simplifies the lookup greatly
    # also, if we create the file now (i.e., before linuxdeploy runs), it won't be overwritten by the python plugin
    - |
      cat > "$BUILD_DIR"/AppDir/usr/bin/weasyprint <<\EOF
      #! /bin/bash
      set -eo pipefail
      own_path="$(dirname "$(readlink -f "$0")")"
      exec "$own_path"/../conda/bin/python -m weasyprint "$@"
      EOF
      chmod +x "$BUILD_DIR"/AppDir/usr/bin/weasyprint

appimage:
  linuxdeploy:
    plugins:
      - qt
      - conda
      - https://github.com/linuxdeploy/misc-plugins/raw/master/grantlee5/linuxdeploy-plugin-grantlee5.sh 
    environment:
      UPD_INFO: "gh-releases-zsync|dragotin|kraft|latest|Kraft-*x86_64.AppImage.zsync"
      PIP_REQUIREMENTS: "weasyprint reportlab pypdf2"
      GRANTLEE5_PLUGINS_DIR: "/usr/lib64/grantlee/5.2/"

