0
0
mirror of https://github.com/termux/termux-packages.git synced 2024-12-11 23:00:52 +00:00
Fredrik Fornwall 092ce80e45 fix(main/python-pillow): Fix undefined symbols
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
2024-05-22 00:26:08 +02:00

49 lines
2.1 KiB
Diff

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)
- _add_directory(library_dirs, os.path.join(sys.prefix, "lib"))
- _add_directory(include_dirs, os.path.join(sys.prefix, "include"))
+ _add_directory(library_dirs, os.path.join("@TERMUX_PREFIX@", "lib"))
+ _add_directory(include_dirs, os.path.join("@TERMUX_PREFIX@", "include"))
#
# add platform directories
@@ -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"):
# termux support for android.
@@ -615,7 +615,7 @@
# FIXME: check /opt/stuff directories here?
# standard locations
- if not self.disable_platform_guessing:
+ if False:
_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"]),
]