diff --git a/common-files/tur_build_wheel.sh b/common-files/tur_build_wheel.sh index 20d9777..ac4f41c 100644 --- a/common-files/tur_build_wheel.sh +++ b/common-files/tur_build_wheel.sh @@ -47,7 +47,13 @@ tur_check_libs_and_licenses_for_wheel() { if [ "$TUR_AUDIT_WHEEL_NO_LIBS" != "false" ]; then _args+=" --ensure-no-libs" fi - if [ "$TUR_LIB_LICENSE_JSON" != "" ]; then + if [ "$TUR_LIB_LICENSE_JSON" == "force-skipped" ]; then + echo "Force skip the checks for libs and licenses" + elif [ "$TUR_LIB_LICENSE_JSON" != "" ]; then + _args+=" --json $TUR_LIB_LICENSE_JSON --check-libs" + if [ "$TUR_PACKAGE_WHEEL_LICENSE" != "false" ]; then + _args+=" --check-licenses" + fi _args+=" --check-libs --check-licenses --json $TUR_LIB_LICENSE_JSON" elif [ "$TUR_AUDIT_WHEEL_NO_LIBS" == "false" ]; then termux_error_exit "Must check libs and licenses after install" diff --git a/tur-pypi-312/python3.12-pillow/build.sh b/tur-pypi-312/python3.12-pillow/build.sh new file mode 100644 index 0000000..51fd2af --- /dev/null +++ b/tur-pypi-312/python3.12-pillow/build.sh @@ -0,0 +1,27 @@ +TERMUX_PKG_HOMEPAGE=https://python-pillow.org/ +TERMUX_PKG_DESCRIPTION="Python Imaging Library" +TERMUX_PKG_LICENSE="custom" +TERMUX_PKG_LICENSE_FILE="LICENSE" +TERMUX_PKG_MAINTAINER="@termux-user-repository" +TERMUX_PKG_VERSION="10.4.0" +TERMUX_PKG_SRCURL=https://github.com/python-pillow/Pillow/archive/refs/tags/${TERMUX_PKG_VERSION}.tar.gz +TERMUX_PKG_SHA256=e70284e8605a5b7ccb37e5bfd4634598ca2c43c7f2c353572351ccf72c031004 +TERMUX_PKG_AUTO_UPDATE=true +TERMUX_PKG_DEPENDS="freetype, libimagequant, libjpeg-turbo, libraqm, libtiff, libwebp, libxcb, littlecms, openjpeg, python, zlib" +TERMUX_PKG_PYTHON_COMMON_DEPS="wheel" +TERMUX_PKG_BUILD_IN_SRC=true + +TERMUX_PYTHON_VERSION=3.12 +TERMUX_PYTHON_CROSSENV_PREFIX=$TERMUX_PKG_BUILDDIR/python${TERMUX_PYTHON_VERSION/./}-crossenv-prefix-$TERMUX_ARCH +TUR_AUTO_AUDIT_WHEEL=true +# XXX: Licenses are included in the LICENSE file of Pillow. +TUR_PACKAGE_WHEEL_LICENSE=false +TUR_LIB_LICENSE_JSON="force-skipped" + +source $TERMUX_SCRIPTDIR/common-files/tur_build_wheel.sh + +termux_step_post_make_install() { + if [ ! -e "$PYTHON_SITE_PKG/pillow-$TERMUX_PKG_VERSION.dist-info" ]; then + termux_error_exit "Package ${TERMUX_PKG_NAME} doesn't build properly." + fi +} diff --git a/tur-pypi-312/python3.12-pillow/setup.py.patch b/tur-pypi-312/python3.12-pillow/setup.py.patch new file mode 100644 index 0000000..0cc77f5 --- /dev/null +++ b/tur-pypi-312/python3.12-pillow/setup.py.patch @@ -0,0 +1,47 @@ +--- a/setup.py ++++ b/setup.py +@@ -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"]), + ] +