Contents

wabiverse/metaversepythonframework

A metaverse project for building a version of Python that can be embedded

Quickstart

Alternatively, to build the frameworks on your own, download/clone this repository, and then in the root directory, and run:

  • `make (or make all`) to build everything.
  • `make macOS` to build everything for macOS.
  • `make xrOS` to build everything for visionOS.
  • `make iOS` to build everything for iOS.
  • `make tvOS` to build everything for tvOS.
  • `make watchOS` to build everything for watchOS.

This should:

  1. Download the original source packages
  2. Patch them as required for compatibility with the selected OS
  3. Build the packages as Xcode-compatible XCFrameworks.

The resulting support packages will be packaged as a `.tar.gz file in the dist` folder.

Each support package contains:

  • `VERSIONS`, a text file describing the specific versions of code used to build the

support package;

  • `bin`, a folder containing shell aliases for the compilers that are needed

to build packages. This is required because Xcode uses the `xcrun alias to dynamically generate the name of binaries, but a lot of C tooling expects that CC` will not contain spaces.

  • `platform-site`, a folder that contains site customization scripts that can be used

to make your local Python install look like it is an on-device install for each of the underlying target architectures supported by the platform. This is needed because when you run `pip you'll be on a macOS machine with a specific architecture; if pip tries to install a binary package, it will install a macOS binary wheel (which won't work on xrOS/iOS/tvOS/watchOS). However, if you add the platform-site folder to your PYTHONPATH when invoking pip, the site customization will make your Python install return platform and sysconfig responses consistent with on-device behavior, which will cause pip` to install platform-appropriate packages.

  • `Python.xcframework`, a multi-architecture build of the Python runtime library
  • `python-stdlib`, the code and binary modules comprising the Python standard library.

On xrOS, iOS, tvOS and watchOS, there are 2 copies of every binary module - one for physical devices, and one for the simulator. The simulator binaries are "fat", containing code for both x86_64 and arm64.

Building binary wheels

When building binary wheels, you may need to use the libraries built by this project as inputs (e.g., the cffi module uses libffi). To support this, this project is able to package these dependencies as "wheels" that can be added to the `dist` directory.

To build these wheels, run:

  • `make wheels` to make all wheels for all mobile platforms
  • `make wheels-xrOS` to build all the visionOS wheels
  • `make wheels-iOS` to build all the iOS wheels
  • `make wheels-tvOS` to build all the tvOS wheels
  • `make wheels-watchOS` to build all the watchOS wheels

Package Metadata

Repository: wabiverse/metaversepythonframework

Default branch: main

README: README.md