summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxiota2023-12-22 09:54:28 -0800
committerGitHub2023-12-22 09:54:28 -0800
commit50530278f44947b8353de3574d229d8c1b60f26a (patch)
treebc2ccb75e78743058739df169dc6d94c8fde406c
parent231f31abc74f10ecc64aa1922015b4d152072515 (diff)
downloadaur-50530278f44947b8353de3574d229d8c1b60f26a.tar.gz
Fix PGO, update, and reorganize (#9)
-rw-r--r--.SRCINFO25
-rw-r--r--PKGBUILD165
2 files changed, 100 insertions, 90 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 60539cc34b1b..8e5b5a7e0954 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,12 +1,10 @@
pkgbase = firefox-wayland-hg
- pkgdesc = Standalone web browser from mozilla.org (mozilla-unified hg, nightly branding, targeting wayland)
- pkgver = 121.0a1+20231117.1+h0dfaf13a5787
+ pkgdesc = Standalone web browser from mozilla.org - mozilla-unified hg, nightly branding, targeting wayland
+ pkgver = 123.0a1+20231222.2+h8481bdfea5c4
pkgrel = 1
url = https://www.mozilla.org/firefox/channel/#nightly
arch = x86_64
- license = GPL
- license = LGPL
- license = MPL
+ license = MPL-2.0
makedepends = cbindgen
makedepends = clang
makedepends = diffutils
@@ -29,21 +27,20 @@ pkgbase = firefox-wayland-hg
makedepends = wasi-libc++abi
makedepends = yasm
makedepends = zip
- depends = dbus-glib
+ depends = dbus
depends = ffmpeg
depends = gtk3
- depends = icu
+ depends = libevent
+ depends = libjpeg
depends = libpulse
+ depends = libvpx
+ depends = libwebp
depends = mime-types
depends = nspr-hg
depends = nss-hg
+ depends = pipewire
depends = ttf-font
- depends = libvpx
- depends = libwebp
- depends = libjpeg
depends = zlib
- depends = libevent
- depends = pipewire
optdepends = hunspell-en_US: Spell checking, American English
optdepends = libnotify: Notification integration
optdepends = networkmanager: Location detection via available WiFi networks
@@ -65,9 +62,5 @@ pkgbase = firefox-wayland-hg
sha256sums = 022e9329fdb4af6267ad32a1398a9ae94a90cbb1e80dcf63e8b19e95490e7a35
sha256sums = a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9
sha256sums = c80937969086550237b0e89a02330d438ce17c3764e43cc5d030cb21c2abce5f
- b2sums = SKIP
- b2sums = e79bb7cf9f6aa1e816809f430a72e4d823756f363f635ebccb9a301d716979f3dd95506895798f54371b65b59065ca4c8e66d1dcac449a633da2a28f4bb966b9
- b2sums = 63a8dd9d8910f9efb353bed452d8b4b2a2da435857ccee083fc0c557f8c4c1339ca593b463db320f70387a1b63f1a79e709e9d12c69520993e26d85a3d742e34
- b2sums = f76eb72c326f347991133c004b252ed2e037e72a7a436012fb1495668d2b9194d836765b58b01ba0bd9f5c4b888ee5ee715bdb458823a2a7822f1b299f4d1948
pkgname = firefox-wayland-hg
diff --git a/PKGBUILD b/PKGBUILD
index cc5bc957f95c..db9b01dd34af 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -11,39 +11,45 @@
# three-stage profile-guided optimization
: ${_build_pgo:=false}
-# pkgtype: hg or wayland-hg
-: ${_pkgtype:=wayland-hg}
+# use mozilla-central repo, instead of mozilla-unified
+: ${_build_nightly:=false}
+# target wayland only
+: ${_build_wayland:=true}
-## --
-pkgname="firefox${_pkgtype:+-$_pkgtype}"
+# modify package name
+: ${_build_hg:=true}
+
+# -----
+[[ "${_build_nightly::1}" == "t" ]] && _pkgtype+="-nightly"
+[[ "${_build_wayland::1}" == "t" ]] && _pkgtype+="-wayland"
+[[ "${_build_hg::1}" == "t" ]] && _pkgtype+="-hg"
+
+## -----
+pkgname="firefox${_pkgtype:-}"
_pkgname=firefox-nightly
-pkgver=121.0a1+20231117.1+h0dfaf13a5787
+pkgver=123.0a1+20231222.2+h8481bdfea5c4
pkgrel=1
pkgdesc="Standalone web browser from mozilla.org"
url="https://www.mozilla.org/firefox/channel/#nightly"
+license=('MPL-2.0')
arch=(x86_64)
-license=(
- GPL
- LGPL
- MPL
-)
+
depends=(
- dbus-glib
+ dbus
ffmpeg
gtk3
- icu
+ libevent
+ libjpeg
libpulse
+ libvpx
+ libwebp
mime-types
nspr-hg
nss-hg
+ pipewire
ttf-font
- libvpx
- libwebp
- libjpeg
zlib
- libevent
- pipewire
)
makedepends=(
cbindgen
@@ -54,7 +60,6 @@ makedepends=(
inetutils
jack
lld
- # mold - relook at the potential of the Mold linker in the future
llvm
mercurial
mesa
@@ -79,31 +84,32 @@ optdepends=(
'xdg-desktop-portal: Screensharing with Wayland'
)
-if [[ x"${_pkgtype::1}" == "xh" ]] ; then
- pkgdesc+=" (mozilla-unified hg, nightly branding, targeting wayland and x11)"
+if [[ "${_build_nightly::1}" == "t" ]] ; then
+ pkgdesc+=" - nightly"
+else
+ pkgdesc+=" - mozilla-unified hg, nightly branding"
+fi
+
+if [[ "${_build_wayland::1}" == "t" ]] ; then
+ pkgdesc+=", targeting wayland"
+else
+ pkgdesc+=", targeting wayland and x11"
depends+=(
libxss
libxt
)
+fi
+
+if [[ "${_build_pgo::1}" == "t" ]] ; then
makedepends+=(
- xorg-server-xvfb
+ weston
+ xwayland-run # AUR
)
-else
- pkgdesc+=" (mozilla-unified hg, nightly branding, targeting wayland)"
-
- if [[ x"${_enable_pgo::1}" == "xt" ]] ; then
- makedepends+=(
- cage
- pixman
- polkit
- xorg-server-xwayland
- )
- fi
fi
-conflicts=('firefox-nightly')
provides=('firefox-nightly')
+conflicts=('firefox-nightly')
options=(
!emptydirs
@@ -112,7 +118,12 @@ options=(
!strip
)
-_repo=https://hg.mozilla.org/mozilla-unified
+if [[ "${_build_nightly::1}" == "t" ]] ; then
+ _repo="https://hg.mozilla.org/mozilla-central"
+else
+ _repo="https://hg.mozilla.org/mozilla-unified"
+fi
+
source=(
hg+$_repo
$_pkgname.desktop
@@ -124,14 +135,12 @@ validpgpkeys=(
# https://blog.mozilla.org/security/2023/05/11/updated-gpg-key-for-signing-firefox-releases/
14F26682D0916CDD81E37B6D61B7B526D98F0353
)
-sha256sums=('SKIP'
- '022e9329fdb4af6267ad32a1398a9ae94a90cbb1e80dcf63e8b19e95490e7a35'
- 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9'
- 'c80937969086550237b0e89a02330d438ce17c3764e43cc5d030cb21c2abce5f')
-b2sums=('SKIP'
- 'e79bb7cf9f6aa1e816809f430a72e4d823756f363f635ebccb9a301d716979f3dd95506895798f54371b65b59065ca4c8e66d1dcac449a633da2a28f4bb966b9'
- '63a8dd9d8910f9efb353bed452d8b4b2a2da435857ccee083fc0c557f8c4c1339ca593b463db320f70387a1b63f1a79e709e9d12c69520993e26d85a3d742e34'
- 'f76eb72c326f347991133c004b252ed2e037e72a7a436012fb1495668d2b9194d836765b58b01ba0bd9f5c4b888ee5ee715bdb458823a2a7822f1b299f4d1948')
+sha256sums=(
+ 'SKIP'
+ '022e9329fdb4af6267ad32a1398a9ae94a90cbb1e80dcf63e8b19e95490e7a35'
+ 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9'
+ 'c80937969086550237b0e89a02330d438ce17c3764e43cc5d030cb21c2abce5f'
+)
# Google API keys (see http://www.chromium.org/developers/how-tos/api-keys)
# Note: These are for Arch Linux use ONLY. For your own distribution, please
@@ -146,7 +155,7 @@ _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM
_mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a
pkgver() {
- cd mozilla-unified
+ cd "${_repo##*/}"
local version=$(<browser/config/version_display.txt)
local date=$(date +%Y%m%d) # Without TZ=UTC, to match systemd timer
@@ -168,7 +177,7 @@ pkgver() {
prepare() {
mkdir mozbuild
- cd mozilla-unified
+ cd "${_repo##*/}"
# Change install dir from 'firefox' to 'firefox-nightly'
patch -Np1 -i ../firefox-install-dir.patch
@@ -183,13 +192,11 @@ mk_add_options MOZ_OBJDIR=${PWD@Q}/obj
ac_add_options --prefix=/usr
ac_add_options --enable-release
ac_add_options --enable-hardening
-ac_add_options --enable-optimize=-O3
ac_add_options --enable-rust-simd
ac_add_options --enable-linker=lld
ac_add_options --disable-elf-hack
ac_add_options --disable-bootstrap
ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot
-
export MOZ_ENABLE_WAYLAND=1
# Branding
@@ -212,7 +219,6 @@ ac_add_options --with-system-nss
ac_add_options --with-system-libvpx
ac_add_options --with-system-webp
ac_add_options --with-system-libevent
-ac_add_options --with-system-icu
ac_add_options --with-system-zlib
ac_add_options --with-system-jpeg
@@ -229,28 +235,34 @@ mk_add_options MOZ_SERVICES_HEALTHREPORT=0
mk_add_options MOZ_TELEMETRY_REPORTING=0
# Other
+export AR=llvm-ar
+export CC='clang'
+export CXX='clang++'
+export NM=llvm-nm
+export RANLIB=llvm-ranlib
END
- if [[ x"${_pkgtype::1}" == "xh" ]] ; then
- echo >>../mozconfig "ac_add_options --enable-default-toolkit=cairo-gtk3-x11-wayland"
- else
+ if [[ "${_build_wayland::1}" == "t" ]] ; then
echo >>../mozconfig "ac_add_options --enable-default-toolkit=cairo-gtk3-wayland-only"
+ else
+ echo >>../mozconfig "ac_add_options --enable-default-toolkit=cairo-gtk3-x11-wayland"
fi
}
build() {
- cd mozilla-unified
+ cd "${_repo##*/}"
- export MOZ_SOURCE_REPO="$_repo"
- export MOZ_NOSPAM=1
+ export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=pip
export MOZBUILD_STATE_PATH="$srcdir/mozbuild"
+ export MOZ_BUILD_DATE="$(date -u${SOURCE_DATE_EPOCH:+d @$SOURCE_DATE_EPOCH} +%Y%m%d%H%M%S)"
export MOZ_ENABLE_FULL_SYMBOLS=1
- export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=pip
+ export MOZ_NOSPAM=1
+ export MOZ_SOURCE_REPO="$_repo"
# LTO/PGO needs more open files
ulimit -n 4096
- if [[ x"${_build_pgo::1}" == "xt" ]] ; then
+ if [[ "${_build_pgo::1}" == "t" ]] ; then
# Do 3-tier PGO
echo "Building instrumented browser..."
cat >.mozconfig ../mozconfig - <<END
@@ -260,36 +272,41 @@ END
echo "Profiling instrumented browser..."
./mach package
- LLVM_PROFDATA=llvm-profdata \
- JARLOG_FILE="$PWD/jarlog" \
- xvfb-run -s "-screen 0 1920x1080x24 -nolisten local" \
- ./mach python build/pgo/profileserver.py
- stat -c "Profile data found (%s bytes)" merged.profdata
- test -s merged.profdata
-
- stat -c "Jar log found (%s bytes)" jarlog
- test -s jarlog
+ LLVM_PROFDATA=llvm-profdata JARLOG_FILE="$PWD/jarlog" \
+ wlheadless-run -c weston --width=1920 --height=1080 \
+ -- ./mach python build/pgo/profileserver.py
echo "Removing instrumented browser..."
./mach clobber
echo "Building optimized browser..."
cat >.mozconfig ../mozconfig - <<END
-ac_add_options --enable-lto=cross,full
-ac_add_options --enable-profile-use=cross
-ac_add_options --with-pgo-profile-path=${PWD@Q}/merged.profdata
-ac_add_options --with-pgo-jarlog=${PWD@Q}/jarlog
+ac_add_options --enable-optimize=-O3
+ac_add_options --enable-lto=cross
END
+
+ if [[ -s merged.profdata ]] ; then
+ stat -c "Profile data found (%s bytes)" merged.profdata
+ echo "ac_add_options --enable-profile-use=cross" >> .mozconfig
+ echo "ac_add_options --with-pgo-profile-path='${PWD@Q}/merged.profdata'" >> .mozconfig
+ else
+ echo "Profile data not found."
+ fi
+
+ if [[ -s jarlog ]] ; then
+ stat -c "Jar log found (%s bytes)" jarlog
+ echo "ac_add_options --with-pgo-jarlog='${PWD@Q}/jarlog'" >> .mozconfig
+ else
+ echo "Jar log not found."
+ fi
+
./mach build
else
echo "Building browser..."
cat >.mozconfig ../mozconfig - <<END
-export AR=llvm-ar
-export CC='clang'
-export CXX='clang++'
-export NM=llvm-nm
-export RANLIB=llvm-ranlib
+ac_add_options --enable-optimize=-O3
+ac_add_options --enable-lto=cross
END
./mach build
fi
@@ -299,7 +316,7 @@ END
}
package() {
- cd mozilla-unified
+ cd "${_repo##*/}"
DESTDIR="$pkgdir" ./mach install
local vendorjs="$pkgdir/usr/lib/$_pkgname/browser/defaults/preferences/vendor.js"