aboutsummaryrefslogtreecommitdiffstats
path: root/Mk/bsd.gnomeng.mk
blob: ba3aaa124479566acececf28f121eacfafa52183 (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
148
149
150
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
#
# $FreeBSD$
#

.if !defined(_POSTMKINCLUDED)

# Please make sure all changes to this file are past through the maintainer.
# Do not commit them yourself (unless of course you're the Port's Wraith ;).
Gnome_Include_MAINTAINER=   gnome@FreeBSD.org

# This section defines possible names of GNOME components and all information
# necessary for ports to use those components.

# Ports can use this as follows:
#
# USE_GNOME=    gnomeprint bonobo
#
# .include <bsd.port.mk>
#
# As a result proper LIB_DEPENDS/RUN_DEPENDS will be added and CONFIGURE_ENV
# and MAKE_ENV defined.

_USE_GNOME_ALL= gnomehack gnomeprefix gnomehier gnomeaudio esound libghttp \
        glib12 gtk12 libxml gdkpixbuf imlib orbit gnomelibs \
        gnomecanvas oaf gnomemimedata gconf gnomevfs libcapplet \
        gnomeprint bonobo libgda gnomedb libglade gal glibwww gtkhtml \
        libpanel

gnomehack_PRE_PATCH=    ${FIND} ${WRKSRC} -name "Makefile.in*" | ${XARGS} ${REINPLACE_CMD} -e \
                's|[(]GNOME_datadir[)]/gnome/|(datadir)/|g ; \
                 s|[(]GNOME_datadir[)]/locale|(prefix)/share/locale|g ; \
                 s|[(]datadir[)]/locale|(prefix)/share/locale|g ; \
                 s|[(]gnomedatadir[)]/gnome|(gnomedatadir)|g ; \
                 s|[(]datadir[)]/aclocal|(prefix)/share/aclocal|g ; \
                 s|[(]datadir[)]/gnome/|(datadir)/|g ; \
                 s|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \
                 s|[(]libdir[)]/bonobo/servers|(prefix)/libdata/bonobo/servers|g'

gnomehier_RUN_DEPENDS=  ${X11BASE}/share/gnome/.keep_me:${PORTSDIR}/misc/gnomehier
gnomehier_DETECT=   ${X11BASE}/share/gnome/.keep_me

GNOME_HTML_DIR?=    ${PREFIX}/share/doc
gnomeprefix_CONFIGURE_ENV=GTKDOC="false"
gnomeprefix_CONFIGURE_ARGS=--localstatedir=${PREFIX}/share/gnome \
               --datadir=${PREFIX}/share/gnome \
               --with-html-dir=${GNOME_HTML_DIR} \
               --disable-gtk-doc \
               --with-gconf-source=xml::${PREFIX}/etc/gconf/gconf.xml.defaults
gnomeprefix_USE_GNOME_IMPL=gnomehier

gnomeaudio_RUN_DEPENDS= ${X11BASE}/share/gnome/sounds/login.wav:${PORTSDIR}/audio/gnomeaudio
gnomeaudio_DETECT=  ${X11BASE}/share/gnome/sounds/login.wav

ESD_CONFIG?=        ${LOCALBASE}/bin/esd-config
esound_LIB_DEPENDS= esd.2:${PORTSDIR}/audio/esound
esound_CONFIGURE_ENV=   ESD_CONFIG="${ESD_CONFIG}"
esound_MAKE_ENV=    ESD_CONFIG="${ESD_CONFIG}"
esound_DETECT=      ${ESD_CONFIG}

libghttp_LIB_DEPENDS=   ghttp.1:${PORTSDIR}/www/libghttp
libghttp_DETECT=    ${LOCALBASE}/etc/ghttpConf.sh

GLIB_CONFIG?=       ${LOCALBASE}/bin/glib12-config
glib12_LIB_DEPENDS= glib12.3:${PORTSDIR}/devel/glib12
glib12_CONFIGURE_ENV=   GLIB_CONFIG="${GLIB_CONFIG}"
glib12_MAKE_ENV=    GLIB_CONFIG="${GLIB_CONFIG}"
glib12_DETECT=      ${GLIB_CONFIG}

GTK_CONFIG?=        ${X11BASE}/bin/gtk12-config
gtk12_LIB_DEPENDS=  gtk12.2:${PORTSDIR}/x11-toolkits/gtk12
gtk12_CONFIGURE_ENV=    GTK_CONFIG="${GTK_CONFIG}"
gtk12_MAKE_ENV=     GTK_CONFIG="${GTK_CONFIG}"
gtk12_DETECT=       ${GTK_CONFIG}
gtk12_USE_GNOME_IMPL=   glib12

XML_CONFIG?=        ${LOCALBASE}/bin/xml-config
libxml_LIB_DEPENDS= xml.5:${PORTSDIR}/textproc/libxml
libxml_CONFIGURE_ENV=   XML_CONFIG="${XML_CONFIG}"
libxml_MAKE_ENV=    XML_CONFIG="${XML_CONFIG}"
libxml_DETECT=      ${XML_CONFIG}
libxml_USE_GNOME_IMPL=  glib12

ORBIT_CONFIG?=      ${LOCALBASE}/bin/orbit-config
orbit_LIB_DEPENDS=  ORBit.2:${PORTSDIR}/devel/ORBit
orbit_CONFIGURE_ENV=    ORBIT_CONFIG="${ORBIT_CONFIG}"
orbit_MAKE_ENV=     ORBIT_CONFIG="${ORBIT_CONFIG}"
orbit_DETECT=       ${ORBIT_CONFIG}
orbit_USE_GNOME_IMPL=   glib12

GDK_PIXBUF_CONFIG?= ${X11BASE}/bin/gdk-pixbuf-config
gdkpixbuf_LIB_DEPENDS=  gdk_pixbuf.2:${PORTSDIR}/graphics/gdk-pixbuf
gdkpixbuf_CONFIGURE_ENV=GDK_PIXBUF_CONFIG="${GDK_PIXBUF_CONFIG}"
gdkpixbuf_MAKE_ENV= GDK_PIXBUF_CONFIG="${GDK_PIXBUF_CONFIG}"
gdkpixbuf_DETECT=   ${GDK_PIXBUF_CONFIG}
gdkpixbuf_USE_GNOME_IMPL=gtk12

IMLIB_CONFIG?=      ${X11BASE}/bin/imlib-config
imlib_LIB_DEPENDS=  Imlib.5:${PORTSDIR}/graphics/imlib
imlib_CONFIGURE_ENV=    IMLIB_CONFIG="${IMLIB_CONFIG}"
imlib_MAKE_ENV=     IMLIB_CONFIG="${IMLIB_CONFIG}"
imlib_DETECT=       ${IMLIB_CONFIG}
imlib_USE_GNOME_IMPL=   gtk12

GNOME_CONFIG?=      ${X11BASE}/bin/gnome-config
gnomelibs_LIB_DEPENDS=  gnome.5:${PORTSDIR}/x11/gnomelibs
gnomelibs_CONFIGURE_ENV=GNOME_CONFIG="${GNOME_CONFIG}"
gnomelibs_MAKE_ENV= GNOME_CONFIG="${GNOME_CONFIG}"
gnomelibs_DETECT=   ${GNOME_CONFIG}
gnomelibs_USE_GNOME_IMPL=esound gtk12 imlib libxml orbit

gnomecanvas_LIB_DEPENDS=gnomecanvaspixbuf.1:${PORTSDIR}/graphics/gnomecanvas
gnomecanvas_DETECT= ${X11BASE}/etc/gnomecanvaspixbufConf.sh
gnomecanvas_USE_GNOME_IMPL=gnomelibs gdkpixbuf

OAF_CONFIG?=        ${X11BASE}/bin/oaf-config
oaf_LIB_DEPENDS=    oaf.0:${PORTSDIR}/devel/oaf
oaf_CONFIGURE_ENV=  OAF_CONFIG="${OAF_CONFIG}"
oaf_MAKE_ENV=       OAF_CONFIG="${OAF_CONFIG}"
oaf_DETECT=     ${OAF_CONFIG}
oaf_USE_GNOME_IMPL= glib12 orbit libxml

gnomemimedata_BUILD_DEPENDS=${X11BASE}/libdata/pkgconfig/gnome-mime-data-2.0.pc:${PORTSDIR}/misc/gnomemimedata
gnomemimedata_RUN_DEPENDS=${X11BASE}/libdata/pkgconfig/gnome-mime-data-2.0.pc:${PORTSDIR}/misc/gnomemimedata
gnomemimedata_DETECT=   ${X11BASE}/libdata/pkgconfig/gnome-mime-data-2.0.pc
gnomemimedata_USE_GNOME_IMPL=gnomehier

GCONF_CONFIG?=      ${X11BASE}/bin/gconf-config
gconf_LIB_DEPENDS=  gconf-1.1:${PORTSDIR}/devel/gconf
gconf_CONFIGURE_ENV=    GCONF_CONFIG="${GCONF_CONFIG}"
gconf_MAKE_ENV=     GCONF_CONFIG="${GCONF_CONFIG}"
gconf_DETECT=       ${GCONF_CONFIG}
gconf_USE_GNOME_IMPL=   oaf

GNOME_VFS_CONFIG?=  ${X11BASE}/bin/gnome-vfs-config
gnomevfs_LIB_DEPENDS=   gnomevfs.0:${PORTSDIR}/devel/gnomevfs
gnomevfs_CONFIGURE_ENV= GNOME_VFS_CONFIG="${GNOME_VFS_CONFIG}"
gnomevfs_MAKE_ENV=  GNOME_VFS_CONFIG="${GNOME_VFS_CONFIG}"
gnomevfs_DETECT=    ${GNOME_VFS_CONFIG}
gnomevfs_USE_GNOME_IMPL=gnomemimedata gconf gnomelibs

libcapplet_LIB_DEPENDS= capplet.5:${PORTSDIR}/x11/libcapplet
libcapplet_DETECT=  ${X11BASE}/etc/cappletConf.sh
libcapplet_USE_GNOME_IMPL=gnomelibs

gnomeprint_LIB_DEPENDS= gnomeprint.16:${PORTSDIR}/print/gnomeprint
gnomeprint_DETECT=  ${X11BASE}/etc/printConf.sh
gnomeprint_USE_GNOME_IMPL=gnomelibs gnomecanvas

bonobo_LIB_DEPENDS= bonobo.2:${PORTSDIR}/devel/bonobo
bonobo_DETECT=      ${X11BASE}/etc/bonoboConf.sh
bonobo_USE_GNOME_IMPL=  oaf gnomeprint

GDA_CONFIG?=        ${X11BASE}/bin/gda-config
libgda_LIB_DEPENDS= gda-client.0:${PORTSDIR}/databases/libgda
libgda_CONFIGURE_ENV=   GDA_CONFIG="${GDA_CONFIG}"
libgda_MAKE_ENV=    GDA_CONFIG="${GDA_CONFIG}"
libgda_DETECT=      ${GDA_CONFIG}
libgda_USE_GNOME_IMPL=  gconf bonobo

GNOMEDB_CONFIG?=    ${X11BASE}/bin/gnomedb-config
gnomedb_LIB_DEPENDS=    gnomedb.0:${PORTSDIR}/databases/gnomedb
gnomedb_CONFIGURE_ENV=  GNOMEDB_CONFIG="${GNOMEDB_CONFIG}"
gnomedb_MAKE_ENV=   GNOMEDB_CONFIG="${GNOMEDB_CONFIG}"
gnomedb_DETECT=     ${GNOMEDB_CONFIG}
gnomedb_USE_GNOME_IMPL= libgda

LIBGLADE_CONFIG?=   ${X11BASE}/bin/libglade-config
libglade_LIB_DEPENDS=   glade.4:${PORTSDIR}/devel/libglade
libglade_CONFIGURE_ENV= LIBGLADE_CONFIG="${LIBGLADE_CONFIG}"
libglade_MAKE_ENV=  LIBGLADE_CONFIG="${LIBGLADE_CONFIG}"
libglade_DETECT=    ${LIBGLADE_CONFIG}
libglade_USE_GNOME_IMPL=gnomedb

gal_LIB_DEPENDS=    gal.19:${PORTSDIR}/x11-toolkits/gal
gal_DETECT=     ${X11BASE}/etc/galConf.sh
gal_USE_GNOME_IMPL= libglade

glibwww_LIB_DEPENDS=    glibwww.1:${PORTSDIR}/www/glibwww
glibwww_DETECT=     ${X11BASE}/etc/glibwwwConf.sh
glibwww_USE_GNOME_IMPL= gnomelibs

gtkhtml_LIB_DEPENDS=    gtkhtml.21:${PORTSDIR}/www/gtkhtml
gtkhtml_DETECT=     ${X11BASE}/etc/gtkhtmlConf.sh
gtkhtml_USE_GNOME_IMPL= glibwww gal libghttp libcapplet

libpanel_LIB_DEPENDS=   panel_applet.5:${PORTSDIR}/x11/libpanel
libpanel_DETECT=    ${X11BASE}/etc/appletsConf.sh
libpanel_USE_GNOME_IMPL=gnomelibs

# This section keeps tests for optional software.  These work off four
# types of of variables.  WANT_GNOME, WITH_GNOME, HAVE_GNOME and USE_GNOME.
# The logic of this is that a port can WANT support for a package, a user
# specifies if they want ports compiles WITH certain features.  This section
# tests if we HAVE these features, and the port is then free to USE them.

# The logic of this section is like this:
#
# .if defined(WANT_GNOME) && !defined(WITHOUT_GNOME)
#   .for foo in ALL_GNOME_COMPONENTS
#     .if defined(WITH_GNOME)
#       HAVE_GNOME += foo
#     .elif (foo installed)
#       HAVE_GNOME += foo
#     .else
#       Print option message
#     .endif
#   .endfor
# .endif
#
# Although it apears a little more convoluted in the tests.

# Ports can make use of this like so:
#
# WANT_GNOME=       yes
#
# .include <bsd.port.pre.mk>
#
# .if ${HAVE_GNOME:Mfoo}!=""
# ... Do some things ...
# USE_GNOME=        foo
# .else
# ... Do some other things ...
# .endif

_USE_GNOME_SAVED:=${USE_GNOME}
HAVE_GNOME?=
.if (defined(WANT_GNOME) && !defined(WITHOUT_GNOME))
. for component in ${_USE_GNOME_ALL}
.    if exists(${${component}_DETECT})
HAVE_GNOME+=    ${component}
.    elif defined(WITH_GNOME)
.      if ${WITH_GNOME}=="yes" || ${WITH_GNOME:M${component}}!="" || \
         ${WITH_GNOME}=="1"
HAVE_GNOME+=    ${component}
.      endif
.    endif
. endfor
.elif defined(WITHOUT_GNOME)
.  if ${WITHOUT_GNOME}!="yes" && ${WITHOUT_GNOME}!="1"
.    for component in ${_USE_GNOME_ALL}
.      if ${WITHOUT_GNOME:M${component}}==""
.        if exists(${${component}_DETECT})
HAVE_GNOME+=    ${component}
.        endif
.      endif
.    endfor
.  endif
.endif

.endif
# End of optional part.

.if defined(_POSTMKINCLUDED)

.if defined(USE_GNOME)
# First of all expand all USE_GNOME_IMPL recursively
. for component in ${_USE_GNOME_ALL}
.  for subcomponent in ${${component}_USE_GNOME_IMPL}
${component}_USE_GNOME_IMPL+=${${subcomponent}_USE_GNOME_IMPL}
.  endfor
. endfor

# Then use already expanded USE_GNOME_IMPL to expand USE_GNOME
. for component in ${USE_GNOME}
.  if ${_USE_GNOME_ALL:M${component}}==""
BROKEN= "Unknown component ${component}"
.  endif
_USE_GNOME+=    ${${component}_USE_GNOME_IMPL} ${component}
. endfor

# Then traverse through all possible components, check which of them
# exist in ${_USE_GNOME} and set variables accordingly
. for component in ${_USE_GNOME_ALL}
.  if ${_USE_GNOME:S/${component}//}!=${_USE_GNOME:S/  / /g}
BUILD_DEPENDS+= ${${component}_BUILD_DEPENDS}
LIB_DEPENDS+=   ${${component}_LIB_DEPENDS}
RUN_DEPENDS+=   ${${component}_RUN_DEPENDS}

CONFIGURE_ARGS+=${${component}_CONFIGURE_ARGS}
CONFIGURE_ENV+= ${${component}_CONFIGURE_ENV}
MAKE_ENV+=  ${${component}_MAKE_ENV}

.   if defined(${component}_PRE_PATCH)
GNOME_PRE_PATCH+=   ${${component}_PRE_PATCH}
.   endif

.  endif
. endfor
.endif

.if defined(GNOME_PRE_PATCH) && !target(pre-patch)
USE_REINPLACE=  yes

pre-patch:
    @${GNOME_PRE_PATCH}
.endif

.if defined(WANT_GNOME)
USE_GNOME?=
.if ${_USE_GNOME_SAVED}==${USE_GNOME}
PLIST_SUB+= GNOME:="@comment " NOGNOME:=""
.else
PLIST_SUB+= GNOME:="" NOGNOME:="@comment "
.endif
.endif

.endif
# End of use part.