blob: 56290aa351d078cef1683667891396cae531d78f (
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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
|
# Maintainer: jc_gargma <jc_gargma@iserlohn-fortress.net>
# Maintainer (Arch): Jan Alexander Steffens (heftig) <jan.steffens@gmail.com>
# Contributor: Aqua-sama <aqua@iserlohn-fortress.net>
# Contributor (Arch): Ionut Biru <ibiru@archlinux.org>
# Contributor (Arch): Jakub Schmidtke <sjakub@gmail.com>
# # I maintain this because:
# Arch version uses eme
# Arch version uses git
# Arch version uses python2
# Arch version uses clang
# Arch version requires signed addons
# Arch version doesn't remove system addons
# Arch version enables debug symbols
# Arch version lacks privacy and security by default
_modclang=0
#_modclang=1 # FIXME
pkgname=firefox
pkgver=70.0.1
pkgrel=1
pkgdesc="Standalone web browser from mozilla.org"
arch=(x86_64)
license=(MPL GPL LGPL)
url="https://www.mozilla.org/firefox/"
depends=(gtk3 libxt startup-notification mime-types dbus-glib ffmpeg
ttf-font libpulse alsa-lib
bzip2 libffi icu libjpeg-turbo libevent libvpx nspr nss pixman libpng sqlite libwebp zlib)
makedepends=(unzip zip diffutils python-setuptools yasm mesa imake inetutils
xorg-server-xvfb autoconf2.13 rust clang llvm jack gtk2
python nodejs python-psutil cbindgen nasm python2)
optdepends=('networkmanager: Location detection via available WiFi networks'
'libnotify: Notification integration'
'alsa-utils: ALSA support'
'jack: Jack support'
'pulseaudio: PulseAudio support'
'speech-dispatcher: Text-to-Speech'
'hunspell-en_CA: Spell checking, Canadian English')
options=(!emptydirs !makeflags)
conflicts=(firefox-esr)
source=("https://archive.mozilla.org/pub/$pkgname/releases/$pkgver/source/$pkgname-$pkgver.source.tar.xz"{,.asc}
no-relinking.patch
0001-Use-remoting-name-for-GDK-application-names.patch
$pkgname.desktop
distribution.ini
mozconfig.in
mozconfig.in.clang
mozconfig.in.clang.pgo
mozconfig.common.override
pgo-1.patch
moz.configure.diff
package-manifest.diff)
sha256sums=('f2e9bb26af7682b31e82fdfc3a4b3e04fd1caa8b004469ea608185d33e35691b'
'SKIP'
'2dc9d1aa5eb7798c89f46478f254ae61e4122b4d1956d6044426288627d8a014'
'ab07ab26617ff76fce68e07c66b8aa9b96c2d3e5b5517e51a3c3eac2edd88894'
'a9e5264257041c0b968425b5c97436ba48e8d294e1a0f02c59c35461ea245c33'
'0ba4d1a619a3a5750a5a48c6bff8c6a69d3aa4be4c303032c5979ab5f68db208'
'1cc0730e0f0285f45f30feeeee6d7757931b25263b35b041abd71c2e0486210d'
'6bf4638134915758466a912dc909fbad165e76cc3807e9eedc659f8f346575fa'
'b9833cf28af757e17a34e5c7f9db89b97d5c56b8f55cb6bccb70fc48275318af'
'dcf70d24eedab79d811974a75663f0e84c5efca420da61fc444ebe311d0cada9'
'a8c15c9d54ef8b360c0932f4ccf5e74954f14e9a9c2a1ae924b6c392075b2b8c'
'ad8a270e1b2affb098440f82517c3952207b28ebf604fef695dad3e29a5ba30e'
'927e400d6920b98d2fe7db2b6498f195135909a76e0da49441223956364d8227')
validpgpkeys=('14F26682D0916CDD81E37B6D61B7B526D98F0353') # Mozilla Software Releases
prepare() {
# mkdir mozbuild
cd ${pkgname}-${pkgver}
# Avoid relinking during buildsymbols
patch -Np1 -i ../no-relinking.patch
# https://bugzilla.mozilla.org/show_bug.cgi?id=1530052
patch -Np1 -i ../0001-Use-remoting-name-for-GDK-application-names.patch
if [ "${_modclang}" != "1" ]; then
# Apply gcc pgo patches
patch -p0 $srcdir/${pkgname}-${pkgver}/security/sandbox/linux/moz.build $srcdir/pgo-1.patch
fi
if [ "${_modclang}" == "1" ]; then
# Add the custom mozconfig for pgo
cp $srcdir/mozconfig.in.clang.pgo $srcdir/${pkgname}-${pkgver}/.mozconfig
else
# Add the custom mozconfig
cp $srcdir/mozconfig.in $srcdir/${pkgname}-${pkgver}/.mozconfig
fi
# MOZ_TELEMETRY_REPORTING only applied correctly when set in this override file
cp $srcdir/mozconfig.common.override $srcdir/${pkgname}-${pkgver}/build/mozconfig.common.override
# Disable various components at the source level
#sed -i 's|[;]1|;0|' $srcdir/${pkgname}-${pkgver}/toolkit/components/telemetry/TelemetryStartup.manifest
sed -i 's/;1/;0/' $srcdir/${pkgname}-${pkgver}/toolkit/components/telemetry/components.conf
# Patch out health reporting so that MOZ_DATA_REPORTING=0 can be applied.
patch -p0 $srcdir/${pkgname}-${pkgver}/browser/moz.configure $srcdir/moz.configure.diff
# Remove @RESPATH@/browser/features/* to prevent system addons from being part of the output package.
patch -p0 $srcdir/${pkgname}-${pkgver}/browser/installer/package-manifest.in $srcdir/package-manifest.diff
# Hide mobile promo
echo ".fxaMobilePromo { display: none !important; }" >> browser/themes/shared/incontentprefs/preferences.inc.css
# Hide plugindeprecation-notice
echo "#plugindeprecation-notice { display: none !important; }" >> toolkit/mozapps/extensions/content/extensions.css
# Hide warnings on unsigned extensions
echo ".warning{display: none!important; } .addon[notification=warning]{background-image: none!important;}" >> toolkit/mozapps/extensions/content/extensions.css
}
build() {
cd ${pkgname}-${pkgver}
export MOZ_NOSPAM=1
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
export CFLAGS="$CFLAGS -O3 -fstack-protector-all -fPIC"
export CXXFLAGS="$CXXFLAGS -O3 -fstack-protector-all -fPIC"
# LTO needs more open files
ulimit -n 4096
if [ "${_modclang}" == "1" ]; then
# clang does not support -fstack-clash-protection, so remove it
export CFLAGS="$(echo $CFLAGS | sed 's/ -fstack-clash-protection//' - )"
export CXXFLAGS="$(echo $CXXFLAGS | sed 's/ -fstack-clash-protection//' - )"
# # -fno-plt with cross-LTO causes obscure LLVM errors
# # LLVM ERROR: Function Import: link error
# CFLAGS="${CFLAGS/-fno-plt/}"
# CXXFLAGS="${CXXFLAGS/-fno-plt/}"
# Do 3-tier PGO
msg2 "Building instrumented browser..."
./mach build
msg2 "Profiling instrumented browser..."
./mach package
LLVM_PROFDATA=llvm-profdata \
JARLOG_FILE="$PWD/jarlog" \
xvfb-run -a -n 92 -s "-screen 0 1600x1200x24" \
./mach python build/pgo/profileserver.py
if ! compgen -G '*.profraw' >&2; then
error "No profile data produced."
return 1
fi
if [[ ! -s jarlog ]]; then
error "No jar log produced."
return 1
fi
msg2 "Removing instrumented browser..."
./mach clobber
msg2 "Building optimized browser..."
# Add the custom mozconfig
cp $srcdir/mozconfig.in.clang $srcdir/${pkgname}-${pkgver}/.mozconfig
cat >.mozconfig - <<END
ac_add_options --with-pgo-profile-path=${PWD@Q}
ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
END
./mach build
else
msg2 "Building optimized browser..."
xvfb-run -a -n 97 -s "-screen 0 1600x1200x24" ./mach build
fi
msg2 "Building symbol archive..."
./mach buildsymbols
}
package() {
cd ${pkgname}-${pkgver}
DESTDIR="$pkgdir" ./mach install
install -Dm644 $srcdir/distribution.ini \
"$pkgdir/usr/lib/$pkgname/distribution/distribution.ini"
# don't duplicate the binary, use a symlink instead
rm "$pkgdir/usr/bin/firefox"
ln -s "/usr/lib/$pkgname/firefox" "$pkgdir/usr/bin/firefox"
find . -name '*crashreporter-symbols-full.zip' -exec \
cp -fvt "$startdir" {} +
# icons
local i
for i in 16 22 24 32 48 64 128 256; do
install -Dvm644 browser/branding/official/default$i.png \
"$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$pkgname.png"
done
install -Dvm644 browser/branding/official/content/about-logo.png \
"$pkgdir/usr/share/icons/hicolor/192x192/apps/$pkgname.png"
install -Dvm644 browser/branding/official/content/about-logo@2x.png \
"$pkgdir/usr/share/icons/hicolor/384x384/apps/$pkgname.png"
install -Dvm644 browser/branding/official/content/identity-icons-brand.svg \
"$pkgdir/usr/share/icons/hicolor/symbolic/apps/$pkgname-symbolic.svg"
# install desktop file
install -Dvm644 ../$pkgname.desktop \
"$pkgdir/usr/share/applications/$pkgname.desktop"
# Use system certificates
local nssckbi="$pkgdir/usr/lib/$pkgname/libnssckbi.so"
if [[ -e $nssckbi ]]; then
ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi"
fi
}
|