Import devel/fpc-fpmkunit version 2.6.4
[dports.git] / Mk / bsd.efl.mk
1 #
2 # $MBSDlabs: portmk/bsd.efl.mk,v 1.17 2006/10/02 14:57:48 stas Exp $
3 # $FreeBSD$
4 #
5 # bsd.efl.mk - Support for Enlightenment Foundation Libraries (EFL)
6 #
7 # Author: Stanislav Sedov <stas@FreeBSD.org>
8 # Inspired by bsd.sdl.mk by Edwin Groothuis <edwin@freebsd.org>
9 #
10 # You can specify EFL-related library dependency using "USE_EFL=" statement,
11 # e.g. "USE_EFL= ecore evas" will add x11/ecore and graphics/evas as dependency
12 # for your port.
13 # You can check existency of certain library throught "WANT_EFL/HAVE_EFL" pair.
14 # Note: WANT_EFL should be defined before including <bsd.port.pre.mk>, and
15 # HAVE_EFL variable could be tested after it. For example:
16 #
17 #       WANT_EFL=       yes
18 #       .include <bsd.port.pre.mk>
19 #       .if ${HAVE_EFL:Mevas}
20 #       USE_EFL+=       evas
21 #       .endif
22 #
23 # Currently recognized variables are:
24 # USE_EFL       - lists all EFL libraries which port depends on
25 # WANT_EFL      - the port wants to test which of EFL libraries are installed
26 #                       on the target system
27 #
28 # The following variables could be tested after inclusion of bsd.port.pre.mk:
29 # HAVE_EFL      - lists all EFL libraries which are available on target system
30 #
31 # Feel free to send any comments and suggestion to maintainer.
32 #
33
34 EFL_Include_MAINTAINER= gblach@FreeBSD.org
35
36 #
37 # Define all supported libraries
38 #
39 _USE_EFL_ALL=   ecore edbus edje eet efreet eio eina elementary embryo \
40                 emotion ender enesim epeg esvg etch ethumb evas imlib2
41
42 # For each library supported we define the following variables:
43 #       _%%LIB%%_CATEGORY       - category the port belongs to
44 #       _%%LIB%%_PREFIX         - where the library is installed
45 #       _%%LIB%%_VERSION        - version of the shared library
46 #       _%%LIB%%_SLIB           - name of the shared library
47 #
48
49 _ecore_CATEGORY=        devel
50 _ecore_PORTNAME=        ecore-main
51 _ecore_VERSION=         8
52
53 _edbus_CATEGORY=        devel
54 _edbus_PORTNAME=        e_dbus
55 _edbus_VERSION=         8
56
57 _eet_CATEGORY=          devel
58 _eet_VERSION=           8
59
60 _efreet_CATEGORY=       x11
61 _efreet_VERSION=        8
62
63 _edje_CATEGORY=         graphics
64 _edje_VERSION=          8
65
66 _eio_CATEGORY=          devel
67 _eio_VERSION=           8
68
69 _eina_CATEGORY=         devel
70 _eina_VERSION=          8
71
72 _elementary_CATEGORY=   x11-toolkits
73 _elementary_VERSION=    8
74
75 _embryo_CATEGORY=       lang
76 _embryo_VERSION=        8
77
78 _emotion_CATEGORY=      multimedia
79 _emotion_VERSION=       8
80
81 _ender_CATEGORY=        graphics
82 _ender_VERSION=         0
83
84 _enesim_CATEGORY=       graphics
85 _enesim_VERSION=        0
86
87 _epeg_CATEGORY=         graphics
88 _epeg_VERSION=          9
89
90 _esvg_CATEGORY=         www
91 _esvg_PORTNAME=         egueb
92 _esvg_VERSION=          0
93
94 _etch_CATEGORY=         graphics
95 _etch_VERSION=          0
96
97 _ethumb_CATEGORY=       graphics
98 _ethumb_VERSION=        8
99
100 _evas_CATEGORY=         graphics
101 _evas_PORTNAME=         evas-core
102 _evas_VERSION=          8
103
104 _imlib2_CATEGORY=       graphics
105 _imlib2_VERSION=        5
106 _imlib2_SLIB=           Imlib2
107
108 #
109 # Assign values for variables which were not defined explicitly
110 #
111 .for LIB in ${_USE_EFL_ALL}
112 . if !defined(_${LIB}_SLIB)
113 _${LIB}_SLIB=${LIB}
114 . endif
115 . if !defined(_${LIB}_PORTNAME)
116 _${LIB}_PORTNAME=${LIB}
117 . endif
118 . if !defined(_${LIB}_PREFIX)
119 _${LIB}_PREFIX=${LOCALBASE}
120 . endif
121 .endfor
122
123 #
124 # Evas engines and loaders support.
125 # Values processed:
126 # _evas_engine_COMP_CATEGORY    - Where the port for this object is located
127 # _evas_engine_COMP_PORTNAME    - Object's port subdirectory
128 # _evas_engine_COMP_DIR         - Evas object's subdir
129 #
130
131 # All components that are currently supported
132 _EFL_EVAS_ENGINES_ALL=  buffer opengl sdl x11
133 _EFL_EVAS_LOADERS_ALL=  bmp eet generic gif ico jpeg \
134                         png pmaps psd svg tga tiff wbmp xpm
135
136 #
137 # Generic evas engines definitions
138 #
139 _EFL_EVAS_CATEGORY=             graphics
140 _EFL_EVAS_MODDIR=               ${LOCALBASE}/lib/evas/modules
141 _EFL_EVAS_ENGINES_MODDIR=       ${_EFL_EVAS_MODDIR}/engines
142 _EFL_EVAS_LOADERS_MODDIR=       ${_EFL_EVAS_MODDIR}/loaders
143
144 #
145 # Evas engine modules definitions
146 #
147
148 _evas_engine_buffer_DIR=        buffer
149 _evas_engine_opengl_DIR=        gl_x11
150 _evas_engine_sdl_DIR=           software_16_sdl
151 _evas_engine_x11_DIR=           software_x11
152
153 #
154 # Assign values for variables which were not defined explicitly
155 #
156 .for COMP in ${_EFL_EVAS_ENGINES_ALL}
157 . if !defined(_evas_engine_${COMP}_CATEGORY)
158 _evas_engine_${COMP}_CATEGORY=  ${_EFL_EVAS_CATEGORY}
159 . endif
160 . if !defined(_evas_engine_${COMP}_PORTNAME)
161 _evas_engine_${COMP}_PORTNAME=  evas-engine-${COMP}
162 . endif
163 . if !defined(_evas_engine_${COMP}_DIR)
164 _evas_engine_${COMP}_DIR=       ${COMP}
165 . endif
166 .endfor
167
168 .for COMP in ${_EFL_EVAS_LOADERS_ALL}
169 . if !defined(_evas_loader_${COMP}_CATEGORY)
170 _evas_loader_${COMP}_CATEGORY=  ${_EFL_EVAS_CATEGORY}
171 . endif
172 . if !defined(_evas_loader_${COMP}_PORTNAME)
173 _evas_loader_${COMP}_PORTNAME=  evas-loader-${COMP}
174 . endif
175 . if !defined(_evas_loader_${COMP}_DIR)
176 _evas_loader_${COMP}_DIR=       ${COMP}
177 . endif
178 .endfor
179
180 #
181 # Ecore modules support
182 # Values processed:
183 # _ecore_COMP_CATEGORY  - Where the port for this object is located
184 # _ecore_COMP_PORTNAME  - Object's port subdirectory
185 # _ecore_COMP_NAME      - Ecore library name
186 #
187
188 # All components that are currently supported
189 _EFL_ECORE_ALL= con config desktop evas file imf imf_evas \
190                 input input_evas ipc job sdl txt x11
191
192 #
193 # Generic ecore definitions
194 #
195 _EFL_ECORE_CATEGORY=    devel
196 _EFL_ECORE_MODDIR=      ${LOCALBASE}/lib/
197
198 #
199 # Ecore modules definitions
200 #
201
202 _ecore_con_CATEGORY=            net
203 _ecore_config_CATEGORY=         sysutils
204 _ecore_desktop_CATEGORY=        x11
205 _ecore_evas_CATEGORY=           graphics
206 _ecore_sdl_CATEGORY=            graphics
207 _ecore_txt_CATEGORY=            converters
208 _ecore_imf_CATEGORY=            x11
209 _ecore_imf_evas_CATEGORY=       x11
210 _ecore_input_CATEGORY=          x11
211 _ecore_input_evas_CATEGORY=     x11
212 _ecore_x11_CATEGORY=            x11
213 _ecore_x11_NAME=                ecore_x
214
215 #
216 # Assign values for variables which were not defined explicitly
217 #
218 .for COMP in ${_EFL_ECORE_ALL}
219 . if !defined(_ecore_${COMP}_CATEGORY)
220 _ecore_${COMP}_CATEGORY=${_EFL_ECORE_CATEGORY}
221 . endif
222 . if !defined(_ecore_${COMP}_PORTNAME)
223 _ecore_${COMP}_PORTNAME=ecore-${COMP}
224 . endif
225 . if !defined(_ecore_${COMP}_NAME)
226 _ecore_${COMP}_NAME=    ecore_${COMP}
227 . endif
228 .endfor
229
230 #
231 # Handle WANT_EFL feature
232 #
233 .if !defined(AFTERPORTMK)
234 .if !defined(EFL_Include_pre)
235
236 EFL_Include_pre=        bsd.efl.mk
237
238 HAVE_EFL?=
239 HAVE_EFL_ECORE?=
240 .if defined(WANT_EFL)
241 #
242 # General EFL components
243 #
244 . for LIB in ${_USE_EFL_ALL}
245 .  if exists(${_${LIB}_PREFIX}/lib/lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION})
246 HAVE_EFL+=      ${LIB}
247 .  endif
248 . endfor
249
250 #
251 # Ecore components
252 #
253 . for COMP in ${_EFL_ECORE_ALL}
254 .  if exists(${_ecore_PREFIX}/lib/lib${_ecore_${COMP}_NAME}.so.${_ecore_VERSION})
255 HAVE_EFL_ECORE+=        ${COMP}
256 .  endif
257 . endfor
258 .endif
259
260 .endif #EFL_Include_pre
261 .endif #AFTERPORTMK
262
263 #
264 # Handle USE_EFL, USE_EFL_EVAS_* and USE_EFL_ECORE features
265 #
266 .if !defined(BEFOREPORTMK)
267 .if !defined(EFL_Include_post)
268
269 .if defined(USE_EFL_EVAS_ENGINES)
270
271 USE_EFL+=       evas
272
273 _USE_EFL_EVAS_ENGINES=  #empty
274 . for COMP in ${USE_EFL_EVAS_ENGINES}
275 .  if ${_EFL_EVAS_ENGINES_ALL:M${COMP}}==""
276 IGNORE= cannot install: unknown evas engine ${COMP}
277 .  else
278 _USE_EFL_EVAS_ENGINES+= ${COMP}
279 .  endif
280 . endfor
281
282 # Get rid of duplicates
283 _USE_EFL_EVAS_ENGINES_UQ=       #empty
284 . for COMP in ${_USE_EFL_EVAS_ENGINES}
285 .  if ${_USE_EFL_EVAS_ENGINES_UQ:M${COMP}}==""
286 _USE_EFL_EVAS_ENGINES_UQ+=      ${COMP}
287 .  endif
288 . endfor
289
290 . for COMP in ${_USE_EFL_EVAS_ENGINES_UQ}
291 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}
292 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}
293 . endfor
294
295 .endif #USE_EFL_EVAS_ENGINES
296
297 .if defined(USE_EFL_EVAS_LOADERS)
298
299 USE_EFL+=       evas
300
301 _USE_EFL_EVAS_LOADERS=  #empty
302 . for COMP in ${USE_EFL_EVAS_LOADERS}
303 .  if ${_EFL_EVAS_LOADERS_ALL:M${COMP}}==""
304 IGNORE= cannot install: unknown evas loader ${COMP}
305 .  else
306 _USE_EFL_EVAS_LOADERS+= ${COMP}
307 .  endif
308 . endfor
309
310 # Get rid of duplicates
311 _USE_EFL_EVAS_LOADERS_UQ=       #empty
312 . for COMP in ${_USE_EFL_EVAS_LOADERS}
313 .  if ${_USE_EFL_EVAS_LOADERS_UQ:M${COMP}}==""
314 _USE_EFL_EVAS_LOADERS_UQ+=      ${COMP}
315 .  endif
316 . endfor
317
318 . for COMP in ${_USE_EFL_EVAS_LOADERS_UQ}
319 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}
320 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}
321 . endfor
322
323 .endif #USE_EFL_EVAS_LOADERS
324
325 .if defined(USE_EFL_ECORE)
326
327 USE_EFL+=       ecore
328
329 _USE_EFL_ECORE= #empty
330 . for COMP in ${USE_EFL_ECORE}
331 .  if ${_EFL_ECORE_ALL:M${COMP}}==""
332 IGNORE= cannot install: unknown ecore module ${COMP}
333 .  else
334 _USE_EFL_ECORE+=        ${COMP}
335 .  endif
336 . endfor
337
338 # Get rid of duplicates
339 _USE_EFL_ECORE_UQ=      #empty
340 . for COMP in ${_USE_EFL_ECORE}
341 .  if ${_USE_EFL_ECORE_UQ:M${COMP}}==""
342 _USE_EFL_ECORE_UQ+=     ${COMP}
343 .  endif
344 . endfor
345
346 . for COMP in ${_USE_EFL_ECORE_UQ}
347 LIB_DEPENDS+=   lib${_ecore_${COMP}_NAME}.so.${_ecore_VERSION}:${PORTSDIR}/${_ecore_${COMP}_CATEGORY}/${_ecore_${COMP}_PORTNAME}
348 . endfor
349
350 .endif #USE_EFL_ECORE
351
352 .if defined(USE_EFL)
353
354 EFL_Include_post=       bsd.efl.mk
355
356 #
357 # Check if we have all libraries requiested and build depends list
358 #
359 .if ${USE_EFL:Mlibrt_hack}
360 _USE_EFL_LIBRT_HACK=    yes
361 .endif
362 .if ${USE_EFL:Mmodarch_hack}
363 _USE_EFL_MODARCH_HACK=  yes
364 .endif
365 .if ${USE_EFL:Mlibtool_hack}
366 _USE_EFL_LIBTOOL_HACK=  yes
367 .endif
368 _USE_EFL=       #empty
369 .for LIB in ${USE_EFL:Nlibrt_hack:Nmodarch_hack:Nlibtool_hack}
370 . if ${_USE_EFL_ALL:M${LIB}}==""
371 IGNORE= cannot install: unknown library ${LIB}
372 . else
373 _USE_EFL+=      ${LIB}
374 . endif
375 .endfor
376
377 #
378 # Get rid of duplicates
379 #
380 _USE_EFL_UQ=    #empty
381 .for LIB in ${_USE_EFL}
382 . if ${_USE_EFL_UQ:M${LIB}}==""
383 _USE_EFL_UQ+=   ${LIB}
384 . endif
385 .endfor
386
387 #
388 # define dependencies
389 #
390 .for LIB in ${_USE_EFL_UQ}
391 LIB_DEPENDS+=   lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION}:${PORTSDIR}/${_${LIB}_CATEGORY}/${_${LIB}_PORTNAME}
392 .endfor
393
394 #
395 # Initialize configure enviropment
396 #
397 CPPFLAGS+=      -I${LOCALBASE}/include
398 LDFLAGS+=       -L${LOCALBASE}/lib
399 CFLAGS+=        -I${LOCALBASE}/include
400
401 PLIST_SUB+=     E17_ARCH=${OPSYS:tl}${OSREL}-${ARCH}
402
403 .if defined(_USE_EFL_LIBRT_HACK)
404 #
405 # Don't use librt
406 #
407 post-patch: efl_drop_librt
408 efl_drop_librt:
409         @${REINPLACE_CMD} -E \
410                 -e '/^[[:space:]]+freebsd\*/,/^[[:space:]];;/s/-lrt//g' \
411                 ${WRKSRC}/configure
412 .endif
413
414 .if defined(_USE_EFL_MODARCH_HACK)
415 #
416 # Use correct module arch path
417 #
418 post-patch: efl_patch_modarch
419 efl_patch_modarch:
420         @${REINPLACE_CMD} -E \
421                 -e 's/(MODULE_ARCH="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \
422                 -e 's/(MODULE_EDJE="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \
423                 ${WRKSRC}/configure
424 .endif
425
426 .if defined(_USE_EFL_LIBTOOL_HACK)
427 #
428 # Get rid of .la and static library files
429 #
430 post-configure: efl_drop_la
431 efl_drop_la:
432         ${REINPLACE_CMD} -E -e \
433                 '/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
434 .endif
435
436 .endif #USE_EFL
437
438 .endif #EFL_Include_post
439 .endif #BEFOREPORTMK