Skip to content

Commit 099a8a2

Browse files
Update pillow from 11.3.0 to 12.0.0 (emscripten-forge#3082)
* Update pillow from 11.3.0 to 12.0.0 * Update recipe --------- Co-authored-by: emscripten-forge-bot <[email protected]> Co-authored-by: Isabel Paredes <[email protected]>
1 parent bf05a70 commit 099a8a2

File tree

6 files changed

+66
-1035
lines changed

6 files changed

+66
-1035
lines changed
Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1-
echo "EMSCRIPTEN_FORGE_EMSDK_DIR $EMSCRIPTEN_FORGE_EMSDK_DIR: " $EMSCRIPTEN_FORGE_EMSDK_DIR
1+
#!/bin/bash
2+
set -e
3+
4+
export CFLAGS="${CFLAGS} -sRELOCATABLE=1 -fexceptions"
5+
export LDFLAGS="${LDFLAGS} -sRELOCATABLE=1 -fexceptions"
6+
export CXXFLAGS="${CXXFLAGS} -sRELOCATABLE=1 -fexceptions"
27

38
# pushd $CONDA_EMSDK_DIR
49
$EMSCRIPTEN_FORGE_EMSDK_DIR/upstream/emscripten/embuilder build freetype --pic
510
$EMSCRIPTEN_FORGE_EMSDK_DIR/upstream/emscripten/embuilder build libjpeg --pic
611
# popd
712

813
export LDFLAGS="${LDFLAGS} -s USE_LIBJPEG"
9-
export CFLAGS="${CFLAGS} -s USE_ZLIB=1 -s USE_LIBJPEG=1 -s USE_FREETYPE=1 -s SIDE_MODULE=1"
10-
11-
14+
export CFLAGS="${CFLAGS} -s USE_ZLIB=1 -s USE_LIBJPEG=1 -s USE_FREETYPE=1 -s SIDE_MODULE=1 -I${PREFIX}/include"
15+
export DISABLE_BCN=1
1216

13-
# replace version in setup.py
14-
sed -i.bak "s/PILLOW_PACKAGE_VERSION_PLACEHOLDER/$PKG_VERSION/g" setup.py
17+
export EMSCRIPTEN_INCLUDE_PATH=$(em-config CACHE)/sysroot/include/
18+
export EMSCRIPTEN_LIBRARY_PATH=$(em-config CACHE)/sysroot/lib/wasm32-emscripten/pic/
19+
export CFLAGS="${CFLAGS} -I${EMSCRIPTEN_INCLUDE_PATH} -L${EMSCRIPTEN_LIBRARY_PATH}"
1520

1621

17-
${PYTHON} -m pip install .
22+
DISABLE_PLATFORM_GUESSING=1 ${PYTHON} -m pip install . -vvv
1823

1924

2025
rm -rf $PREFIX/bin
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
From 095e258f0dd419dc689513fcaee1fe872708e008 Mon Sep 17 00:00:00 2001
2+
From: Isabel Paredes <[email protected]>
3+
Date: Mon, 17 Nov 2025 17:33:07 +0100
4+
Subject: [PATCH 1/2] Avoid using usr/ headers and libs
5+
6+
---
7+
setup.py | 1 +
8+
1 file changed, 1 insertion(+)
9+
10+
diff --git a/setup.py b/setup.py
11+
index 3a72a07..178dad9 100644
12+
--- a/setup.py
13+
+++ b/setup.py
14+
@@ -521,6 +521,7 @@ class pil_build_ext(build_ext):
15+
"IMAGEQUANT_ROOT": "libimagequant",
16+
}.items():
17+
root = globals()[root_name]
18+
+ root = os.environ.get("PREFIX")
19+
20+
if root is None and root_name in os.environ:
21+
root_prefix = os.environ[root_name]
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
From 3f3dbb5e4a174ac2ae5592bdb84cba19e3d4506b Mon Sep 17 00:00:00 2001
2+
From: Isabel Paredes <[email protected]>
3+
Date: Mon, 17 Nov 2025 17:33:41 +0100
4+
Subject: [PATCH 2/2] Fix duplicate symbols
5+
6+
Library pil_imaging_mode is added twice causing duplicate symbol errors.
7+
---
8+
setup.py | 4 ++--
9+
1 file changed, 2 insertions(+), 2 deletions(-)
10+
11+
diff --git a/setup.py b/setup.py
12+
index 178dad9..153172b 100644
13+
--- a/setup.py
14+
+++ b/setup.py
15+
@@ -1087,8 +1087,8 @@ for src_file in _IMAGING:
16+
for src_file in _LIB_IMAGING:
17+
files.append(os.path.join("src/libImaging", src_file + ".c"))
18+
ext_modules = [
19+
- Extension("PIL._imaging", files, libraries=["pil_imaging_mode"]),
20+
- Extension("PIL._imagingft", ["src/_imagingft.c"], libraries=["pil_imaging_mode"]),
21+
+ Extension("PIL._imaging", files),
22+
+ Extension("PIL._imagingft", ["src/_imagingft.c"]),
23+
Extension("PIL._imagingcms", ["src/_imagingcms.c"], libraries=["pil_imaging_mode"]),
24+
Extension("PIL._webp", ["src/_webp.c"], libraries=["pil_imaging_mode"]),
25+
Extension("PIL._avif", ["src/_avif.c"]),

recipes/recipes_emscripten/pillow/recipe.yaml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
context:
22
name: pillow
3-
version: 11.3.0
3+
version: 12.0.0
44

55
package:
66
name: ${{ name }}
77
version: ${{ version }}
88

99
source:
1010
- url: https://github.com/python-pillow/Pillow/archive/refs/tags/${{ version }}.tar.gz
11-
sha256: fa4aca745b1e1c733589ebf0ef19491b145dd4225c4aa06958963b4e7f0734cf
11+
sha256: 9d24d8c1197610e63eee5e5cfa60025e4aaaba3f5c3c592e9a62cdf734f0bb13
12+
patches:
13+
- patches/0001-Avoid-using-usr-headers-and-libs.patch
14+
- patches/0002-Fix-duplicate-symbols.patch
1215
- path: src/setup.cfg
13-
- path: setup.py
1416

1517
build:
1618
number: 0
@@ -22,6 +24,9 @@ requirements:
2224
- pip
2325
host:
2426
- python
27+
- pybind11 >=3.0
28+
- zlib
29+
run:
2530
- zlib
2631

2732
tests:

0 commit comments

Comments
 (0)