Skip to content

Commit 24d63d9

Browse files
authored
new package: python3.12-pillow (#155)
1 parent af87753 commit 24d63d9

File tree

3 files changed

+81
-1
lines changed

3 files changed

+81
-1
lines changed

common-files/tur_build_wheel.sh

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,13 @@ tur_check_libs_and_licenses_for_wheel() {
4747
if [ "$TUR_AUDIT_WHEEL_NO_LIBS" != "false" ]; then
4848
_args+=" --ensure-no-libs"
4949
fi
50-
if [ "$TUR_LIB_LICENSE_JSON" != "" ]; then
50+
if [ "$TUR_LIB_LICENSE_JSON" == "force-skipped" ]; then
51+
echo "Force skip the checks for libs and licenses"
52+
elif [ "$TUR_LIB_LICENSE_JSON" != "" ]; then
53+
_args+=" --json $TUR_LIB_LICENSE_JSON --check-libs"
54+
if [ "$TUR_PACKAGE_WHEEL_LICENSE" != "false" ]; then
55+
_args+=" --check-licenses"
56+
fi
5157
_args+=" --check-libs --check-licenses --json $TUR_LIB_LICENSE_JSON"
5258
elif [ "$TUR_AUDIT_WHEEL_NO_LIBS" == "false" ]; then
5359
termux_error_exit "Must check libs and licenses after install"
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
TERMUX_PKG_HOMEPAGE=https://python-pillow.org/
2+
TERMUX_PKG_DESCRIPTION="Python Imaging Library"
3+
TERMUX_PKG_LICENSE="custom"
4+
TERMUX_PKG_LICENSE_FILE="LICENSE"
5+
TERMUX_PKG_MAINTAINER="@termux-user-repository"
6+
TERMUX_PKG_VERSION="10.4.0"
7+
TERMUX_PKG_SRCURL=https://github.com/python-pillow/Pillow/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz
8+
TERMUX_PKG_SHA256=e70284e8605a5b7ccb37e5bfd4634598ca2c43c7f2c353572351ccf72c031004
9+
TERMUX_PKG_AUTO_UPDATE=true
10+
TERMUX_PKG_DEPENDS="freetype, libimagequant, libjpeg-turbo, libraqm, libtiff, libwebp, libxcb, littlecms, openjpeg, python, zlib"
11+
TERMUX_PKG_PYTHON_COMMON_DEPS="wheel"
12+
TERMUX_PKG_BUILD_IN_SRC=true
13+
14+
TERMUX_PYTHON_VERSION=3.12
15+
TERMUX_PYTHON_CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python${TERMUX_PYTHON_VERSION/./}-crossenv-prefix-$TERMUX_ARCH
16+
TUR_AUTO_AUDIT_WHEEL=true
17+
# XXX: Licenses are included in the LICENSE file of Pillow.
18+
TUR_PACKAGE_WHEEL_LICENSE=false
19+
TUR_LIB_LICENSE_JSON="force-skipped"
20+
21+
source $TERMUX_SCRIPTDIR/common-files/tur_build_wheel.sh
22+
23+
termux_step_post_make_install() {
24+
if [ ! -e "$PYTHON_SITE_PKG/pillow-$TERMUX_PKG_VERSION.dist-info" ]; then
25+
termux_error_exit "Package ${TERMUX_PKG_NAME} doesn't build properly."
26+
fi
27+
}
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
--- a/setup.py
2+
+++ b/setup.py
3+
@@ -515,8 +515,8 @@
4+
for d in os.environ[k].split(os.path.pathsep):
5+
_add_directory(library_dirs, d)
6+
7+
- _add_directory(library_dirs, os.path.join(sys.prefix, "lib"))
8+
- _add_directory(include_dirs, os.path.join(sys.prefix, "include"))
9+
+ _add_directory(library_dirs, os.path.join("@TERMUX_PREFIX@", "lib"))
10+
+ _add_directory(include_dirs, os.path.join("@TERMUX_PREFIX@", "include"))
11+
12+
#
13+
# add platform directories
14+
@@ -589,7 +589,7 @@
15+
or sys.platform.startswith("gnu")
16+
or sys.platform.startswith("freebsd")
17+
):
18+
- for dirname in _find_library_dirs_ldconfig():
19+
+ for dirname in []:
20+
_add_directory(library_dirs, dirname)
21+
if sys.platform.startswith("linux") and os.environ.get("ANDROID_ROOT"):
22+
# termux support for android.
23+
@@ -615,7 +615,7 @@
24+
# FIXME: check /opt/stuff directories here?
25+
26+
# standard locations
27+
- if not self.disable_platform_guessing:
28+
+ if False:
29+
_add_directory(library_dirs, "/usr/local/lib")
30+
_add_directory(include_dirs, "/usr/local/include")
31+
32+
@@ -990,12 +990,12 @@
33+
for src_file in _LIB_IMAGING:
34+
files.append(os.path.join("src/libImaging", src_file + ".c"))
35+
ext_modules = [
36+
- Extension("PIL._imaging", files),
37+
+ Extension("PIL._imaging", files, extra_link_args=["-lm"]),
38+
- Extension("PIL._imagingft", ["src/_imagingft.c"]),
39+
+ Extension("PIL._imagingft", ["src/_imagingft.c"], extra_link_args=["-lm"]),
40+
Extension("PIL._imagingcms", ["src/_imagingcms.c"]),
41+
Extension("PIL._webp", ["src/_webp.c"]),
42+
Extension("PIL._imagingtk", ["src/_imagingtk.c", "src/Tk/tkImaging.c"]),
43+
- Extension("PIL._imagingmath", ["src/_imagingmath.c"]),
44+
+ Extension("PIL._imagingmath", ["src/_imagingmath.c"], extra_link_args=["-lm"]),
45+
Extension("PIL._imagingmorph", ["src/_imagingmorph.c"]),
46+
]
47+

0 commit comments

Comments
 (0)