Use freedesktop.Sdk instead of freedesktop.Platform for Blender?

Hello,

I would like to change the runtime from org.freedesktop.Platform to org.freedesktop.Sdk for Blender so that pip will be available. The reasoning is for python scriping in Blender. As well as there are some addons that need extra python libs to run (e.g. Sverchok parametric tool). So I would like some opinion on this.

Looking further, this is the work around for now.

flatpak run --command=bash org.blender.Blender
[inside Flatpak sandbox] PYTHONPATH=/app/org.blender.Blender/data/python/lib/python3.11/
[inside Flatpak sandbox] exit
flatpak run org.blender.Blender --python-use-system-env

The reason for the env variable is because blender try to install python libs to /app/blender/4.2/python/lib/python3.11/site-packages/ but it is read-only. Also --python-use-system-env is needed because blender ignore PYTHONPATH variable (see Command Line Arguments - Blender 4.4 Manual)

Here is a bug report Cannot install Python packages due to read-only file system · Issue #188 · flathub/org.blender.Blender · GitHub

FreeCAD has it working without using “sdk” as runtime.

Looks like pip module is added in FreeCAD. However, there is a work around, which I think this might not be needed.

  # For add-on manager
  - name: python3-pip
    buildsystem: simple
    build-commands:
      # ignore installed because it's in the SDK
      - pip3 install --exists-action=i --ignore-installed --no-index --find-links="file://${PWD}" --prefix=${FLATPAK_DEST} "pip" --no-build-isolation
    sources:
      - type: file
        url: https://files.pythonhosted.org/packages/1f/2c/d9626f045e7b49a6225c6b09257861f24da78f4e5f23af2ddbdf852c99b8/pip-22.2.2-py3-none-any.whl
        sha256: b61a374b5bc40a6e982426aede40c9b5a08ff20e640f5b56977f4f91fed1e39a