aboutsummaryrefslogtreecommitdiffstats
path: root/main/firefox/APKBUILD
blob: 4e740a469c41c114650cbfd15b45ffbd81f086f2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
# Contributor: William Pitcock <nenolod@dereferenced.org>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=firefox
pkgver=17.0.1
_pkgver=$pkgver
_xulver=$pkgver
pkgrel=0
pkgdesc="firefox web browser"
url="http://www.firefox.com"
arch="all"
license="GPL LGPL MPL"
depends="xulrunner>=${_xulver}"
makedepends="xulrunner-dev>=${_xulver}

	     nspr-dev
	     nss-dev
	     gtk+-dev
             mesa-dev
             dbus-glib-dev
             alsa-lib-dev
             libvorbis-dev
             libogg-dev
             libtheora-dev
             wireless-tools-dev
             libnotify-dev
             libevent-dev
	     libvpx-dev
             libxt-dev
             libjpeg-turbo-dev
             bzip2-dev
             hunspell-dev
             startup-notification-dev
             sqlite-dev
             libidl-dev

	     autoconf2.13

	     python
	     zip
	     yasm

	     autoconf
	     automake
	     libtool

	     paxctl"
install=""
subpackages=""
source="http://releases.mozilla.org/pub/mozilla.org/${pkgname}/releases/${pkgver}/source/${pkgname}-${_pkgver}.source.tar.bz2
	mozconfig
	firefox-5.0-asciidel.patch
	duckduckgo.patch
	firefox.desktop
	firefox-safe.desktop"

options="!strip"

_builddir="${srcdir}/mozilla-release"
_mozappdir=/usr/lib/firefox-$pkgver

prepare() {
	local i

	cd "$_builddir"

	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done

	cp "${srcdir}/mozconfig" .mozconfig
	echo "ac_add_options --with-libxul-sdk=$(pkg-config --variable=sdkdir libxul)" >> .mozconfig
	echo "ac_add_options --enable-debug-symbols" >> .mozconfig
	echo "ac_add_options --disable-install-strip" >>.mozconfig
}

build() {
	cd "$_builddir"

	# mozilla's buildsystem is on drugs
	export CFLAGS="$(echo $CFLAGS | sed -e 's/-Wall//' -e 's/-fexceptions/-fno-exceptions/g')"
	export CXXFLAGS="$CFLAGS"

#	export LDFLAGS="-Wl,-rpath,${_mozappdir}"
	make -j1 -f client.mk build \
		STRIP="/bin/true" \
		MOZ_MAKE_FLAGS="$MAKEOPTS" || return 1
}

package() {
	cd "$_builddir"
	make -j1 -f client.mk install \
		DESTDIR="$pkgdir" \
		MOZ_MAKE_FLAGS="$MAKEOPTS" \
		|| return 1

	install -m755 -d ${pkgdir}/usr/share/applications
	install -m755 -d ${pkgdir}/usr/share/pixmaps
	install -m644 "$_builddir"/browser/branding/official/default48.png \
		${pkgdir}/usr/share/pixmaps/firefox.png || return 1
	install -m644 ${srcdir}/firefox.desktop ${pkgdir}/usr/share/applications/firefox.desktop
	install -m644 ${srcdir}/firefox-safe.desktop ${pkgdir}/usr/share/applications/firefox-safe.desktop

	# firefox currently does not work with mprotect. disable it for now
	paxctl -c -m "$pkgdir"/$_mozappdir/firefox || return 1

	# xulrunner stub launcher has changed to using a symlink overlay...
	# go figure
	ln -sf /usr/lib/xulrunner-${_xulver} ${pkgdir}/$_mozappdir/xulrunner

	# launcher as symlink is broken from firefox-7.0
	rm "$pkgdir"/usr/bin/firefox || return 1
	cat > "$pkgdir"/usr/bin/firefox << __EOF__
#!/bin/sh

exec $_mozappdir/firefox "\$@"
__EOF__
	chmod 755 "$pkgdir"/usr/bin/firefox
}

md5sums="13d616028eb77de927c29b6655c832c9  firefox-17.0.1.source.tar.bz2
98bcd8b2d33037f12ca513882fc5d831  mozconfig
2328df219e042f6aaec361cbf83cf9e9  firefox-5.0-asciidel.patch
7341e290faecd9a827c4d580142699a5  duckduckgo.patch
ba96924ece1d77453e462429037a2ce5  firefox.desktop
6f38a5899034b7786cb1f75ad42032b8  firefox-safe.desktop"