Lines 1-269
Link Here
|
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= epeg imlib2 |
40 |
|
41 |
# For each library supported we define the following variables: |
42 |
# _%%LIB%%_CATEGORY - category the port belongs to |
43 |
# _%%LIB%%_PREFIX - where the library is installed |
44 |
# _%%LIB%%_VERSION - version of the shared library |
45 |
# _%%LIB%%_SLIB - name of the shared library |
46 |
# |
47 |
|
48 |
_epeg_CATEGORY= graphics |
49 |
_epeg_VERSION= 9 |
50 |
|
51 |
_imlib2_CATEGORY= graphics |
52 |
_imlib2_VERSION= 5 |
53 |
_imlib2_SLIB= Imlib2 |
54 |
|
55 |
# |
56 |
# Assign values for variables which were not defined explicitly |
57 |
# |
58 |
.for LIB in ${_USE_EFL_ALL} |
59 |
. if !defined(_${LIB}_SLIB) |
60 |
_${LIB}_SLIB=${LIB} |
61 |
. endif |
62 |
. if !defined(_${LIB}_PORTNAME) |
63 |
_${LIB}_PORTNAME=${LIB} |
64 |
. endif |
65 |
. if !defined(_${LIB}_PREFIX) |
66 |
_${LIB}_PREFIX=${LOCALBASE} |
67 |
. endif |
68 |
.endfor |
69 |
|
70 |
# |
71 |
# Handle WANT_EFL feature |
72 |
# |
73 |
.if !defined(AFTERPORTMK) |
74 |
.if !defined(EFL_Include_pre) |
75 |
|
76 |
EFL_Include_pre= bsd.efl.mk |
77 |
|
78 |
HAVE_EFL?= |
79 |
.if defined(WANT_EFL) |
80 |
# |
81 |
# General EFL components |
82 |
# |
83 |
. for LIB in ${_USE_EFL_ALL} |
84 |
. if exists(${_${LIB}_PREFIX}/lib/lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION}) |
85 |
HAVE_EFL+= ${LIB} |
86 |
. endif |
87 |
. endfor |
88 |
.endif |
89 |
|
90 |
.endif #EFL_Include_pre |
91 |
.endif #AFTERPORTMK |
92 |
|
93 |
# |
94 |
# Handle USE_EFL feature |
95 |
# |
96 |
.if !defined(BEFOREPORTMK) |
97 |
.if !defined(EFL_Include_post) |
98 |
|
99 |
.if defined(USE_EFL_EVAS_ENGINES) |
100 |
|
101 |
USE_EFL+= evas |
102 |
|
103 |
_USE_EFL_EVAS_ENGINES= #empty |
104 |
. for COMP in ${USE_EFL_EVAS_ENGINES} |
105 |
. if ${_EFL_EVAS_ENGINES_ALL:M${COMP}}=="" |
106 |
IGNORE= cannot install: unknown evas engine ${COMP} |
107 |
. else |
108 |
_USE_EFL_EVAS_ENGINES+= ${COMP} |
109 |
. endif |
110 |
. endfor |
111 |
|
112 |
# Get rid of duplicates |
113 |
_USE_EFL_EVAS_ENGINES_UQ= #empty |
114 |
. for COMP in ${_USE_EFL_EVAS_ENGINES} |
115 |
. if ${_USE_EFL_EVAS_ENGINES_UQ:M${COMP}}=="" |
116 |
_USE_EFL_EVAS_ENGINES_UQ+= ${COMP} |
117 |
. endif |
118 |
. endfor |
119 |
|
120 |
. for COMP in ${_USE_EFL_EVAS_ENGINES_UQ} |
121 |
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} |
122 |
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 |
. endfor |
124 |
|
125 |
.endif #USE_EFL_EVAS_ENGINES |
126 |
|
127 |
.if defined(USE_EFL_EVAS_LOADERS) |
128 |
|
129 |
USE_EFL+= evas |
130 |
|
131 |
_USE_EFL_EVAS_LOADERS= #empty |
132 |
. for COMP in ${USE_EFL_EVAS_LOADERS} |
133 |
. if ${_EFL_EVAS_LOADERS_ALL:M${COMP}}=="" |
134 |
IGNORE= cannot install: unknown evas loader ${COMP} |
135 |
. else |
136 |
_USE_EFL_EVAS_LOADERS+= ${COMP} |
137 |
. endif |
138 |
. endfor |
139 |
|
140 |
# Get rid of duplicates |
141 |
_USE_EFL_EVAS_LOADERS_UQ= #empty |
142 |
. for COMP in ${_USE_EFL_EVAS_LOADERS} |
143 |
. if ${_USE_EFL_EVAS_LOADERS_UQ:M${COMP}}=="" |
144 |
_USE_EFL_EVAS_LOADERS_UQ+= ${COMP} |
145 |
. endif |
146 |
. endfor |
147 |
|
148 |
. for COMP in ${_USE_EFL_EVAS_LOADERS_UQ} |
149 |
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} |
150 |
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 |
. endfor |
152 |
|
153 |
.endif #USE_EFL_EVAS_LOADERS |
154 |
|
155 |
.if defined(USE_EFL_ECORE) |
156 |
|
157 |
USE_EFL+= ecore |
158 |
|
159 |
_USE_EFL_ECORE= #empty |
160 |
. for COMP in ${USE_EFL_ECORE} |
161 |
. if ${_EFL_ECORE_ALL:M${COMP}}=="" |
162 |
IGNORE= cannot install: unknown ecore module ${COMP} |
163 |
. else |
164 |
_USE_EFL_ECORE+= ${COMP} |
165 |
. endif |
166 |
. endfor |
167 |
|
168 |
# Get rid of duplicates |
169 |
_USE_EFL_ECORE_UQ= #empty |
170 |
. for COMP in ${_USE_EFL_ECORE} |
171 |
. if ${_USE_EFL_ECORE_UQ:M${COMP}}=="" |
172 |
_USE_EFL_ECORE_UQ+= ${COMP} |
173 |
. endif |
174 |
. endfor |
175 |
|
176 |
. for COMP in ${_USE_EFL_ECORE_UQ} |
177 |
LIB_DEPENDS+= lib${_ecore_${COMP}_NAME}.so.${_ecore_VERSION}:${PORTSDIR}/${_ecore_${COMP}_CATEGORY}/${_ecore_${COMP}_PORTNAME} |
178 |
. endfor |
179 |
|
180 |
.endif #USE_EFL_ECORE |
181 |
|
182 |
.if defined(USE_EFL) |
183 |
|
184 |
EFL_Include_post= bsd.efl.mk |
185 |
|
186 |
# |
187 |
# Check if we have all libraries requiested and build depends list |
188 |
# |
189 |
.if ${USE_EFL:Mlibrt_hack} |
190 |
_USE_EFL_LIBRT_HACK= yes |
191 |
.endif |
192 |
.if ${USE_EFL:Mmodarch_hack} |
193 |
_USE_EFL_MODARCH_HACK= yes |
194 |
.endif |
195 |
.if ${USE_EFL:Mlibtool_hack} |
196 |
_USE_EFL_LIBTOOL_HACK= yes |
197 |
.endif |
198 |
_USE_EFL= #empty |
199 |
.for LIB in ${USE_EFL:Nlibrt_hack:Nmodarch_hack:Nlibtool_hack} |
200 |
. if ${_USE_EFL_ALL:M${LIB}}=="" |
201 |
IGNORE= cannot install: unknown library ${LIB} |
202 |
. else |
203 |
_USE_EFL+= ${LIB} |
204 |
. endif |
205 |
.endfor |
206 |
|
207 |
# |
208 |
# Get rid of duplicates |
209 |
# |
210 |
_USE_EFL_UQ= #empty |
211 |
.for LIB in ${_USE_EFL} |
212 |
. if ${_USE_EFL_UQ:M${LIB}}=="" |
213 |
_USE_EFL_UQ+= ${LIB} |
214 |
. endif |
215 |
.endfor |
216 |
|
217 |
# |
218 |
# define dependencies |
219 |
# |
220 |
.for LIB in ${_USE_EFL_UQ} |
221 |
LIB_DEPENDS+= lib${_${LIB}_SLIB}.so.${_${LIB}_VERSION}:${PORTSDIR}/${_${LIB}_CATEGORY}/${_${LIB}_PORTNAME} |
222 |
.endfor |
223 |
|
224 |
# |
225 |
# Initialize configure enviropment |
226 |
# |
227 |
CPPFLAGS+= -I${LOCALBASE}/include |
228 |
LDFLAGS+= -L${LOCALBASE}/lib |
229 |
CFLAGS+= -I${LOCALBASE}/include |
230 |
|
231 |
PLIST_SUB+= E17_ARCH=${OPSYS:tl}${OSREL}-${ARCH} |
232 |
|
233 |
.if defined(_USE_EFL_LIBRT_HACK) |
234 |
# |
235 |
# Don't use librt |
236 |
# |
237 |
post-patch: efl_drop_librt |
238 |
efl_drop_librt: |
239 |
@${REINPLACE_CMD} -E \ |
240 |
-e '/^[[:space:]]+freebsd\*/,/^[[:space:]];;/s/-lrt//g' \ |
241 |
${WRKSRC}/configure |
242 |
.endif |
243 |
|
244 |
.if defined(_USE_EFL_MODARCH_HACK) |
245 |
# |
246 |
# Use correct module arch path |
247 |
# |
248 |
post-patch: efl_patch_modarch |
249 |
efl_patch_modarch: |
250 |
@${REINPLACE_CMD} -E \ |
251 |
-e 's/(MODULE_ARCH="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \ |
252 |
-e 's/(MODULE_EDJE="\$$host_os-\$$host_cpu)-[^"]+"/\1"/g' \ |
253 |
${WRKSRC}/configure |
254 |
.endif |
255 |
|
256 |
.if defined(_USE_EFL_LIBTOOL_HACK) |
257 |
# |
258 |
# Get rid of .la and static library files |
259 |
# |
260 |
post-configure: efl_drop_la |
261 |
efl_drop_la: |
262 |
${REINPLACE_CMD} -E -e \ |
263 |
'/Install the pseudo-library/,/staticlibs=/s,^,#,' ${WRKSRC}/libtool |
264 |
.endif |
265 |
|
266 |
.endif #USE_EFL |
267 |
|
268 |
.endif #EFL_Include_post |
269 |
.endif #BEFOREPORTMK |