Build the python sane bindings.

Subpackage this port:
py-Pillow
py-sane

ok sthen@ rpointel@
This commit is contained in:
ajacoutot 2014-08-14 07:04:22 +00:00
parent 42399626b3
commit 6be0de9820
6 changed files with 53 additions and 9 deletions

View File

@ -1,41 +1,63 @@
# $OpenBSD: Makefile,v 1.3 2014/04/06 21:10:19 sthen Exp $
# $OpenBSD: Makefile,v 1.4 2014/08/14 07:04:22 ajacoutot Exp $
COMMENT= Python Imaging Library (fork)
COMMENT-main= Python Imaging Library (fork)
COMMENT-sane= Python SANE module
MODPY_EGG_VERSION= 2.4.0
DISTNAME= Pillow-${MODPY_EGG_VERSION}
PKGNAME= py-${DISTNAME}
PKGNAME-main= py-${DISTNAME}
PKGNAME-sane= py-sane-${MODPY_EGG_VERSION}
CATEGORIES= graphics
REVISION-main= 0
HOMEPAGE= https://github.com/python-imaging/Pillow
# PIL Software License
# Permission to use, copy, modify and distribute freely.
PERMIT_PACKAGE_CDROM= Yes
MULTI_PACKAGES= -main -sane
MASTER_SITES= ${MASTER_SITE_PYPI:=P/Pillow/}
EXTRACT_SUFX= .zip
WANTLIB= freetype jpeg lcms2 pthread tiff webp z \
WANTLIB-main= freetype jpeg lcms2 pthread tiff webp z \
webpdemux webpmux \
${MODPY_WANTLIB} ${MODTK_WANTLIB}
WANTLIB-sane= pthread sane ${MODPY_WANTLIB}
MODULES= lang/python \
x11/tk
# ${MODPY_TKINTER_DEPENDS} appends ,tkinter to devel/setuptools too.
BUILD_DEPENDS= ${RUN_DEPENDS}
RUN_DEPENDS= lang/python/${MODPY_VERSION},-tkinter
LIB_DEPENDS= graphics/lcms2 \
BUILD_DEPENDS= lang/python/${MODPY_VERSION},-tkinter
RUN_DEPENDS-main= ${MODPY_RUN_DEPENDS} \
lang/python/${MODPY_VERSION},-tkinter
LIB_DEPENDS-main= graphics/lcms2 \
graphics/libwebp \
${MODTK_LIB_DEPENDS}
RUN_DEPENDS-sane= ${BASE_PKGPATH},-main
LIB_DEPENDS-sane= ${MODPY_LIB_DEPENDS} \
graphics/sane-backends
MODPY_SETUPTOOLS= Yes
INCL_DIR= ${PREFIX}/include/python${MODPY_VERSION}
MODPY_ADJ_FILES= Scripts/*.py
pre-configure:
${SUBST_CMD} ${WRKSRC}/Sane/setup.py
post-build:
cd ${WRKSRC}/Sane && ${MODPY_BIN} setup.py build
post-install:
cd ${WRKSRC}/Sane && \
${MODPY_BIN} setup.py install --skip-build --root ${WRKINST}
for s in ${WRKSRC}/Scripts/*.py; do \
${INSTALL_SCRIPT} $$s ${PREFIX}/bin/`basename $$s .py`; \
done

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-Sane_setup_py,v 1.1 2014/08/14 07:04:22 ajacoutot Exp $
--- Sane/setup.py.orig Wed Aug 6 16:04:10 2014
+++ Sane/setup.py Wed Aug 6 16:04:31 2014
@@ -11,9 +11,9 @@ except ImportError:
pass
sane = Extension('_sane',
- include_dirs = [PIL_IMAGING_DIR],
+ include_dirs = [PIL_IMAGING_DIR, '${LOCALBASE}/include'],
libraries = ['sane'],
- library_dirs = [PIL_IMAGING_DIR],
+ library_dirs = [PIL_IMAGING_DIR, '${LOCALBASE}/lib'],
define_macros = defs,
sources = ['_sane.c'])

View File

@ -0,0 +1,2 @@
The Python SANE module provides an interface to the SANE scanner and
frame grabber interface.

View File

@ -1,6 +1,6 @@
@comment $OpenBSD: PLIST,v 1.2 2014/04/06 21:10:19 sthen Exp $
@comment $OpenBSD: PLIST-main,v 1.1 2014/08/14 07:04:22 ajacoutot Exp $
@conflict py-Imaging-*
@pkgpath graphics/py-Imaging
@pkgpath graphics/py-Pillow
@pkgpath graphics/py-Imaging,-bin[,python2.4][,python2.5][,python2.6][,python2.7]
@pkgpath graphics/py-Imaging,-docs[,python2.4][,python2.5][,python2.6][,python2.7]
@pkgpath graphics/py-Imaging,-examples[,python2.4][,python2.5][,python2.6][,python2.7]

View File

@ -0,0 +1,5 @@
@comment $OpenBSD: PLIST-sane,v 1.1 2014/08/14 07:04:22 ajacoutot Exp $
lib/python${MODPY_VERSION}/site-packages/_sane.so
lib/python${MODPY_VERSION}/site-packages/pysane-2.0-py${MODPY_VERSION}.egg-info
lib/python${MODPY_VERSION}/site-packages/sane.py
lib/python${MODPY_VERSION}/site-packages/sane.pyc