From patchwork Mon Jun 13 20:38:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Angelo Compagnucci X-Patchwork-Id: 634845 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3rT4P62N7cz9s0M for ; Tue, 14 Jun 2016 06:38:34 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=wF4GPpXT; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 98D0C877BE; Mon, 13 Jun 2016 20:38:32 +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 fOCym4glPNsv; Mon, 13 Jun 2016 20:38:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 1DDD8875F8; Mon, 13 Jun 2016 20:38:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id D1EF81BF9F2 for ; Mon, 13 Jun 2016 20:38:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id CEC998578B for ; Mon, 13 Jun 2016 20:38:28 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wHy6I2O-JWLd for ; Mon, 13 Jun 2016 20:38:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by fraxinus.osuosl.org (Postfix) with ESMTPS id EF23487E7B for ; Mon, 13 Jun 2016 20:38:20 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id r5so17603036wmr.0 for ; Mon, 13 Jun 2016 13:38:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=PEAeaHe/syHGlMKLLhS16gw+Mj2cCD1DyEIgvb5vmZs=; b=wF4GPpXT6XtE9XauzVJ7cDmGjqVdAnZDlbBNlJAKTo9SIJ17x1nMJ+UgVUKahtdBR8 u69Z4aYiaAMvVY9/TdEzmFDfHNnI+XVtO6XssDpvNXcW/6zWcMTBByNoQPWtko/O6Rz+ 5Z4H6ygkkcojQdvd3BRqy35x6UAPDpFhdog+jHlCeM30xZFozZgMloVjvDTnLc6QeTLr ymem8GB08hGeaMl2rn3Vl7ZFs8WBZhrc9beqLLHC8lgEnrQcriHVbOXBCfak8B8015Ao +PdXgNhT4APb1pb/4EQJRvm68EPbYUMerRinTOEf/yQaVeMJjrekqFPASKWSntmLxncv OorA== 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=PEAeaHe/syHGlMKLLhS16gw+Mj2cCD1DyEIgvb5vmZs=; b=fpxeGrd9HcUlHaheP7bJ34CljCM6FLBVkp1+wbPs4zzKr5HkLZlJICIvSwgpstMv/G xQvkV1KXfzYXMSB2VpFG8A1IXI2SWUv7r+VU1PArkgzHoA2rPEbQB8zXLSxC9LhgLCo2 YUKQG9hS5umvPXRP9XIelOOT7glkesJyziuvoYGbja3SG0Ovzfmi5F43o1DJ9QHDKYL7 jM0KM9iNN6TLHpGKokbKhY1MNkgXKm3np1iDgmWZldETXmXrXwhRX1mXfcl7ywo1XE2a f5QsFKhbZ2Ix30n3GEK7nbaOGMKSHv8lc8aKOYSI44nJhufPIOq3aw/6ThDqq3NUxBRn bQ1g== X-Gm-Message-State: ALyK8tKLJ9PioTYcvcgNYWLCU0ggmw2ULPUUW57K8OZmiFQkrtOhBWJ9aOgJPCN44r0Wpg== X-Received: by 10.194.79.168 with SMTP id k8mr2850002wjx.52.1465850299536; Mon, 13 Jun 2016 13:38:19 -0700 (PDT) Received: from localhost.localdomain ([89.202.204.147]) by smtp.gmail.com with ESMTPSA id kc2sm29308304wjb.5.2016.06.13.13.38.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 13 Jun 2016 13:38:17 -0700 (PDT) From: Angelo Compagnucci To: buildroot@buildroot.org Date: Mon, 13 Jun 2016 22:38:09 +0200 Message-Id: <1465850289-11760-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, it includes a backported patch to disable configuration platfom guessing. Signed-off-by: Angelo Compagnucci Tested-by: Bernd Kuhls --- Changes v4 -> v5: * Better build and install opts handling (Peter Korsgaard) * Strong sha256 hash * Simplified INSTALL_TARGET_CMDS * Better commit message package/Config.in | 1 + ...y-add-option-to-disable-platform-guessing.patch | 63 ++++++++++++++++++++++ package/python-pillow/Config.in | 12 +++++ package/python-pillow/python-pillow.hash | 4 ++ package/python-pillow/python-pillow.mk | 33 ++++++++++++ 5 files changed, 113 insertions(+) create mode 100644 package/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.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 3d99d72..a26043d 100644 --- a/package/Config.in +++ b/package/Config.in @@ -704,6 +704,7 @@ menu "External python modules" source "package/python-pathtools/Config.in" source "package/python-pathvalidate/Config.in" source "package/python-pexpect/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-add-option-to-disable-platform-guessing.patch b/package/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.patch new file mode 100644 index 0000000..a1a4cbe --- /dev/null +++ b/package/python-pillow/0001-setup.py-add-option-to-disable-platform-guessing.patch @@ -0,0 +1,63 @@ +From 3344eff32427f1d10f3ca82ca4344c501a1a2055 Mon Sep 17 00:00:00 2001 +From: Angelo Compagnucci +Date: Sun, 12 Jun 2016 12:06:59 +0200 +Subject: [PATCH] setup.py: add option to disable platform guessing + +When cross-compiling (ex on Buildroot) platform guessing is not needed +cause the environment is correctly built externally. +This patch adds an option to disable platform guessing on Linux. +--- + setup.py | 19 ++++++++++++++----- + 1 file changed, 14 insertions(+), 5 deletions(-) + +diff --git a/setup.py b/setup.py +index 0f74a40..f1eac1e 100644 +--- a/setup.py ++++ b/setup.py +@@ -121,9 +121,13 @@ class pil_build_ext(build_ext): + ('disable-%s' % x, None, 'Disable support for %s' % x) for x in feature + ] + [ + ('enable-%s' % x, None, 'Enable support for %s' % x) for x in feature ++ ] + [ ++ ('disable-platform-guessing', None, 'Disable platform guessing on Linux'), ++ ('debug', None, 'Debug logging') + ] + + def initialize_options(self): ++ self.disable_platform_guessing = None + build_ext.initialize_options(self) + for x in self.feature: + setattr(self, 'disable_%s' % x, None) +@@ -190,7 +194,10 @@ class pil_build_ext(build_ext): + # + # add platform directories + +- if sys.platform == "cygwin": ++ if self.disable_platform_guessing: ++ pass ++ ++ elif sys.platform == "cygwin": + # pythonX.Y.dll.a is in the /usr/lib/pythonX.Y/config directory + _add_directory(library_dirs, + os.path.join("/usr/lib", "python%s" % +@@ -352,11 +359,13 @@ class pil_build_ext(build_ext): + _add_directory(include_dirs, tcl_dir) + + # standard locations +- _add_directory(library_dirs, "/usr/local/lib") +- _add_directory(include_dirs, "/usr/local/include") ++ if not self.disable_platform_guessing: ++ _add_directory(library_dirs, "/usr/local/lib") ++ _add_directory(include_dirs, "/usr/local/include") ++ ++ _add_directory(library_dirs, "/usr/lib") ++ _add_directory(include_dirs, "/usr/include") + +- _add_directory(library_dirs, "/usr/lib") +- _add_directory(include_dirs, "/usr/include") + + # on Windows, look for the OpenJPEG libraries in the location that + # the official installer puts them +-- +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..6de9606 --- /dev/null +++ b/package/python-pillow/python-pillow.hash @@ -0,0 +1,4 @@ +# https://pypi.python.org/pypi?:action=show_md5&digest=7cfd093c11205d9e2ebe3c51dfcad510 +md5 7cfd093c11205d9e2ebe3c51dfcad510 Pillow-3.2.0.tar.gz +# sha256 locally computed +sha256 64b0a057210c480aea99406c9391180cd866fc0fd8f0b53367e3af21b195784a Pillow-3.2.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..2926886 --- /dev/null +++ b/package/python-pillow/python-pillow.mk @@ -0,0 +1,33 @@ +################################################################################ +# +# python-pillow +# +################################################################################ + +PYTHON_PILLOW_VERSION = 3.2.0 +PYTHON_PILLOW_SOURCE = Pillow-$(PYTHON_PILLOW_VERSION).tar.gz +PYTHON_PILLOW_SITE = https://pypi.python.org/packages/source/P/Pillow +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 = --disable-platform-guessing +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_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 = $(PYTHON_PILLOW_BUILD_CMDS) install + +$(eval $(python-package))