Browse Source

Merge pull request #2635 from kissg1988/pillow

python-imglib/pillow: replace discontinued python-imglib (PIL) with pillow
lilik-openwrt-22.03
Jo-Philipp Wich 9 years ago
committed by GitHub
parent
commit
c9fd05542c
6 changed files with 234 additions and 132 deletions
  1. +53
    -0
      lang/pillow/Makefile
  2. +180
    -0
      lang/pillow/patches/010-fix-paths.patch
  3. +0
    -62
      lang/python-imglib/Makefile
  4. +0
    -48
      lang/python-imglib/patches/010-cross-compile.patch
  5. +0
    -21
      lang/python-imglib/patches/020-freetype-header-include.patch
  6. +1
    -1
      net/seafile-seahub/Makefile

+ 53
- 0
lang/pillow/Makefile View File

@ -0,0 +1,53 @@
#
# Copyright © 1997-2011 by Secret Labs AB
# Copyright © 1995-2011 by Fredrik Lundh
# Copyright © 2016 by Alex Clark and contributors
#
include $(TOPDIR)/rules.mk
PKG_NAME:=pillow
PKG_VERSION:=3.2.0
PKG_RELEASE=1
PKG_LICENSE:=CUSTOM
PKG_LICENSE_FILES:=LICENSE
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/python-pillow/Pillow.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=344cb709ed0111adcc6ad47cc007507c3f5efeb3
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
define Package/pillow
SUBMENU:=Python
SECTION:=lang
CATEGORY:=Languages
TITLE:=The friendly PIL fork
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=https://www.pillowproject.com/
DEPENDS:=+python +libfreetype +libjpeg +zlib +libtiff
endef
define Package/pillow/description
The friendly PIL fork
endef
define Build/Compile
$(call Build/Compile/PyMod,,install --prefix=/usr --root=$(PKG_INSTALL_DIR))
endef
define Package/pillow/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
$(CP) $(PKG_BUILD_DIR)/LICENSE $(1)$(PYTHON_PKG_DIR)/PIL/
endef
$(eval $(call BuildPackage,pillow))

+ 180
- 0
lang/pillow/patches/010-fix-paths.patch View File

@ -0,0 +1,180 @@
diff -rupN Pillow-3.2.0.orig/setup.py Pillow-3.2.0/setup.py
--- Pillow-3.2.0.orig/setup.py 2016-04-01 14:17:23.000000000 +0200
+++ Pillow-3.2.0/setup.py 2016-04-28 23:24:08.633969175 +0200
@@ -90,11 +90,11 @@ except (ImportError, OSError):
NAME = 'Pillow'
PILLOW_VERSION = '3.2.0'
TCL_ROOT = None
-JPEG_ROOT = None
+JPEG_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
JPEG2K_ROOT = None
-ZLIB_ROOT = None
-TIFF_ROOT = None
-FREETYPE_ROOT = None
+ZLIB_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+TIFF_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
+FREETYPE_ROOT = _lib_include(os.environ['STAGING_DIR'] + "/usr")
LCMS_ROOT = None
@@ -187,129 +187,6 @@ class pil_build_ext(build_ext):
_add_directory(library_dirs, os.path.join(prefix, "lib"))
_add_directory(include_dirs, os.path.join(prefix, "include"))
- #
- # add platform directories
-
- if 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" %
- sys.version[:3], "config"))
-
- elif sys.platform == "darwin":
- # attempt to make sure we pick freetype2 over other versions
- _add_directory(include_dirs, "/sw/include/freetype2")
- _add_directory(include_dirs, "/sw/lib/freetype2/include")
- # fink installation directories
- _add_directory(library_dirs, "/sw/lib")
- _add_directory(include_dirs, "/sw/include")
- # darwin ports installation directories
- _add_directory(library_dirs, "/opt/local/lib")
- _add_directory(include_dirs, "/opt/local/include")
-
- # if Homebrew is installed, use its lib and include directories
- import subprocess
- try:
- prefix = subprocess.check_output(['brew', '--prefix']).strip(
- ).decode('latin1')
- except:
- # Homebrew not installed
- prefix = None
-
- ft_prefix = None
-
- if prefix:
- # add Homebrew's include and lib directories
- _add_directory(library_dirs, os.path.join(prefix, 'lib'))
- _add_directory(include_dirs, os.path.join(prefix, 'include'))
- ft_prefix = os.path.join(prefix, 'opt', 'freetype')
-
- if ft_prefix and os.path.isdir(ft_prefix):
- # freetype might not be linked into Homebrew's prefix
- _add_directory(library_dirs, os.path.join(ft_prefix, 'lib'))
- _add_directory(include_dirs,
- os.path.join(ft_prefix, 'include'))
- else:
- # fall back to freetype from XQuartz if
- # Homebrew's freetype is missing
- _add_directory(library_dirs, "/usr/X11/lib")
- _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()
-
- elif sys.platform.startswith("gnu"):
- self.add_multiarch_paths()
-
- elif sys.platform.startswith("freebsd"):
- _add_directory(library_dirs, "/usr/local/lib")
- _add_directory(include_dirs, "/usr/local/include")
-
- elif sys.platform.startswith("netbsd"):
- _add_directory(library_dirs, "/usr/pkg/lib")
- _add_directory(include_dirs, "/usr/pkg/include")
-
- elif sys.platform.startswith("sunos5"):
- _add_directory(library_dirs, "/opt/local/lib")
- _add_directory(include_dirs, "/opt/local/include")
-
- # FIXME: check /opt/stuff directories here?
-
# locate tkinter libraries
if _tkinter:
@@ -343,21 +220,6 @@ class pil_build_ext(build_ext):
else:
TCL_ROOT = None
- # add standard directories
-
- # look for tcl specific subdirectory (e.g debian)
- if _tkinter:
- tcl_dir = "/usr/include/tcl" + TCL_VERSION
- if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
- _add_directory(include_dirs, tcl_dir)
-
- # standard locations
- _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")
-
# on Windows, look for the OpenJPEG libraries in the location that
# the official installer puts them
if sys.platform == "win32":
@@ -449,7 +311,7 @@ class pil_build_ext(build_ext):
# look for freetype2 include files
freetype_version = 0
for dir in self.compiler.include_dirs:
- if os.path.isfile(os.path.join(dir, "ft2build.h")):
+ if os.path.isfile(os.path.join(dir, "freetype2/ft2build.h")):
freetype_version = 21
dir = os.path.join(dir, "freetype2")
break

+ 0
- 62
lang/python-imglib/Makefile View File

@ -1,62 +0,0 @@
#
# Copyright (c) 1997-2009 by Secret Labs AB
# Copyright (c) 1995-2009 by Fredrik Lundh
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-imglib
PKG_VERSION:=1.1.7
PKG_RELEASE:=1
PKG_LICENSE:=CUSTOM
PKG_LICENSE_FILES:=README
PKG_SOURCE:=Imaging-$(PKG_VERSION).tar.gz
PKG_SOURCE_URL:=http://effbot.org/downloads
PKG_MD5SUM:=fc14a54e1ce02a0225be8854bfba478e
PKG_BUILD_DIR:=$(BUILD_DIR)/Imaging-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=python python-setuptools
include $(INCLUDE_DIR)/package.mk
$(call include_mk, python-package.mk)
define Package/python-imglib
SECTION:=language-python
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=Python Imaging Library (PIL)
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://www.pythonware.com/products/pil/
DEPENDS:=+python +libfreetype +libjpeg +zlib
endef
define Package/python-imglib/description
The Python Imaging Library adds image processing capabilities to your
Python interpreter.
This library provides extensive file format support, an efficient
internal representation, and fairly powerful image processing
capabilities.
The core image library is designed for fast access to data stored in a
few basic pixel formats. It should provide a solid foundation for a
general image processing tool.
endef
define Build/Compile
$(call Build/Compile/PyMod,., \
install --prefix="/usr" --root="$(PKG_INSTALL_DIR)", \
)
endef
define Package/python-imglib/install
$(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
$(INSTALL_DIR) $(1)/usr/bin
$(CP) \
$(PKG_INSTALL_DIR)$(PYTHON_PKG_DIR)/* \
$(1)$(PYTHON_PKG_DIR)/
$(CP) $(PKG_INSTALL_DIR)/usr/bin/* $(1)/usr/bin
endef
$(eval $(call BuildPackage,python-imglib))

+ 0
- 48
lang/python-imglib/patches/010-cross-compile.patch View File

@ -1,48 +0,0 @@
diff -rupN Imaging-1.1.7.orig/setup.py Imaging-1.1.7/setup.py
--- Imaging-1.1.7.orig/setup.py 2009-11-15 17:06:10.000000000 +0100
+++ Imaging-1.1.7/setup.py 2014-12-11 01:01:10.857100877 +0100
@@ -34,10 +34,10 @@ def libinclude(root):
# TIFF_ROOT = libinclude("/opt/tiff")
TCL_ROOT = None
-JPEG_ROOT = None
-ZLIB_ROOT = None
+JPEG_ROOT = os.environ['STAGING_DIR'] + "/usr/lib", os.environ['STAGING_DIR'] + "/usr/include"
+ZLIB_ROOT = os.environ['STAGING_DIR'] + "/usr/lib", os.environ['STAGING_DIR'] + "/usr/include"
TIFF_ROOT = None
-FREETYPE_ROOT = None
+FREETYPE_ROOT = os.environ['STAGING_DIR'] + "/usr/lib", os.environ['STAGING_DIR'] + "/usr/include"
LCMS_ROOT = None
# FIXME: add mechanism to explicitly *disable* the use of a library
@@ -147,7 +147,6 @@ class pil_build_ext(build_ext):
add_directory(library_dirs, "/opt/local/lib")
add_directory(include_dirs, "/opt/local/include")
- add_directory(library_dirs, "/usr/local/lib")
# FIXME: check /opt/stuff directories here?
prefix = sysconfig.get_config_var("prefix")
@@ -199,22 +198,6 @@ class pil_build_ext(build_ext):
add_directory(include_dirs, include_root)
#
- # add standard directories
-
- # look for tcl specific subdirectory (e.g debian)
- if _tkinter:
- tcl_dir = "/usr/include/tcl" + TCL_VERSION
- if os.path.isfile(os.path.join(tcl_dir, "tk.h")):
- add_directory(include_dirs, tcl_dir)
-
- # standard locations
- 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")
-
- #
# insert new dirs *before* default libs, to avoid conflicts
# between Python PYD stub libs and real libraries

+ 0
- 21
lang/python-imglib/patches/020-freetype-header-include.patch View File

@ -1,21 +0,0 @@
diff -rupN Imaging-1.1.7.orig/_imagingft.c Imaging-1.1.7/_imagingft.c
--- Imaging-1.1.7.orig/_imagingft.c 2009-11-01 01:44:12.000000000 +0100
+++ Imaging-1.1.7/_imagingft.c 2014-12-11 01:05:21.290135484 +0100
@@ -32,7 +32,7 @@
#include FT_FREETYPE_H
#else
/* freetype 2.0 */
-#include <freetype/freetype.h>
+#include <freetype2/freetype.h>
#endif
#if PY_VERSION_HEX < 0x01060000
@@ -70,7 +70,7 @@ struct {
const char* message;
} ft_errors[] =
-#include <freetype/fterrors.h>
+#include <freetype2/fterrors.h>
/* -------------------------------------------------------------------- */
/* font objects */

+ 1
- 1
net/seafile-seahub/Makefile View File

@ -27,7 +27,7 @@ define Package/seafile-seahub
TITLE:=Seafile server - seahub component TITLE:=Seafile server - seahub component
MAINTAINER:=Gergely Kiss <mail.gery@gmail.com> MAINTAINER:=Gergely Kiss <mail.gery@gmail.com>
URL:=http://seafile.com/ URL:=http://seafile.com/
DEPENDS:=+python +simplejson +python-imglib +python-setuptools
DEPENDS:=+python +simplejson +pillow +python-setuptools
endef endef
define Package/seafile-seahub/description define Package/seafile-seahub/description


Loading…
Cancel
Save