Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:ZhangHua:firefox-xdg
firefox-xdg
PKGBUILD
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File PKGBUILD of Package firefox-xdg
# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org> # Contributor: Ionut Biru <ibiru@archlinux.org> # Contributor: Jakub Schmidtke <sjakub@gmail.com> _pkgname=firefox pkgname=$_pkgname-xdg pkgver=126.0.1 pkgrel=1 pkgdesc="Standalone web browser from mozilla.org but with .mozilla moved to .config" url="https://www.mozilla.org/firefox/" arch=(x86_64) license=(MPL-2.0) depends=( alsa-lib at-spi2-core bash cairo dbus ffmpeg fontconfig freetype2 gcc-libs gdk-pixbuf2 glib2 glibc gtk3 hicolor-icon-theme libpulse libx11 libxcb libxcomposite libxdamage libxext libxfixes libxrandr libxss libxt mime-types nspr nss pango ttf-font ) makedepends=( cbindgen clang diffutils imake inetutils jack lld llvm mesa nasm nodejs python rust unzip wasi-compiler-rt wasi-libc wasi-libc++ wasi-libc++abi xorg-server-xvfb yasm zip ) optdepends=( 'hunspell-en_US: Spell checking, American English' 'libnotify: Notification integration' 'networkmanager: Location detection via available WiFi networks' 'speech-dispatcher: Text-to-Speech' 'xdg-desktop-portal: Screensharing with Wayland' ) provides=(firefox=$pkgver) conflicts=(firefox) options=( !emptydirs !lto !makeflags ) source=( https://archive.mozilla.org/pub/firefox/releases/$pkgver/source/firefox-$pkgver.source.tar.xz{,.asc} $_pkgname.desktop identity-icons-brand.svg 0001-Bug-1882209-Update-encoding_rs-to-0.8.34-to-deal-wit.patch # Rebased from https://phabricator.services.mozilla.com/D6995 firefox-xdg-support.diff ) validpgpkeys=( # Mozilla Software Releases <release@mozilla.com> # https://blog.mozilla.org/security/2023/05/11/updated-gpg-key-for-signing-firefox-releases/ 14F26682D0916CDD81E37B6D61B7B526D98F0353 ) sha256sums=('f63026359f678a5d45cea4c7744fcef512abbb58a5b016bbbb1c6ace723a263b' 'SKIP' '1f241fdc619f92a914c75aece7c7c717401d7467c9a306458e106b05f34e5044' 'a9b8b4a0a1f4a7b4af77d5fc70c2686d624038909263c795ecc81e0aec7711e9' '22c030ef8a047802ae56d20b1c2a6a3830e9a5ac4e5399163a2b57a1c09a20b2' '6041685023b50b1b76da0f5cf63cad3151e2b497430d2083349e395a44a8abbd') b2sums=('b5d381bbf3ac7d63561dc4c8f8955faeb08fe41e57a05b39585f01054a5348d68d6fc50d9c00d151c211d26ba2d0fb21843868e4cfc1445e4c637ac5756af161' 'SKIP' 'd07557840097dd48a60c51cc5111950781e1c6ce255557693bd11306c7a9258b2a82548329762148f117b2295145f9e66e0483a18e2fe09c5afcffed2e4b8628' '63a8dd9d8910f9efb353bed452d8b4b2a2da435857ccee083fc0c557f8c4c1339ca593b463db320f70387a1b63f1a79e709e9d12c69520993e26d85a3d742e34' '6b8b6fe5d658fd76844fc1d9f47b3892bcb5a59a8d10baabf7d52fb4f7c9e8f4858576859390e6d4c542d46cabb335cd06f8c4a80a7d5dde0868b29cd048d308' 'f9024830898e2d2b4fa51146a11c805ba58fbb1a636b83fd1f21bb733eda194a0c83c033fe5db14493cd14162ce468c7a60829afbdd728e10c214a836a3794df') # 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 # get your own set of keys. Feel free to contact foutrelis@archlinux.org for # more information. _google_api_key=AIzaSyDwr302FpOSkGRpLlUpPThNTDPbXcIn_FM # Mozilla API keys (see https://location.services.mozilla.com/api) # Note: These are for Arch Linux use ONLY. For your own distribution, please # get your own set of keys. Feel free to contact heftig@archlinux.org for # more information. _mozilla_api_key=e05d56db0a694edc8b5aaebda3f2db6a prepare() { mkdir mozbuild cd firefox-$pkgver # Fix build with Rust 1.78.0 patch -Np1 -i ../0001-Bug-1882209-Update-encoding_rs-to-0.8.34-to-deal-wit.patch patch -p1 -i ../firefox-xdg-support.diff sed -i 's|psutil>=5.4.2,<=5.9.4|psutil>=5.4.2,<=5.9.8|g' ./python/sites/mach.txt #sed -i 's|zstandard>=0.11.1,<=0.22.0|zstandard>=0.11.1,<=0.22.0|g' ./python/sites/mach.txt sed -i 's|vendored:third_party/python/typing_extensions||g' ./python/sites/mach.txt echo -n "$_google_api_key" >google-api-key echo -n "$_mozilla_api_key" >mozilla-api-key cat >../mozconfig <<END ac_add_options --enable-application=browser 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 ac_add_options --enable-rust-simd ac_add_options --enable-linker=lld ac_add_options --disable-install-strip ac_add_options --disable-elf-hack ac_add_options --disable-bootstrap ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot # Branding ac_add_options --enable-official-branding ac_add_options --enable-update-channel=release ac_add_options --with-distribution-id=org.archlinux ac_add_options --with-unsigned-addon-scopes=app,system ac_add_options --allow-addon-sideload export MOZILLA_OFFICIAL=1 export MOZ_APP_REMOTINGNAME=$_pkgname # Keys ac_add_options --with-google-location-service-api-keyfile=${PWD@Q}/google-api-key ac_add_options --with-google-safebrowsing-api-keyfile=${PWD@Q}/google-api-key ac_add_options --with-mozilla-api-keyfile=${PWD@Q}/mozilla-api-key # System libraries ac_add_options --with-system-nspr ac_add_options --with-system-nss # Features ac_add_options --enable-alsa ac_add_options --enable-jack ac_add_options --enable-crashreporter ac_add_options --disable-updater ac_add_options --disable-tests END } build() { cd firefox-$pkgver export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system 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_NOSPAM=1 # malloc_usable_size is used in various parts of the codebase CFLAGS="${CFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" CXXFLAGS="${CXXFLAGS/_FORTIFY_SOURCE=3/_FORTIFY_SOURCE=2}" # Breaks compilation since https://bugzilla.mozilla.org/show_bug.cgi?id=1896066 CFLAGS="${CFLAGS/-fexceptions/}" CXXFLAGS="${CXXFLAGS/-fexceptions/}" # LTO needs more open files ulimit -n 4096 # Do 3-tier PGO echo "Building instrumented browser..." cat >.mozconfig ../mozconfig - <<END ac_add_options --enable-profile-generate=cross END ./mach build --priority normal 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 echo "Removing instrumented browser..." ./mach clobber objdir 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 END ./mach build --priority normal } package() { cd firefox-$pkgver DESTDIR="$pkgdir" ./mach install local vendorjs="$pkgdir/usr/lib/$_pkgname/browser/defaults/preferences/vendor.js" install -Dvm644 /dev/stdin "$vendorjs" <<END // Use LANG environment variable to choose locale pref("intl.locale.requested", ""); // Use system-provided dictionaries pref("spellchecker.dictionary_path", "/usr/share/hunspell"); // Disable default browser checking. pref("browser.shell.checkDefaultBrowser", false); // Don't disable extensions in the application directory pref("extensions.autoDisableScopes", 11); // Enable GNOME Shell search provider pref("browser.gnome-search-provider.enabled", true); END local distini="$pkgdir/usr/lib/$_pkgname/distribution/distribution.ini" install -Dvm644 /dev/stdin "$distini" <<END [Global] id=archlinux version=1.0 about=Mozilla Firefox for Arch Linux [Preferences] app.distributor=archlinux app.distributor.channel=$_pkgname app.partner.archlinux=archlinux END local i theme=official for i in 16 22 24 32 48 64 128 256; do install -Dvm644 browser/branding/$theme/default$i.png \ "$pkgdir/usr/share/icons/hicolor/${i}x${i}/apps/$_pkgname.png" done install -Dvm644 browser/branding/$theme/content/about-logo.png \ "$pkgdir/usr/share/icons/hicolor/192x192/apps/$_pkgname.png" install -Dvm644 browser/branding/$theme/content/about-logo@2x.png \ "$pkgdir/usr/share/icons/hicolor/384x384/apps/$_pkgname.png" install -Dvm644 browser/branding/$theme/content/about-logo.svg \ "$pkgdir/usr/share/icons/hicolor/scalable/apps/$_pkgname.svg" install -Dvm644 ../identity-icons-brand.svg \ "$pkgdir/usr/share/icons/hicolor/symbolic/apps/$_pkgname-symbolic.svg" install -Dvm644 ../$_pkgname.desktop \ "$pkgdir/usr/share/applications/$_pkgname.desktop" # Install a wrapper to avoid confusion about binary path install -Dvm755 /dev/stdin "$pkgdir/usr/bin/$_pkgname" <<END #!/bin/sh exec /usr/lib/$_pkgname/firefox "\$@" END # Replace duplicate binary with wrapper # https://bugzilla.mozilla.org/show_bug.cgi?id=658850 ln -srfv "$pkgdir/usr/bin/$_pkgname" "$pkgdir/usr/lib/$_pkgname/firefox-bin" # Use system certificates local nssckbi="$pkgdir/usr/lib/$_pkgname/libnssckbi.so" if [[ -e $nssckbi ]]; then ln -srfv "$pkgdir/usr/lib/libnssckbi.so" "$nssckbi" fi local sprovider="$pkgdir/usr/share/gnome-shell/search-providers/$_pkgname.search-provider.ini" install -Dvm644 /dev/stdin "$sprovider" <<END [Shell Search Provider] DesktopId=$_pkgname.desktop BusName=org.mozilla.${_pkgname//-/_}.SearchProvider ObjectPath=/org/mozilla/${_pkgname//-/_}/SearchProvider Version=2 END } # vim:set sw=2 sts=-1 et:
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor