Skip to content

Commit

Permalink
pillow: add Python3 variant and update to 6.1.0
Browse files Browse the repository at this point in the history
- Add @commodo as maintainer
- Add patch when looking for Windows libtiff

Co-Authored-By: Jeffery To <jeffery.to@gmail.com>
Signed-off-by: Josef Schlehofer <pepe.schlehofer@gmail.com>
  • Loading branch information
BKPepe and jefferyto committed Jul 9, 2019
1 parent 2b29d83 commit a1c5a3f
Show file tree
Hide file tree
Showing 3 changed files with 95 additions and 204 deletions.
76 changes: 53 additions & 23 deletions lang/python/pillow/Makefile
Expand Up @@ -7,43 +7,73 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=pillow
PKG_VERSION:=5.3.0
PKG_RELEASE:=2
PKG_VERSION:=6.1.0
PKG_RELEASE:=1

PKG_SOURCE:=Pillow-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=https://files.pythonhosted.org/packages/source/P/Pillow
PKG_HASH:=2ea3517cd5779843de8a759c2349a3cd8d3893e03ab47053b66d5ec6f8bc4f93
PKG_BUILD_DIR:=$(BUILD_DIR)/Pillow-$(PKG_VERSION)
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_HASH:=0804f77cb1e9b6dbd37601cee11283bba39a8d44b9ddb053400c58e0c0d7d9de
PKG_BUILD_DIR:=$(BUILD_DIR)/$(BUILD_VARIANT)-Pillow-$(PKG_VERSION)

PKG_LICENSE:=CUSTOM
PKG_MAINTAINER:=Alexandru Ardelean <ardeleanalex@gmail.com>
PKG_LICENSE:=HPND
PKG_LICENSE_FILES:=LICENSE

include $(INCLUDE_DIR)/package.mk
include ../python-package.mk
include ../python3-package.mk

PKG_UNPACK:=$(HOST_TAR) -C $(PKG_BUILD_DIR) --strip-components=1 -xzf $(DL_DIR)/$(PKG_SOURCE)

define Package/python-pillow/Default
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The friendly PIL fork
URL:=https://python-pillow.org/
DEPENDS:=+libfreetype +libjpeg +libtiff +zlib
endef

define Package/pillow
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The friendly PIL fork
URL:=https://python-pillow.org/
DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
define Package/python-pillow
$(call Package/python-pillow/Default)
DEPENDS+=+PACKAGE_python-pillow:python
VARIANT:=python
endef

define Package/pillow/description
The friendly PIL fork
define Package/python-pillow/description
The friendly PIL fork
endef

define Build/Compile
$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
define Package/python3-pillow
$(call Package/python-pillow/Default)
DEPENDS+=+PACKAGE_python3-pillow:python3
VARIANT:=python3
endef

define Package/pillow/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
define Package/python3-pillow/description
$(call Package/python-pillow/description)
.
(Variant for Python3)
endef

$(eval $(call BuildPackage,pillow))
PYTHON3_PKG_SETUP_GLOBAL_ARGS += build_ext \
--enable-zlib \
--enable-jpeg \
--enable-tiff \
--enable-freetype \
--disable-lcms \
--disable-webp \
--disable-webpmux \
--disable-jpeg2000 \
--disable-imagequant \
--disable-platform-guessing

PYTHON_PKG_SETUP_GLOBAL_ARGS:=$(PYTHON3_PKG_SETUP_GLOBAL_ARGS)

$(eval $(call PyPackage,python-pillow))
$(eval $(call BuildPackage,python-pillow))
$(eval $(call BuildPackage,python-pillow-src))

$(eval $(call Py3Package,python3-pillow))
$(eval $(call BuildPackage,python3-pillow))
$(eval $(call BuildPackage,python3-pillow-src))
@@ -0,0 +1,42 @@
From 6011697c8cfc814087bf4b7f620ef5d1e3fbc130 Mon Sep 17 00:00:00 2001
From: Josef Schlehofer <josef.schlehofer@nic.cz>
Date: Tue, 9 Jul 2019 21:56:59 +0200
Subject: [PATCH] setup.py: use host.platform when looking for Windows libtiff

---
setup.py | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/setup.py b/setup.py
index 5ceae34..0f929ea 100755
--- a/setup.py
+++ b/setup.py
@@ -20,6 +20,8 @@ from distutils.command.build_ext import build_ext

from setuptools import Extension, setup

+host_platform = "linux"
+
# monkey patch import hook. Even though flake8 says it's not used, it is.
# comment this out to disable multi threaded builds.
import mp_compile
@@ -606,7 +608,7 @@ class pil_build_ext(build_ext):
if _find_include_file(self, "tiff.h"):
if _find_library_file(self, "tiff"):
feature.tiff = "tiff"
- if sys.platform in ["win32", "darwin"] and _find_library_file(
+ if host.platform in ["win32", "darwin"] and _find_library_file(
self, "libtiff"
):
feature.tiff = "libtiff"
@@ -785,7 +787,7 @@ class pil_build_ext(build_ext):
print("-" * 68)
print("version Pillow %s" % PILLOW_VERSION)
v = sys.version.split("[")
- print("platform %s %s" % (sys.platform, v[0].strip()))
+ print("platform %s %s" % (host_platform, v[0].strip()))
for v in v[1:]:
print(" [%s" % v.strip())
print("-" * 68)
--
2.20.1
181 changes: 0 additions & 181 deletions lang/python/pillow/patches/010-fix-paths.patch

This file was deleted.

0 comments on commit a1c5a3f

Please sign in to comment.