Magellan Linux

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

Parent Directory Parent Directory | Revision Log Revision Log


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