summaryrefslogtreecommitdiff
path: root/devel/directfb/Makefile
blob: e5e5467cf42e17e8d8c180093e452aa048baacd6 (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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
# New ports collection makefile for:	DirectFB
# Date created:				19 October 2002
# Whom:					Devaux Fabien <fab@gcu.info>
#
# $FreeBSD$
#

PORTNAME=	directfb
PORTVERSION=	1.4.13
CATEGORIES=	devel
MASTER_SITES=	http://www.directfb.org/downloads/Core/${DISTNAME:R}/
DISTNAME=	DirectFB-${PORTVERSION}

MAINTAINER=	anatoly.borodin@gmail.com
COMMENT=	Graphic development lightweight API

LIB_DEPENDS=	jpeg.11:${PORTSDIR}/graphics/jpeg \
		png.6:${PORTSDIR}/graphics/png

LICENSE=	LGPL21
LICENSE_FILE=	${WRKSRC}/COPYING

OPTIONS=	FREETYPE2	"Enable Freetype support" on \
		X11		"Enable X11 backend" on \
		SDL		"Enable SDL backend" on \
		UNIQUE		"Enable Unique (WM Module)" off \
		TESTS		"Install test apps" off

CPPFLAGS+=	-I${LOCALBASE}/include ${PTHREAD_CFLAGS}
LDFLAGS+=	${PTHREAD_LIBS}
USE_AUTOTOOLS=	libtool
GNU_CONFIGURE=	yes
USE_GMAKE=	yes
USE_GNOME=	gnomehack
USE_LDCONFIG=	yes
USE_PERL5_BUILD=yes
USE_NCURSES=	yes

DIRECTFB_SHLIB=	5 # LT_CURRENT
DIRECTFB_BIN=	5 # LT_BINARY
PLIST_SUB+=	DIRECTFB_VERSION="${PORTVERSION}" \
		DIRECTFB_RELEASE="${PORTVERSION:R}" \
		DIRECTFB_SHLIB="${DIRECTFB_SHLIB}" \
		DIRECTFB_BIN="${DIRECTFB_BIN}"

CONFIGURE_ARGS=	--disable-osx --disable-extra-warnings --disable-profiling \
		--disable-debug --enable-debug-support --disable-trace \
		--enable-text --enable-gettid --enable-network \
		--disable-multi --enable-voodoo --disable-pure-voodoo \
		--enable-devmem --disable-fbdev --disable-vnc --disable-sysfs \
		--enable-jpeg --enable-zlib --enable-png --enable-gif \
		--disable-linotype --disable-video4linux \
		--disable-video4linux2 --with-gfxdrivers=all \
		--with-inputdrivers=all --with-smooth-scaling \
		--with-dither-rgb16=advanced

.include <bsd.port.options.mk>

.if !defined(NOPORTDOCS)
BUILD_DEPENDS+=	man2html:${PORTSDIR}/textproc/man2html
PORTDOCS=	*
.endif

.if defined(WITH_FREETYPE2)
LIB_DEPENDS+=	freetype.9:${PORTSDIR}/print/freetype2
CONFIGURE_ARGS+=	--enable-freetype
PLIST_SUB+=	FREETYPE2=""
.else
CONFIGURE_ARGS+=	--disable-freetype
PLIST_SUB+=	FREETYPE2="@comment "
.endif

.if defined(WITH_X11)
USE_XORG+=	x11 xext xproto
CONFIGURE_ARGS+=	--enable-x11
PLIST_SUB+=	X11=""
.else
CONFIGURE_ARGS+=	--disable-x11
PLIST_SUB+=	X11="@comment "
.endif

.if defined(WITH_SDL)
USE_SDL+=	sdl
CONFIGURE_ARGS+=	--enable-sdl
PLIST_SUB+=	SDL=""
.else
CONFIGURE_ARGS+=	--disable-sdl
PLIST_SUB+=	SDL="@comment "
.endif

.if defined(WITH_UNIQUE)
CONFIGURE_ARGS+=	--enable-unique
PLIST_SUB+=	UNIQUE=""
.else
CONFIGURE_ARGS+=	--disable-unique
PLIST_SUB+=	UNIQUE="@comment "
.endif

.if defined(WITH_TESTS)
CONFIGURE_ARGS+=	--with-tests
PLIST_SUB+=	TESTS=""
.else
CONFIGURE_ARGS+=	--without-tests
PLIST_SUB+=	TESTS="@comment "
.endif

MAN1=		directfb-csource.1 dfbg.1
MAN5=		directfbrc.5

.include <bsd.port.pre.mk>

.if ${ARCH} == "alpha"
BROKEN=		Does not compile on alpha
.endif

.if ${ARCH} == "arm"
PLIST_SUB+=	ARCH_ARM=""
.else
PLIST_SUB+=	ARCH_ARM="@comment "
.endif

.if ${ARCH} == "powerpc"
PLIST_SUB+=	ARCH_POWERPC=""
.else
PLIST_SUB+=	ARCH_POWERPC="@comment "
.endif

post-patch:
	@${REINPLACE_CMD} -e \
		's|-lc_r|${PTHREAD_LIBS}|g ; s|%%LTMAIN%%|${LTMAIN}|g ; \
		s|/usr/local|${LOCALBASE}|g ; s|/usr/X11R6|${LOCALBASE}|g' \
		${WRKSRC}/configure
	@${GREP} -lr alloca\.h ${WRKSRC} | ${XARGS} \
		${REINPLACE_CMD} -e 's|<alloca\.h>|<stdlib.h>|g'

.if !defined(NOPORTDOCS)
post-install:
	${MKDIR} ${DOCSDIR}/html
.for f in AUTHORS ChangeLog NEWS README TODO fb.modes docs/README.screenshots docs/*.html
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}
.endfor
.for f in docs/html/*.html docs/html/*.png
	${INSTALL_DATA} ${WRKSRC}/${f} ${DOCSDIR}/html
.endfor
.endif

.include <bsd.port.post.mk>