From patchwork Wed Feb 24 07:00:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 587224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 1906C140B9E for ; Wed, 24 Feb 2016 18:01:07 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=IZXD3/a5; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id E6CD233C3F; Wed, 24 Feb 2016 07:01:05 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id m5t3OVSyBPHk; Wed, 24 Feb 2016 07:00:58 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 7B1D829A3A; Wed, 24 Feb 2016 07:00:58 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 68EAC1CF145 for ; Wed, 24 Feb 2016 07:00:56 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 311DB95BE7 for ; Wed, 24 Feb 2016 07:00:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 2KdzZv0FKO6v for ; Wed, 24 Feb 2016 07:00:54 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46]) by hemlock.osuosl.org (Postfix) with ESMTPS id BFE8C95BC1 for ; Wed, 24 Feb 2016 07:00:53 +0000 (UTC) Received: by mail-wm0-f46.google.com with SMTP id g62so230847685wme.0 for ; Tue, 23 Feb 2016 23:00:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=X7wteh4Z/RraT/jp6PrTlbmqi8QhBmh8AgqFM7efLE8=; b=IZXD3/a5Q3+VzoveeMXzY2H5wVvgi7lRG03/m/wJBItkyCq0uJp7OtKfiJPR7SdbP3 kw4I1mAncnUDuYG9+/fQgUz+0VVjPq0m5OPN/1XdM8VjYRXstiszrcdV6WWWlQYvds3a eF2UVtEcx9UpnELF5ZWOeA6wEIWx0irasBkziSeUexe27wPiH1J/2e+EcbEOXFmvHQiy CDH1Dlgg3+T/Zv6D9eaHLgyoS7biwOyiHVzCEvPWtLKXnHqs7mEICLLmiqiwfQ9DPFjX ergxYSV+Fx5zMRoIltNWKz6X5JgEYFz367dOIyoIuHsJlV96agNGTG/Vt3LvtOgkzUql ZBQg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=X7wteh4Z/RraT/jp6PrTlbmqi8QhBmh8AgqFM7efLE8=; b=nE0CSgufK7clmmhpvGCnDvgY0tCJotAuLKw5TpEsTWTG3UI50ArZoaZgmF9nzJZdvw DN6bTSKRhW2IFsqhNZFoDY+JEkOtAx1atODBq4Zzc83YYDVwNzdKZrlYE+zTO9d/SAY3 3rMhZL9qh6h/EaeVm47TiOKCfOxJpdpiPj5jOsvjcaRqtv93aU8eDHgw17GWSMG2rjWR 0/JqjAI0+c4mjgPKKQktlGkRUq6j15Ma+pClsWoFT/2Ish4ZTPdKn7uMmKYJoGUKgPs2 vYtR84cfzrDOoEwpqpNkOeQt6GdbKUc7t5MiH6jMoxJrltOOgLkQDJLHVJtictgBkx3i WAdQ== X-Gm-Message-State: AG10YOTp+/sIk9mjtoQQa4JCQJcfDaW9huZffMzRWrbi7Q8b0Q6UJJuscb2JAPRYHJBATg== X-Received: by 10.194.86.68 with SMTP id n4mr43436871wjz.150.1456297252362; Tue, 23 Feb 2016 23:00:52 -0800 (PST) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id g1sm1376351wmc.0.2016.02.23.23.00.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 23 Feb 2016 23:00:48 -0800 (PST) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Wed, 24 Feb 2016 08:00:40 +0100 Message-Id: <1456297240-32112-1-git-send-email-angelo.compagnucci@gmail.com> X-Mailer: git-send-email 1.9.1 Subject: [Buildroot] [PATCH v5] package/python-pillow: new package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This patch adds python-pillow, the friendly python image library fork. Signed-off-by: Angelo Compagnucci --- Changes: v4 -> v5: * Fixed build options (suggested by Thomas Petazzoni) * Usign custom BUILD_CMDS and INSTALL_TARGET_CMDS to overcome package strangeness (suggested by Thomas Petazzoni) * Bump to version 3.1.0 v3 -> v4: * Fixing a couple of typos v2 -> v3: * Simplified package * Better handling of setup type * Adding hash file v1 -> v2: * Added patch to remove platform guessing, now headers should be searched in buildroot folders * Fixed optional configure options package/Config.in | 1 + ...setup.py-removing-unneeded-platform-guess.patch | 85 ++++++++++++++++++++++ package/python-pillow/Config.in | 12 +++ package/python-pillow/python-pillow.hash | 2 + package/python-pillow/python-pillow.mk | 37 ++++++++++ 5 files changed, 137 insertions(+) create mode 100644 package/python-pillow/0001-setup.py-removing-unneeded-platform-guess.patch create mode 100644 package/python-pillow/Config.in create mode 100644 package/python-pillow/python-pillow.hash create mode 100644 package/python-pillow/python-pillow.mk diff --git a/package/Config.in b/package/Config.in index 3eb3618..55f16cc 100644 --- a/package/Config.in +++ b/package/Config.in @@ -674,6 +674,7 @@ menu "External python modules" source "package/python-paho-mqtt/Config.in" source "package/python-pam/Config.in" source "package/python-paramiko/Config.in" + source "package/python-pillow/Config.in" source "package/python-posix-ipc/Config.in" source "package/python-protobuf/Config.in" source "package/python-psutil/Config.in" diff --git a/package/python-pillow/0001-setup.py-removing-unneeded-platform-guess.patch b/package/python-pillow/0001-setup.py-removing-unneeded-platform-guess.patch new file mode 100644 index 0000000..b772223 --- /dev/null +++ b/package/python-pillow/0001-setup.py-removing-unneeded-platform-guess.patch @@ -0,0 +1,85 @@ +From d21bfb7f9d8df1910f07a0834624413d36c264f5 Mon Sep 17 00:00:00 2001 +From: Angelo Compagnucci +Date: Wed, 24 Feb 2016 07:51:48 +0100 +Subject: [PATCH] setup.py: removing unneeded platform guess + +Platform guess is not needed when cross compiling on buildroot +so removing it. + +Signed-off-by: Angelo Compagnucci +--- + setup.py | 58 +--------------------------------------------------------- + 1 file changed, 1 insertion(+), 57 deletions(-) + +diff --git a/setup.py b/setup.py +index f31a146..fa21c33 100644 +--- a/setup.py ++++ b/setup.py +@@ -241,63 +241,7 @@ class pil_build_ext(build_ext): + _add_directory(include_dirs, "/usr/X11/include") + + elif sys.platform.startswith("linux"): +- arch_tp = (plat.processor(), plat.architecture()[0]) +- if arch_tp == ("x86_64", "32bit"): +- # 32-bit build on 64-bit machine. +- _add_directory(library_dirs, "/usr/lib/i386-linux-gnu") +- else: +- for platform_ in arch_tp: +- +- if not platform_: +- continue +- +- if platform_ in ["x86_64", "64bit"]: +- _add_directory(library_dirs, "/lib64") +- _add_directory(library_dirs, "/usr/lib64") +- _add_directory( +- library_dirs, "/usr/lib/x86_64-linux-gnu") +- break +- elif platform_ in ["i386", "i686", "32bit"]: +- _add_directory( +- library_dirs, "/usr/lib/i386-linux-gnu") +- break +- elif platform_ in ["aarch64"]: +- _add_directory(library_dirs, "/usr/lib64") +- _add_directory( +- library_dirs, "/usr/lib/aarch64-linux-gnu") +- break +- elif platform_ in ["arm", "armv7l"]: +- _add_directory( +- library_dirs, "/usr/lib/arm-linux-gnueabi") +- break +- elif platform_ in ["ppc64"]: +- _add_directory(library_dirs, "/usr/lib64") +- _add_directory( +- library_dirs, "/usr/lib/ppc64-linux-gnu") +- _add_directory( +- library_dirs, "/usr/lib/powerpc64-linux-gnu") +- break +- elif platform_ in ["ppc"]: +- _add_directory(library_dirs, "/usr/lib/ppc-linux-gnu") +- _add_directory( +- library_dirs, "/usr/lib/powerpc-linux-gnu") +- break +- elif platform_ in ["s390x"]: +- _add_directory(library_dirs, "/usr/lib64") +- _add_directory( +- library_dirs, "/usr/lib/s390x-linux-gnu") +- break +- elif platform_ in ["s390"]: +- _add_directory(library_dirs, "/usr/lib/s390-linux-gnu") +- break +- else: +- raise ValueError( +- "Unable to identify Linux platform: `%s`" % platform_) +- +- # XXX Kludge. Above /\ we brute force support multiarch. Here we +- # try Barry's more general approach. Afterward, something should +- # work ;-) +- self.add_multiarch_paths() ++ pass + + elif sys.platform.startswith("gnu"): + self.add_multiarch_paths() +-- +1.9.1 + diff --git a/package/python-pillow/Config.in b/package/python-pillow/Config.in new file mode 100644 index 0000000..d5c3809 --- /dev/null +++ b/package/python-pillow/Config.in @@ -0,0 +1,12 @@ +config BR2_PACKAGE_PYTHON_PILLOW + bool "python-pillow" + help + Pillow is the "friendly" PIL fork by Alex Clark and Contributors. PIL is + the Python Imaging Library by Fredrik Lundh and Contributors. + + Pillow relies on external libraries to provide support various + image formats. Select the corresponding package(s) to get this + support. Pillow can use jpeg, zlib (for PNG), tiff, freetype, webp, + and openjpeg (JPEG-2000). + + https://pypi.python.org/pypi/Pillow/ diff --git a/package/python-pillow/python-pillow.hash b/package/python-pillow/python-pillow.hash new file mode 100644 index 0000000..b2e200b --- /dev/null +++ b/package/python-pillow/python-pillow.hash @@ -0,0 +1,2 @@ +# sha256 locally computed +sha256 1c186d9fe393eabb311a4c2e2dfff99f206372b2fa04f37cb10c8022cc8d5f95 python-pillow-3.1.0.tar.gz diff --git a/package/python-pillow/python-pillow.mk b/package/python-pillow/python-pillow.mk new file mode 100644 index 0000000..7f4f299 --- /dev/null +++ b/package/python-pillow/python-pillow.mk @@ -0,0 +1,37 @@ +################################################################################ +# +# python-pillow +# +################################################################################ + +PYTHON_PILLOW_VERSION = 3.1.0 +PYTHON_PILLOW_SITE = $(call github,python-pillow,Pillow,$(PYTHON_PILLOW_VERSION)) +PYTHON_PILLOW_SETUP_TYPE = setuptools +PYTHON_PILLOW_DEPENDENCIES = $(if $(BR2_PACKAGE_JPEG),jpeg) \ + $(if $(BR2_PACKAGE_ZLIB),zlib) \ + $(if $(BR2_PACKAGE_TIFF),tiff) \ + $(if $(BR2_PACKAGE_FREETYPE),freetype) \ + $(if $(BR2_PACKAGE_WEBP),webp) \ + $(if $(BR2_PACKAGE_OPENJPEG),openjpeg) + +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_JPEG),--enable-jpeg,--disable-jpeg) +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_ZLIB),--enable-zlib,--disable-zlib) +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_TIFF),--enable-tiff,--disable-tiff) +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_FREETYPE),--enable-freetype,--disable-freetype) +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_WEBP),--enable-webp,--disable-webp) +PYTHON_PILLOW_BUILD_OPTS += $(if $(BR2_PACKAGE_OPENJPEG),--enable-jpeg2000,--disable-jpeg2000) + +PYTHON_PILLOW_INSTALL_TARGET_OPTS += $(PYTHON_PILLOW_BUILD_OPTS) + +PYTHON_PILLOW_BUILD_CMDS = (cd $(PYTHON_PILLOW_BUILDDIR); \ + $(PYTHON_PILLOW_BASE_ENV) $(PYTHON_PILLOW_ENV) \ + $(PYTHON_PILLOW_PYTHON_INTERPRETER) setup.py build_ext \ + $(PYTHON_PILLOW_BASE_BUILD_OPTS) $(PYTHON_PILLOW_BUILD_OPTS)) + +PYTHON_PILLOW_INSTALL_TARGET_CMDS = (cd $(PYTHON_PILLOW_BUILDDIR); \ + $(PYTHON_PILLOW_BASE_ENV) $(PYTHON_PILLOW_ENV) \ + $(PYTHON_PILLOW_PYTHON_INTERPRETER) setup.py build_ext \ + $(PYTHON_PILLOW_INSTALL_TARGET_OPTS) install \ + $(PYTHON_PILLOW_BASE_INSTALL_TARGET_OPTS)) + +$(eval $(python-package))