4 # Date created: 12 Nov 2005
5 # Whom: Michael Johnson <ahze@FreeBSD.org>
9 # 4 column tabs prevent hair loss and tooth decay!
11 # bsd.gecko.mk abstracts the selection of gecko-based backends. It allows users
12 # and porters to support any available gecko backend without needing to build
13 # many conditional tests. ${USE_GECKO} is the list of backends that your port
14 # can handle, and ${GECKO} is set by bsd.gecko.mk to be the chosen backend.
15 # Users set ${WITH_GECKO} to the list of gecko backends they want on their
18 .if defined(USE_GECKO)
19 .if !defined(_POSTMKINCLUDED) && !defined(Gecko_Pre_Include)
20 Gecko_Pre_Include= bsd.gecko.mk
22 # This file contains some reusable components for mozilla ports. It's of
23 # use primarily to apps from the mozilla project itself (such as Firefox,
24 # Thunderbird, etc.), and probably won't be of use for gecko-based ports
25 # like epiphany, galeon, etc.
27 # You need to make sure to add USE_GECKO=gecko to for your port can uses
28 # one of these options below.
30 # Ports can use the following:
32 # USE_MOZILLA By default, it enables every system dependency
33 # listed in '_ALL_DEPENDS'. If your port doesn't
34 # need one of those then you can use '-' like
35 # 'USE_MOZILLA= -png -vpx' to subtract the
36 # dependencies. Experimental deps use '+' like
37 # 'USE_MOZILLA= +speex +theora'.
39 # GECKO_PLIST_PRE_FILES Manual add files in the plist if it needs.
41 # GECKO_PLIST_PRE_DIRS Manual directories in the plist if it needs.
43 # MOZILLA_PLIST_DIRS List of directories to descend into when installing
44 # and creating the plist
46 # MOZ_PIS_SCRIPTS List of scripts residing in ${FILESDIR} to be
47 # filtered through MOZCONFIG_SED and installed along
48 # with our Pluggable Init Scripts (PIS)
50 # MOZ_SED_ARGS sed(1) commands through which MOZ_PIS_SCRIPTS are
51 # filtered. There is a default set defined here, so
52 # you probably want to add to MOZ_SED_ARGS rather
55 # MOZ_OPTIONS configure arguments (added to .mozconfig). If
56 # NOMOZCONFIG is defined, you probably want to set
57 # CONFIGURE_ARGS+=${MOZ_OPTIONS}
59 # MOZ_MK_OPTIONS The make(1) arguments (added to .mozconfig). If
60 # NOMOZCONFIG is defined, you probably want to set
61 # MAKE_ARGS+=${MOZ_MK_OPTIONS}
63 # MOZ_EXPORT Environment variables for the build process (added
64 # to .mozconfig). If NOMOZCONFIG is defined, you
65 # probably want to set MAKE_ENV+=${MOZ_EXPORT}
67 # MOZ_CHROME A variable for the --enable-chrome-format= in
68 # CONFIGURE_ARGS. The default is omni.
70 # MOZ_TOOLKIT A variable for the --enable-default-toolkit= in
71 # CONFIGURE_ARGS. The default is cairo-gtk2.
73 # MOZ_EXTENSIONS A list of extensions to build
75 # MOZ_PROTOCOLS A list of protocols to build (http, ftp, etc.)
77 # PORT_MOZCONFIG Defaults to ${FILESDIR}/mozconfig.in, but can be
78 # set to a generic mozconfig included with the port
80 # NOGECKO_INSTALL Don't install the built gecko (most likely for
83 # NOGECKO_PLIST Don't create a dynamically-generated playlist
85 # NOMOZCONFIG Don't drop a customized .mozconfig into the build
86 # directory. Options will have to be specified in
87 # CONFIGURE_ARGS instead
90 MAINTAINER?= gecko@FreeBSD.org
93 MOZILLA_VER?= ${PORTVERSION}
94 MOZILLA_BIN?= ${PORTNAME}-bin
95 MOZILLA_EXEC_NAME?=${MOZILLA}
96 MOZ_RPATH?= ${MOZILLA}
97 USE_GNOME+= desktopfileutils
98 USES+= compiler:c++11-lib gmake iconv perl5 pkgconfig
100 USE_XORG= xext xrender xt
106 WRKSRC?= ${WRKDIR}/mozilla
107 FAKEDIR?= ${WRKDIR}/fake
108 PLIST?= ${WRKDIR}/plist
109 PLISTD?= ${WRKDIR}/plist_dirs
110 PLISTF?= ${WRKDIR}/plist_files
112 MOZ_PIS_DIR?= lib/${MOZILLA}/init.d
114 PORT_MOZCONFIG?= ${FILESDIR}/mozconfig.in
115 MOZCONFIG?= ${WRKSRC}/.mozconfig
116 MOZILLA_PLIST_DIRS?= bin lib
117 PKGINSTALL?= ${WRKDIR}/pkg-install
118 PKGDEINSTALL?= ${WRKDIR}/pkg-deinstall
119 PKGINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-install.in
120 PKGDEINSTALL_INC?= ${.CURDIR}/../../www/firefox/files/pkg-deinstall.in
122 EXTRACT_AFTER_ARGS?= --exclude */CVS/* \
123 --exclude */macbuild/* \
124 --exclude */package/* \
125 --exclude mozilla*/gc/boehm
127 MOZ_PKGCONFIG_FILES?= ${MOZILLA}-gtkmozembed ${MOZILLA}-js \
128 ${MOZILLA}-xpcom ${MOZILLA}-plugin
130 MOZ_EXPORT+= ${CONFIGURE_ENV} \
131 LIBS="${LIBS}" PERL="${PERL}"
132 MOZ_OPTIONS+= --prefix="${FAKEDIR}"
134 CPPFLAGS+= -isystem${LOCALBASE}/include
135 LDFLAGS+= -L${LOCALBASE}/lib -Wl,-rpath,${PREFIX}/lib/${MOZILLA}
137 # use jemalloc 3.0.0 API for stats/tuning
138 MOZ_EXPORT+= MOZ_JEMALLOC3=1
139 .if ${OSVERSION} < 1000012
140 MOZ_OPTIONS+= --enable-jemalloc
144 _ALL_DEPENDS= cairo event ffi graphite harfbuzz hunspell icu jpeg nspr nss opus png pixman soundtouch sqlite vorbis vpx
146 cairo_LIB_DEPENDS= libcairo.so:${PORTSDIR}/graphics/cairo
147 cairo_MOZ_OPTIONS= --enable-system-cairo
148 cairo_EXTRACT_AFTER_ARGS= --exclude mozilla*/gfx/cairo/cairo
150 event_LIB_DEPENDS= libevent-2.0.so:${PORTSDIR}/devel/libevent2
151 event_MOZ_OPTIONS= --with-system-libevent
152 event_EXTRACT_AFTER_ARGS= --exclude mozilla*/ipc/chromium/src/third_party/libevent
154 ffi_LIB_DEPENDS= libffi.so:${PORTSDIR}/devel/libffi
155 ffi_MOZ_OPTIONS= --enable-system-ffi
156 ffi_EXTRACT_AFTER_ARGS= --exclude mozilla*/js/src/ctypes/libffi
158 .if exists(${FILESDIR}/patch-bug847568) || exists(${FILESDIR}/patch-z-bug847568)
159 graphite_LIB_DEPENDS= libgraphite2.so:${PORTSDIR}/graphics/graphite2
160 graphite_MOZ_OPTIONS= --with-system-graphite2
161 graphite_EXTRACT_AFTER_ARGS= --exclude mozilla*/gfx/graphite2
163 harfbuzz_LIB_DEPENDS= libharfbuzz.so:${PORTSDIR}/print/harfbuzz
164 harfbuzz_MOZ_OPTIONS= --with-system-harfbuzz
165 harfbuzz_EXTRACT_AFTER_ARGS= --exclude mozilla*/gfx/harfbuzz
168 hunspell_LIB_DEPENDS= libhunspell-1.3.so:${PORTSDIR}/textproc/hunspell
169 hunspell_MOZ_OPTIONS= --enable-system-hunspell
171 icu_LIB_DEPENDS= libicui18n.so:${PORTSDIR}/devel/icu
172 icu_MOZ_OPTIONS= --with-system-icu --with-intl-api --enable-intl-api
174 -jpeg_BUILD_DEPENDS=yasm:${PORTSDIR}/devel/yasm
175 # XXX depends on ports/180159 or package flavor support
176 #jpeg_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/libjpeg-turbo
177 jpeg_LIB_DEPENDS= libjpeg.so:${PORTSDIR}/graphics/jpeg
178 jpeg_MOZ_OPTIONS= --with-system-jpeg=${LOCALBASE}
179 jpeg_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libjpeg
181 nspr_LIB_DEPENDS= libnspr4.so:${PORTSDIR}/devel/nspr
182 nspr_MOZ_OPTIONS= --with-system-nspr
184 nss_LIB_DEPENDS= libnss3.so:${PORTSDIR}/security/nss
185 nss_MOZ_OPTIONS= --with-system-nss
186 nss_EXTRACT_AFTER_ARGS= --exclude mozilla*/dbm \
187 --exclude mozilla*/security/coreconf \
188 --exclude mozilla*/security/nss
190 .if exists(${FILESDIR}/patch-z-bug517422) || exists(${FILESDIR}/patch-zz-bug517422)
191 opus_LIB_DEPENDS= libopus.so:${PORTSDIR}/audio/opus
192 opus_MOZ_OPTIONS= --with-system-opus
193 opus_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libopus
196 pixman_LIB_DEPENDS= libpixman-1.so:${PORTSDIR}/x11/pixman
197 pixman_MOZ_OPTIONS= --enable-system-pixman
198 pixman_EXTRACT_AFTER_ARGS= --exclude mozilla*/gfx/cairo/libpixman
200 png_LIB_DEPENDS= libpng15.so:${PORTSDIR}/graphics/png
201 png_MOZ_OPTIONS= --with-system-png=${LOCALBASE}
202 png_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libpng
204 .if exists(${FILESDIR}/patch-z-bug517422) || exists(${FILESDIR}/patch-zz-bug517422)
205 soundtouch_LIB_DEPENDS= libSoundTouch.so:${PORTSDIR}/audio/soundtouch
206 soundtouch_MOZ_OPTIONS= --with-system-soundtouch
207 soundtouch_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libsoundtouch
209 # XXX disabled: bug 913854 not yet upstreamed
210 speex_LIB_DEPENDS= libspeexdsp.so:${PORTSDIR}/audio/speex
211 speex_MOZ_OPTIONS= --with-system-speex
212 speex_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libspeex_resampler
215 sqlite_LIB_DEPENDS= libsqlite3.so:${PORTSDIR}/databases/sqlite3
216 sqlite_MOZ_OPTIONS= --enable-system-sqlite
217 sqlite_EXTRACT_AFTER_ARGS= --exclude mozilla*/db/sqlite3
219 .if exists(${FILESDIR}/patch-z-bug517422) || exists(${FILESDIR}/patch-zz-bug517422)
220 # XXX disabled: update to 1.2.x or review backported fixes
221 theora_LIB_DEPENDS= libtheora.so:${PORTSDIR}/multimedia/libtheora
222 theora_MOZ_OPTIONS= --with-system-theora
223 theora_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libtheora
225 vorbis_LIB_DEPENDS= libvorbis.so:${PORTSDIR}/audio/libvorbis
226 vorbis_MOZ_OPTIONS= --with-system-vorbis --with-system-ogg
227 vorbis_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libvorbis \
228 --exclude mozilla*/media/libogg
231 -vpx_BUILD_DEPENDS= yasm:${PORTSDIR}/devel/yasm
232 vpx_LIB_DEPENDS= libvpx.so:${PORTSDIR}/multimedia/libvpx
233 vpx_MOZ_OPTIONS= --with-system-libvpx
234 vpx_EXTRACT_AFTER_ARGS= --exclude mozilla*/media/libvpx
236 .for use in ${USE_MOZILLA}
237 ${use:S/-/_WITHOUT_/}= ${TRUE}
240 .for dep in ${_ALL_DEPENDS} ${USE_MOZILLA:M+*:S/+//}
241 .if !defined(_WITHOUT_${dep})
242 BUILD_DEPENDS+= ${${dep}_BUILD_DEPENDS}
243 LIB_DEPENDS+= ${${dep}_LIB_DEPENDS}
244 RUN_DEPENDS+= ${${dep}_RUN_DEPENDS}
245 MOZ_OPTIONS+= ${${dep}_MOZ_OPTIONS}
246 EXTRACT_AFTER_ARGS+= ${${dep}_EXTRACT_AFTER_ARGS}
248 BUILD_DEPENDS+= ${-${dep}_BUILD_DEPENDS}
254 MOZ_TOOLKIT?= cairo-gtk2
256 --enable-chrome-format=${MOZ_CHROME} \
257 --enable-default-toolkit=${MOZ_TOOLKIT} \
259 # Configure options for install
260 .if !defined(MOZ_EXTENSIONS)
261 MOZ_OPTIONS+= --enable-extensions=default
263 MOZ_OPTIONS+= --enable-extensions=${MOZ_EXTENSIONS}
265 .if !defined(MOZ_PROTOCOLS)
266 MOZ_OPTIONS+= --enable-necko-protocols=default
268 MOZ_OPTIONS+= --enable-necko-protocols=${MOZ_PROTOCOLS}
271 MOZ_OPTIONS+= --with-system-zlib \
273 --enable-unified-compilation \
274 --disable-debug-symbols \
277 --disable-freetypetest \
278 --disable-installer \
282 # XXX stolen from www/chromium
283 MOZ_EXPORT+= MOZ_GOOGLE_API_KEY=AIzaSyBsp9n41JLW8jCokwn7vhoaMejDFRd1mp8
285 .if ${PORT_OPTIONS:MGTK3}
286 MOZ_TOOLKIT= cairo-gtk3
289 .if ${MOZ_TOOLKIT:Mcairo-qt}
290 # don't use - transparent backgrounds (bug 521582),
291 USE_MOZILLA+= -cairo # ports/169343
292 USE_DISPLAY=yes # install
294 . if ${MOZILLA_VER:R:R} >= 30
295 USE_QT5+= qmake_build buildtools_build gui network quick printsupport
297 USE_QT4+= qmake_build moc_build rcc_build gui network opengl
299 MOZ_EXPORT+= HOST_QMAKE="${QMAKE}" HOST_MOC="${MOC}" HOST_RCC="${RCC}"
300 .elif ${MOZ_TOOLKIT:Mcairo-gtk3}
302 .else # gtk2, cairo-gtk2
306 .if ${PORT_OPTIONS:MOPTIMIZED_CFLAGS}
308 MOZ_EXPORT+= MOZ_OPTIMIZE_FLAGS="${CFLAGS:M-O*}"
309 MOZ_OPTIONS+= --enable-optimize
311 MOZ_OPTIONS+= --disable-optimize
314 .if ${PORT_OPTIONS:MDBUS}
315 BUILD_DEPENDS+= libnotify>0:${PORTSDIR}/devel/libnotify
316 LIB_DEPENDS+= libdbus-glib-1.so:${PORTSDIR}/devel/dbus-glib \
317 libstartup-notification-1.so:${PORTSDIR}/x11/startup-notification
318 MOZ_OPTIONS+= --enable-startup-notification
320 MOZ_OPTIONS+= --disable-dbus --disable-libnotify
323 .if ${PORT_OPTIONS:MGSTREAMER}
324 . if ${MOZILLA_VER:R:R} >= 30 || exists(${FILESDIR}/patch-bug806917)
325 USE_GSTREAMER1?=good libav
326 MOZ_OPTIONS+= --enable-gstreamer=1.0
328 USE_GSTREAMER?= good ffmpeg
329 MOZ_OPTIONS+= --enable-gstreamer
332 MOZ_OPTIONS+= --disable-gstreamer
335 .if ${PORT_OPTIONS:MGCONF}
336 BUILD_DEPENDS+= ${gconf2_DETECT}:${gconf2_LIB_DEPENDS:C/.*://}
337 USE_GNOME+= gconf2:build
338 MOZ_OPTIONS+= --enable-gconf
340 MOZ_OPTIONS+= --disable-gconf
343 .if ${PORT_OPTIONS:MGIO} && ! ${MOZ_TOOLKIT:Mcairo-qt}
344 MOZ_OPTIONS+= --enable-gio
346 MOZ_OPTIONS+= --disable-gio
349 .if ${PORT_OPTIONS:MGNOMEUI}
350 BUILD_DEPENDS+= ${libgnomeui_DETECT}:${libgnomeui_LIB_DEPENDS:C/.*://}
351 USE_GNOME+= libgnomeui:build
352 MOZ_OPTIONS+= --enable-gnomeui
354 MOZ_OPTIONS+= --disable-gnomeui
357 .if ${PORT_OPTIONS:MGNOMEVFS2}
358 BUILD_DEPENDS+= ${gnomevfs2_DETECT}:${gnomevfs2_LIB_DEPENDS:C/.*://}
359 USE_GNOME+= gnomevfs2:build
360 MOZ_OPTIONS+= --enable-gnomevfs
361 MOZ_OPTIONS:= ${MOZ_OPTIONS:C/(extensions)=(.*)/\1=\2,gnomevfs/}
363 MOZ_OPTIONS+= --disable-gnomevfs
366 .if ${PORT_OPTIONS:MLIBPROXY}
367 LIB_DEPENDS+= libproxy.so:${PORTSDIR}/net/libproxy
368 MOZ_OPTIONS+= --enable-libproxy
370 MOZ_OPTIONS+= --disable-libproxy
373 .if ${PORT_OPTIONS:MPGO}
378 MAKEFILE= ${WRKSRC}/client.mk
379 ALL_TARGET= profiledbuild
380 MOZ_EXPORT+=MOZ_OPTIMIZE_FLAGS="-Os" MOZ_PGO_OPTIMIZE_FLAGS="${CFLAGS:M-O*}"
383 .if ${PORT_OPTIONS:MALSA}
384 LIB_DEPENDS+= libasound.so:${PORTSDIR}/audio/alsa-lib
385 RUN_DEPENDS+= ${LOCALBASE}/lib/alsa-lib/libasound_module_pcm_oss.so:${PORTSDIR}/audio/alsa-plugins
386 MOZ_OPTIONS+= --enable-alsa
389 .if ${PORT_OPTIONS:MPULSEAUDIO}
390 . if ${PORT_OPTIONS:MALSA}
391 BUILD_DEPENDS+= pulseaudio>0:${PORTSDIR}/audio/pulseaudio
393 # pull pulse package if we cannot fallback to another backend
394 LIB_DEPENDS+= libpulse.so:${PORTSDIR}/audio/pulseaudio
396 MOZ_OPTIONS+= --enable-pulseaudio
398 MOZ_OPTIONS+= --disable-pulseaudio
401 .if ${PORT_OPTIONS:MDEBUG}
402 MOZ_OPTIONS+= --enable-debug --disable-release
403 STRIP= # ports/184285
405 MOZ_OPTIONS+= --disable-debug --enable-release
408 .if ${PORT_OPTIONS:MLOGGING} || ${PORT_OPTIONS:MDEBUG}
409 MOZ_OPTIONS+= --enable-logging
411 MOZ_OPTIONS+= --disable-logging
414 .if ${PORT_OPTIONS:MPROFILE}
415 MOZ_OPTIONS+= --enable-profiling
418 MOZ_OPTIONS+= --disable-profiling
421 .if ${PORT_OPTIONS:MTEST}
422 USE_XORG+= xscrnsaver
423 MOZ_OPTIONS+= --enable-tests
425 MOZ_OPTIONS+= --disable-tests
428 .if !defined(STRIP) || ${STRIP} == ""
429 MOZ_OPTIONS+= --disable-strip --disable-install-strip
431 MOZ_OPTIONS+= --enable-strip --enable-install-strip
434 MOZ_SED_ARGS+= -e's|@CPPFLAGS@|${CPPFLAGS}|g' \
435 -e 's|@CFLAGS@|${CFLAGS}|g' \
436 -e 's|@LDFLAGS@|${LDFLAGS}|g' \
437 -e 's|@LIBS@|${LIBS}|g' \
438 -e 's|@LOCALBASE@|${LOCALBASE}|g' \
439 -e 's|@FAKEDIR@|${FAKEDIR}|g' \
440 -e 's|@PERL@|${PERL5}|g' \
441 -e 's|@MOZDIR@|${PREFIX}/lib/${MOZILLA}|g' \
442 -e 's|%%PREFIX%%|${PREFIX}|g' \
443 -e 's|%%CFLAGS%%|${CFLAGS}|g' \
444 -e 's|%%LDFLAGS%%|${LDFLAGS}|g' \
445 -e 's|%%LIBS%%|${LIBS}|g' \
446 -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
447 -e 's|%%FAKEDIR%%|${FAKEDIR}|g' \
448 -e 's|%%PERL%%|${PERL5}|g' \
449 -e 's|%%MOZILLA%%|${MOZILLA}|g' \
450 -e 's|%%MOZILLA_BIN%%|${MOZILLA_BIN}|g' \
451 -e 's|%%MOZDIR%%|${PREFIX}/lib/${MOZILLA}|g'
452 MOZCONFIG_SED?= ${SED} ${MOZ_SED_ARGS}
455 CONFIGURE_TARGET=x86_64-unknown-${OPSYS:tl}${OSREL}
456 . if ${USE_MOZILLA:M-nss}
457 USE_BINUTILS= # intel-gcm.s
458 CFLAGS+= -B${LOCALBASE}/bin
459 LDFLAGS+= -B${LOCALBASE}/bin
460 . if ${OSVERSION} < 1000041 && exists(/usr/lib/libcxxrt.so) && \
461 ${CXXFLAGS:M-stdlib=libc++}
465 .elif ${ARCH:Mpowerpc*}
467 CFLAGS+= -D__STDC_CONSTANT_MACROS
468 . if ${ARCH} == "powerpc64"
469 MOZ_EXPORT+= UNAME_m="${ARCH}"
470 CFLAGS+= -mminimal-toc
472 .elif ${ARCH} == "sparc64"
473 # Work around miscompilation/mislinkage of the sCanonicalVTable hacks.
474 MOZ_OPTIONS+= --disable-v1-string-abi
477 .if defined(OBJDIR_BUILD)
478 CONFIGURE_SCRIPT=../configure
480 MOZ_OBJDIR= ${WRKSRC}/obj-${CONFIGURE_TARGET}
481 CONFIGURE_WRKSRC=${MOZ_OBJDIR}
482 BUILD_WRKSRC= ${MOZ_OBJDIR}
483 INSTALL_WRKSRC= ${MOZ_OBJDIR}
485 MOZ_OBJDIR= ${WRKSRC}
488 .else # bsd.port.post.mk
490 pre-extract: gecko-pre-extract
493 .if ${PORT_OPTIONS:MPGO}
494 @${ECHO} "*****************************************************************"
495 @${ECHO} "**************************** attention **************************"
496 @${ECHO} "*****************************************************************"
497 @${ECHO} "To build ${MOZILLA} with PGO support you need a running X server and"
498 @${ECHO} " build this port with an user who could access the X server! "
500 @${ECHO} "During the build a ${MOZILLA} instance will start and run some test."
501 @${ECHO} " Do not interrupt or close ${MOZILLA} during this tests! "
502 @${ECHO} "*****************************************************************"
506 post-patch: gecko-post-patch gecko-moz-pis-patch
509 .if exists(${PKGINSTALL_INC})
510 @${MOZCONFIG_SED} < ${PKGINSTALL_INC} > ${PKGINSTALL}
512 .if exists(${PKGDEINSTALL_INC})
513 @${MOZCONFIG_SED} < ${PKGDEINSTALL_INC} > ${PKGDEINSTALL}
515 @${RM} -f ${MOZCONFIG}
516 .if !defined(NOMOZCONFIG)
517 @if [ -e ${PORT_MOZCONFIG} ] ; then \
518 ${MOZCONFIG_SED} < ${PORT_MOZCONFIG} >> ${MOZCONFIG} ; \
520 .for arg in ${MOZ_OPTIONS}
521 @${ECHO_CMD} ac_add_options ${arg:Q} >> ${MOZCONFIG}
523 .for arg in ${MOZ_MK_OPTIONS}
524 @${ECHO_CMD} mk_add_options ${arg:Q} >> ${MOZCONFIG}
526 .for var in ${MOZ_EXPORT}
527 @${ECHO_CMD} export ${var:Q} >> ${MOZCONFIG}
529 .endif # .if !defined(NOMOZCONFIG)
530 .if exists(${MOZSRC}/build/unix/mozilla-config.in)
531 @${REINPLACE_CMD} -e 's/%{idldir}/%idldir%/g ; \
532 s|"%FULL_NSPR_CFLAGS%"|`nspr-config --cflags`|g ; \
533 s|"%FULL_NSPR_LIBS%"|`nspr-config --libs`|g' \
534 ${MOZSRC}/build/unix/mozilla-config.in
536 .if ${USE_MOZILLA:M-nspr}
537 @${ECHO_MSG} "===> Applying NSPR patches"
538 @for i in ${.CURDIR}/../../devel/nspr/files/patch-*; do \
539 ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/nsprpub/build < $$i; \
542 .if ${USE_MOZILLA:M-nss}
543 @${ECHO_MSG} "===> Applying NSS patches"
544 @for i in ${.CURDIR}/../../security/nss/files/patch-*; do \
545 ${PATCH} ${PATCH_ARGS} -d ${MOZSRC}/security/nss < $$i; \
549 ${WRKSRC}/directory/c-sdk/config/FreeBSD.mk \
550 ${WRKSRC}/directory/c-sdk/configure \
551 ${MOZSRC}/security/coreconf/FreeBSD.mk \
552 ${MOZSRC}/js/src/Makefile.in \
553 ${MOZSRC}/js/src/configure \
554 ${MOZSRC}/configure \
555 ${WRKSRC}/configure; do \
556 if [ -f $$f ] ; then \
557 ${REINPLACE_CMD} -Ee 's|-lc_r|${PTHREAD_LIBS}|g ; \
558 s|-l?pthread|${PTHREAD_LIBS}|g ; \
559 s|echo aout|echo elf|g ; \
560 s|/usr/X11R6|${LOCALBASE}|g' \
564 @if [ -f ${WRKSRC}/config/baseconfig.mk ] ; then \
565 ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \
566 ${WRKSRC}/config/baseconfig.mk; \
568 ${REINPLACE_CMD} -e 's|%%MOZILLA%%|${MOZILLA}|g' \
569 ${WRKSRC}/config/autoconf.mk.in; \
571 @${REINPLACE_CMD} -e 's|%%PREFIX%%|${PREFIX}|g ; \
572 s|%%LOCALBASE%%|${LOCALBASE}|g' \
573 ${MOZSRC}/build/unix/run-mozilla.sh
574 @${REINPLACE_CMD} -e 's|/usr/local/netscape|${LOCALBASE}|g ; \
575 s|/usr/local/lib/netscape|${LOCALBASE}/lib|g' \
576 ${MOZSRC}/xpcom/io/SpecialSystemDirectory.cpp
577 @${REINPLACE_CMD} -e 's|/etc|${PREFIX}&|g' \
578 ${MOZSRC}/xpcom/build/nsXPCOMPrivate.h
579 @${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \
580 -e 's|mozilla/plugins|browser_plugins|g' \
581 -e 's|share/mozilla/extensions|lib/xpi|g' \
582 ${MOZSRC}/xpcom/io/nsAppFileLocationProvider.cpp \
583 ${MOZSRC}/toolkit/xre/nsXREDirProvider.cpp
584 @${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
585 ${MOZSRC}/extensions/spellcheck/hunspell/src/mozHunspell.cpp
587 # handles mozilla pis scripts.
589 .for moz in ${MOZ_PIS_SCRIPTS}
590 @${MOZCONFIG_SED} < ${FILESDIR}/${moz} > ${WRKDIR}/${moz}
593 pre-configure: gecko-pre-configure
596 .if defined(OBJDIR_BUILD)
597 ${MKDIR} ${MOZ_OBJDIR}
600 post-configure: gecko-post-configure
602 gecko-post-configure:
603 @${ECHO_CMD} "#define JNIIMPORT" >> ${MOZSRC}/mozilla-config.h
605 pre-install: gecko-moz-pis-pre-install gecko-pre-install port-pre-install gecko-create-plist
607 .if !target(port-pre-install)
613 .if !defined(NOGECKO_PLIST)
614 @${RM} -rf ${FAKEDIR} ${PLIST} ${PLISTD} ${PLISTF}
615 @${TOUCH} -f ${PLIST} ${PLISTD} ${PLISTF}
616 @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} \
617 ${MAKEFILE} ${MAKE_ARGS} prefix=${FAKEDIR} ${INSTALL_TARGET}
618 .if defined(MOZILLA_SUFX) && ${MOZILLA_SUFX}!="none"
619 ${MV} ${FAKEDIR}/bin/${MOZILLA_EXEC_NAME:S/${MOZILLA_SUFX}//} ${FAKEDIR}/bin/${MOZILLA}
620 .if exists(${FAKEDIR}/bin/${MOZILLA_EXEC_NAME:S/${MOZILLA_SUFX}//}-config)
621 ${MV} ${FAKEDIR}/bin/${MOZILLA_EXEC_NAME:S/${MOZILLA_SUFX}//}-config ${FAKEDIR}/bin/${MOZILLA}-config
623 .for pc in ${MOZ_PKGCONFIG_FILES:S|${MOZILLA_SUFX}||}
624 ${SED} -e 's|Requires: ${MOZILLA:S/${MOZILLA_SUFX}//}|Requires: ${MOZILLA}|' \
625 ${FAKEDIR}/lib/pkgconfig/${pc}.pc > ${FAKEDIR}/lib/pkgconfig/${pc:S/${MOZILLA:S,${MOZILLA_SUFX},,}/${MOZILLA}/}.pc
627 @${REINPLACE_CMD} -e 's|${MOZILLA_BIN}|${MOZILLA:S/${MOZILLA_SUFX}//}|; \
628 s|$${progbase}-bin|${MOZILLA:S/${MOZILLA_SUFX}//}-bin|' \
629 -e 's|${FAKEDIR}|${PREFIX}|g' \
630 -i '' $$(${REALPATH} ${FAKEDIR}/bin/${MOZILLA}*)
632 @${REINPLACE_CMD} -e 's|${FAKEDIR}|${PREFIX}|g' \
633 -i '' $$(${REALPATH} ${FAKEDIR}/bin/${MOZILLA_EXEC_NAME}*)
638 .if !defined(NOGECKO_PLIST)
640 .for f in ${GECKO_PLIST_PRE_FILES}
641 ${ECHO_CMD} ${f} >> ${PLISTF}
643 .for f in ${GECKO_PLIST_PRE_DIRS}
644 ${ECHO_CMD} "@dirrm ${f}" >> ${PLISTD}
646 ${MKDIR} ${FAKEDIR}/libdata
647 ${MV} -f ${FAKEDIR}/lib/pkgconfig ${FAKEDIR}/libdata/ || ${TRUE}
648 ${RM} -f ${FAKEDIR}/lib/pkgconfig
649 .for dir in ${MOZILLA_PLIST_DIRS}
650 @cd ${FAKEDIR}/${dir} && ${FIND} -H -s * ! -type d | \
651 ${SED} -e 's|^|${dir}/|' >> ${PLISTF} && \
652 ${FIND} -d * -type d | \
653 ${SED} -e 's|^|@dirrm ${dir}/|' >> ${PLISTD}
655 .for pcfile in ${MOZ_PKGCONFIG_FILES}
656 ${ECHO_CMD} "libdata/pkgconfig/${pcfile}.pc" >> ${PLISTF}
657 @${REINPLACE_CMD} -e 's|${FAKEDIR}|${PREFIX}|g' \
658 -e 's|${MOZILLA}-nspr = ${PORTVERSION}|nspr|' \
659 ${FAKEDIR}/libdata/pkgconfig/${pcfile}.pc
661 ${CAT} ${PLISTF} | ${SORT} >> ${PLIST}
662 ${CAT} ${PLISTD} | ${SORT} -r >> ${PLIST}
663 ${ECHO_CMD} "@exec ${LOCALBASE}/bin/update-desktop-database > /dev/null || ${TRUE}" >> ${PLIST}
664 ${ECHO_CMD} "@unexec ${LOCALBASE}/bin/update-desktop-database > /dev/null || ${TRUE}" >> ${PLIST}
665 .endif # !defined(NOGECKO_PLIST)
667 do-install: gecko-do-install
670 .if !defined(NOGECKO_INSTALL)
671 .for dir in ${MOZILLA_PLIST_DIRS}
672 .if !exists(${PREFIX}/${dir})
673 ${MKDIR} ${PREFIX}/${dir}
675 ${TAR} cf - -C${FAKEDIR}/${dir} -s'|${FAKEDIR}|${PREFIX}|s' . | \
676 ${TAR} xof - -C${PREFIX}/${dir}
678 .for pcfile in ${MOZ_PKGCONFIG_FILES}
679 ${INSTALL_DATA} ${FAKEDIR}/libdata/pkgconfig/${pcfile}.pc \
680 ${PREFIX}/libdata/pkgconfig/${pcfile}.pc
682 .endif # !defined(NOGECKO_INSTALL)
684 gecko-moz-pis-pre-install:
685 .if defined(MOZ_PIS_SCRIPTS)
686 ${MKDIR} ${FAKEDIR}/${MOZ_PIS_DIR}
687 .for moz in ${MOZ_PIS_SCRIPTS}
688 ${INSTALL_SCRIPT} ${WRKDIR}/${moz} ${FAKEDIR}/${MOZ_PIS_DIR}
692 post-install: gecko-post-install
695 .if !defined(PACKAGE_BUILDING) && !defined(NO_MOZPKGINSTALL)
696 @if [ -e ${PKGINSTALL} ] ; then \
697 ${SETENV} PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL; \
700 @-update-desktop-database
704 # HERE THERE BE TACOS -- adamw