bsd.efl.mk 6.52 KB
Newer Older
1
2
3
4
5
6
#
# $MBSDlabs: portmk/bsd.efl.mk,v 1.17 2006/10/02 14:57:48 stas Exp $
# $FreeBSD$
#
# bsd.efl.mk - Support for Enlightenment Foundation Libraries (EFL)
#
7
# Author: Stanislav Sedov <stas@FreeBSD.org>
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Inspired by bsd.sdl.mk by Edwin Groothuis <edwin@freebsd.org>
#
# You can specify EFL-related library dependency using "USE_EFL=" statement,
# e.g. "USE_EFL= ecore evas" will add x11/ecore and graphics/evas as dependency
# for your port.
# You can check existency of certain library throught "WANT_EFL/HAVE_EFL" pair.
# Note: WANT_EFL should be defined before including <bsd.port.pre.mk>, and
# HAVE_EFL variable could be tested after it. For example:
#
#	WANT_EFL=	yes
#	.include <bsd.port.pre.mk>
#	.if ${HAVE_EFL:Mevas}
#	USE_EFL+=	evas
#	.endif
#
# Currently recognized variables are:
# USE_EFL	- lists all EFL libraries which port depends on
# WANT_EFL	- the port wants to test which of EFL libraries are installed
gblach's avatar
gblach committed
26
#			on the target system
27
28
29
30
31
32
33
#
# The following variables could be tested after inclusion of bsd.port.pre.mk:
# HAVE_EFL	- lists all EFL libraries which are available on target system
#
# Feel free to send any comments and suggestion to maintainer.
#

34
EFL_Include_MAINTAINER=	gblach@FreeBSD.org
35
36
37
38

#
# Define all supported libraries
#
39
_USE_EFL_ALL=	epeg imlib2
40
41
42
43
44
45
46
47
48
49
50
51

# For each library supported we define the following variables:
#	_%%LIB%%_CATEGORY	- category the port belongs to
#	_%%LIB%%_PREFIX		- where the library is installed
#	_%%LIB%%_VERSION	- version of the shared library
#	_%%LIB%%_SLIB		- name of the shared library
#

_epeg_CATEGORY=		graphics
_epeg_VERSION=		9

_imlib2_CATEGORY=	graphics
52
_imlib2_VERSION=	5
53
54
55
56
57
58
59
60
61
_imlib2_SLIB=		Imlib2

#
# Assign values for variables which were not defined explicitly
#
.for LIB in ${_USE_EFL_ALL}
. if !defined(_${LIB}_SLIB)
_${LIB}_SLIB=${LIB}
. endif
62
63
64
. if !defined(_${LIB}_PORTNAME)
_${LIB}_PORTNAME=${LIB}
. endif
65
66
67
. if !defined(_${LIB}_PREFIX)
_${LIB}_PREFIX=${LOCALBASE}
. endif
68
69
70
71
72
73
74
75
76
77
78
79
.endfor

#
# Handle WANT_EFL feature
#
.if !defined(AFTERPORTMK)
.if !defined(EFL_Include_pre)

EFL_Include_pre=	bsd.efl.mk

HAVE_EFL?=
.if defined(WANT_EFL)
80
81
82
#
# General EFL components
#
83
84
85
86
87
88
89
90
91
92
93
. for LIB in ${_USE_EFL_ALL}
.  if exists(${_${LIB}_PREFIX}/lib/lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION})
HAVE_EFL+=	${LIB}
.  endif
. endfor
.endif

.endif #EFL_Include_pre
.endif #AFTERPORTMK

#
94
# Handle USE_EFL feature
95
96
97
98
#
.if !defined(BEFOREPORTMK)
.if !defined(EFL_Include_post)

99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
.if defined(USE_EFL_EVAS_ENGINES)

USE_EFL+=	evas

_USE_EFL_EVAS_ENGINES=	#empty
. for COMP in ${USE_EFL_EVAS_ENGINES}
.  if ${_EFL_EVAS_ENGINES_ALL:M${COMP}}==""
IGNORE=	cannot install: unknown evas engine ${COMP}
.  else
_USE_EFL_EVAS_ENGINES+=	${COMP}
.  endif
. endfor

# Get rid of duplicates
_USE_EFL_EVAS_ENGINES_UQ=	#empty
. for COMP in ${_USE_EFL_EVAS_ENGINES}
.  if ${_USE_EFL_EVAS_ENGINES_UQ:M${COMP}}==""
_USE_EFL_EVAS_ENGINES_UQ+=	${COMP}
.  endif
. endfor

. for COMP in ${_USE_EFL_EVAS_ENGINES_UQ}
bapt's avatar
bapt committed
121
122
BUILD_DEPENDS+=	${_EFL_EVAS_ENGINES_MODDIR}/${_evas_engine_${COMP}_DIR}/${OPSYS:tl}${OSREL}-${ARCH}/module.so:${PORTSDIR}/${_evas_engine_${COMP}_CATEGORY}/${_evas_engine_${COMP}_PORTNAME}
RUN_DEPENDS+=	${_EFL_EVAS_ENGINES_MODDIR}/${_evas_engine_${COMP}_DIR}/${OPSYS:tl}${OSREL}-${ARCH}/module.so:${PORTSDIR}/${_evas_engine_${COMP}_CATEGORY}/${_evas_engine_${COMP}_PORTNAME}
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
148
. endfor

.endif #USE_EFL_EVAS_ENGINES

.if defined(USE_EFL_EVAS_LOADERS)

USE_EFL+=	evas

_USE_EFL_EVAS_LOADERS=	#empty
. for COMP in ${USE_EFL_EVAS_LOADERS}
.  if ${_EFL_EVAS_LOADERS_ALL:M${COMP}}==""
IGNORE=	cannot install: unknown evas loader ${COMP}
.  else
_USE_EFL_EVAS_LOADERS+=	${COMP}
.  endif
. endfor

# Get rid of duplicates
_USE_EFL_EVAS_LOADERS_UQ=	#empty
. for COMP in ${_USE_EFL_EVAS_LOADERS}
.  if ${_USE_EFL_EVAS_LOADERS_UQ:M${COMP}}==""
_USE_EFL_EVAS_LOADERS_UQ+=	${COMP}
.  endif
. endfor

. for COMP in ${_USE_EFL_EVAS_LOADERS_UQ}
bapt's avatar
bapt committed
149
150
BUILD_DEPENDS+=	${_EFL_EVAS_LOADERS_MODDIR}/${_evas_loader_${COMP}_DIR}/${OPSYS:tl}${OSREL}-${ARCH}/module.so:${PORTSDIR}/${_evas_loader_${COMP}_CATEGORY}/${_evas_loader_${COMP}_PORTNAME}
RUN_DEPENDS+=	${_EFL_EVAS_LOADERS_MODDIR}/${_evas_loader_${COMP}_DIR}/${OPSYS:tl}${OSREL}-${ARCH}/module.so:${PORTSDIR}/${_evas_loader_${COMP}_CATEGORY}/${_evas_loader_${COMP}_PORTNAME}
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
. endfor

.endif #USE_EFL_EVAS_LOADERS

.if defined(USE_EFL_ECORE)

USE_EFL+=	ecore

_USE_EFL_ECORE=	#empty
. for COMP in ${USE_EFL_ECORE}
.  if ${_EFL_ECORE_ALL:M${COMP}}==""
IGNORE=	cannot install: unknown ecore module ${COMP}
.  else
_USE_EFL_ECORE+=	${COMP}
.  endif
. endfor

# Get rid of duplicates
_USE_EFL_ECORE_UQ=	#empty
. for COMP in ${_USE_EFL_ECORE}
.  if ${_USE_EFL_ECORE_UQ:M${COMP}}==""
_USE_EFL_ECORE_UQ+=	${COMP}
.  endif
. endfor

. for COMP in ${_USE_EFL_ECORE_UQ}
gblach's avatar
gblach committed
177
LIB_DEPENDS+=	lib${_ecore_${COMP}_NAME}.so.${_ecore_VERSION}:${PORTSDIR}/${_ecore_${COMP}_CATEGORY}/${_ecore_${COMP}_PORTNAME}
178
179
180
181
. endfor

.endif #USE_EFL_ECORE

182
183
184
185
186
187
188
.if defined(USE_EFL)

EFL_Include_post=	bsd.efl.mk

#
# Check if we have all libraries requiested and build depends list
#
189
190
191
192
193
194
195
196
197
.if ${USE_EFL:Mlibrt_hack}
_USE_EFL_LIBRT_HACK=	yes
.endif
.if ${USE_EFL:Mmodarch_hack}
_USE_EFL_MODARCH_HACK=	yes
.endif
.if ${USE_EFL:Mlibtool_hack}
_USE_EFL_LIBTOOL_HACK=	yes
.endif
198
_USE_EFL=	#empty
199
.for LIB in ${USE_EFL:Nlibrt_hack:Nmodarch_hack:Nlibtool_hack}
200
201
. if ${_USE_EFL_ALL:M${LIB}}==""
IGNORE=	cannot install: unknown library ${LIB}
202
. else
gblach's avatar
gblach committed
203
_USE_EFL+=	${LIB}
204
. endif
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
.endfor

#
# Get rid of duplicates
#
_USE_EFL_UQ=	#empty
.for LIB in ${_USE_EFL}
. if ${_USE_EFL_UQ:M${LIB}}==""
_USE_EFL_UQ+=	${LIB}
. endif
.endfor

#
# define dependencies
#
.for LIB in ${_USE_EFL_UQ}
gblach's avatar
gblach committed
221
LIB_DEPENDS+=	lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION}:${PORTSDIR}/${_${LIB}_CATEGORY}/${_${LIB}_PORTNAME}
222
223
224
225
226
.endfor

#
# Initialize configure enviropment
#
227
228
229
CPPFLAGS+=	-I${LOCALBASE}/include
LDFLAGS+=	-L${LOCALBASE}/lib
CFLAGS+=	-I${LOCALBASE}/include
230

bapt's avatar
bapt committed
231
PLIST_SUB+=	E17_ARCH=${OPSYS:tl}${OSREL}-${ARCH}
232

233
234
235
236
237
238
239
.if defined(_USE_EFL_LIBRT_HACK)
#
# Don't use librt
#
post-patch: efl_drop_librt
efl_drop_librt:
	@${REINPLACE_CMD} -E \
gblach's avatar
gblach committed
240
241
		-e '/^[[:space:]]+freebsd\*/,/^[[:space:]];;/s/-lrt//g' \
		${WRKSRC}/configure
242
243
244
245
246
247
248
249
250
.endif

.if defined(_USE_EFL_MODARCH_HACK)
#
# Use correct module arch path
#
post-patch: efl_patch_modarch
efl_patch_modarch:
	@${REINPLACE_CMD} -E \
gblach's avatar
gblach committed
251
252
253
		-e 's/(MODULE_ARCH="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \
		-e 's/(MODULE_EDJE="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \
		${WRKSRC}/configure
254
255
256
257
258
259
260
261
262
.endif

.if defined(_USE_EFL_LIBTOOL_HACK)
#
# Get rid of .la and static library files
#
post-configure: efl_drop_la
efl_drop_la:
	${REINPLACE_CMD} -E -e \
gblach's avatar
gblach committed
263
		'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
264
265
.endif

266
267
268
269
.endif #USE_EFL

.endif #EFL_Include_post
.endif #BEFOREPORTMK