aboutsummaryrefslogtreecommitdiffstats
path: root/x11-toolkits/py-gtk2/Makefile
blob: 10cc47f65d86c31f0a4af6c329940775a67e1765 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# Created by: marc@informatik.uni-bremen.de
# $FreeBSD$
#   $MCom: ports/x11-toolkits/py-gtk2/Makefile,v 1.78 2011/04/01 12:35:27 kwm Exp $

PORTNAME=   gtk
PORTVERSION=    2.24.0
PORTREVISION=   5
CATEGORIES= x11-toolkits python
MASTER_SITES=   GNOME/sources/pygtk/${PORTVERSION:C/^([0-9]+\.[0-9]+).*/\1/}
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
PKGNAMESUFFIX=  2
DISTNAME=   pygtk-${PORTVERSION}
DIST_SUBDIR=    gnome2

MAINTAINER= gnome@FreeBSD.org
COMMENT=    Set of Python bindings for GTK+

BUILD_DEPENDS=  ${PYTHON_SITELIBDIR}/cairo/__init__.py:graphics/py-cairo@${PY_FLAVOR}
RUN_DEPENDS=    ${PYTHON_SITELIBDIR}/cairo/__init__.py:graphics/py-cairo@${PY_FLAVOR}

USES=       gettext gmake libtool pathfix pkgconfig python:2.7 tar:bzip2
USE_GNOME=  libglade2 pygobject
USE_PYTHON= flavors
GNU_CONFIGURE=  yes
CPPFLAGS+=  -I${LOCALBASE}/include
LDFLAGS+=   -L${LOCALBASE}/lib
CONFIGURE_ARGS= --disable-docs

DOCSDIR=    ${PREFIX}/share/doc/py-gtk
EG_SRC_DIR= ${WRKSRC}/examples
EXAMPLESDIR=    ${PREFIX}/share/examples/py-gtk

CONFLICTS=  py*-gtk-0*

OPTIONS_DEFINE= NUMPY DOCS EXAMPLES
NUMPY_DESC= Numpy support (pulls in lang/gcc)

.include <bsd.port.options.mk>

.if ${PORT_OPTIONS:MNUMPY}
BUILD_DEPENDS+= ${PYNUMPY}
RUN_DEPENDS+=   ${PYNUMPY}
CONFIGURE_ARGS+=--enable-numpy
.else
CONFIGURE_ARGS+=--disable-numpy
.endif

#
# Use the same way as the Python port to determine if we want
# threading support.
#
.if !defined(WITHOUT_THREADS)
CONFIGURE_ARGS+=    --enable-thread
LDFLAGS+=       -lpthread
.else
CONFIGURE_ARGS+=    --disable-thread
.endif

post-install:
.if ${PORT_OPTIONS:MEXAMPLES}
    @${RM} ${WRKSRC}/examples/pygtk-demo/pygtk-demo.in
    ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
    cd ${EG_SRC_DIR} && ${COPYTREE_SHARE} . ${STAGEDIR}${EXAMPLESDIR}
.endif
.if ${PORT_OPTIONS:MDOCS}
    ${MKDIR} ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/MAPPING ${STAGEDIR}${DOCSDIR}
    ${INSTALL_DATA} ${WRKSRC}/THREADS ${STAGEDIR}${DOCSDIR}
.endif
    @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/gtk-2.0/gtk/*.so
    @${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/gtk-2.0/*.so

.include <bsd.port.mk>