Magellan Linux

Contents of /trunk/extras/firefox/firefox-17.0.1-r1.smage2

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15572 - (show annotations) (download)
Fri Jan 4 16:10:32 2013 UTC (11 years, 8 months ago) by niro
File size: 9248 byte(s)
-use autoconf-2.1
1 # $Id$
2
3 PNAME="firefox"
4 PVER="17.0.1"
5 PBUILD="r1"
6
7 SPLIT_PACKAGES="firefox firefox-sdk"
8
9 PCAT="net-www"
10 HOMEPAGE="http://www.mozilla.org/products/firefox/"
11
12 FIREFOX_DEPEND=">= x11-libs/libXrender-0.9
13 >= x11-libs/libXcomposite-0.4
14 >= x11-libs/libXt-1
15 >= x11-libs/libXmu-1
16 >= dev-libs/expat-2
17 >= sys-libs/zlib-1.2
18 >= sys-apps/dbus-1.6
19 >= dev-libs/dbus-glib-0.100
20 >= media-libs/fontconfig-2.10
21 >= media-libs/libjpeg-8
22 >= media-libs/libpng-1.5
23 >= media-libs/alsa-lib-1.0.26
24 >= media-libs/libogg-1.3
25 >= dev-libs/glib2-2.34
26 >= dev-libs/libidl-0.8.14
27 >= app-arch/unzip-6
28 >= x11-libs/pango-1.32
29 >= x11-libs/cairo-1.12
30 >= x11-libs/gtk2+-2.24
31 >= x11-libs/libnotify-0.7
32 >= dev-libs/nspr-4.9
33 >= dev-libs/nss-3.14
34 >= media-fonts/corefonts-2
35 >= app-text/hunspell-1.3
36 >= dev-db/sqlite-3.7
37 >= dev-libs/libffi-3
38 >= x11-libs/startup-notification-0.12
39 >= x11-libs/pixman-0.28"
40
41 SDEPEND="${FIREFOX_DEPEND}
42 >= x11-proto/xineramaproto-1
43 >= x11-proto/compositeproto-0.4
44 >= dev-util/pkgconfig-0.25
45 >= sys-dev/autoconf-5
46 >= sys-dev/automake-4
47 >= virtual/sed
48 >= app-arch/zip-3
49 >= dev-lang/yasm-1.2"
50
51 SRCFILE="firefox-${PVER}.source.tar.bz2"
52 SRCDIR="${BUILDDIR}/mozilla-release"
53
54 sminclude mozilla mtools cleanutils
55
56 SRC_URI=(
57 ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/${PVER}/source/${SRCFILE}
58 mirror://mozilla-firefox/${SRCFILE}
59 mirror://mozilla-firefox/menu/firefox.png
60 mirror://mozilla-firefox/menu/firefox.desktop
61 mirror://mozilla-firefox/mozilla-firefox-3.0.6-pkgconfig.patch
62 mirror://mozilla-firefox/mozilla-firefox-2.0.0.5-rpath-3.patch
63 mirror://mozilla-firefox/mozilla-firefox-2.0.0.9-language.patch
64 )
65
66 UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/latest/source | sed 's:[-|.]source::' | lasttarball"
67
68 split_info_firefox()
69 {
70 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
71 DEPEND="${FIREFOX_DEPEND}"
72 PROVIDE="virtual/webbrowser"
73 }
74
75 split_info_firefox-sdk()
76 {
77 DESCRIPTION="Firefox SDK to build plugins and programs."
78 DEPEND="== net-www/firefox-${PVER}"
79 }
80
81 export MOZ_PHOENIX=1
82
83 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
84 export MOZILLA_CLIENT=1
85 export BUILD_OPT=1
86 export NO_STATIC_LIB=1
87 export USE_PTHREADS=1
88
89 # now strip optimization from CFLAGS so it doesn't end up in the
90 # compile string
91 export CFLAGS="${CFLAGS/-O*/}"
92 export CXXFLAGS="${CFLAGS}"
93
94 # needed to build without warnings on gcc-3
95 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
96
97 src_prepare()
98 {
99 munpack ${SRCFILE} || die
100 cd ${SRCDIR}
101
102 # patches, patches, patches
103
104 # fix pkgconfig pathes
105 # mpatch mozilla-firefox-3.0.6-pkgconfig.patch || die
106
107 # fix some compile issues on multilib systems
108 mpatch mozilla-firefox-2.0.0.5-rpath-3.patch || die
109
110 # enable variable languages via environment vars
111 # mpatch mozilla-firefox-2.0.0.9-language.patch || die
112
113 # fix newer curl-headers
114 sed -i '/#include <curl\/types.h>/d' \
115 toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
116 toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
117 config/system-headers \
118 js/src/config/system-headers || die
119
120 # don't exit with error when some libs are missing which we have in system
121 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
122
123 # don't error out when there's no files to be removed
124 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
125
126 export WANT_AUTOCONF=2.1
127 mautoreconf || die
128 }
129
130 src_compile()
131 {
132 cd ${SRCDIR}
133
134 # setup .mozconfig
135 cp browser/config/mozconfig .mozconfig || die
136
137 # where shall the files go ?
138 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
139
140 # set optimization level based on CFLAGS
141 if [[ ${ARCH} = x86_64 ]]
142 then
143 # opts may cause segfaults on 64bit arches
144 mozconf_add --enable-optimize=-O1
145 export CFLAGS="${CFLAGS} -fPIC"
146 export CXXFLAGS="${CXXFLAGS} -fPIC"
147 else
148 mozconf_add --enable-optimize=-O2
149 fi
150
151 # enable compat mode for plugins build with gcc2
152 mozconf_add --enable-old-abi-compat-wrappers
153
154 # we don't need the installer
155 mozconf_add --disable-installer
156
157 # issue all warnings demanded by strict ANSI C
158 mozconf_add --disable-pedantic
159
160 # enable crypto support (Personal Security Manager)
161 mozconf_add --enable-crypto
162
163 # want system jpeg, pngm, zlib, nspr and nss
164 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
165 # doesn't work atm
166 #mozconf_add --with-system-png
167 mozconf_add --with-system-zlib
168 mozconf_add --with-system-nspr
169 mozconf_add --with-system-nss
170 mozconf_add --with-system-bz2
171 mozconf_add --enable-system-hunspell
172 mozconf_add --enable-system-sqlite
173 mozconf_add --enable-system-ffi
174 mozconf_add --enable-system-pixman
175
176 # enable cairo-gtk2 as default
177 mozconf_add --enable-default-toolkit=cairo-gtk2
178
179 # libnotify support (disabled atm)
180 mozconf_add --disable-libnotify
181
182 # ipv6 support
183 mozconf_add --enable-ipv6
184
185 # want xinerama
186 mozconf_add --enable-xinerama
187
188 # no xprint ?
189 mozconf_add --disable-xprint
190
191 # >= firefox-1.0.7 should use xft + pango, svg with cairo
192 mozconf_add --disable-freetype2
193 mozconf_add --enable-xft
194 mozconf_add --enable-pango
195 mozconf_add --enable-system-cairo
196 mozconf_add --enable-svg
197 mozconf_add --enable-canvas
198
199 # enable all image encoders
200 mozconf_add --enable-image-encoder=all
201
202 # disable debug build && enable stripping
203 mozconf_add --disable-debug
204 mozconf_add --disable-tests
205 mozconf_add --enable-reorder
206 mozconf_add --enable-strip
207 mozconf_add --enable-strip-libs
208
209 if [[ ${ARCH} = i*86 ]]
210 then
211 # optimze build for x86
212 mozconf_add --enable-elf-dynstr-gc
213 fi
214
215 # both needed to build galeon
216 mozconf_add --enable-oji
217 mozconf_add --enable-mathml
218
219 # enable storage, places and safe-browsing
220 mozconf_add --enable-storage
221 mozconf_add --enable-places
222 mozconf_add --enable-safe-browsing
223
224 # enable default extensions
225 mozconf_add --enable-extensions=default
226
227 # gnome support (needs gnome-vfs)
228 mozconf_add --disable-gnomevfs
229 mozconf_add --enable-extension=-gnomevfs
230
231 # broken with firefox-3.0.10
232 mozconf_add --disable-mochitest
233 mozconf_add --disable-crashreporter
234
235 # enable libnotify
236 mozconf_add --enable-libnotify
237 # enable gio
238 mozconf_add --enable-gio
239 # enable startup-notification
240 mozconf_add --enable-startup-notification
241 # enable dbus
242 mozconf_add --enable-dbus
243 # enable webm and libjpeg-turbo format
244 # both needs yasm
245 mozconf_add --enable-webm
246 mozconf_add --enable-libjpeg-turbo
247 # enable libalsa and ogg
248 mozconf_add --enable-ogg
249 mozconf_add --enable-wave
250
251 # resolve multiple --enable-extensions down to one
252 rebuild_extension_list
253
254 # now run configure
255 mconfigure || die
256
257 # removes extraneous CFLAGS
258 # to reduce RAM requirements while compiling
259 mozilla_remove_cflags || die
260
261 mmake || die
262 }
263
264 src_install_firefox()
265 {
266 cd ${SRCDIR}
267
268 # install
269 make DESTDIR=${BINDIR} install || die
270
271 # fix permissions
272 mchown -R root:root /usr/$(mlibdir)/firefox || die
273
274 # vendor information
275 msetpref general.useragent.vendor Magellan-Linux || die
276
277 # disable app.update in default config
278 msetpref app.update.auto false || die
279 msetpref app.update.enabled false || die
280 msetpref app.update.autoInstallEnabled false || die
281
282 # use system-colors
283 msetpref browser.display.use_system_colors true || die
284 # disable default-browser check
285 msetpref browser.shell.checkDefaultBrowser false || die
286
287 # menu entries
288 minstallpixmap firefox.png || die
289 minstalldir /usr/share/applications || die
290 minstallfile -s firefox.desktop /usr/share/applications || die
291
292 # now move all plugins to /usr/lib/nsbrowser/plugins
293 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
294 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
295 then
296 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
297 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
298 fi
299 # and symlink them (we need a defined location for the plugins of all browsers)
300 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
301
302 # fix missing binary
303 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
304 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
305
306 # remove sdk files
307 mdelete -r /usr/include || die
308 mdelete -r /usr/$(mlibdir)/firefox/idl || die
309 mdelete -r /usr/$(mlibdir)/firefox/include || die
310 mdelete -r /usr/$(mlibdir)/firefox/lib || die
311 mdelete -r /usr/$(mlibdir)/firefox/sdk || die
312 }
313
314 src_install_firefox-sdk()
315 {
316 cd ${SRCDIR}
317
318 make DESTDIR=${BINDIR} install || die
319 mchown -R root:root /usr/$(mlibdir)/firefox || die
320
321 # environment
322 # mozilla-1.7* uses already the env var mozilla_five_home
323 # firefox does not need this, the env var is only to compile
324 # mozilla-based sources
325 minstalldir /etc/env.d || die
326 MCONFIG="/etc/env.d/90firefox-sdk"
327 mclearconfig || die
328 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
329 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
330
331 # keep only sdk files
332 zapmost ${BINDIR} \
333 etc/env.d \
334 usr/include \
335 usr/$(mlibdir)/firefox/idl \
336 usr/$(mlibdir)/firefox/include \
337 usr/$(mlibdir)/firefox/lib \
338 usr/$(mlibdir)/firefox/sdk \
339 || die
340 }
341
342 preinstall_firefox()
343 {
344 # remove old 90mozilla-firefox env-file
345 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
346 then
347 rm ${MROOT}/etc/env.d/90mozilla-firefox
348 env-rebuild
349 fi
350 }