From 55af8bb86cafb9509780c4e1e3ae4cd295b1d8f7 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Tue, 20 Sep 2022 14:47:41 +0200 Subject: [PATCH] firefox: update to 105.0. --- srcpkgs/firefox/files/mozconfig | 37 ----- srcpkgs/firefox/template | 263 ++++++++++++++++++-------------- 2 files changed, 148 insertions(+), 152 deletions(-) delete mode 100644 srcpkgs/firefox/files/mozconfig diff --git a/srcpkgs/firefox/files/mozconfig b/srcpkgs/firefox/files/mozconfig deleted file mode 100644 index b0dade7104f..00000000000 --- a/srcpkgs/firefox/files/mozconfig +++ /dev/null @@ -1,37 +0,0 @@ -ac_add_options --prefix=/usr -ac_add_options --libdir=/usr/lib - -ac_add_options --with-system-nspr -ac_add_options --with-system-nss -ac_add_options --with-system-jpeg -ac_add_options --with-system-zlib -ac_add_options --with-system-libevent -ac_add_options --with-system-libvpx -ac_add_options --with-system-icu -# XXX: the system's libpng doesn't have APNG support -ac_add_options --without-system-png -ac_add_options --enable-system-pixman -ac_add_options --enable-system-ffi - -nspr_config_args=" - --libdir=${XBPS_CROSS_BASE}/usr/lib - --includedir=${XBPS_CROSS_BASE}/usr/include/nspr" - -nss_config_args=" - --libdir=${XBPS_CROSS_BASE}/usr/lib - --includedir=${XBPS_CROSS_BASE}/usr/include/nss" - -ac_add_options --disable-tests -ac_add_options --disable-crashreporter -ac_add_options --disable-updater -ac_add_options --disable-install-strip -ac_add_options --disable-strip -ac_add_options --disable-profiling -ac_add_options --enable-release -ac_add_options --enable-optimize="$CFLAGS" - -ac_add_options --enable-official-branding -ac_add_options --enable-application=browser - -ac_add_options --with-unsigned-addon-scopes=app,system -ac_add_options --allow-addon-sideload diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index f75728d1462..f599561489c 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -3,7 +3,7 @@ # THIS PKG MUST BE SYNCHRONIZED WITH "srcpkgs/firefox-i18n". # pkgname=firefox -version=104.0.2 +version=105.0 revision=1 build_helper="rust" short_desc="Mozilla Firefox web browser" @@ -11,42 +11,34 @@ maintainer="Duncaen " license="MPL-2.0, GPL-2.0-or-later, LGPL-2.1-or-later" homepage="https://www.mozilla.org/firefox/" distfiles="${MOZILLA_SITE}/${pkgname}/releases/${version}/source/${pkgname}-${version}.source.tar.xz" -checksum=72bba06f04e7745f6b02951906413eb1c15a7e253e06e373302162c6219f286a +checksum=2b5becbb89aa2b2007ba8c86ad517aeae1b54904d007d9d3acbf054be6a0ed62 lib32disabled=yes hostmakedepends="autoconf213 unzip zip pkg-config perl python3 yasm rust cargo - llvm clang nodejs-lts cbindgen python nasm which tar" + llvm clang lld nodejs cbindgen nasm which tar" makedepends="nss-devel libjpeg-turbo-devel gtk+3-devel icu-devel - pixman-devel libevent-devel libnotify-devel libvpx-devel + pixman-devel libevent-devel libnotify-devel libvpx-devel libwebp-devel libXrender-devel libXcomposite-devel libSM-devel libXt-devel rust-std - libXdamage-devel freetype-devel $(vopt_if alsa alsa-lib-devel) - $(vopt_if dbus dbus-glib-devel) $(vopt_if pulseaudio pulseaudio-devel) - $(vopt_if xscreensaver libXScrnSaver-devel) + libXdamage-devel freetype-devel libatomic-devel + $(vopt_if alsa alsa-lib-devel) $(vopt_if dbus dbus-glib-devel) + $(vopt_if pulseaudio pulseaudio-devel) $(vopt_if xscreensaver libXScrnSaver-devel) $(vopt_if sndio sndio-devel) $(vopt_if jack jack-devel)" depends="nss>=3.72 nspr>=4.32 desktop-file-utils hicolor-icon-theme" conflicts="firefox-esr>=0" -build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland" +build_options="alsa jack dbus pulseaudio xscreensaver sndio wayland lto" build_options_default="alsa jack dbus pulseaudio xscreensaver sndio wayland" +desc_option_lto="Enable Link Time Optimization" + case $XBPS_TARGET_MACHINE in armv[56]*) broken="required NEON extensions are not supported on armv6" ;; ppc64*) ;; ppc*) broken="xptcall bitrot" ;; - armv7*) broken="https://build.voidlinux.org/builders/armv7l_builder/builds/39410/steps/shell_3/logs/stdio" ;; + # armv7*) broken="https://build.voidlinux.org/builders/armv7l_builder/builds/39410/steps/shell_3/logs/stdio" ;; esac -if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then - makedepends+=" libatomic-devel" -fi - -# work around large debug symbols on 32-bit hosts -# cargo:warning=cc1plus: out of memory allocating 65536 bytes after a total of 1010126848 bytes -if [ "$XBPS_WORDSIZE" = "32" ]; then - nodebug=yes -fi - # we need this because cargo verifies checksums of all files in vendor # crates when it builds and gives us no way to override or update the # file sanely... so just clear out the file list @@ -67,104 +59,157 @@ post_extract() { } post_patch() { - _clear_vendor_checksums num-traits + : # _clear_vendor_checksums num-traits } do_build() { - cp "${FILESDIR}/mozconfig" "${wrksrc}/.mozconfig" - - echo "MOZ_APP_REMOTINGNAME=Firefox" >>.mozconfig - - case "$XBPS_TARGET_MACHINE" in - *-musl) - echo "ac_add_options --disable-jemalloc" >>.mozconfig - echo "ac_add_options --enable-linker=bfd" >>.mozconfig - ;; - esac - - case "$XBPS_TARGET_MACHINE" in - x86_64*|i686*|arm*|aarch64*) - echo "ac_add_options --disable-elf-hack" >>.mozconfig - ;; - esac - - # third_party/libwebrtc/common_audio/wav_file.cc:93:2: error: - # #error "Need to convert samples to big-endian when reading from WAV file" - if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then - echo "ac_add_options --disable-webrtc" >>.mozconfig - fi - - # it seems mozilla has started catching up with google's webrtc - # and this newly involves introducing several megabytes of generated - # json junk that we just cannot maintain in-tree, additionally they - # have indicated that they will be re-generating these frequently - # - # it is unacceptable to keep a 7MB patch downstream, so disable it - # - # https://phabricator.services.mozilla.com/D134738 - # - case "$XBPS_TARGET_MACHINE" in - ppc64le*|armv7l*) echo "ac_add_options --disable-webrtc" >>.mozconfig ;; - esac - - if [ "$XBPS_TARGET_NO_ATOMIC8" ]; then - export LDFLAGS+=" -latomic" - fi + export CC=clang + export CXX=clang++ if [ "$CROSS_BUILD" ]; then - BINDGEN_INCLUDE_FLAGS=$( $CPP -x c++ -v /dev/null -o /dev/null 2>&1 | \ - sed -n '/#include <...> search starts here:/,/End of search list./p' | \ - sed '1,1d;$d' | sed 's/^ /-I/' | paste -s ) + mkdir -p wrapper - export BINDGEN_CFLAGS="--target=$XBPS_CROSS_TRIPLET \ - --sysroot=${XBPS_CROSS_BASE} ${BINDGEN_INCLUDE_FLAGS}" - export HOST_CC=cc - export TARGET_CC="${CC}" - export HOST_CFLAGS="${XBPS_CFLAGS}" - export HOST_CXXFLAGS="${XBPS_CXXFLAGS}" - export ac_cv_sqlite_secure_delete=yes \ - ac_cv_sqlite_threadsafe=yes \ - ac_cv_sqlite_enable_fts3=yes \ - ac_cv_sqlite_dbstat_vtab=yes \ - ac_cv_sqlite_enable_unlock_notify=yes \ - ac_cv_prog_hostcxx_works=1 + local gcc_version=$(gcc -dumpversion) + local clang_version=$(clang -dumpversion) - echo "ac_add_options --target=$XBPS_CROSS_TRIPLET" >>.mozconfig - echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig - else - echo "ac_add_options --target=$XBPS_TRIPLET" >>.mozconfig - echo "ac_add_options --host=$XBPS_TRIPLET" >>.mozconfig + cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang" + #!/bin/sh + exec clang \ + --target="${XBPS_CROSS_TRIPLET}" \ + --gcc-toolchain=/usr \ + --sysroot="${XBPS_CROSS_BASE}" \ + -nostdinc \ + -isystem "${XBPS_CROSS_BASE}/usr/include" \ + -isystem "/usr/lib/clang/${clang_version}/include" \ + "\$@" + ! + + cat <<-! >"wrapper/${XBPS_TARGET_MACHINE}-clang++" + #!/bin/sh + exec clang++ \ + --target="${XBPS_CROSS_TRIPLET}" \ + --gcc-toolchain=/usr \ + --sysroot="${XBPS_CROSS_BASE}" \ + -nostdinc++ \ + -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}" \ + -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/${XBPS_CROSS_TRIPLET}" \ + -isystem "${XBPS_CROSS_BASE}/usr/include/c++/${gcc_version%.*}/backward" \ + -nostdinc \ + -isystem "${XBPS_CROSS_BASE}/usr/include" \ + -isystem "/usr/lib/clang/${clang_version}/include" \ + "\$@" + ! + + chmod +x wrapper/* + + export PATH="${wrksrc}/wrapper:$PATH" + export CC=${XBPS_TARGET_MACHINE}-clang + export CXX=${XBPS_TARGET_MACHINE}-clang++ fi + export AR=llvm-ar + export NM=llvm-nm + export AS="${CC}" + export CFLAGS="-O2 -fno-plt" + export CXXFLAGS="-O2 -fno-plt" + export HOST_CC=clang + export HOST_CXX=clang++ + export HOST_CFLAGS="" + export HOST_CXXFLAGS="" + export LDFLAGS="-Wl,-rpath=/usr/lib/firefox" + # export LDFLAGS+="-Wl,--threads=${XBPS_MAKEJOBS}" + + disable_jemalloc() { + if [ "$XBPS_TARGET_LIBC" = "musl" ]; then + echo "ac_add_options --disable-jemalloc" + fi + } + + disable_elfhack() { + case "$XBPS_TARGET_MACHINE" in + x86_64*|i686*|arm*|aarch64*) echo "ac_add_options --disable-elf-hack" ;; + esac + } + + disable_webrtc() { + # it seems mozilla has started catching up with google's webrtc + # and this newly involves introducing several megabytes of generated + # json junk that we just cannot maintain in-tree, additionally they + # have indicated that they will be re-generating these frequently + # + # it is unacceptable to keep a 7MB patch downstream, so disable it + # + # https://phabricator.services.mozilla.com/D134738 + # + case "$XBPS_TARGET_MACHINE" in + ppc64le*|armv7l*) echo "ac_add_options --disable-webrtc" ;; + esac + + # third_party/libwebrtc/common_audio/wav_file.cc:93:2: error: + # #error "Need to convert samples to big-endian when reading from WAV file" + if [ "$XBPS_TARGET_ENDIAN" = "be" ]; then + echo "ac_add_options --disable-webrtc" + fi + } + + cat <<-! >.mozconfig + ac_add_options --prefix=/usr + ac_add_options --libdir=/usr/lib + ac_add_options --host=${XBPS_TRIPLET} + ac_add_options --target=${XBPS_CROSS_TRIPLET:-${XBPS_TRIPLET}} + ac_add_options --enable-linker=lld + $(vopt_if lto 'ac_add_options --enable-lto=cross') + ac_add_options --with-libclang-path=/usr/lib + + ac_add_options --enable-official-branding + ac_add_options --enable-application=browser + ac_add_options --enable-release + ac_add_options --enable-hardening + ac_add_options --enable-optimize="\${CFLAGS}" + ac_add_options --enable-path-remapping=c,rust + ac_add_options --disable-tests + ac_add_options --disable-crashreporter + ac_add_options --disable-updater + ac_add_options --disable-install-strip + ac_add_options --disable-strip + ac_add_options --disable-profiling + $(disable_jemalloc) + $(disable_elfhack) + $(disable_webrtc) + # XXX: wasi currently not ready - # echo "ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot" >>.mozconfig - echo "ac_add_options --without-wasm-sandboxed-libraries" >>.mozconfig + # ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot + ac_add_options --without-wasm-sandboxed-libraries - mkdir -p third_party/rust/libloading/.deps + ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" - case "$XBPS_TARGET_MACHINE" in - armv7*) - export CFLAGS+=" -mfpu=neon -Wno-psabi" - export CXXFLAGS+=" -mfpu=neon -Wno-psabi" - ;; - esac + ac_add_options --enable-system-pixman + ac_add_options --with-system-ffi + ac_add_options --with-system-icu + ac_add_options --with-system-jpeg + ac_add_options --with-system-libevent + ac_add_options --with-system-libvpx + ac_add_options --with-system-nspr + ac_add_options --with-system-nss + ac_add_options --with-system-webp + ac_add_options --with-system-zlib + # XXX: the system's libpng doesn't have APNG support + ac_add_options --without-system-png - # work around large debug symbols on 32-bit hosts - if [ "$XBPS_WORDSIZE" = "32" ]; then - echo "ac_add_options --disable-debug-symbols" >>.mozconfig - echo "ac_add_options --disable-debug" >>.mozconfig - export LDFLAGS+=" -Wl,--no-keep-memory" - # patch the rust debug level, this is hardcoded - vsed -i 's/debug_info = "2"/debug_info = "0"/' \ - build/moz.configure/toolchain.configure - fi + ac_add_options --with-unsigned-addon-scopes=app,system + ac_add_options --allow-addon-sideload - case "$XBPS_TARGET_MACHINE" in - aarch64*|i686*|x86_64*) - echo "ac_add_options --enable-rust-simd" >>.mozconfig ;; - esac + ac_add_options $(vopt_enable dbus) + ac_add_options $(vopt_enable dbus necko-wifi) + ac_add_options --disable-audio-backends + ac_add_options $(vopt_enable alsa) + ac_add_options $(vopt_enable jack) + ac_add_options $(vopt_enable pulseaudio) + ac_add_options $(vopt_enable sndio) + ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' 'cairo-gtk3') - export LDFLAGS+=" -Wl,-rpath=/usr/lib/firefox" + MOZ_APP_REMOTINGNAME=Firefox + ! if [ "$SOURCE_DATE_EPOCH" ]; then export MOZ_BUILD_DATE=$(date --date "@$SOURCE_DATE_EPOCH" "+%Y%m%d%H%M%S") @@ -175,22 +220,10 @@ do_build() { export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild" export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system - export AS=$CC - - cat <>.mozconfig -ac_add_options --with-mozilla-api-keyfile="${wrksrc}/mozilla-api-key" -ac_add_options $(vopt_enable alsa) -ac_add_options $(vopt_enable jack) -ac_add_options $(vopt_enable sndio) -ac_add_options $(vopt_enable dbus) -ac_add_options $(vopt_enable dbus necko-wifi) -ac_add_options $(vopt_enable pulseaudio) -ac_add_options --enable-default-toolkit=$(vopt_if wayland 'cairo-gtk3-wayland' 'cairo-gtk3') -! - rm -f old-configure ./mach build } + do_install() { export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system export MOZBUILD_STATE_PATH="${wrksrc}/mozbuild"