Skip to content

Commit

Permalink
fix(main/python-pillow): Fix undefined symbols
Browse files Browse the repository at this point in the history
Fixes the following build error:
> ERROR: ./lib/python3.11/site-packages/PIL/_imaging.cpython-311.so contains undefined symbols:
>    89: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND log
>   109: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND fmod
>   111: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND hypot
>   113: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND sincos
>   114: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND sin
> ERROR: ./lib/python3.11/site-packages/PIL/_imagingmath.cpython-311.so contains undefined symbols:
>    12: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND pow
>    14: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND fmod
>    15: 0000000000000000     0 NOTYPE  GLOBAL DEFAULT   UND powf
  • Loading branch information
fornwall committed May 21, 2024
1 parent d76d01a commit 092ce80
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 8 deletions.
1 change: 1 addition & 0 deletions packages/python-pillow/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ TERMUX_PKG_DESCRIPTION="Python Imaging Library"
TERMUX_PKG_LICENSE="custom"
TERMUX_PKG_MAINTAINER="@termux"
TERMUX_PKG_VERSION="10.3.0"
TERMUX_PKG_REVISION=1
TERMUX_PKG_SRCURL=https://github.com/python-pillow/Pillow/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
TERMUX_PKG_SHA256=5a2f1a812237bf9bd57f283422f46ca97a1c3d43d5f67b9bf8a0d499c4b97c85
TERMUX_PKG_AUTO_UPDATE=true
Expand Down
32 changes: 24 additions & 8 deletions packages/python-pillow/setup.py.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
diff -uNr Pillow-9.2.0/setup.py Pillow-9.2.0.mod/setup.py
--- Pillow-9.2.0/setup.py 2022-07-01 22:19:51.000000000 +0900
+++ Pillow-9.2.0.mod/setup.py 2022-10-13 23:03:54.800557858 +0900
@@ -497,8 +497,8 @@
diff -u -r ../Pillow-10.3.0/setup.py ./setup.py
--- ../Pillow-10.3.0/setup.py 2024-04-01 09:22:36.000000000 +0000
+++ ./setup.py 2024-05-21 21:57:30.822979186 +0000
@@ -515,8 +515,8 @@
for d in os.environ[k].split(os.path.pathsep):
_add_directory(library_dirs, d)

Expand All @@ -12,16 +12,16 @@ diff -uNr Pillow-9.2.0/setup.py Pillow-9.2.0.mod/setup.py

#
# add platform directories
@@ -567,7 +567,7 @@
@@ -589,7 +589,7 @@
or sys.platform.startswith("gnu")
or sys.platform.startswith("freebsd")
):
- for dirname in _find_library_dirs_ldconfig():
+ for dirname in []:
_add_directory(library_dirs, dirname)
if sys.platform.startswith("linux") and os.environ.get(
"ANDROID_ROOT", None
@@ -595,7 +595,7 @@
if sys.platform.startswith("linux") and os.environ.get("ANDROID_ROOT"):
# termux support for android.
@@ -615,7 +615,7 @@
# FIXME: check /opt/stuff directories here?

# standard locations
Expand All @@ -30,3 +30,19 @@ diff -uNr Pillow-9.2.0/setup.py Pillow-9.2.0.mod/setup.py
_add_directory(library_dirs, "/usr/local/lib")
_add_directory(include_dirs, "/usr/local/include")

@@ -990,12 +990,12 @@
for src_file in _LIB_IMAGING:
files.append(os.path.join("src/libImaging", src_file + ".c"))
ext_modules = [
- Extension("PIL._imaging", files),
+ Extension("PIL._imaging", files, extra_link_args=["-lm"]),
- Extension("PIL._imagingft", ["src/_imagingft.c"]),
+ Extension("PIL._imagingft", ["src/_imagingft.c"], extra_link_args=["-lm"]),
Extension("PIL._imagingcms", ["src/_imagingcms.c"]),
Extension("PIL._webp", ["src/_webp.c"]),
Extension("PIL._imagingtk", ["src/_imagingtk.c", "src/Tk/tkImaging.c"]),
- Extension("PIL._imagingmath", ["src/_imagingmath.c"]),
+ Extension("PIL._imagingmath", ["src/_imagingmath.c"], extra_link_args=["-lm"]),
Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]),
]

0 comments on commit 092ce80

Please sign in to comment.