Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 15827 - (show annotations) (download)
Thu Jan 10 11:58:16 2013 UTC (11 years, 5 months ago) by niro
File size: 9718 byte(s)
-fixed installation pathes and src_install
1 # $Id$
2
3 PNAME="firefox"
4 PVER="18.0"
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 )
62
63 UP2DATE="updatecmd ftp://ftp.mozilla.org/pub/mozilla.org/${PNAME}/releases/latest/source | sed 's:[-|.]source::' | lasttarball"
64
65 split_info_firefox()
66 {
67 DESCRIPTION="Firefox is Mozilla's award-winning next generation web browser."
68 DEPEND="${FIREFOX_DEPEND}"
69 PROVIDE="virtual/webbrowser"
70 }
71
72 split_info_firefox-sdk()
73 {
74 DESCRIPTION="Firefox SDK to build plugins and programs."
75 DEPEND="== net-www/firefox-${PVER}"
76 }
77
78 export MOZ_PHOENIX=1
79
80 # set by configure (plus USE_AUTOCONF=1), but useful for NSPR
81 export MOZILLA_CLIENT=1
82 export BUILD_OPT=1
83 export NO_STATIC_LIB=1
84 export USE_PTHREADS=1
85
86 # now strip optimization from CFLAGS so it doesn't end up in the
87 # compile string
88 export CFLAGS="${CFLAGS/-O*/}"
89 export CXXFLAGS="${CFLAGS}"
90
91 # needed to build without warnings on gcc-3
92 export CXXFLAGS="${CXXFLAGS} -Wno-deprecated"
93
94 src_prepare()
95 {
96 munpack ${SRCFILE} || die
97 cd ${SRCDIR}
98
99 # patches, patches, patches
100
101
102 # fix newer curl-headers
103 sed -i '/#include <curl\/types.h>/d' \
104 toolkit/crashreporter/google-breakpad/src/common/linux/http_upload.cc \
105 toolkit/crashreporter/google-breakpad/src/common/linux/libcurl_wrapper.cc \
106 config/system-headers \
107 js/src/config/system-headers || die
108
109 # don't exit with error when some libs are missing which we have in system
110 sed -i '/^MOZ_PKG_FATAL_WARNINGS/s@= 1@= 0@' browser/installer/Makefile.in || die
111
112 # don't error out when there's no files to be removed
113 sed -i 's@\(xargs rm\)$@\1 -f@' toolkit/mozapps/installer/packager.mk || die
114
115 # create missing python execs on multilib systems
116 if [[ ${ARCH} = x86_64 ]] && [[ $(mlibdir) != lib ]]
117 then
118 sed -i '/^rm -rf _virtualenv/d' configure.in || die
119 sed -i '/^mkdir -p _virtualenv/d' configure.in || die
120
121 # seems that firefox ignores all chost settings on x86_64:
122 local _mychost="${CHOST}"
123 [[ ${ARCH} = x86_64 ]] && _mychost="${CHOST/pc/unknown}"
124
125 install -d obj-${_mychost}/_virtualenv/bin || die
126 cp -a /usr/bin/python-m32 obj-${_mychost}/_virtualenv/bin || die
127 cp -a /usr/bin/python-m64 obj-${_mychost}/_virtualenv/bin || die
128 cp -a /usr/bin/python$(get_python_version)-m32 obj-${_mychost}/_virtualenv/bin || die
129 cp -a /usr/bin/python$(get_python_version)-m64 obj-${_mychost}/_virtualenv/bin || die
130 fi
131
132 export WANT_AUTOCONF=2.1
133 autoconf || die
134 }
135
136 src_compile()
137 {
138 cd ${SRCDIR}
139
140 # setup .mozconfig
141 cp browser/config/mozconfig .mozconfig || die
142
143 # where shall the files go ?
144 mozconf_add --prefix=/usr
145 mozconf_add --libdir=/usr/$(mlibdir)
146 mozconf_add --with-default-mozilla-five-home=/usr/$(mlibdir)/firefox
147
148 mozconf_add --host="${CHOST}"
149 mozconf_add --build="${CHOST}"
150
151 # set optimization level based on CFLAGS
152 if [[ ${ARCH} = x86_64 ]]
153 then
154 # opts may cause segfaults on 64bit arches
155 mozconf_add --enable-optimize=-O1
156 export CFLAGS="${CFLAGS} -fPIC"
157 export CXXFLAGS="${CXXFLAGS} -fPIC"
158 else
159 mozconf_add --enable-optimize=-O2
160 fi
161
162 # enable compat mode for plugins build with gcc2
163 mozconf_add --enable-old-abi-compat-wrappers
164
165 # we don't need the installer
166 mozconf_add --disable-installer
167
168 # issue all warnings demanded by strict ANSI C
169 mozconf_add --disable-pedantic
170
171 # enable crypto support (Personal Security Manager)
172 mozconf_add --enable-crypto
173
174 # want system jpeg, pngm, zlib, nspr and nss
175 #mozconf_add --with-system-jpeg # prefer libjpeg-turbo
176 # doesn't work atm
177 #mozconf_add --with-system-png
178 mozconf_add --with-system-zlib
179 mozconf_add --with-system-nspr
180 mozconf_add --with-system-nss
181 mozconf_add --with-system-bz2
182 mozconf_add --enable-system-hunspell
183 mozconf_add --enable-system-sqlite
184 mozconf_add --enable-system-ffi
185 mozconf_add --enable-system-pixman
186
187 # enable cairo-gtk2 as default
188 mozconf_add --enable-default-toolkit=cairo-gtk2
189
190 # libnotify support (disabled atm)
191 mozconf_add --disable-libnotify
192
193 # ipv6 support
194 mozconf_add --enable-ipv6
195
196 # want xinerama
197 mozconf_add --enable-xinerama
198
199 # no xprint ?
200 mozconf_add --disable-xprint
201
202 # >= firefox-1.0.7 should use xft + pango, svg with cairo
203 mozconf_add --disable-freetype2
204 mozconf_add --enable-xft
205 mozconf_add --enable-pango
206 #mozconf_add --enable-system-cairo # cairo-1.12 fails atm
207 mozconf_add --enable-svg
208 mozconf_add --enable-canvas
209
210 # enable all image encoders
211 mozconf_add --enable-image-encoder=all
212
213 # disable debug build && enable stripping
214 mozconf_add --disable-debug
215 mozconf_add --disable-tests
216 mozconf_add --enable-reorder
217 mozconf_add --enable-strip
218 mozconf_add --enable-strip-libs
219
220 if [[ ${ARCH} = i*86 ]]
221 then
222 # optimze build for x86
223 mozconf_add --enable-elf-dynstr-gc
224 fi
225
226 # both needed to build galeon
227 mozconf_add --enable-oji
228 mozconf_add --enable-mathml
229
230 # enable storage, places and safe-browsing
231 mozconf_add --enable-storage
232 mozconf_add --enable-places
233 mozconf_add --enable-safe-browsing
234
235 # enable default extensions
236 mozconf_add --enable-extensions=default
237
238 # gnome support (needs gnome-vfs)
239 mozconf_add --disable-gnomevfs
240 mozconf_add --enable-extension=-gnomevfs
241
242 # broken with firefox-3.0.10
243 mozconf_add --disable-mochitest
244 mozconf_add --disable-crashreporter
245
246 # enable libnotify
247 mozconf_add --enable-libnotify
248 # enable gio
249 mozconf_add --enable-gio
250 # enable startup-notification
251 mozconf_add --enable-startup-notification
252 # enable dbus
253 mozconf_add --enable-dbus
254 # enable webm and libjpeg-turbo format
255 # both needs yasm
256 mozconf_add --enable-webm
257 mozconf_add --enable-libjpeg-turbo
258 # enable libalsa and ogg
259 mozconf_add --enable-ogg
260 mozconf_add --enable-wave
261
262 # resolve multiple --enable-extensions down to one
263 rebuild_extension_list
264
265 # # now run configure
266 # mconfigure || die
267 #
268 # # removes extraneous CFLAGS
269 # # to reduce RAM requirements while compiling
270 # mozilla_remove_cflags || die
271
272 mmake -f client.mk || die
273 }
274
275 src_install_firefox()
276 {
277 cd ${SRCDIR}
278
279 # install
280 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
281
282 # fix permissions
283 mchown -R root:root /usr/$(mlibdir)/firefox || die
284
285 # vendor information
286 msetpref general.useragent.vendor Magellan-Linux || die
287
288 # disable app.update in default config
289 msetpref app.update.auto false || die
290 msetpref app.update.enabled false || die
291 msetpref app.update.autoInstallEnabled false || die
292
293 # use system-colors
294 msetpref browser.display.use_system_colors true || die
295 # disable default-browser check
296 msetpref browser.shell.checkDefaultBrowser false || die
297
298 # menu entries
299 minstallpixmap firefox.png || die
300 minstalldir /usr/share/applications || die
301 minstallfile -s firefox.desktop /usr/share/applications || die
302
303 # now move all plugins to /usr/lib/nsbrowser/plugins
304 minstalldir /usr/$(mlibdir)/nsbrowser/plugins || die
305 if [[ -d ${BINDIR}/usr/$(mlibdir)/firefox/plugins ]]
306 then
307 mcopy -a ${BINDIR}/usr/$(mlibdir)/firefox/plugins/\* /usr/$(mlibdir)/nsbrowser/plugins || die
308 mdelete -r /usr/$(mlibdir)/firefox/plugins || die
309 fi
310 # and symlink them (we need a defined location for the plugins of all browsers)
311 mlink /usr/$(mlibdir)/nsbrowser/plugins /usr/$(mlibdir)/firefox/plugins || die
312
313 # fix missing binary
314 #https://bugzilla.mozilla.org/show_bug.cgi?id=658850
315 mlink firefox /usr/$(mlibdir)/firefox/firefox-bin || die
316
317 # remove sdk files
318 mdelete -r /usr/include || die
319 mdelete -r /usr/$(mlibdir)/firefox/idl || die
320 mdelete -r /usr/$(mlibdir)/firefox/include || die
321 mdelete -r /usr/$(mlibdir)/firefox/lib || die
322 mdelete -r /usr/$(mlibdir)/firefox/sdk || die
323 }
324
325 src_install_firefox-sdk()
326 {
327 cd ${SRCDIR}
328
329 mmake -j1 -f client.mk DESTDIR=${BINDIR} install || die
330 mchown -R root:root /usr/$(mlibdir)/firefox || die
331
332 # environment
333 # mozilla-1.7* uses already the env var mozilla_five_home
334 # firefox does not need this, the env var is only to compile
335 # mozilla-based sources
336 minstalldir /etc/env.d || die
337 MCONFIG="/etc/env.d/90firefox-sdk"
338 mclearconfig || die
339 maddconfig "MOZILLA_FIVE_HOME=/usr/$(mlibdir)/firefox" || die
340 maddconfig "LDPATH=/usr/$(mlibdir)/firefox" || die
341
342 # keep only sdk files
343 zapmost ${BINDIR} \
344 etc/env.d \
345 usr/include \
346 usr/$(mlibdir)/firefox/idl \
347 usr/$(mlibdir)/firefox/include \
348 usr/$(mlibdir)/firefox/lib \
349 usr/$(mlibdir)/firefox/sdk \
350 || die
351 }
352
353 preinstall_firefox()
354 {
355 # remove old 90mozilla-firefox env-file
356 if [[ -f ${MROOT}/etc/env.d/90mozilla-firefox ]]
357 then
358 rm ${MROOT}/etc/env.d/90mozilla-firefox
359 env-rebuild
360 fi
361 }