fix xpi extraction
[dports.git] / Mk / bsd.mate.mk
1 #-*- tab-width: 4; -*-
2 # ex:ts=4
3 #
4 # $FreeBSD$
5 #       $NetBSD$
6 #     $MCom: ports-experimental/Mk/bsd.mate.mk,v 1.13 2012/09/03 17:02:31 mezz Exp $
7 #
8 # Please view me with 4 column tabs!
9
10 #######################################################
11 #
12 # *** WARNING: Disable MARCUSCOM before merge in FreeBSD!
13 #     Please also remove this section before merging into FreeBSD.
14 #
15 #MARCUSCOM_CVS=yes
16
17 # ======================= USERS =================================
18 #
19 # There are no significant user-definable settings in here.
20 # This file is a framework to make it easier to create MATE ports.
21 #
22 # ======================= /USERS ================================
23
24 .if !defined(_POSTMKINCLUDED) && !defined(Mate_Pre_Include)
25
26 # Please make sure all changes to this file are passed through the maintainer.
27 # Do not commit them yourself (unless of course you're the Port's Wraith ;).
28 Mate_Include_MAINTAINER=        gnome@FreeBSD.org
29 Mate_Pre_Include=                       bsd.mate.mk
30
31 # This section defines possible names of MATE components and all information
32 # necessary for ports to use those components.
33
34 # Ports can use this as follows:
35 #
36 # USE_MATE=     caja common desktop
37 #
38 # .include <bsd.port.mk>
39 #
40 # As a result proper LIB_DEPENDS/RUN_DEPENDS will be added and CONFIGURE_ENV
41 # and MAKE_ENV defined.
42 #
43
44 # non-version specific components. Do not use :build/:run on those.
45 _USE_MATE_ALL=  autogen intlhack intltool ltasneededhack lthack ltverhack
46 # These *hack* tools are the same as in bsd.gnome.mk but are run in
47 # pre-configure because pre-patch is when we run autogen.sh.
48
49 # MATE components, you can use the :build or :run if need. Without the :build
50 # and :run, it will be added in both build and run dependency. It will check
51 # for the library dependency first. If not exists then do the build/run on
52 # the *.pc file instead.
53 _USE_MATE_ALL+= caja common controlcenter desktop dialogs docutils icontheme \
54                 keyring libmatekbd libmatekeyring libmateweather libmatewnck \
55                 marco menus mucharmap notificationdaemon panel polkit pluma \
56                 settingsdaemon
57
58 SCROLLKEEPER_DIR=       /var/db/rarian
59
60 lthack_PRE_PATCH=       ${FIND} ${WRKSRC} -name "configure" -type f | ${XARGS} ${REINPLACE_CMD} -e \
61                                 '/^LIBTOOL_DEPS="$$ac_aux_dir\/ltmain.sh"$$/s|$$|; $$ac_aux_dir/ltconfig $$LIBTOOL_DEPS;|'
62
63 caja_DETECT=            ${LOCALBASE}/libdata/pkgconfig/libcaja-extension.pc
64 caja_BUILD_DEPENDS=     ${caja_DETECT}:${PORTSDIR}/x11-fm/mate-file-manager
65 caja_LIB_DEPENDS=       libcaja-extension.so:${PORTSDIR}/x11-fm/mate-file-manager
66 caja_RUN_DEPENDS=       ${caja_DETECT}:${PORTSDIR}/x11-fm/mate-file-manager
67
68 mucharmap_DETECT=               ${LOCALBASE}/libdata/pkgconfig/mucharmap-2.pc
69 mucharmap_BUILD_DEPENDS=${mucharmap_DETECT}:${PORTSDIR}/deskutils/mate-character-map
70 mucharmap_LIB_DEPENDS=  libmucharmap.so:${PORTSDIR}/deskutils/mate-character-map
71 mucharmap_RUN_DEPENDS=  ${mucharmap_DETECT}:${PORTSDIR}/deskutils/mate-character-map
72
73 common_DETECT=          ${LOCALBASE}/bin/mate-autogen
74 common_BUILD_DEPENDS=   ${common_DETECT}:${PORTSDIR}/devel/mate-common
75 common_RUN_DEPENDS=     ${common_DETECT}:${PORTSDIR}/devel/mate-common
76
77 controlcenter_DETECT=           ${LOCALBASE}/libdata/pkgconfig/mate-window-settings-2.0.pc
78 controlcenter_BUILD_DEPENDS=    ${controlcenter_DETECT}:${PORTSDIR}/sysutils/mate-control-center
79 controlcenter_LIB_DEPENDS=      libmate-window-settings.so:${PORTSDIR}/sysutils/mate-control-center
80 controlcenter_RUN_DEPENDS=      ${controlcenter_DETECT}:${PORTSDIR}/sysutils/mate-control-center
81
82 desktop_DETECT=         ${LOCALBASE}/libdata/pkgconfig/mate-desktop-2.0.pc
83 desktop_BUILD_DEPENDS=  ${desktop_DETECT}:${PORTSDIR}/x11/mate-desktop
84 desktop_LIB_DEPENDS=    libmate-desktop-2.so:${PORTSDIR}/x11/mate-desktop
85 desktop_RUN_DEPENDS=    ${desktop_DETECT}:${PORTSDIR}/x11/mate-desktop
86
87 dialogs_DETECT=         ${LOCALBASE}/bin/matedialog
88 dialogs_BUILD_DEPENDS=  ${dialogs_DETECT}:${PORTSDIR}/x11/mate-dialogs
89 dialogs_RUN_DEPENDS=    ${dialogs_DETECT}:${PORTSDIR}/x11/mate-dialogs
90
91 docutils_DETECT=        ${LOCALBASE}/libdata/pkgconfig/mate-doc-utils.pc
92 docutils_BUILD_DEPENDS= ${docutils_DETECT}:${PORTSDIR}/textproc/mate-doc-utils
93 docutils_RUN_DEPENDS=   ${docutils_DETECT}:${PORTSDIR}/textproc/mate-doc-utils
94
95 icontheme_DETECT=       ${LOCALBASE}/libdata/pkgconfig/mate-icon-theme.pc
96 icontheme_BUILD_DEPENDS=${icontheme_DETECT}:${PORTSDIR}/x11-themes/mate-icon-theme
97 icontheme_RUN_DEPENDS=  ${icontheme_DETECT}:${PORTSDIR}/x11-themes/mate-icon-theme
98
99 intltool_DETECT=        ${LOCALBASE}/bin/intltool-extract
100 intltool_BUILD_DEPENDS= ${intltool_DETECT}:${PORTSDIR}/textproc/intltool
101
102 intlhack_PRE_PATCH=             ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${REINPLACE_CMD} -e \
103                                 's|mkdir $$lang or|mkdir $$lang, 0777 or| ; \
104                                  s|^push @INC, "/.*|push @INC, "${LOCALBASE}/share/intltool";| ; \
105                                  s|/usr/bin/iconv|${LOCALBASE}/bin/iconv|g ; \
106                                  s|unpack *[(]'"'"'U\*'"'"'|unpack ('"'"'C*'"'"'|'
107 .if ${USE_MATE:Mintlhack}!=""
108 USE_MATE+=                              intltool
109 .endif
110
111 keyring_DETECT=         ${LOCALBASE}/libdata/pkgconfig/mate-gcr-0.pc
112 keyring_BUILD_DEPENDS=  ${keyring_DETECT}:${PORTSDIR}/security/mate-keyring
113 keyring_LIB_DEPENDS=    libmategcr.so:${PORTSDIR}/security/mate-keyring
114 keyring_RUN_DEPENDS=    ${keyring_DETECT}:${PORTSDIR}/security/mate-keyring
115
116 libmatekbd_DETECT=              ${LOCALBASE}/libdata/pkgconfig/libmatekbd.pc
117 libmatekbd_BUILD_DEPENDS=       ${libmatekbd_DETECT}:${PORTSDIR}/x11/libmatekbd
118 libmatekbd_LIB_DEPENDS=         libmatekbd.so:${PORTSDIR}/x11/libmatekbd
119 libmatekbd_RUN_DEPENDS=         ${libmatekbd_DETECT}:${PORTSDIR}/x11/libmatekbd
120
121 libmatekeyring_DETECT=          ${LOCALBASE}/libdata/pkgconfig/mate-keyring-1.pc
122 libmatekeyring_BUILD_DEPENDS=   ${libmatekeyring_DETECT}:${PORTSDIR}/security/libmatekeyring
123 libmatekeyring_LIB_DEPENDS=     libmate-keyring.so:${PORTSDIR}/security/libmatekeyring
124 libmatekeyring_RUN_DEPENDS=     ${libmatekeyring_DETECT}:${PORTSDIR}/security/libmatekeyring
125
126 libmateweather_DETECT=          ${LOCALBASE}/libdata/pkgconfig/mateweather.pc
127 libmateweather_BUILD_DEPENDS=   ${libmateweather_DETECT}:${PORTSDIR}/net/libmateweather
128 libmateweather_LIB_DEPENDS=     libmateweather.so:${PORTSDIR}/net/libmateweather
129 libmateweather_RUN_DEPENDS=     ${libmateweather_DETECT}:${PORTSDIR}/net/libmateweather
130
131 libmatewnck_DETECT=             ${LOCALBASE}/libdata/pkgconfig/libmatewnck.pc
132 libmatewnck_BUILD_DEPENDS=      ${libmatewnck_DETECT}:${PORTSDIR}/x11-toolkits/libmatewnck
133 libmatewnck_LIB_DEPENDS=        libmatewnck.so:${PORTSDIR}/x11-toolkits/libmatewnck
134 libmatewnck_RUN_DEPENDS=        ${libmatewnck_DETECT}:${PORTSDIR}/x11-toolkits/libmatewnck
135
136 marco_DETECT=           ${LOCALBASE}/libdata/pkgconfig/libmarco-private.pc
137 marco_BUILD_DEPENDS=    ${marco_DETECT}:${PORTSDIR}/x11-wm/mate-window-manager
138 marco_LIB_DEPENDS=      libmarco-private.so:${PORTSDIR}/x11-wm/mate-window-manager
139 marco_RUN_DEPENDS=      ${marco_DETECT}:${PORTSDIR}/x11-wm/mate-window-manager
140
141 menus_DETECT=           ${LOCALBASE}/libdata/pkgconfig/libmate-menu.pc
142 menus_BUILD_DEPENDS=    ${menus_DETECT}:${PORTSDIR}/x11/mate-menus
143 menus_LIB_DEPENDS=      libmate-menu.so:${PORTSDIR}/x11/mate-menus
144 menus_RUN_DEPENDS=      ${menus_DETECT}:${PORTSDIR}/x11/mate-menus
145
146 notificationdaemon_DETECT=              ${LOCALBASE}/libexec/mate-notification-daemon
147 notificationdaemon_BUILD_DEPENDS=       ${notificationdaemon_DETECT}:${PORTSDIR}/deskutils/mate-notification-daemon
148 notificationdaemon_RUN_DEPENDS=         ${notificationdaemon_DETECT}:${PORTSDIR}/deskutils/mate-notification-daemon
149
150 panel_DETECT=           ${LOCALBASE}/libdata/pkgconfig/libmatepanelapplet-4.0.pc
151 panel_BUILD_DEPENDS=    ${panel_DETECT}:${PORTSDIR}/x11/mate-panel
152 panel_LIB_DEPENDS=      libmate-panel-applet-4.so:${PORTSDIR}/x11/mate-panel
153 panel_RUN_DEPENDS=      ${panel_DETECT}:${PORTSDIR}/x11/mate-panel
154
155 polkit_DETECT=          ${LOCALBASE}/libdata/pkgconfig/polkit-gtk-mate-1.pc
156 polkit_BUILD_DEPENDS=   ${polkit_DETECT}:${PORTSDIR}/sysutils/mate-polkit
157 polkit_LIB_DEPENDS=     libpolkit-gtk-mate-1.so:${PORTSDIR}/sysutils/mate-polkit
158 polkit_RUN_DEPENDS=     ${polkit_DETECT}:${PORTSDIR}/sysutils/mate-polkit
159
160 pluma_DETECT=           ${LOCALBASE}/libdata/pkgconfig/pluma.pc
161 pluma_BUILD_DEPENDS=    ${pluma_DETECT}:${PORTSDIR}/editors/mate-text-editor
162 pluma_RUN_DEPENDS=      ${pluma_DETECT}:${PORTSDIR}/editors/mate-text-editor
163
164 settingsdaemon_DETECT=          ${LOCALBASE}/libdata/pkgconfig/mate-settings-daemon.pc
165 settingsdaemon_BUILD_DEPENDS=   ${settingsdaemon_DETECT}:${PORTSDIR}/sysutils/mate-settings-daemon
166 settingsdaemon_RUN_DEPENDS=     ${settingsdaemon_DETECT}:${PORTSDIR}/sysutils/mate-settings-daemon
167
168 # End component definition section
169
170 .endif
171 # End of optional part.
172
173 .if defined(_POSTMKINCLUDED) && !defined(Mate_Post_Include)
174
175 Mate_Post_Include=              bsd.mate.mk
176
177 .if defined(USE_MATE)
178 # Then handle the ltverhack component (it has to be done here, because
179 # we rely on some bsd.autotools.mk variables, and bsd.autotools.mk is
180 # included in the post-makefile section).
181 .if defined(_AUTOTOOL_libtool)
182 lthacks_CONFIGURE_ENV=  ac_cv_path_DOLT_BASH=
183 lthacks_PRE_PATCH=              ${CP} -pf ${LTMAIN} ${WRKDIR}/mate-ltmain.sh && \
184                                                 ${CP} -pf ${LIBTOOL} ${WRKDIR}/mate-libtool && \
185                                                 for file in ${LIBTOOLFILES}; do \
186                                                         ${REINPLACE_CMD} -e \
187                                                                 '/^ltmain=/!s|$$ac_aux_dir/ltmain\.sh|${LIBTOOLFLAGS} ${WRKDIR}/mate-ltmain.sh|g; \
188                                                                  /^LIBTOOL=/s|$$(top_builddir)/libtool|${WRKDIR}/mate-libtool|g' \
189                                                                 ${PATCH_WRKSRC}/$$file; \
190                                                 done;
191 .else
192 .  if ${USE_MATE:Mltverhack*}!="" || ${USE_MATE:Mltasneededhack}!=""
193 IGNORE= cannot install: ${PORTNAME} uses the ltverhack and/or ltasneededhack MATE components but does not use libtool
194 .  endif
195 .endif
196
197 .if ${USE_MATE:Mltverhack\:*:C/^[^:]+:([^:]+).*/\1/}==""
198 ltverhack_LIB_VERSION=  major=.`expr $$current - $$age`
199 .else
200 ltverhack_LIB_VERSION=  major=".${USE_MATE:Mltverhack\:*:C/^[^:]+:([^:]+).*/\1/}"
201 .endif
202 ltverhack_PATCH_DEPENDS=${LIBTOOL_DEPENDS}
203 ltverhack_PRE_PATCH=    for file in mate-ltmain.sh mate-libtool; do \
204                                                         if [ -f ${WRKDIR}/$$file ]; then \
205                                                                 ${REINPLACE_CMD} -e \
206                                                                         '/freebsd-elf)/,/;;/ s|major="\.$$current"|${ltverhack_LIB_VERSION}|; \
207                                                                          /freebsd-elf)/,/;;/ s|versuffix="\.$$current"|versuffix="$$major"|' \
208                                                                         ${WRKDIR}/$$file; \
209                                                         fi; \
210                                                 done
211
212 ltasneededhack_PATCH_DEPENDS=${LIBTOOL_DEPENDS}
213 ltasneededhack_PRE_PATCH=       if [ -f ${WRKDIR}/mate-libtool ]; then \
214                                                                 ${REINPLACE_CMD} -e \
215                                                                         '/^archive_cmds=/s/-shared/-shared -Wl,--as-needed/ ; \
216                                                                         /^archive_expsym_cmds=/s/-shared/-shared -Wl,--as-needed/' \
217                                                                         ${WRKDIR}/mate-libtool; \
218                                                         fi
219
220
221 # Comparing between USE_MATE and _USE_MATE_ALL to make sure the component
222 # exists in _USE_MATE_ALL. If it does not exist then give an error about it.
223 #. for component in ${USE_MATE:O:u:C/^([^:]+).*/\1/}
224 . for component in ${USE_MATE:C/^([^:]+).*/\1/}
225 #. for component in ${USE_GNOME:C/^([^:]+).*/\1/}
226 .  if ${_USE_MATE_ALL:M${component}}==""
227 .error cannot install: Unknown component USE_MATE=${component}
228 .  endif
229 . endfor
230
231 . if ${USE_MATE:Mltverhack*}!= "" || ${USE_MATE:Mltasneededhack}!= ""
232 MATE_PRE_PATCH+=        ${lthacks_PRE_PATCH}
233 CONFIGURE_ENV+=         ${lthacks_CONFIGURE_ENV}
234 . endif
235
236 . for component in ${USE_MATE:O:u:C/^([^:]+).*/\1/}
237 .  if defined(${component}_PATCH_DEPENDS)
238 PATCH_DEPENDS+= ${${component}_PATCH_DEPENDS}
239 .  endif
240
241 .  if defined(${component}_DETECT)
242 .   if ${USE_MATE:M${component}\:build}!=""
243 BUILD_DEPENDS+= ${${component}_BUILD_DEPENDS}
244 .   elif ${USE_MATE:M${component}\:run}!=""
245 RUN_DEPENDS+=   ${${component}_RUN_DEPENDS}
246 .   else
247 .    if defined(${component}_LIB_DEPENDS)
248 LIB_DEPENDS+=   ${${component}_LIB_DEPENDS}
249 .    else
250 BUILD_DEPENDS+= ${${component}_BUILD_DEPENDS}
251 RUN_DEPENDS+=   ${${component}_RUN_DEPENDS}
252 .    endif
253 .   endif
254 .  endif
255
256 .  if defined(${component}_CONFIGURE_TARGET)
257 CONFIGURE_ARGS+=${${component}_CONFIGURE_ARGS}
258 .  endif
259
260 .  if defined(${component}_CONFIGURE_ENV)
261 CONFIGURE_ENV+= ${${component}_CONFIGURE_ENV}
262 .  endif
263
264 .  if defined(${component}_MAKE_ENV)
265 MAKE_ENV+=      ${${component}_MAKE_ENV}
266 .  endif
267
268 .  if !defined(CONFIGURE_TARGET) && defined(${component}_CONFIGURE_TARGET)
269 CONFIGURE_TARGET=       ${${component}_CONFIGURE_TARGET}
270 .  endif
271
272 .  if defined(${component}_PRE_PATCH)
273 MATE_PRE_PATCH+=        ; ${${component}_PRE_PATCH}
274 .  endif
275 . endfor
276 .endif # USE_MATE check
277
278 .if ${USE_MATE:Mautogen}!=""
279
280 CONFIGURE_ENV+= NOCONFIGURE=yes
281
282 pre-configure: mate-pre-configure
283
284 mate-pre-configure:
285         @(cd ${CONFIGURE_WRKSRC} ; ${SETENV} ${CONFIGURE_ENV} ./autogen.sh)
286 .endif
287
288 .if defined(MATE_PRE_PATCH)
289
290 pre-configure-script: mate-pre-configure-script
291
292 mate-pre-configure-script:
293         @${MATE_PRE_PATCH:C/^;//1}
294 .endif
295
296 .if ${MAINTAINER}=="gnome@FreeBSD.org"
297 CONFIGURE_FAIL_MESSAGE= "Please run the gnomelogalyzer, available from \"http://www.freebsd.org/gnome/gnomelogalyzer.sh\", which will diagnose the problem and suggest a solution. If - and only if - the gnomelogalyzer cannot solve the problem, report the build failure to the FreeBSD MATE team at ${MAINTAINER}, and attach (a) \"${CONFIGURE_WRKSRC}/${CONFIGURE_LOG}\", (b) the output of the failed make command, and (c) the gnomelogalyzer output. Also, it might be a good idea to provide an overview of all packages installed on your system (i.e. an \`ls ${PKG_DBDIR}\`). Put your attachment up on any website, copy-and-paste into http://freebsd-gnome.pastebin.com, or use send-pr(1) with the attachment. Try to avoid sending any attachments to the mailing list (${MAINTAINER}), because attachments sent to FreeBSD mailing lists are usually discarded by the mailing list software."
298 .endif
299
300 .endif
301 # End of use part.