Enable Wasm BigInt. This enables WASM_BIGINT while maintaining (hypothetical) Safari 14 support
by shimming BigInt64Array and BigUint64Array if they are missing. I think the
last time we tried to enable WASM_BIGINT was before #2019 so our chances
are significantly better this time.

This will fix dynamic linking bugs, reduce code size, and improve speed.

See also my upstream PR:
https://github.com/emscripten-core/emscripten/pull/17103

- [x] Add a [CHANGELOG](https://github.com/pyodide/pyodide/blob/main/docs/project/changelog.md) entry

package:
  name: Pillow
  version: 9.1.0
source:
  sha256: f401ed2bbb155e1ade150ccc63db1a4f6c1909d3d378f7d1235a44e90d75fb97
  url: https://files.pythonhosted.org/packages/4b/83/090146d7871d90a2643d469c319c1d014e41b315ab5cf0f8b4b6a764ef31/Pillow-9.1.0.tar.gz
  patches:
    - patches/0001-Enable-image-formats.patch
  extras:
    - - src/setup.cfg
      - ./setup.cfg
build:
  script: |
    export LIBWEBP_INCLUDE_PATH=$(pkg-config --cflags-only-I --dont-define-prefix libwebp)
    export LIBWEBP_LIBRARY_PATH=$(pkg-config --libs-only-L --dont-define-prefix libwebp)
  cflags: |
    -s USE_ZLIB=1
    -s USE_LIBJPEG=1
    -s USE_FREETYPE=1
    -s SIDE_MODULE=1
    $(LIBWEBP_INCLUDE_PATH)
  ldflags: |
    -ljpeg
    $(LIBWEBP_LIBRARY_PATH)
requirements:
  run:
    - libwebp
test:
  imports:
    - PIL

package:
  name: Pillow
  version: 9.1.0
source:
  sha256: f401ed2bbb155e1ade150ccc63db1a4f6c1909d3d378f7d1235a44e90d75fb97
  url: https://files.pythonhosted.org/packages/4b/83/090146d7871d90a2643d469c319c1d014e41b315ab5cf0f8b4b6a764ef31/Pillow-9.1.0.tar.gz
  patches:
    - patches/0001-Enable-image-formats.patch
  extras:
    - - src/setup.cfg
      - ./setup.cfg
build:
  script: |
    export LIBWEBP_INCLUDE_PATH=$(pkg-config --cflags-only-I --dont-define-prefix libwebp)
    export LIBWEBP_LIBRARY_PATH=$(pkg-config --libs-only-L --dont-define-prefix libwebp)
  cflags: |
    -s USE_ZLIB=1
    -s USE_LIBJPEG=1
    -s USE_FREETYPE=1
    -s SIDE_MODULE=1
    $(LIBWEBP_INCLUDE_PATH)
  ldflags: |
    -ljpeg
    $(LIBWEBP_LIBRARY_PATH)
requirements:
  run:
    - libwebp
test:
  imports:
    - PIL
