Help with recipe for Kodi 17 (pkg2appimage)

I need to use kodi in different versions to test addons.
I’m using kodi_17.6 + dfsg1-1ubuntu1_amd64.deb
http://archive.ubuntu.com/ubuntu/pool/universe/k/kodi/kodi_17.6+dfsg1-1ubuntu1_amd64.deb

and pkg2appimage with this recipe kodi.yml:
./pkg2appimage-continuous-x86_64.AppImage recipes/kodi.yml

app: Kodi
binpatch: true

ingredients:
  dist: trusty
  sources:
    - deb http://security.ubuntu.com/ubuntu/ trusty main universe
    - deb http://archive.ubuntu.com/ubuntu/ trusty main universe
  ppas:
    - team-xbmc/kodi-old

script:
  - cat > ./usr/bin/kodi <<\EOF
  - #!/bin/bash
  - SCRIPT_PATH="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null && pwd )"
  - export XBMC_HOME=${SCRIPT_PATH}/../share/kodi
  - exec ${SCRIPT_PATH}/../lib/x86_64-linux-gnu/kodi/kodi.bin "$@"
  - EOF
  - chmod +x ./usr/bin/kodi
  - mv ./usr/lib/x86_64-linux-gnu/samba/* ./usr/lib/x86_64-linux-gnu/

When running AppRun via terminal these errors appear:

leonardo@Mint-PC:~/.AppDir$ ./AppRun
ImportError: No module named site
Segmentation fault (core dumped)
Aborted (core dumped)
find: ‘/home/leonardo/.dbus’: Permission denied
Aborted (core dumped)
find: ‘/home/leonardo/.cache/doc’: Permission denied
find: ‘/home/leonardo/.cache/dconf’: Permission denied
Aborted (core dumped)
find: ‘/home/leonardo/.gvfs’: Permission denied
Aborted (core dumped)
Aborted (core dumped)
Crash report available at /home/leonardo/kodi_crashlog-20190315_165341.log

Would anyone know how to fix this?

Python is not correctly bundled. The recipe may need some (trial end error) work.