blob: 14be5abe13e09673a699b55ebdb394b040e2e602 (
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
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
|
# Copyright 2011-2014 Quentin "Sardem FF7" Glidic <sardemff7@exherbo.org>
# Distributed under the terms of the GNU General Public License v2
myexparam application
myexparam -b comm=false
exparam -v MOZ_APPLICATION application
require flag-o-matic
if ever is_scm; then
MOZ_HG_BASE_URI="http://hg.mozilla.org"
# Default to mozilla-central, you may want
# to use mozilla-aurora
MOZ_HG_MODULE_XULRUNNER=mozilla-central
MOZ_HG_MODULE_COMM=${MOZ_HG_MODULE_XULRUNNER/mozilla/comm}
MOZ_HG_MODULE_LDAP_SDKS=projects/ldap-sdks
SCM_REPOSITORY="https://github.com/mozilla/gecko-dev"
SCM_CHECKOUT_TO=moz_gecko
SCM_moz_comm_REPOSITORY="https://github.com/mozilla/releases-comm-central"
SCM_moz_comm_UNPACK_TO=${WORK}/comm
SCM_moz_ldap_sdks_REPOSITORY=${MOZ_HG_BASE_URI}/${MOZ_HG_MODULE_LDAP_SDKS}
SCM_moz_ldap_sdks_TYPE=hg
exparam -b comm && SCM_SECONDARY_REPOSITORIES="moz_comm ${SCM_SECONDARY_REPOSITORIES}"
#exparam -b comm && SCM_SECONDARY_REPOSITORIES="moz_comm moz_ldap_sdks ${SCM_SECONDARY_REPOSITORIES}"
require autotools [ supported_autoconf=[ 2.1 ] supported_automake=[ none ] ]
require scm-git
# It is really quicker and we do not need a full repo here
scm-hg_do_unpack() {
scm-hg_hg archive \
--rev=$(scm-hg_revision_spec) \
"$(scm_get_var UNPACK_TO)"
}
fi
require cargo [ rust_minimum_version=1.47.0 ]
export_exlib_phases pkg_setup src_configure src_compile src_test src_install
LICENCES="MPL-2.0"
SLOT="0"
MYOPTIONS="
bindist [[ description = [ Disable official branding, allowing binary redistribution ] ]]
dbus
pulseaudio
raw [[ description = [ RAW image formats ] ]]
wayland
wifi
( providers: jpeg-turbo [[ description = [ Build with system jpeg ] ]] )
"
if exparam -b comm; then
MYOPTIONS+="
lightning [[ description = [ Install the calendar extension 'Lightning' ] ]]
"
fi
DEPENDENCIES="
build:
app-arch/zip
dev-lang/python:*[>=3][sqlite]
dev-lang/yasm[>=1.1]
dev-rust/cbindgen[>=0.19.0]
virtual/pkg-config
build+run:
app-arch/unzip
dev-lang/clang:*
dev-lang/node
dev-libs/expat
dev-libs/glib:2
dev-libs/icu:=[>=67.1]
dev-libs/libevent:=[>=1.4.7]
dev-libs/libffi
dev-libs/libIDL[>=0.8.0]
dev-libs/nss[>=3.33]
media-libs/libvpx:=[>=1.0.0]
sys-devel/binutils[>=2.16.1]
sys-libs/zlib[>=1.1.4]
sys-sound/alsa-lib
x11-libs/cairo[X][>=1.10.2]
x11-libs/gtk+:3
x11-libs/libXmu
x11-libs/libXrender
x11-libs/libXt
x11-libs/pango[>=1.10.1]
x11-libs/pixman
dbus? ( dev-libs/dbus-glib[>=0.72] )
providers:jpeg-turbo? ( media-libs/libjpeg-turbo )
wifi? ( net-wireless/wireless_tools )
recommendation:
x11-libs/libnotify [[ description = [ Provide system integrated notification ] ]]
"
# Needed for comm
# Should be fixed upstream
#DEFAULT_SRC_COMPILE_PARAMS=(
# MKDIR=mkdir
# RANLIB=$(exhost --tool-prefix)ranlib
#)
mozilla-app_pkg_setup() {
if option bindist; then
if [[ -d ${MOZ_APPLICATION}/branding/unofficial ]]; then
MOZ_BRANDING=${MOZ_APPLICATION}/branding/unofficial
else
MOZ_BRANDING=${MOZ_APPLICATION}/branding/nightly
fi
elif ever is_scm; then
MOZ_BRANDING=${MOZ_APPLICATION}/branding/nightly
else
case ${MOZ_APPLICATION} in
comm/mail)
MOZ_BRANDING=${MOZ_APPLICATION}/branding/${PN}
;;
*)
MOZ_BRANDING=${MOZ_APPLICATION}/branding/official
;;
esac
fi
export MOZ_BRANDING
}
if ever is_scm; then
export_exlib_phases src_prepare
mozilla-scm_patch_baseconfig() {
# Exherbo install dirs
edo sed -i \
-e "/^installdir/ c installdir = /usr/$(exhost --target)/lib/${PN}" \
-e "/^includedir/ c includedir = /usr/$(exhost --target)/include/${PN}" \
-e "/^idldir/ c idldir = /usr/share/idl/${PN}" \
-e "/^sdkdir/ c sdkdir = /usr/$(exhost --target)/lib/${PN}-devel" \
config/baseconfig.mk
}
mozilla-app_src_prepare() {
default
mozilla-scm_patch_baseconfig
# Force symbols file to be regenerated
edo sed -i \
-e '/MAPFILE =/s/def/sym/' \
security/nss/lib/ckfw/builtins/manifest.mn \
security/nss/lib/ckfw/capi/manifest.mn \
security/nss/lib/nss/manifest.mn \
security/nss/lib/ssl/manifest.mn \
security/nss/lib/util/manifest.mn \
security/nss/lib/smime/manifest.mn \
security/nss/lib/freebl/manifest.mn \
security/nss/lib/sqlite/manifest.mn \
security/nss/lib/softoken/legacydb/manifest.mn \
security/nss/lib/softoken/manifest.mn
edo sed -i \
-e "/^AR/s/ar/$(exhost --tool-prefix)ar/" \
security/nss/coreconf/UNIX.mk
edo sed -i \
-e "/cmd =/s/'nm'/'$(exhost --tool-prefix)nm'/" \
config/check_vanilla_allocations.py
eautoconf
edo pushd nsprpub
edo sed -i \
-e "/AC_PATH_PROGS(AR/d" \
-e "/AC_PATH_PROGS(AS/d" \
-e "/AC_PATH_PROGS(LD/d" \
-e "/AC_PATH_PROGS(STRIP/d" \
configure.in
WANT_AUTOCONF=2.5 eautoconf
edo popd
edo pushd js/src
edo mkdir .deps
eautoconf
edo popd
}
fi
mozilla-app_src_configure() {
# Optimization CFLAG
local x opt=-O2 debug=disable
# Set optimization level based on CFLAGS
for x in ${CFLAGS} ${CXXFLAGS}; do
case ${x} in
-g*) debug=enable ;;
-O3) opt=-O2 ;;
-O0|-01|-O2|-Os) opt=${x} ;;
esac
done
# Now filter -O from CFLAGS/CXXFLAGS to avoid a duplicate in the resulting
# compile string.
filter-flags '-O*'
# Ensure we do not fail on i{3,5,7} processors that support -mavx
append-flags -mno-avx
# Fix for widevine gmp loading
append-flags "-Wl,-rpath=/usr/$(exhost --target)/lib/${PN}"
edo tee -a build/application.ini.in <<EOF
[AppUpdate]
URL=https://exherbo.example/update/6/%PRODUCT%/%VERSION%/%BUILD_ID%/%BUILD_TARGET%/%LOCALE%/%CHANNEL%/%OS_VERSION%/%SYSTEM_CAPABILITIES%/%DISTRIBUTION%/%DISTRIBUTION_VERSION%/update.xml
EOF
local mozconfig_params=(
PKG_SKIP_STRIP=1
CROSS_COMPILE=1
MOZ_TELEMETRY_REPORTING=1
TOOLCHAIN_PREFIX=$(exhost --tool-prefix)
MOZ_CO_PROJECT=${MOZ_APPLICATION}
MOZ_MAKE_FLAGS=-j${EXJOBS:-1}
MOZ_OBJDIR="${WORKBASE}"/build
--prefix=/usr/$(exhost --target)
--host=$(exhost --build)
--target=$(exhost --target)
# CFLAGS
--enable-optimize=${opt}
--disable-strip
--disable-install-strip
--disable-warnings-as-errors
# We don’t want debug
--enable-release
--${debug}-debug
--${debug}-debug-symbols
--disable-tests
# Exherbo system
--with-distribution-id=org.exherbo
--with-branding=${MOZ_BRANDING}
# Disable auto-distribution stuff
--disable-updater
# Use system libs
--with-clang-path=/usr/$(exhost --build)/bin/$(exhost --tool-prefix)clang++
$(option_with providers:jpeg-turbo system-jpeg)
# --enable-system-cairo # causes crashes: https://github.com/voidlinux/void-packages/issues/2308
--enable-system-ffi
--with-system-icu
#--with-system-libevent=/usr/$(exhost --target)
--with-system-libvpx
--enable-system-pixman
--x-includes=/usr/$(exhost --target)/include
--x-libraries=/usr/$(exhost --target)/lib
--with-system-zlib
# Exheres defaults and options
--enable-chrome-format=omni
--enable-default-toolkit=cairo-gtk3$(option wayland -wayland)
#--with-gl-provider=EGL
--disable-crashreporter
#--disable-nodejs
--enable-ffmpeg
$(option_enable dbus)
$(option_enable pulseaudio)
$(option_enable raw)
$(option_enable wifi necko-wifi)
# Application defaults
--enable-application=${MOZ_APPLICATION}
--enable-extensions=default
)
# Dev tools
#export MOZ_DEVTOOLS=server
#edo sed -i \
# -e s/MOZ_DEVTOOLS=all/MOZ_DEVTOOLS=server/ \
# ${MOZ_APPLICATION}/confvars.sh
if exparam -b comm; then
mozconfig_params+=(
$(option_enable lightning calendar)
)
fi
local x
edo tee .mozconfig <<EOF
$(for x in "${mozconfig_params[@]}" "${@}"; do
case "${x}" in
--*)
echo ac_add_options "${x}"
;;
*)
echo export "${x}"
echo mk_add_options "${x}"
;;
esac
done)
EOF
unset AS
MACH_USE_SYSTEM_PYTHON=1 \
edo ./mach configure
}
mozilla-app_src_compile() {
unset TARGETS
MACH_USE_SYSTEM_PYTHON=1 \
edo ./mach build -j${EXJOBS:-1} -v
}
mozilla-app_src_test() {
default
}
mozilla-app_src_install() {
unset TARGETS
edo cd "${WORKBASE}"/build
default
find "${IMAGE}" -type d -empty -printf "rmdir %P\n" -delete 1>&2
local branding_path=${WORK}/${MOZ_BRANDING} icon name size
source "${branding_path}"/configure.sh
targeticonname="${MOZ_APP_DISPLAYNAME,,}"
# Install icons
for size in 16 22 24 32 48 64 72 96 128 256; do
for name in default${size}.png mozicon${size}.png content/icon${size}.png; do
local path=${branding_path}/${name}
if [[ -f "${path}" ]]; then
insinto /usr/share/icons/hicolor/${size}x${size}/apps
newins "${path}" "${targeticonname}.png"
# Install a 48x48 icon into /usr/share/pixmaps for legacy DEs
insinto /usr/share/pixmaps
newins "${path}" "${targeticonname}.png"
break
fi
done
done
# Install .desktop for menu entry
insinto /usr/share/applications
doins "${FILES}"/${PN}.desktop
edo sed -i \
-e "s:@NAME@:${MOZ_APP_DISPLAYNAME}:" \
-e "s:@ICON@:${targeticonname}:" \
"${IMAGE}"/usr/share/applications/${PN}.desktop
# Plugins dir
hereenvd 50${PN} <<EOF
MOZ_PLUGIN_PATH="/usr/host/lib/mozilla/plugins:/usr/host/lib/nsbrowser/plugins:/opt/nsbrowser/plugins:/opt/netscape/plugins"
COLON_SEPARATED="MOZ_PLUGIN_PATH"
EOF
}
mozilla-app_unpack_extension() {
local emid=$1 xpi=$2 dir=usr/$(exhost --target)/lib/${PN}/extensions/${emid}
[[ -d "${IMAGE}"${dir} ]] && return
dodir /${dir}
edo pushd "${IMAGE}"${dir}
edo unzip "${WORK}"/${xpi}
edo popd
}
|