2 # $MBSDlabs: portmk/bsd.efl.mk,v 1.17 2006/10/02 14:57:48 stas Exp $
5 # bsd.efl.mk - Support for Enlightenment Foundation Libraries (EFL)
7 # Author: Stanislav Sedov <stas@FreeBSD.org>
8 # Inspired by bsd.sdl.mk by Edwin Groothuis <edwin@freebsd.org>
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
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:
18 # .include <bsd.port.pre.mk>
19 # .if ${HAVE_EFL:Mevas}
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
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
31 # Feel free to send any comments and suggestion to maintainer.
34 EFL_Include_MAINTAINER= gblach@FreeBSD.org
37 # Define all supported libraries
39 _USE_EFL_ALL= ecore edbus edje eet efreet eio eina elementary embryo \
40 emotion ender enesim epeg esvg etch ethumb evas imlib2
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
49 _ecore_CATEGORY= devel
50 _ecore_PORTNAME= ecore-main
53 _edbus_CATEGORY= devel
54 _edbus_PORTNAME= e_dbus
63 _edje_CATEGORY= graphics
72 _elementary_CATEGORY= x11-toolkits
73 _elementary_VERSION= 8
75 _embryo_CATEGORY= lang
78 _emotion_CATEGORY= multimedia
81 _ender_CATEGORY= graphics
84 _enesim_CATEGORY= graphics
87 _epeg_CATEGORY= graphics
94 _etch_CATEGORY= graphics
97 _ethumb_CATEGORY= graphics
100 _evas_CATEGORY= graphics
101 _evas_PORTNAME= evas-core
104 _imlib2_CATEGORY= graphics
109 # Assign values for variables which were not defined explicitly
111 .for LIB in ${_USE_EFL_ALL}
112 . if !defined(_${LIB}_SLIB)
115 . if !defined(_${LIB}_PORTNAME)
116 _${LIB}_PORTNAME=${LIB}
118 . if !defined(_${LIB}_PREFIX)
119 _${LIB}_PREFIX=${LOCALBASE}
124 # Evas engines and loaders support.
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
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
137 # Generic evas engines definitions
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
145 # Evas engine modules definitions
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
154 # Assign values for variables which were not defined explicitly
156 .for COMP in ${_EFL_EVAS_ENGINES_ALL}
157 . if !defined(_evas_engine_${COMP}_CATEGORY)
158 _evas_engine_${COMP}_CATEGORY= ${_EFL_EVAS_CATEGORY}
160 . if !defined(_evas_engine_${COMP}_PORTNAME)
161 _evas_engine_${COMP}_PORTNAME= evas-engine-${COMP}
163 . if !defined(_evas_engine_${COMP}_DIR)
164 _evas_engine_${COMP}_DIR= ${COMP}
168 .for COMP in ${_EFL_EVAS_LOADERS_ALL}
169 . if !defined(_evas_loader_${COMP}_CATEGORY)
170 _evas_loader_${COMP}_CATEGORY= ${_EFL_EVAS_CATEGORY}
172 . if !defined(_evas_loader_${COMP}_PORTNAME)
173 _evas_loader_${COMP}_PORTNAME= evas-loader-${COMP}
175 . if !defined(_evas_loader_${COMP}_DIR)
176 _evas_loader_${COMP}_DIR= ${COMP}
181 # Ecore modules support
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
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
193 # Generic ecore definitions
195 _EFL_ECORE_CATEGORY= devel
196 _EFL_ECORE_MODDIR= ${LOCALBASE}/lib/
199 # Ecore modules definitions
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
216 # Assign values for variables which were not defined explicitly
218 .for COMP in ${_EFL_ECORE_ALL}
219 . if !defined(_ecore_${COMP}_CATEGORY)
220 _ecore_${COMP}_CATEGORY=${_EFL_ECORE_CATEGORY}
222 . if !defined(_ecore_${COMP}_PORTNAME)
223 _ecore_${COMP}_PORTNAME=ecore-${COMP}
225 . if !defined(_ecore_${COMP}_NAME)
226 _ecore_${COMP}_NAME= ecore_${COMP}
231 # Handle WANT_EFL feature
233 .if !defined(AFTERPORTMK)
234 .if !defined(EFL_Include_pre)
236 EFL_Include_pre= bsd.efl.mk
240 .if defined(WANT_EFL)
242 # General EFL components
244 . for LIB in ${_USE_EFL_ALL}
245 . if exists(${_${LIB}_PREFIX}/lib/lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION})
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}
260 .endif #EFL_Include_pre
264 # Handle USE_EFL, USE_EFL_EVAS_* and USE_EFL_ECORE features
266 .if !defined(BEFOREPORTMK)
267 .if !defined(EFL_Include_post)
269 .if defined(USE_EFL_EVAS_ENGINES)
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}
278 _USE_EFL_EVAS_ENGINES+= ${COMP}
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}
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}
295 .endif #USE_EFL_EVAS_ENGINES
297 .if defined(USE_EFL_EVAS_LOADERS)
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}
306 _USE_EFL_EVAS_LOADERS+= ${COMP}
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}
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}
323 .endif #USE_EFL_EVAS_LOADERS
325 .if defined(USE_EFL_ECORE)
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}
334 _USE_EFL_ECORE+= ${COMP}
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}
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}
350 .endif #USE_EFL_ECORE
354 EFL_Include_post= bsd.efl.mk
357 # Check if we have all libraries requiested and build depends list
359 .if ${USE_EFL:Mlibrt_hack}
360 _USE_EFL_LIBRT_HACK= yes
362 .if ${USE_EFL:Mmodarch_hack}
363 _USE_EFL_MODARCH_HACK= yes
365 .if ${USE_EFL:Mlibtool_hack}
366 _USE_EFL_LIBTOOL_HACK= yes
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}
378 # Get rid of duplicates
381 .for LIB in ${_USE_EFL}
382 . if ${_USE_EFL_UQ:M${LIB}}==""
388 # define dependencies
390 .for LIB in ${_USE_EFL_UQ}
391 LIB_DEPENDS+= lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION}:${PORTSDIR}/${_${LIB}_CATEGORY}/${_${LIB}_PORTNAME}
395 # Initialize configure enviropment
397 CPPFLAGS+= -I${LOCALBASE}/include
398 LDFLAGS+= -L${LOCALBASE}/lib
399 CFLAGS+= -I${LOCALBASE}/include
401 PLIST_SUB+= E17_ARCH=${OPSYS:tl}${OSREL}-${ARCH}
403 .if defined(_USE_EFL_LIBRT_HACK)
407 post-patch: efl_drop_librt
409 @${REINPLACE_CMD} -E \
410 -e '/^[[:space:]]+freebsd\*/,/^[[:space:]];;/s/-lrt//g' \
414 .if defined(_USE_EFL_MODARCH_HACK)
416 # Use correct module arch path
418 post-patch: 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' \
426 .if defined(_USE_EFL_LIBTOOL_HACK)
428 # Get rid of .la and static library files
430 post-configure: efl_drop_la
432 ${REINPLACE_CMD} -E -e \
433 '/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool
438 .endif #EFL_Include_post