# Maintainer: Vladislav Nepogodin (vnepogodin) # Contributor: Kyle De'Vir (QuartzDragon) # Contributor: Jonas Heinrich # Contributor: Maxwell Anselm # Contributor: Jan Alexander Steffens (heftig) # Contributor: Ionut Biru # Contributor: Jakub Schmidtke pkgname=librewolf-hg _pkgname=librewolf-nightly __pkgname="Librewolf Nightly" pkgver=92.0a1.r655136.a8a4dfcadce5 pkgrel=1 pkgdesc="Community-maintained fork of Firefox, focused on privacy, security and freedom. (nightly edition)" arch=(x86_64 x86_64_v3 aarch64) license=(MPL GPL LGPL) url="https://librewolf-community.gitlab.io/" depends=(gtk3 libxt mime-types dbus-glib nss-hg ttf-font libpulse xorg-server-xwayland libvpx libwebp libjpeg zlib icu libevent pipewire) makedepends=(unzip zip diffutils yasm mesa imake inetutils ccache rust xorg-server-xvfb autoconf2.13 mercurial clang llvm jack nodejs cbindgen nasm python-setuptools python-psutil python-zstandard git binutils lld dump_syms wasi-sdk-git) optdepends=('networkmanager: Location detection via available WiFi networks' 'libnotify: Notification integration' 'pulseaudio: Audio support' 'speech-dispatcher: Text-to-Speech' 'hunspell-en_US: Spell checking, American English' 'xdg-desktop-portal: Screensharing with Wayland' 'libappindicator-gtk3: Global menu support for GTK apps' 'appmenu-gtk-module: Appmenu for GTK only' 'plasma5-applets-window-appmenu: Appmenu for Plasma only') depends_x86_64=(ffmpeg4.4) depends_aarch64=(ffmpeg) backup=('usr/lib/librewolf-nightly/librewolf.cfg' 'usr/lib/librewolf-nightly/distribution/policies.json') options=(!emptydirs !makeflags !strip !lto !debug) _arch_git=https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/firefox/trunk _repo=https://hg.mozilla.org/mozilla-unified install=librewolf-nightly.install source=("hg+$_repo#revision=autoland" $_pkgname.desktop "git+https://gitlab.com/vnepogodin/librewolf-common.git" "git+https://gitlab.com/vnepogodin/librewolf-settings.git" "default192x192.png") sha512sums=('SKIP' '5a0932eeceba04a09133a7b61e9eee49cd5bdacb2daadc132e910fdd3ef8392262208b6401043655bff58068b2320022daa6722f11aed9284c5b5a008d570bcd' 'SKIP' 'SKIP' '2ebb0e9b37ea6445d71ab783ca180def1125ec76bff685cce31705360f32fd26d205ba95e232848663bd1c1d927873985d3658105588feb7f09aec0180b6e3a7') pkgver() { cd mozilla-unified _pkgver=$(cat browser/config/version.txt) printf "${_pkgver}.r%s.%s" "$(hg identify -n)" "$(hg identify -i)" | sed 's/\+//g' } prepare() { mkdir -p mozbuild cd mozilla-unified local _patches_dir="${srcdir}/librewolf-common/patches" cat >../mozconfig <>../mozconfig <>../mozconfig < breaks profiled builds since 90.0, it seems # allow SearchEngines option in non-ESR builds patch -Np1 -i ${_patches_dir}/sed-patches/allow-searchengines-non-esr.patch cp "${srcdir}/librewolf-common/source_files/search-config.json" services/settings/dumps/main/search-config.json # stop some undesired requests (https://gitlab.com/librewolf-community/browser/common/-/issues/10) patch -Np1 -i ${_patches_dir}/sed-patches/stop-undesired-requests.patch # Assorted patches patch -Np1 -i ${_patches_dir}/context-menu.patch patch -Np1 -i ${_patches_dir}/urlbarprovider-interventions.patch # allow overriding the color scheme light/dark preference with RFP # deprecated, will probably be dropped soon # patch -Np1 -i ${_patches_dir}/allow_dark_preference_with_rfp.patch # fix an URL in 'about' dialog # patch -Np1 -i ${_patches_dir}/about-dialog.patch # change some hardcoded directory strings that could lead to unnecessarily # created directories patch -Np1 -i ${_patches_dir}/mozilla_dirs.patch # somewhat experimental patch to fix bus/dbus/remoting names to io.gitlab.librewolf # should not break things, buuuuuuuuuut we'll see. patch -Np1 -i ${_patches_dir}/dbus_name.patch # allow uBlockOrigin to run in private mode by default, without user intervention. patch -Np1 -i ${_patches_dir}/allow-ubo-private-mode.patch # add custom uBO assets (on first launch only) patch -Np1 -i ${_patches_dir}/custom-ubo-assets-bootstrap-location.patch # ui patches # remove references to firefox from the settings UI, change text in some of the links, # explain that we force en-US and suggest enabling history near the session restore checkbox. patch -Np1 -i ${_patches_dir}/ui-patches/pref-naming.patch # patch -Np1 -i ${_patches_dir}/ui-patches/hide-safe-browsing.patch # remove firefox references in the urlbar, when suggesting opened tabs. patch -Np1 -i ${_patches_dir}/ui-patches/remove-branding-urlbar.patch # remove cfr UI elements, as they are disabled and locked already. patch -Np1 -i ${_patches_dir}/ui-patches/remove-cfrprefs.patch # do not display your browser is being managed by your organization in the settings. patch -Np1 -i ${_patches_dir}/ui-patches/remove-organization-policy-banner.patch # hide "snippets" section from the home page settings, as it was already locked. patch -Np1 -i ${_patches_dir}/ui-patches/remove-snippets-from-home.patch # add warning that sanitizing exceptions are bypassed by the options in History > Clear History when LibreWolf closes > Settings patch -Np1 -i ${_patches_dir}/ui-patches/sanitizing-description.patch # pref pane patch -Np1 -i ${_patches_dir}/librewolf-pref-pane.patch # fix telemetry removal, see https://gitlab.com/librewolf-community/browser/linux/-/merge_requests/17, for example patch -Np1 -i ${_patches_dir}/disable-data-reporting-at-compile-time.patch rm -f ${srcdir}/librewolf-common/source_files/mozconfig # what was this for? TODO cp -r ${srcdir}/librewolf-common/source_files/browser ./ } build() { cd mozilla-unified export MOZ_SOURCE_REPO="$_repo" export MOZ_NOSPAM=1 export MOZBUILD_STATE_PATH="$srcdir/mozbuild" export MACH_USE_SYSTEM_PYTHON=1 # LTO/PGO needs more open files ulimit -n 4096 # -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 # echo "Building instrumented browser..." if [[ $CARCH == 'aarch64' ]]; then cat >.mozconfig ../mozconfig - <.mozconfig ../mozconfig - <.mozconfig ../mozconfig - <.mozconfig ../mozconfig - <