Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15576 - (show annotations) (download)
Fri Jan 4 16:57:28 2013 UTC (11 years, 5 months ago) by niro
File size: 9761 byte(s)
-fixed sed
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 python
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 # create missing python execs on multilib systems
127 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
128 then
129 sed -i '/^rm -rf _virtualenv/d' configure.in || die
130 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
131
132 install -d _virtualenv/bin || die
133 cp -a /usr/bin/python-m32 _virtualenv/bin || die
134 cp -a /usr/bin/python-m64 _virtualenv/bin || die
135 cp -a /usr/bin/python$(get_python_version)-m32 _virtualenv/bin || die
136 cp -a /usr/bin/python$(get_python_version)-m64 _virtualenv/bin || die
137 fi
138
139 export WANT_AUTOCONF=2.1
140 autoconf || die
141 }
142
143 src_compile()
144 {
145 cd ${SRCDIR}
146
147 # setup .mozconfig
148 cp browser/config/mozconfig .mozconfig || die
149
150 # where shall the files go ?
151 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
152
153 # set optimization level based on CFLAGS
154 if [[ ${ARCH} = x86_64 ]]
155 then
156 # opts may cause segfaults on 64bit arches
157 mozconf_add --enable-optimize=-O1
158 export CFLAGS="${CFLAGS} -fPIC"
159 export CXXFLAGS="${CXXFLAGS} -fPIC"
160 else
161 mozconf_add --enable-optimize=-O2
162 fi
163
164 # enable compat mode for plugins build with gcc2
165 mozconf_add --enable-old-abi-compat-wrappers
166
167 # we don't need the installer
168 mozconf_add --disable-installer
169
170 # issue all warnings demanded by strict ANSI C
171 mozconf_add --disable-pedantic
172
173 # enable crypto support (Personal Security Manager)
174 mozconf_add --enable-crypto
175
176 # want system jpeg, pngm, zlib, nspr and nss
177 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
178 # doesn't work atm
179 #mozconf_add --with-system-png
180 mozconf_add --with-system-zlib
181 mozconf_add --with-system-nspr
182 mozconf_add --with-system-nss
183 mozconf_add --with-system-bz2
184 mozconf_add --enable-system-hunspell
185 mozconf_add --enable-system-sqlite
186 mozconf_add --enable-system-ffi
187 mozconf_add --enable-system-pixman
188
189 # enable cairo-gtk2 as default
190 mozconf_add --enable-default-toolkit=cairo-gtk2
191
192 # libnotify support (disabled atm)
193 mozconf_add --disable-libnotify
194
195 # ipv6 support
196 mozconf_add --enable-ipv6
197
198 # want xinerama
199 mozconf_add --enable-xinerama
200
201 # no xprint ?
202 mozconf_add --disable-xprint
203
204 # >= firefox-1.0.7 should use xft + pango, svg with cairo
205 mozconf_add --disable-freetype2
206 mozconf_add --enable-xft
207 mozconf_add --enable-pango
208 mozconf_add --enable-system-cairo
209 mozconf_add --enable-svg
210 mozconf_add --enable-canvas
211
212 # enable all image encoders
213 mozconf_add --enable-image-encoder=all
214
215 # disable debug build && enable stripping
216 mozconf_add --disable-debug
217 mozconf_add --disable-tests
218 mozconf_add --enable-reorder
219 mozconf_add --enable-strip
220 mozconf_add --enable-strip-libs
221
222 if [[ ${ARCH} = i*86 ]]
223 then
224 # optimze build for x86
225 mozconf_add --enable-elf-dynstr-gc
226 fi
227
228 # both needed to build galeon
229 mozconf_add --enable-oji
230 mozconf_add --enable-mathml
231
232 # enable storage, places and safe-browsing
233 mozconf_add --enable-storage
234 mozconf_add --enable-places
235 mozconf_add --enable-safe-browsing
236
237 # enable default extensions
238 mozconf_add --enable-extensions=default
239
240 # gnome support (needs gnome-vfs)
241 mozconf_add --disable-gnomevfs
242 mozconf_add --enable-extension=-gnomevfs
243
244 # broken with firefox-3.0.10
245 mozconf_add --disable-mochitest
246 mozconf_add --disable-crashreporter
247
248 # enable libnotify
249 mozconf_add --enable-libnotify
250 # enable gio
251 mozconf_add --enable-gio
252 # enable startup-notification
253 mozconf_add --enable-startup-notification
254 # enable dbus
255 mozconf_add --enable-dbus
256 # enable webm and libjpeg-turbo format
257 # both needs yasm
258 mozconf_add --enable-webm
259 mozconf_add --enable-libjpeg-turbo
260 # enable libalsa and ogg
261 mozconf_add --enable-ogg
262 mozconf_add --enable-wave
263
264 # resolve multiple --enable-extensions down to one
265 rebuild_extension_list
266
267 # now run configure
268 mconfigure || die
269
270 # removes extraneous CFLAGS
271 # to reduce RAM requirements while compiling
272 mozilla_remove_cflags || die
273
274 mmake || die
275 }
276
277 src_install_firefox()
278 {
279 cd ${SRCDIR}
280
281 # install
282 make DESTDIR=${BINDIR} install || die
283
284 # fix permissions
285 mchown -R root:root /usr/$(mlibdir)/firefox || die
286
287 # vendor information
288 msetpref general.useragent.vendor Magellan-Linux || die
289
290 # disable app.update in default config
291 msetpref app.update.auto false || die
292 msetpref app.update.enabled false || die
293 msetpref app.update.autoInstallEnabled false || die
294
295 # use system-colors
296 msetpref browser.display.use_system_colors true || die
297 # disable default-browser check
298 msetpref browser.shell.checkDefaultBrowser false || die
299
300 # menu entries
301 minstallpixmap firefox.png || die
302 minstalldir /usr/share/applications || die
303 minstallfile -s firefox.desktop /usr/share/applications || die
304
305 # now move all plugins to /usr/lib/nsbrowser/plugins
306 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
307 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
308 then
309 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
310 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
311 fi
312 # and symlink them (we need a defined location for the plugins of all browsers)
313 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
314
315 # fix missing binary
316 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
317 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
318
319 # remove sdk files
320 mdelete -r /usr/include || die
321 mdelete -r /usr/$(mlibdir)/firefox/idl || die
322 mdelete -r /usr/$(mlibdir)/firefox/include || die
323 mdelete -r /usr/$(mlibdir)/firefox/lib || die
324 mdelete -r /usr/$(mlibdir)/firefox/sdk || die
325 }
326
327 src_install_firefox-sdk()
328 {
329 cd ${SRCDIR}
330
331 make DESTDIR=${BINDIR} install || die
332 mchown -R root:root /usr/$(mlibdir)/firefox || die
333
334 # environment
335 # mozilla-1.7* uses already the env var mozilla_five_home
336 # firefox does not need this, the env var is only to compile
337 # mozilla-based sources
338 minstalldir /etc/env.d || die
339 MCONFIG="/etc/env.d/90firefox-sdk"
340 mclearconfig || die
341 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
342 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
343
344 # keep only sdk files
345 zapmost ${BINDIR} \
346 etc/env.d \
347 usr/include \
348 usr/$(mlibdir)/firefox/idl \
349 usr/$(mlibdir)/firefox/include \
350 usr/$(mlibdir)/firefox/lib \
351 usr/$(mlibdir)/firefox/sdk \
352 || die
353 }
354
355 preinstall_firefox()
356 {
357 # remove old 90mozilla-firefox env-file
358 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
359 then
360 rm ${MROOT}/etc/env.d/90mozilla-firefox
361 env-rebuild
362 fi
363 }