* move libffi to base/ Category
[t2sde.git] / package / www / firefox / firefox.conf
blob484129f4c3f0ed87402c4638c917223c067740a1
1 # --- T2-COPYRIGHT-BEGIN ---
2 # t2/package/*/firefox/firefox.conf
3 # Copyright (C) 2004 - 2025 The T2 SDE Project
4 # Copyright (C) 1998 - 2004 ROCK Linux Project
5 # SPDX-License-Identifier: GPL-2.0
6 # --- T2-COPYRIGHT-END ---
8 export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
9 export HOME=$sysroot/root
11 if [ $prefix_auto = 1 ]; then
12         prefix=$mozilla_prefix
13         set_confopt
16 hook_add inmake 5 "./mach build"
17 hook_add postmake 5 "./mach install"
19 firefox_config() {
20         cat <<-EOT >> .mozconfig
21 . \$topsrcdir/browser/config/mozconfig
22 export MOZ_PHOENIX=1
23 mk_add_options MOZ_PHOENIX=1
24 mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/objs
26 #ac_add_options --enable-mathml
27 #ac_add_options --enable-crypto
28 #ac_add_options --enable-module=psm
29 ac_add_options --enable-default-toolkit=cairo-gtk3
30 ac_add_options --without-system-png
31 #ac_add_options --disable-profilesharing
32 ac_add_options --enable-official-branding
33 ac_add_options --with-system-zlib
34 #ac_add_options --with-system-bz2
35 #ac_add_options --enable-system-sqlite
36 ac_add_options --enable-system-ffi
37 ac_add_options --enable-system-pixman
38 #ac_add_options --with-pthreads
39 #ac_add_options --enable-gio
40 #ac_add_options --disable-gnomevfs
41 ac_add_options --disable-necko-wifi
42 ac_add_options --disable-crashreporter
43 ac_add_options --disable-updater
44 ac_add_options --disable-tests
45 #ac_add_options --disable-installer
46 #ac_add_options --disable-cargo-incremental
47 ac_add_options --disable-jemalloc
48 EOT
50 [ "$SDECFG_DEBUG" = 1 ] &&
51         echo "ac_add_options --enable-debug-symbols --enable-debug" >> .mozconfig ||
52         echo "ac_add_options --enable-strip" >> .mozconfig
54 pkginstalled dbus || echo "ac_add_options --disable-dbus" >> .mozconfig
55 pkginstalled libjpeg-turbo && echo "ac_add_options --with-system-jpeg" >> .mozconfig
56 pkginstalled icu4c && echo "ac_add_options --with-system-icu" >> .mozconfig
57 pkginstalled pulseaudio || echo "ac_add_options --disable-pulseaudio" >> .mozconfig
58 pkginstalled alsa-lib && echo "ac_add_options --enable-alsa" >> .mozconfig
59 pkginstalled libevent && echo "ac_add_options --with-system-libevent" >> .mozconfig
60 pkginstalled wasi-libc &&
61         echo "ac_add_options --with-wasi-sysroot=$root/$(pkgprefix wasi-libc)" >> .mozconfig ||
62         echo "ac_add_options --without-wasm-sandboxed-libraries" >> .mozconfig
64         [ "$SDECFG_DEFAULT_CC" = clang ] &&
65                 var_append GCC_WRAPPER_APPEND " " "-c?:-fuse-ld=lld" &&
66                 echo "ac_add_options --disable-elf-hack" >> .mozconfig
68         [ "$SDECFG_POWERPC64_ENDIANESS" = 'le' ] ||
69                 var_append patchfiles ' ' "$confdir/hotfix-ppc-not-power8.diff"
71         # jit and sandbox?
72         #echo "ac_add_options --disable-sandbox" >> .mozconfig
73         case "$arch" in
74         x86)
75                 # FF needs sse for jit on x86
76                 if ! $CC -E -dM -x c /dev/null | grep -iq _sse; then
77                         var_append patchfiles ' ' "$confdir/no-jit.diff"
78                         echo "ac_add_options --disable-jit" >> .mozconfig
79                 fi
80                 ;;
81         arm)
82                 [[ $arch_machine = armv[678]* ]] || echo "ac_add_options --disable-jit" >> .mozconfig
83                 ;;
84         arm64|riscv64|x86-64)
85                 : ;;
87         *)
88                 echo "ac_add_options --disable-jit --disable-webrtc" >> .mozconfig ;;
89         esac
92 # don't pass CPU optimizations to clang w/ wasi
93 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/-march=/--target=wasm32-wasi?:-march=}"
94 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/-mcpu=/--target=wasm32-wasi?:-mcpu=}"
95 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/-mtune=/--target=wasm32-wasi?:-mtune=}"
96 GCC_WRAPPER_INSERT="${GCC_WRAPPER_INSERT/-mfpu=/--target=wasm32-wasi?:-mfpu=}"
98 hook_add prepatch 5 "cargo_clear_cksum third_party/rust/*/.cargo-checksum.json"
99 hook_add postpatch 5 "rust_update_arch_target third_party/rust/*/no_atomic*.rs"
101 hook_add prepatch 4 "firefox_config"
102 hook_add preconf 2 "mozilla_branding"
104 # disable legacy component registration
105 mozilla_register() {
106         :