[3.19] user/zotero: upgrade to 7.0.0_git20240131 and merge firefox-esr #382

Merged
ayakael merged 2 commits from zotero/upgrade-20240131-319 into v3.19 2024-02-03 19:46:00 +00:00
41 changed files with 81814 additions and 803 deletions

View file

@ -1,671 +0,0 @@
# Contributor: Natanael Copa <ncopa@alpinelinux.org>
# Contributor: Sören Tempel <soeren+alpine@soeren-tempel.net>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=firefox-esr
pkgver=102.10.0
# Date of release, YY-MM-DD for metainfo file (see package())
_releasedate=2023-04-11
pkgrel=5
pkgdesc="Firefox web browser - Extended Support Release"
url="https://www.mozilla.org/en-US/firefox/organizations/"
# s390x and riscv64: blocked by rust and cargo
# armhf: build failure on armhf due to wasm
# fix later
#arch="x86_64 armv7 aarch64 x86 ppc64le"
license="GPL-3.0-only AND LGPL-2.1-only AND LGPL-3.0-only AND MPL-2.0"
install="$pkgname.post-upgrade"
depends="
ffmpeg-libavcodec
"
makedepends="
alsa-lib-dev
automake
bsd-compat-headers
cargo
cbindgen
clang
dbus-glib-dev
gettext
gtk+3.0-dev
hunspell-dev
icu-dev>=69.1
libevent-dev
libffi-dev
libjpeg-turbo-dev
libnotify-dev
libogg-dev
libtheora-dev
libtool
libvorbis-dev
libvpx-dev
libwebp-dev
libxcomposite-dev
libxt-dev
lld
llvm-dev
m4
mesa-dev
nasm
nodejs
nspr-dev
nss-dev
pipewire-dev
pulseaudio-dev
py3-psutil
py3-zstandard
python3
sed
wasi-sdk
wireless-tools-dev
zip
"
source="https://ftp.mozilla.org/pub/firefox/releases/${pkgver}esr/source/firefox-${pkgver}esr.source.tar.xz
allow-custom-rust-vendor.patch
avoid-redefinition.patch
bindgen.patch
disable-moz-stackwalk.patch
esr-metainfo.patch
firefox-esr-ffmpeg6.patch::https://dev.alpinelinux.org/archive/firefoxies/firefox-esr-ffmpeg6.patch
ffmpeg6-fixup.patch
fix-neon-aom.patch
fix-fortify-system-wrappers.patch
fix-rust-target.patch
fix-webrtc-glibcisms.patch
gcc13.patch
mallinfo.patch
python-deps.patch
sandbox-fork.patch
sandbox-largefile.patch
sandbox-sched_setscheduler.patch
zstandard.patch
stab.h
firefox.desktop
mozilla-location.keys
vendor-prefs.js
"
builddir="$srcdir/firefox-$pkgver"
_mozappdir=/usr/lib/firefox-esr
# help our shared-object scanner to find the libs
ldpath="$_mozappdir"
# secfixes:
# 102.1.0-r0:
# - CVE-2022-2505
# - CVE-2022-36314
# - CVE-2022-36318
# - CVE-2022-36319
# 91.11.0-r0:
# - CVE-2022-2200
# - CVE-2022-31744
# - CVE-2022-34468
# - CVE-2022-34470
# - CVE-2022-34472
# - CVE-2022-34478
# - CVE-2022-34479
# - CVE-2022-34481
# - CVE-2022-34484
# 91.10.0-r0:
# - CVE-2022-31736
# - CVE-2022-31737
# - CVE-2022-31738
# - CVE-2022-31739
# - CVE-2022-31740
# - CVE-2022-31741
# - CVE-2022-31742
# - CVE-2022-31747
# 91.9.1-r0:
# - CVE-2022-1529
# - CVE-2022-1802
# 91.9.0-r0:
# - CVE-2022-29909
# - CVE-2022-29911
# - CVE-2022-29912
# - CVE-2022-29914
# - CVE-2022-29916
# - CVE-2022-29917
# 91.8.0-r0:
# - CVE-2022-1097
# - CVE-2022-1196
# - CVE-2022-24713
# - CVE-2022-28281
# - CVE-2022-28282
# - CVE-2022-28285
# - CVE-2022-28286
# - CVE-2022-28289
# 91.7.0-r0:
# - CVE-2022-26381
# - CVE-2022-26383
# - CVE-2022-26384
# - CVE-2022-26386
# - CVE-2022-26387
# 91.6.1-r0:
# - CVE-2022-26485
# - CVE-2022-26486
# 91.6.0-r0:
# - CVE-2022-22754
# - CVE-2022-22756
# - CVE-2022-22759
# - CVE-2022-22760
# - CVE-2022-22761
# - CVE-2022-22763
# - CVE-2022-22764
# 91.5.0-r0:
# - CVE-2021-4140
# - CVE-2022-22737
# - CVE-2022-22738
# - CVE-2022-22739
# - CVE-2022-22740
# - CVE-2022-22741
# - CVE-2022-22742
# - CVE-2022-22743
# - CVE-2022-22744
# - CVE-2022-22745
# - CVE-2022-22746
# - CVE-2022-22747
# - CVE-2022-22748
# - CVE-2022-22751
# 91.4.0-r0:
# - CVE-2021-43536
# - CVE-2021-43537
# - CVE-2021-43538
# - CVE-2021-43539
# - CVE-2021-43541
# - CVE-2021-43542
# - CVE-2021-43543
# - CVE-2021-43545
# - CVE-2021-43546
# 91.3.0-r0:
# - CVE-2021-38503
# - CVE-2021-38504
# - CVE-2021-38505
# - CVE-2021-38506
# - CVE-2021-38507
# - CVE-2021-38508
# - CVE-2021-38509
# - CVE-2021-38510
# 91.2.0-r0:
# - CVE-2021-32810
# - CVE-2021-38492
# - CVE-2021-38493
# - CVE-2021-38495
# - CVE-2021-38496
# - CVE-2021-38497
# - CVE-2021-38498
# - CVE-2021-38500
# - CVE-2021-38501
# 78.13.0-r0:
# - CVE-2021-29980
# - CVE-2021-29984
# - CVE-2021-29985
# - CVE-2021-29986
# - CVE-2021-29988
# - CVE-2021-29989
# 78.12.0-r0:
# - CVE-2021-29970
# - CVE-2021-29976
# - CVE-2021-30547
# 78.11.0-r0:
# - CVE-2021-29967
# 78.10.0-r0:
# - CVE-2021-23961
# - CVE-2021-23994
# - CVE-2021-23995
# - CVE-2021-23998
# - CVE-2021-23999
# - CVE-2021-24002
# - CVE-2021-29945
# - CVE-2021-29946
# 78.9.0-r0:
# - CVE-2021-23981
# - CVE-2021-23982
# - CVE-2021-23984
# - CVE-2021-23987
# 78.8.0-r0:
# - CVE-2021-23968
# - CVE-2021-23969
# - CVE-2021-23973
# - CVE-2021-23978
# 78.7.0-r0:
# - CVE-2020-26976
# - CVE-2021-23953
# - CVE-2021-23954
# - CVE-2021-23960
# - CVE-2021-23964
# 78.6.1-r0:
# - CVE-2020-16044
# 78.6.0-r0:
# - CVE-2020-16042
# - CVE-2020-26971
# - CVE-2020-26973
# - CVE-2020-26974
# - CVE-2020-26978
# - CVE-2020-35111
# - CVE-2020-35112
# - CVE-2020-35113
# 78.5.0-r0:
# - CVE-2020-15683
# - CVE-2020-15969
# - CVE-2020-15999
# - CVE-2020-16012
# - CVE-2020-26950
# - CVE-2020-26951
# - CVE-2020-26953
# - CVE-2020-26956
# - CVE-2020-26958
# - CVE-2020-26959
# - CVE-2020-26960
# - CVE-2020-26961
# - CVE-2020-26965
# - CVE-2020-26966
# - CVE-2020-26968
# 78.3.0-r0:
# - CVE-2020-15673
# - CVE-2020-15676
# - CVE-2020-15677
# - CVE-2020-15678
# 78.2.0-r0:
# - CVE-2020-15663
# - CVE-2020-15664
# - CVE-2020-15670
# 78.1.0-r0:
# - CVE-2020-15652
# - CVE-2020-15653
# - CVE-2020-15654
# - CVE-2020-15655
# - CVE-2020-15656
# - CVE-2020-15657
# - CVE-2020-15658
# - CVE-2020-15659
# - CVE-2020-6463
# - CVE-2020-6514
# 68.10.0-r0:
# - CVE-2020-12417
# - CVE-2020-12418
# - CVE-2020-12419
# - CVE-2020-12420
# - CVE-2020-12421
# 68.9.0-r0:
# - CVE-2020-12399
# - CVE-2020-12405
# - CVE-2020-12406
# - CVE-2020-12410
# 68.8.0-r0:
# - CVE-2020-12387
# - CVE-2020-12388
# - CVE-2020-12389
# - CVE-2020-12392
# - CVE-2020-12393
# - CVE-2020-12395
# - CVE-2020-6831
# 68.7.0-r0:
# - CVE-2020-6821
# - CVE-2020-6822
# - CVE-2020-6825
# 68.6.1-r0:
# - CVE-2020-6819
# - CVE-2020-6820
# 68.6.0-r0:
# - CVE-2019-20503
# - CVE-2020-6805
# - CVE-2020-6806
# - CVE-2020-6807
# - CVE-2020-6811
# - CVE-2020-6812
# - CVE-2020-6814
# 68.5.0-r0:
# - CVE-2020-6796
# - CVE-2020-6797
# - CVE-2020-6798
# - CVE-2020-6799
# - CVE-2020-6800
# 68.4.1-r0:
# - CVE-2019-17016
# - CVE-2019-17022
# - CVE-2019-17024
# - CVE-2019-17026
# 68.3.0-r0:
# - CVE-2019-17005
# - CVE-2019-17008
# - CVE-2019-17009
# - CVE-2019-17010
# - CVE-2019-17011
# - CVE-2019-17012
# 68.2.0-r0:
# - CVE-2019-11757
# - CVE-2019-11758
# - CVE-2019-11759
# - CVE-2019-11760
# - CVE-2019-11761
# - CVE-2019-11762
# - CVE-2019-11763
# - CVE-2019-11764
# - CVE-2019-15903
# 68.1.0-r0:
# - CVE-2019-9812
# - CVE-2019-11740
# - CVE-2019-11742
# - CVE-2019-11743
# - CVE-2019-11744
# - CVE-2019-11746
# - CVE-2019-11752
# 68.0.2-r0:
# - CVE-2019-11733
# 68.0-r0:
# - CVE-2019-11709
# - CVE-2019-11711
# - CVE-2019-11712
# - CVE-2019-11713
# - CVE-2019-11715
# - CVE-2019-11717
# - CVE-2019-11719
# - CVE-2019-11729
# - CVE-2019-11730
# - CVE-2019-9811
# 60.7.2-r0:
# - CVE-2019-11708
# 60.7.1-r0:
# - CVE-2019-11707
# 60.7.0-r0:
# - CVE-2019-9815
# - CVE-2019-9816
# - CVE-2019-9817
# - CVE-2019-9818
# - CVE-2019-9819
# - CVE-2019-9820
# - CVE-2019-11691
# - CVE-2019-11692
# - CVE-2019-11693
# - CVE-2019-7317
# - CVE-2019-9797
# - CVE-2018-18511
# - CVE-2019-11694
# - CVE-2019-11698
# - CVE-2019-5798
# - CVE-2019-9800
# 60.6.1-r0:
# - CVE-2019-9810
# - CVE-2019-9813
# - CVE-2019-9790
# - CVE-2019-9791
# - CVE-2019-9792
# - CVE-2019-9793
# - CVE-2019-9794
# - CVE-2019-9795
# - CVE-2019-9796
# - CVE-2019-9801
# - CVE-2018-18506
# - CVE-2019-9788
# 60.5.2-r0:
# - CVE-2019-5785
# - CVE-2018-18335
# - CVE-2018-18356
# 60.5.0-r0:
# - CVE-2018-18500
# - CVE-2018-18505
# - CVE-2018-18501
# 52.6.0-r0:
# - CVE-2018-5089
# - CVE-2018-5091
# - CVE-2018-5095
# - CVE-2018-5096
# - CVE-2018-5097
# - CVE-2018-5098
# - CVE-2018-5099
# - CVE-2018-5102
# - CVE-2018-5103
# - CVE-2018-5104
# - CVE-2018-5117
# 52.5.2-r0:
# - CVE-2017-7843
# 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
_clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json
}
export SHELL=/bin/sh
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export USE_SHORT_LIBNAME=1
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZ_APP_PROFILE="mozilla/firefox"
export MOZ_APP_REMOTINGNAME=firefox-esr
export MOZBUILD_STATE_PATH="$srcdir"/mozbuild
# disable desktop notifications
export MOZ_NOSPAM=1
# Find our triplet JSON
export RUST_TARGET="$CTARGET"
# Build with Clang, takes less RAM
export CC="clang"
export CXX="clang++"
# set rpath so linker finds the libs
export LDFLAGS="$LDFLAGS -Wl,-rpath,$_mozappdir"
# let firefox do this itself.
unset CARGO_PROFILE_RELEASE_OPT_LEVEL
unset CARGO_PROFILE_RELEASE_LTO
export CFLAGS="$CFLAGS -O2"
export CXXFLAGS="$CXXFLAGS -O2 -Wno-deprecated-builtins"
prepare() {
default_prepare
cp "$srcdir"/stab.h toolkit/crashreporter/google-breakpad/src/
base64 -d "$srcdir"/mozilla-location.keys > "$builddir"/mozilla-api-key
_clear_vendor_checksums audio_thread_priority
_clear_vendor_checksums target-lexicon-0.9.0
_clear_vendor_checksums packed_simd_2
_clear_vendor_checksums bindgen
# webrtc does not build on these
case "$CARCH" in
ppc64le)
local webrtc_config="ac_add_options --disable-webrtc"
;;
esac
case "$CARCH" in
armv7)
# broken here
local rust_simd="ac_add_options --disable-rust-simd"
;;
*)
local rust_simd="ac_add_options --enable-rust-simd"
;;
esac
case "$CARCH" in
aarch64|arm*|x86*)
# disable-elf-hack: exists only on aarch64, arm*, x86, x86_64
local arch_config="ac_add_options --disable-elf-hack"
;;
esac
# sandbox only supported here
case "$CARCH" in
x86*|armv7|aarch64)
local sandbox="ac_add_options --enable-sandbox"
;;
*)
local sandbox="ac_add_options --disable-sandbox"
;;
esac
cat > base-mozconfig <<-EOF
# disable unwanted things
ac_add_options --disable-bootstrap
ac_add_options --disable-cargo-incremental
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-install-strip
ac_add_options --disable-jemalloc
ac_add_options --disable-strip
ac_add_options --disable-tests
ac_add_options --disable-updater
# features
ac_add_options --enable-alsa
ac_add_options --enable-dbus
ac_add_options --enable-default-toolkit=cairo-gtk3-wayland
ac_add_options --enable-ffmpeg
ac_add_options --enable-hardening
ac_add_options --enable-linker=lld
ac_add_options --enable-necko-wifi
ac_add_options --enable-official-branding
ac_add_options --enable-optimize="$CFLAGS"
ac_add_options --enable-pulseaudio
ac_add_options --enable-release
ac_add_options --enable-update-channel=release
# system libs
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-png
ac_add_options --with-system-webp
ac_add_options --with-system-zlib
# misc
ac_add_options --allow-addon-sideload
ac_add_options --prefix=/usr
ac_add_options --with-app-name=firefox-esr
ac_add_options --with-distribution-id=org.alpinelinux
ac_add_options --with-libclang-path=/usr/lib
ac_add_options --with-unsigned-addon-scopes=app,system
ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot
ac_add_options --host=$CHOST
ac_add_options --target=$CTARGET
# objdir
mk_add_options MOZ_OBJDIR="$builddir/obj"
mk_add_options RUSTFLAGS="$RUSTFLAGS"
# keys
# these are for alpine linux use only
ac_add_options --with-mozilla-api-keyfile="$builddir/mozilla-api-key"
$arch_config
$rust_simd
$sandbox
$webrtc_config
EOF
}
build() {
cat > .mozconfig base-mozconfig
export MOZ_BUILD_DATE=$(date ${SOURCE_DATE_EPOCH:+ -d@${SOURCE_DATE_EPOCH}} "+%Y%m%d%H%M%S")
# for lto
ulimit -n 4096
# can't be set here and fail
unset RUSTFLAGS
local thinlto_jobs=${JOBS:-1}
case "$CARCH" in
# on this platforms, lld seems to not utilise >1 threads for thinlto for some reason.
# at the same time, having more than 8 also crashes lld for firefox buildsystems (why?).
aarch64)
if [ $thinlto_jobs -gt 8 ]; then
thinlto_jobs=8
fi
;;
esac
export LDFLAGS="$LDFLAGS -Wl,--thinlto-jobs=$thinlto_jobs"
case "$CARCH" in
# lto for 64-bit systems only
aarch64|x86_64|ppc64le)
cat > .mozconfig base-mozconfig <<-EOF
ac_add_options --enable-lto=cross
EOF
esac
./mach build
}
package() {
DESTDIR="$pkgdir" ./mach install
local _png
for _png in ./browser/branding/official/default*.png; do
local i=${_png%.png}
i=${i##*/default}
install -Dm644 "$_png" \
"$pkgdir"/usr/share/icons/hicolor/"$i"x"$i"/apps/firefox-esr.png
done
install -Dm644 browser/branding/official/content/about-logo.png \
"$pkgdir"/usr/share/icons/hicolor/192x192/apps/firefox-esr.png
install -Dm644 browser/branding/official/content/about-logo@2x.png \
"$pkgdir"/usr/share/icons/hicolor/384x384/apps/firefox-esr.png
install -Dm644 browser/branding/official/content/about-logo.svg \
"$pkgdir"/usr/share/icons/hicolor/scalable/apps/firefox-esr.svg
install -Dm644 "$srcdir"/firefox.desktop \
"$pkgdir"/usr/share/applications/firefox-esr.desktop
# install our vendor prefs
install -Dm644 "$srcdir"/vendor-prefs.js \
"$pkgdir"/$_mozappdir/browser/defaults/preferences/vendor.js
# Generate appdata file
mkdir -p "$pkgdir"/usr/share/metainfo/
export VERSION="$pkgver"
export DATE="$_releasedate"
envsubst < "$builddir"/taskcluster/docker/firefox-flatpak/org.mozilla.firefox.appdata.xml.in > "$pkgdir"/usr/share/metainfo/org.mozilla.firefox-esr.appdata.xml
# Replace duplicate binary with wrapper
# https://bugzilla.mozilla.org/show_bug.cgi?id=658850
install -Dm755 /dev/stdin "$pkgdir"/usr/bin/firefox-esr <<- EOF
#!/bin/sh
exec $_mozappdir/firefox-esr "\$@"
EOF
rm "$pkgdir"/$_mozappdir/firefox-esr-bin
ln -sfv /usr/bin/firefox-esr "$pkgdir"/$_mozappdir/firefox-esr-bin
}
sha512sums="
f2b53c35bdd22a3de6f32699b832babcbf499667197c02dd50cf0b6cd956e0f4471f420938c2ab72f0a0686ed99fe74e3184afe9b5f7169130879b8f8fd99f0b firefox-102.10.0esr.source.tar.xz
4e584621145cf8add069c6dac18e805b3274a1ee402d84e924df2341f7d3c5be261a93ef51283bacbd606f47fbdc628c4323ecc31efc5b403b8d224b18dc278f allow-custom-rust-vendor.patch
b1cb2db3122634f66d2bae7066e76f2dcd455c464e021db4de3b0a08314df95cb667846081682db549dd2af8a00831cabe44a2420c66cdfb5e3b5fa7e6bd21d3 avoid-redefinition.patch
0f793fc991e35ac17585c7ab5f86fe5925401bb9512167909706b85b51155e28b037e3a7ab775b243804195477ade36ec4ab32c3118885c52364079526ae26a9 bindgen.patch
454ea3263cabce099accbdc47aaf83be26a19f8b5a4568c01a7ef0384601cf8315efd86cd917f9c8bf419c2c845db89a905f3ff9a8eb0c8e41042e93aa96a85c disable-moz-stackwalk.patch
f7b3b45ba04d05d17439d009bf0c9f27881e126f424e2257552338a0c1e3771ee1289c044babcb0920f62af62873a268c0cf524e1d35711e6dc8b808ca5e9f26 esr-metainfo.patch
a13dee87adf659423f5b3fa0358cfbde135fa614c85dd170d1a48d32ee080e27aef062d3a8e3c45059c41463fda579f8900988166ccb51568793ee7ef9080d04 firefox-esr-ffmpeg6.patch
c2e17f269070d782154f843b95bf68be25d8c4356825dd436b1877aab63ac023051899371da5c21f6151970b2562376c2dadd2d6a038446e5fa621e2495668e1 ffmpeg6-fixup.patch
d3a54897089eda9fdfe4b25ade1cb2c01c4b31fa9bf0e0ddbb0bbe674072ec5d36a6e52f791a8cbc8d3908e912ac2d7edec69b34d87ecca0acca876d45974c8d fix-neon-aom.patch
2f4f15974d52de4bb273b62a332d13620945d284bbc6fe6bd0a1f58ff7388443bc1d3bf9c82cc31a8527aad92b0cd3a1bc41d0af5e1800e0dcbd7033e58ffd71 fix-fortify-system-wrappers.patch
cd68b89e29e5f6379fbd5679db27b9a5ef70ea65e51c0d0a8137e1f1fd210e35a8cfb047798e9549bc7275606d7ec5c8d8af1335d29da4699db7acd8bc7ff556 fix-rust-target.patch
305c874fdea3096e9c4c6aa6520ac64bb1c347c4b59db8360096646593fe684c3b5377874d91cecd33d56d1410b4714fbdea2b514923723ecbeff79d51265d9b fix-webrtc-glibcisms.patch
49aa1dfbe11ed5370e839afb190da7f55ae4887b35645865efe25d398d890563722caedd5696d648ad71448621fbc8bab8def1a3d079e301d6414f0f20e96758 gcc13.patch
a4a3e062661bda64d502d426c480ac9645345860118de9df9ffe6e0597738c70c11e5cdef2d4fd12c5e2ee30a09310159230524655a419a4f7e4eeeb0f3c06b0 mallinfo.patch
f3d419880cc7f043b6eb547894d486457d407640be2bd8b402eb3a534ccea39568f6d506fc44a3b29c94eb0dc6fc2bec6600d161786fd233d26b1dc8970f5ab4 python-deps.patch
2518f2fc75b5db30058e0735f47d60fdf1e7adfaeee4b33fb2afb1bd9a616ce943fd88f4404d0802d4083703f4acf1d5ad42377218d025bc768807fbaf7e1609 sandbox-fork.patch
b7d0a6126bdf6c0569f80aabf5b37ed2c7a35712eb8a0404a2d85381552f5555d4f97d213ea26cec6a45dc2785f22439376ed5f8e78b4fd664ef0223307b333e sandbox-largefile.patch
94433c5ffdbe579c456d95c5f053f61fcbab2f652fa90bc69dcc27d9a1507a8e5c677adeadae9a7a75cc9a55184c1040737f4dfd10b279c088ef016561e6f135 sandbox-sched_setscheduler.patch
12fbe50d94624931a581314b8e6e228a1f8a4550704a6ee4f8904184ac4727efd90982e87a8fdd318e15515f9430dfc6cf7455b301e903003027b3f0afa79795 zstandard.patch
0b3f1e4b9fdc868e4738b5c81fd6c6128ce8885b260affcb9a65ff9d164d7232626ce1291aaea70132b3e3124f5e13fef4d39326b8e7173e362a823722a85127 stab.h
d354f48a29bfc16719f3b230b1395063239d4420f9e47522de4662392d9697b15f931ca3bf6055d100fa33d61a9a1a13477687d5eac99e50ae7dbef9882a5808 firefox.desktop
382510375b1a2fa79be0ab79e3391a021ae2c022429ffbaa7e7a69166f99bb56d01e59a1b10688592a29238f21c9d6977672bd77f9fae439b66bdfe0c55ddb15 mozilla-location.keys
fc45bc3ffb9404e5338ea26a9f04807b40f6f516324972cddd48bedb91b8bd7c6b8d4e03a0209020f5e67b703bc4ff89389985791b9bd544a0fc3951e2dc338e vendor-prefs.js
"

View file

@ -1,94 +1,374 @@
# Contributor: Antoine Martin (ayakael) <dev@ayakael.net>
# Maintainer: Antoine Martin (ayakael) <dev@ayakael.net>
pkgname=zotero
pkgver=7.0.0_git20230415
pkgrel=0
pkgver=7.0.0_git20240131
pkgrel=2
_fxver=102.15.1
# Date of release, YY-MM-DD for metainfo file (see package())
_releasedate=2024-02-02
pkgdesc="A free, easy-to-use tool to help you collect, organize, cite, and share your research sources."
# fix firefox
#arch="x86_64"
arch="x86_64"
url="https://github.com/zotero/zotero"
_giturl="https://lab.ilot.io/mirrors/zotero"
_gittag_client=7.0.0_20230415
_gittag_standalone=7.0.0_20230415
_gittag_build=20230314
license="AGPL3"
_gittag=7.0.0._20240131
license="GPL-3.0-only AND LGPL-2.1-only AND LGPL-3.0-only AND MPL-2.0"
options="!check" # No test suite
depends="
dbus-glib
gtk+3.0
nss
libxt
ffmpeg-libavcodec
"
makedepends="
npm
grep
zip
unzip
perl
python3
alsa-lib-dev
automake
bash
bsd-compat-headers
cargo
cbindgen
clang
clang-libclang
curl
dbus-glib-dev
gettext
grep
gtk+3.0-dev
hunspell-dev
icu-dev>=69.1
libevent-dev
libffi-dev
libjpeg-turbo-dev
libnotify-dev
libogg-dev
libtheora-dev
libtool
libvorbis-dev
libvpx-dev
libwebp-dev
libxcomposite-dev
libxt-dev
lld
llvm-dev
m4
mesa-dev
nasm
nodejs
firefox-esr~=102
npm
nspr-dev
nss-dev
perl
pipewire-dev
pulseaudio-dev
py3-psutil
py3-zstandard
python3
sed
unzip
wasi-sdk
wireless-tools-dev
zip
"
source="
https://ftp.mozilla.org/pub/firefox/releases/${_fxver}esr/source/firefox-${_fxver}esr.source.tar.xz
allow-custom-rust-vendor.patch
audio-lfs64.patch
avoid-redefinition.patch
disable-moz-stackwalk.patch
esr-metainfo.patch
firefox-102.12.0-ffmpeg_6-1.patch
ffmpeg6-fixup.patch
fix-neon-aom.patch
fix-fortify-system-wrappers.patch
fix-rust-target.patch
fix-webrtc-glibcisms.patch
gcc13.patch
mallinfo.patch
python-deps.patch
rust-lto-thin.patch
sandbox-fork.patch
sandbox-largefile.patch
sandbox-sched_setscheduler.patch
zstandard.patch
icu74.patch
lfs64.patch
hunspell-dont-build-unused-function.patch
utils-libc-lfs64.patch
stab.h
firefox.desktop
mozilla-location.keys
vendor-prefs.js
zotero.desktop
xulrunner-get-alpine-firefox.diff
$_giturl-client/-/releases/$_gittag_client/downloads/tarball/zotero-client-$_gittag_client.tar.gz
$_giturl-standalone-build/-/releases/$_gittag_standalone/downloads/tarball/zotero-standalone-build-$_gittag_standalone.tar.gz
$_giturl-build/-/releases/$_gittag_build/downloads/tarball/zotero-build-$_gittag_build.tar.gz
https://lab.ilot.io/mirrors/zotero-client/-/releases/$_gittag/downloads/tarball/zotero-client-$_gittag.tar.gz
zotero_build-modifications.diff
"
builddir="$srcdir"/zotero-client-$_gittag_client
options="!check"
builddir="$srcdir"/firefox-$_fxver
_zoterodir="$srcdir"/zotero-client-$_gittag
# 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
_clear_vendor_checksums() {
sed -i 's/\("files":{\)[^}]*/\1/' third_party/rust/$1/.cargo-checksum.json
}
export SHELL=/bin/sh
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export USE_SHORT_LIBNAME=1
export MACH_BUILD_PYTHON_NATIVE_PACKAGE_SOURCE=system
export MOZ_APP_PROFILE="mozilla/firefox"
export MOZ_APP_REMOTINGNAME=firefox-esr
export MOZBUILD_STATE_PATH="$srcdir"/mozbuild
# disable desktop notifications
export MOZ_NOSPAM=1
# Find our triplet JSON
export RUST_TARGET="$CTARGET"
# Build with Clang, takes less RAM
export CC="clang"
export CXX="clang++"
# let firefox do this itself.
unset CARGO_PROFILE_RELEASE_OPT_LEVEL
unset CARGO_PROFILE_RELEASE_LTO
export CFLAGS="${CFLAGS/-fstack-clash-protection/} -g0 -O2"
export CXXFLAGS="${CXXFLAGS/-fstack-clash-protection/} -g0 -O2 -Wno-deprecated-builtins -Wno-deprecated-declarations"
export LDFLAGS="$LDFLAGS -Wl,--undefined-version"
prepare() {
default_prepare
cp "$srcdir"/stab.h toolkit/crashreporter/google-breakpad/src/
ln -s "$srcdir"/zotero-client-$_gittag_client "$srcdir"/zotero-client
ln -s "$srcdir"/zotero-build-$_gittag_build "$srcdir"/zotero-build
base64 -d "$srcdir"/mozilla-location.keys > "$builddir"/mozilla-api-key
_clear_vendor_checksums audio_thread_priority
_clear_vendor_checksums target-lexicon-0.9.0
_clear_vendor_checksums packed_simd_2
_clear_vendor_checksums bindgen
_clear_vendor_checksums mp4parse
_clear_vendor_checksums getrandom
# webrtc does not build on these
case "$CARCH" in
ppc64le)
local webrtc_config="ac_add_options --disable-webrtc"
;;
esac
case "$CARCH" in
armv7)
# broken here
local rust_simd="ac_add_options --disable-rust-simd"
;;
*)
local rust_simd="ac_add_options --enable-rust-simd"
;;
esac
case "$CARCH" in
aarch64|arm*|x86*)
# disable-elf-hack: exists only on aarch64, arm*, x86, x86_64
local arch_config="ac_add_options --disable-elf-hack"
;;
esac
# sandbox only supported here
case "$CARCH" in
x86*|armv7|aarch64)
local sandbox="ac_add_options --enable-sandbox"
;;
*)
local sandbox="ac_add_options --disable-sandbox"
;;
esac
cat > base-mozconfig <<-EOF
# disable unwanted things
ac_add_options --disable-bootstrap
ac_add_options --disable-cargo-incremental
ac_add_options --disable-crashreporter
ac_add_options --disable-debug
ac_add_options --disable-debug-symbols
ac_add_options --disable-install-strip
ac_add_options --disable-jemalloc
ac_add_options --disable-strip
ac_add_options --disable-tests
ac_add_options --disable-updater
# features
ac_add_options --enable-alsa
ac_add_options --enable-dbus
ac_add_options --enable-default-toolkit=cairo-gtk3-wayland
ac_add_options --enable-ffmpeg
ac_add_options --enable-hardening
ac_add_options --enable-linker=lld
ac_add_options --enable-necko-wifi
ac_add_options --enable-official-branding
ac_add_options --enable-optimize="$CFLAGS"
ac_add_options --enable-pulseaudio
ac_add_options --enable-release
ac_add_options --enable-update-channel=release
# system libs
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-png
ac_add_options --with-system-webp
ac_add_options --with-system-zlib
# misc
ac_add_options --allow-addon-sideload
ac_add_options --prefix=/usr
ac_add_options --with-app-name=firefox-esr
ac_add_options --with-distribution-id=org.alpinelinux
ac_add_options --with-libclang-path=/usr/lib
ac_add_options --with-unsigned-addon-scopes=app,system
ac_add_options --with-wasi-sysroot=/usr/share/wasi-sysroot
ac_add_options --host=$CHOST
ac_add_options --target=$CTARGET
# objdir
mk_add_options MOZ_OBJDIR="$builddir/obj"
mk_add_options RUSTFLAGS="$RUSTFLAGS"
# keys
# these are for alpine linux use only
ac_add_options --with-mozilla-api-keyfile="$builddir/mozilla-api-key"
$arch_config
$rust_simd
$sandbox
$webrtc_config
EOF
# zotero prepare
(
cd "$_zoterodir"
# zotero build expects to be in a git repo
git init
git commit --allow-empty -m 'Initial'
npm i --legacy-peer-deps
cd "$srcdir"/zotero-standalone-build*
patch -p1 -i "$srcdir"/xulrunner-get-alpine-firefox.diff
# We need to had '.git/HEAD' and '.git/config' to the archive as the build expects those
mkdir .git
echo '[remote "origin"]\nurl="http://github.com/zotero/zotero-standalone-build"' > .git/config
echo "$_gittag_standalone" > .git/HEAD
./fetch_xulrunner.sh -p l
./fetch_pdftools
# zorero patches
for i in $source; do
case ${i%::*} in
*.diff)
msg ${i%::*}
patch ${patch_args:--p1} -i "$srcdir/$(filename_from_uri $i)"
;;
esac
done
)
}
build() {
cat > .mozconfig base-mozconfig
export MOZ_BUILD_DATE=$(date ${SOURCE_DATE_EPOCH:+ -d@${SOURCE_DATE_EPOCH}} "+%Y%m%d%H%M%S")
# for lto
ulimit -n 4096
# can't be set here and fail
unset RUSTFLAGS
local thinlto_jobs=${JOBS:-1}
case "$CARCH" in
# on this platforms, lld seems to not utilise >1 threads for thinlto for some reason.
# at the same time, having more than 8 also crashes lld for firefox buildsystems (why?).
aarch64)
if [ $thinlto_jobs -gt 8 ]; then
thinlto_jobs=8
fi
;;
esac
case "$CARCH" in
x86)
# the i586 baseline cannot compile firefox
export CFLAGS="$CFLAGS -march=pentium4"
export CXXFLAGS="$CXXFLAGS -march=pentium4"
;;
esac
export LDFLAGS="$LDFLAGS -Wl,--thinlto-jobs=$thinlto_jobs"
case "$CARCH" in
# lto for 64-bit systems only
aarch64|x86_64|ppc64le)
cat > .mozconfig base-mozconfig <<-EOF
ac_add_options --enable-lto=cross
EOF
esac
./mach build
# install to where zotero expects it
DESTDIR="$_zoterodir"/app/xulrunner/firefox-$CARCH ./mach install
mv "$_zoterodir"/app/xulrunner/firefox-$CARCH/usr/lib/firefox-esr/* "$_zoterodir"/app/xulrunner/firefox-$CARCH/.
rm -R "$_zoterodir"/app/xulrunner/firefox-$CARCH/usr
# zotero build
(
cd "$_zoterodir"
npm i --legacy-peer-deps
NODE_OPTIONS=--openssl-legacy-provider npm run build
cd "$srcdir"/zotero-standalone-build*
scripts/dir_build -p l
SKIP_32=1 app/scripts/dir_build -p l
)
}
package() {
install -dDm755 "$pkgdir"/usr/bin
install -dDm755 "$pkgdir"/usr/lib/zotero
cp -r "$srcdir"/zotero-standalone-build*/staging/Zotero_linux-$CARCH/* "$pkgdir/usr/lib/zotero"
rm "$pkgdir/usr/lib/zotero/updater"
cp -r "$_zoterodir"/app/staging/Zotero_linux-$CARCH/* "$pkgdir/usr/lib/zotero"
ln -s /usr/lib/zotero/zotero "$pkgdir/usr/bin/zotero"
install -Dm644 "$srcdir/zotero.desktop" "$pkgdir/usr/share/applications/zotero.desktop"
# Copy zotero icons to a standard location
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default16.png" "$pkgdir/usr/share/icons/hicolor/16x16/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default32.png" "$pkgdir/usr/share/icons/hicolor/32x32/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default48.png" "$pkgdir/usr/share/icons/hicolor/48x48/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/chrome/icons/default/default256.png" "$pkgdir/usr/share/icons/hicolor/256x256/apps/zotero.png"
install -Dm644 "$pkgdir/usr/lib/zotero/icons/icon128.png" "$pkgdir/usr/share/icons/hicolor/128x128/apps/zotero.png"
# Close shell when launching
sed -i -r 's:^("\$CALLDIR/zotero-bin" -app "\$CALLDIR/application.ini" "\$@"):exec \1:' "$pkgdir/usr/lib/zotero/zotero"
}
sha512sums="
bdb66b4fb5622af3e60580a3bcd464d98ef13cb38d6ac6c9e5fc046e567a003cf080125d7748950c91c442fde5e8024c50c4180d2f551aa3528160a3c05ae187 firefox-102.15.1esr.source.tar.xz
4e584621145cf8add069c6dac18e805b3274a1ee402d84e924df2341f7d3c5be261a93ef51283bacbd606f47fbdc628c4323ecc31efc5b403b8d224b18dc278f allow-custom-rust-vendor.patch
3e0501ae7a650346c667dfdc0ae0ca286084f22e89ab2ac671cc0d7315673dc5b6dcb9f9882f6f39d26e9a31e57f7a0fd53d6b805e520224e22b8976850e2eb8 audio-lfs64.patch
b1cb2db3122634f66d2bae7066e76f2dcd455c464e021db4de3b0a08314df95cb667846081682db549dd2af8a00831cabe44a2420c66cdfb5e3b5fa7e6bd21d3 avoid-redefinition.patch
454ea3263cabce099accbdc47aaf83be26a19f8b5a4568c01a7ef0384601cf8315efd86cd917f9c8bf419c2c845db89a905f3ff9a8eb0c8e41042e93aa96a85c disable-moz-stackwalk.patch
f7b3b45ba04d05d17439d009bf0c9f27881e126f424e2257552338a0c1e3771ee1289c044babcb0920f62af62873a268c0cf524e1d35711e6dc8b808ca5e9f26 esr-metainfo.patch
a13dee87adf659423f5b3fa0358cfbde135fa614c85dd170d1a48d32ee080e27aef062d3a8e3c45059c41463fda579f8900988166ccb51568793ee7ef9080d04 firefox-102.12.0-ffmpeg_6-1.patch
c2e17f269070d782154f843b95bf68be25d8c4356825dd436b1877aab63ac023051899371da5c21f6151970b2562376c2dadd2d6a038446e5fa621e2495668e1 ffmpeg6-fixup.patch
d3a54897089eda9fdfe4b25ade1cb2c01c4b31fa9bf0e0ddbb0bbe674072ec5d36a6e52f791a8cbc8d3908e912ac2d7edec69b34d87ecca0acca876d45974c8d fix-neon-aom.patch
2f4f15974d52de4bb273b62a332d13620945d284bbc6fe6bd0a1f58ff7388443bc1d3bf9c82cc31a8527aad92b0cd3a1bc41d0af5e1800e0dcbd7033e58ffd71 fix-fortify-system-wrappers.patch
cd68b89e29e5f6379fbd5679db27b9a5ef70ea65e51c0d0a8137e1f1fd210e35a8cfb047798e9549bc7275606d7ec5c8d8af1335d29da4699db7acd8bc7ff556 fix-rust-target.patch
305c874fdea3096e9c4c6aa6520ac64bb1c347c4b59db8360096646593fe684c3b5377874d91cecd33d56d1410b4714fbdea2b514923723ecbeff79d51265d9b fix-webrtc-glibcisms.patch
49aa1dfbe11ed5370e839afb190da7f55ae4887b35645865efe25d398d890563722caedd5696d648ad71448621fbc8bab8def1a3d079e301d6414f0f20e96758 gcc13.patch
a4a3e062661bda64d502d426c480ac9645345860118de9df9ffe6e0597738c70c11e5cdef2d4fd12c5e2ee30a09310159230524655a419a4f7e4eeeb0f3c06b0 mallinfo.patch
f3d419880cc7f043b6eb547894d486457d407640be2bd8b402eb3a534ccea39568f6d506fc44a3b29c94eb0dc6fc2bec6600d161786fd233d26b1dc8970f5ab4 python-deps.patch
9f433c8051d05efb8b119e0b67b97951837aca6a8c5671646714a24023be11a9d63fa7c4e56a6c7f3911c9d8406b06cd95926de1a82925d02197dfd55daf5642 rust-lto-thin.patch
2518f2fc75b5db30058e0735f47d60fdf1e7adfaeee4b33fb2afb1bd9a616ce943fd88f4404d0802d4083703f4acf1d5ad42377218d025bc768807fbaf7e1609 sandbox-fork.patch
b7d0a6126bdf6c0569f80aabf5b37ed2c7a35712eb8a0404a2d85381552f5555d4f97d213ea26cec6a45dc2785f22439376ed5f8e78b4fd664ef0223307b333e sandbox-largefile.patch
94433c5ffdbe579c456d95c5f053f61fcbab2f652fa90bc69dcc27d9a1507a8e5c677adeadae9a7a75cc9a55184c1040737f4dfd10b279c088ef016561e6f135 sandbox-sched_setscheduler.patch
12fbe50d94624931a581314b8e6e228a1f8a4550704a6ee4f8904184ac4727efd90982e87a8fdd318e15515f9430dfc6cf7455b301e903003027b3f0afa79795 zstandard.patch
afabea91b328c5a68eaa20f9099ac7b2d0e7f2423e816b05ed168bdd326a5684fa02de08bf05c6033e9b888f02775d1b0443a00329b7a632ee399122a391c13a icu74.patch
5fa9382c692e4bd6a2634308f24a6526fd12a60a2563d2090056d43a60505df3ec9881bbf54562e69394467529b3b0dc45955afca46ed329af03cea074fff070 lfs64.patch
6aa925477109ed3be8f061fe1ea91caf95c7a7f5cca05c3e31322d08c3c2c044fb12bb1dbea09cd224b22e40e987571e415c6457aa5cab6a0b67f248f11b3df2 hunspell-dont-build-unused-function.patch
2625dcf433abbfa4c6835830b04c7b8cab72fba3a987515a6ba8e4f181332e804d98ccfbcc07e62c673be50db04c80d0f51c415173bb18cf4d18dc1364e165d0 utils-libc-lfs64.patch
0b3f1e4b9fdc868e4738b5c81fd6c6128ce8885b260affcb9a65ff9d164d7232626ce1291aaea70132b3e3124f5e13fef4d39326b8e7173e362a823722a85127 stab.h
d354f48a29bfc16719f3b230b1395063239d4420f9e47522de4662392d9697b15f931ca3bf6055d100fa33d61a9a1a13477687d5eac99e50ae7dbef9882a5808 firefox.desktop
382510375b1a2fa79be0ab79e3391a021ae2c022429ffbaa7e7a69166f99bb56d01e59a1b10688592a29238f21c9d6977672bd77f9fae439b66bdfe0c55ddb15 mozilla-location.keys
fc45bc3ffb9404e5338ea26a9f04807b40f6f516324972cddd48bedb91b8bd7c6b8d4e03a0209020f5e67b703bc4ff89389985791b9bd544a0fc3951e2dc338e vendor-prefs.js
e1a0a4ff5cc1b53f13776ca11927d671426b0691e78e74a4adf2166d57bb2ae8ac409cc11a37ce5e2f680fdf05d5bc3849c33a9717aca1bb62d03ae5231a67fb zotero.desktop
1002732c348e3caceb077b8595a3a8b5c15dc17bc9c443e8dc96f8efe82ee37d9b5d7241530d82188846007504a277fd261763a4c64c3c259d9130db3139043d xulrunner-get-alpine-firefox.diff
88ae8204fde34bd6b1595ddddc153ded3a3bfcaeb5d65ffd8398d58f41787ddd2ff35051c4f74e0c83483b6ec234f1bf987acbebccfe73ad31be5cb4b55cc403 zotero-client-7.0.0_20230415.tar.gz
2dad54ac1a75e9ed62eec9fe08081e6807ce0167992059d3b7cd7aee3fb4803c694dc852ffe27f82cbe162c7536f2d77c302a8f947b507c6548f729a8c9d3057 zotero-standalone-build-7.0.0_20230415.tar.gz
8379985c0da84d82bdba72a03daaf3afe80a30ef696a2da837cff12b23fdec75b62dd43061ede4687c6acc756181ecefd0a025a7fedce500137faba4ae3326ae zotero-build-20230314.tar.gz
27ca570df108cb9ffa48254f7cc5ef133371dcab652a12b2f636b87a2378d51afa6c118533d8b1779071441fa2b26663d2275db9d441f17dc7431dfdc90996ea zotero-client-7.0.0._20240131.tar.gz
dca620aa9a96c83d7a81cf11a2a1cf84ef94a1c06688cf00e2b03fd3fd671b6bd08094b7f76ef0f92cbfc2a9a97317855e5b39d17d51054ea3c539d2b3ee0ab2 zotero_build-modifications.diff
"

View file

@ -0,0 +1,61 @@
--- a/third_party/rust/audio_thread_priority/src/rt_linux.rs
+++ b/third_party/rust/audio_thread_priority/src/rt_linux.rs
@@ -112,7 +112,7 @@
/// Returns the maximum priority, maximum real-time time slice, and the current real-time time
/// slice for this process.
-fn get_limits() -> Result<(i64, u64, libc::rlimit64), AudioThreadPriorityError> {
+fn get_limits() -> Result<(i64, u64, libc::rlimit), AudioThreadPriorityError> {
let c = Connection::get_private(BusType::System)?;
let p = Props::new(
@@ -122,7 +122,7 @@
"org.freedesktop.RealtimeKit1",
DBUS_SOCKET_TIMEOUT,
);
- let mut current_limit = libc::rlimit64 {
+ let mut current_limit = libc::rlimit {
rlim_cur: 0,
rlim_max: 0,
};
@@ -141,9 +141,9 @@
));
}
- if unsafe { libc::getrlimit64(libc::RLIMIT_RTTIME, &mut current_limit) } < 0 {
+ if unsafe { libc::getrlimit(libc::RLIMIT_RTTIME, &mut current_limit) } < 0 {
return Err(AudioThreadPriorityError::new_with_inner(
- "getrlimit64",
+ "getrlimit",
Box::new(OSError::last_os_error()),
));
}
@@ -154,13 +154,13 @@
fn set_limits(request: u64, max: u64) -> Result<(), AudioThreadPriorityError> {
// Set a soft limit to the limit requested, to be able to handle going over the limit using
// SIGXCPU. Set the hard limit to the maxium slice to prevent getting SIGKILL.
- let new_limit = libc::rlimit64 {
+ let new_limit = libc::rlimit {
rlim_cur: request,
rlim_max: max,
};
- if unsafe { libc::setrlimit64(libc::RLIMIT_RTTIME, &new_limit) } < 0 {
+ if unsafe { libc::setrlimit(libc::RLIMIT_RTTIME, &new_limit) } < 0 {
return Err(AudioThreadPriorityError::new_with_inner(
- "setrlimit64",
+ "setrlimit",
Box::new(OSError::last_os_error()),
));
}
@@ -296,9 +296,9 @@
match r {
Ok(_) => Ok(handle),
Err(e) => {
- if unsafe { libc::setrlimit64(libc::RLIMIT_RTTIME, &limits) } < 0 {
+ if unsafe { libc::setrlimit(libc::RLIMIT_RTTIME, &limits) } < 0 {
return Err(AudioThreadPriorityError::new_with_inner(
- "setrlimit64",
+ "setrlimit",
Box::new(OSError::last_os_error()),
));
}

View file

@ -0,0 +1,44 @@
diff --git a/app/build.sh.orig b/app/build.sh
index 649d629..642ce81 100755
--- a/app/build.sh.orig
+++ b/app/build.sh
@@ -59,10 +59,7 @@ function abspath {
}
function check_lfs_file {
- if [ "$(head --bytes 5 "$1")" = "versi" ]; then
- echo "$1 not checked out -- install Git LFS and run 'git lfs pull'" >&2
- exit 1
- fi
+ return 0
}
SOURCE_DIR=""
@@ -840,18 +837,13 @@ if [ $BUILD_LINUX == 1 ]; then
cp -r "$runtime_path/"!(application.ini|browser|defaults|devtools-files|crashreporter|crashreporter.ini|firefox|pingsender|precomplete|removed-files|run-mozilla.sh|update-settings.ini|updater|updater.ini) "$APPDIR"
# Use our own launcher that calls the original Firefox executable with -app
- mv "$APPDIR"/firefox-bin "$APPDIR"/zotero-bin
+ mv "$APPDIR"/firefox-esr "$APPDIR"/zotero-bin
cp "$CALLDIR/linux/zotero" "$APPDIR"/zotero
# Copy Ubuntu launcher files
cp "$CALLDIR/linux/zotero.desktop" "$APPDIR"
cp "$CALLDIR/linux/set_launcher_icon" "$APPDIR"
- # Use our own updater, because Mozilla's requires updates signed by Mozilla
- check_lfs_file "$CALLDIR/linux/updater.tar.xz"
- tar xf "$CALLDIR/linux/updater.tar.xz" --to-stdout updater-$arch > "$APPDIR/updater"
- chmod 755 "$APPDIR/updater"
-
# Copy app files
rsync -a "$base_dir/" "$APPDIR/"
@@ -860,6 +852,7 @@ if [ $BUILD_LINUX == 1 ]; then
cp -RH "$CALLDIR/modules/zotero-libreoffice-integration/install" "$APPDIR/integration/libreoffice"
# Copy icons
+ mkdir -p "$APPDIR"/icons
cp "$CALLDIR/linux/icons/icon128.png" "$APPDIR/icons/"
cp "$CALLDIR/linux/icons/symbolic.svg" "$APPDIR/icons/"

View file

@ -0,0 +1,343 @@
Submitted By: Xi Ruoyao <xry111 at xry111 dot site>
Date: 2023-05-14
Initial Package Version: 102.12.0esr
Upstream Status: Applied for nightly, but not ESR
Origin:
- The first patch comes from
- https://github.com/rust-lang/rust-bindgen/pull/2319
- https://github.com/rust-lang/rust-bindgen/pull/2339
And they are integrated into mozilla at
- https://hg.mozilla.org/mozilla-central/rev/bd3481bf45fb
- The second patch comes from
- https://hg.mozilla.org/mozilla-central/rev/61f052c26dd1
- https://hg.mozilla.org/mozilla-central/rev/9fffd4b92c43
- The third patch comes from
- https://hg.mozilla.org/mozilla-central/rev/1a15f95b880f
- The fourth patch comes from
- https://github.com/mozilla/mp4parse-rust/commit/8d58b2d5fc7f
And it's integrated into mozilla at
- https://hg.mozilla.org/mozilla-central/rev/a651d4323066
A hack is added for Cargo.{toml,lock} to suppress sha256 check
Description: The first patch updates the bundled rust-bindgen
crate to be compatible with Clang/LLVM 16.
Without this patch, you will encounter "not a valid
Ident" errors when building Firefox, and it will
come out of fallback.rs in proc-macro2. This
references mfbt/Vector.h (symlinked to
firefox-build-dir/dist/include/mozilla/Vector.h) in
it's error output, but it is because LLVM changed
how it reports anonymous items.
The second patch adds missing "#include <cstdint>"
for three C++ headers and source files. Without
this patch, it will fail to build with C++ headers
from GCC 13.
The third and fourth patches work around build
failures with Rustc-1.70.0.
From 8e0b55b6029226d448ffc1c5465bf475ea0852c5 Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <xry111@xry111.site>
Date: Sun, 14 May 2023 03:37:24 +0800
Subject: [PATCH 1/4] cbindgen patch
---
third_party/rust/bindgen/src/clang.rs | 5 ++++
third_party/rust/bindgen/src/ir/comp.rs | 3 +-
third_party/rust/bindgen/src/ir/ty.rs | 30 +++++++++++--------
third_party/rust/bindgen/src/ir/var.rs | 8 ++---
5 files changed, 29 insertions(+), 19 deletions(-)
diff --git a/third_party/rust/bindgen/src/clang.rs b/third_party/rust/bindgen/src/clang.rs
index 488660c434..ef74ac08c2 100644
--- a/third_party/rust/bindgen/src/clang.rs
+++ b/third_party/rust/bindgen/src/clang.rs
@@ -54,6 +54,11 @@ impl Cursor {
unsafe { clang_isDeclaration(self.kind()) != 0 }
}
+ /// Is this cursor's referent an anonymous record or so?
+ pub fn is_anonymous(&self) -> bool {
+ unsafe { clang_Cursor_isAnonymous(self.x) != 0 }
+ }
+
/// Get this cursor's referent's spelling.
pub fn spelling(&self) -> String {
unsafe { cxstring_into_string(clang_getCursorSpelling(self.x)) }
diff --git a/third_party/rust/bindgen/src/ir/comp.rs b/third_party/rust/bindgen/src/ir/comp.rs
index 22c124fa36..b715616c5e 100644
--- a/third_party/rust/bindgen/src/ir/comp.rs
+++ b/third_party/rust/bindgen/src/ir/comp.rs
@@ -1372,8 +1372,7 @@ impl CompInfo {
// A declaration of an union or a struct without name could
// also be an unnamed field, unfortunately.
- if cur.spelling().is_empty() &&
- cur.kind() != CXCursor_EnumDecl
+ if cur.is_anonymous() && cur.kind() != CXCursor_EnumDecl
{
let ty = cur.cur_type();
let offset = cur.offset_of_field().ok();
diff --git a/third_party/rust/bindgen/src/ir/ty.rs b/third_party/rust/bindgen/src/ir/ty.rs
index e6eecc3c50..f3e1193ce2 100644
--- a/third_party/rust/bindgen/src/ir/ty.rs
+++ b/third_party/rust/bindgen/src/ir/ty.rs
@@ -737,7 +737,12 @@ impl Type {
let layout = ty.fallible_layout(ctx).ok();
let cursor = ty.declaration();
- let mut name = cursor.spelling();
+ let is_anonymous = cursor.is_anonymous();
+ let mut name = if is_anonymous {
+ None
+ } else {
+ Some(cursor.spelling()).filter(|n| !n.is_empty())
+ };
debug!(
"from_clang_ty: {:?}, ty: {:?}, loc: {:?}",
@@ -771,7 +776,7 @@ impl Type {
if is_canonical_objcpointer && is_template_type_param {
// Objective-C generics are just ids with fancy name.
// To keep it simple, just name them ids
- name = "id".to_owned();
+ name = Some("id".to_owned());
}
}
@@ -900,7 +905,7 @@ impl Type {
return Err(ParseError::Recurse);
}
} else {
- name = location.spelling();
+ name = Some(location.spelling());
}
let complex = CompInfo::from_ty(
@@ -942,7 +947,7 @@ impl Type {
CXType_Typedef
);
- name = current.spelling();
+ name = Some(location.spelling());
let inner_ty = cur
.typedef_type()
@@ -1126,10 +1131,10 @@ impl Type {
CXType_Enum => {
let enum_ = Enum::from_ty(ty, ctx).expect("Not an enum?");
- if name.is_empty() {
+ if !is_anonymous {
let pretty_name = ty.spelling();
if clang::is_valid_identifier(&pretty_name) {
- name = pretty_name;
+ name = Some(pretty_name);
}
}
@@ -1144,12 +1149,12 @@ impl Type {
)
.expect("Not a complex type?");
- if name.is_empty() {
+ if !is_anonymous {
// The pretty-printed name may contain typedefed name,
// but may also be "struct (anonymous at .h:1)"
let pretty_name = ty.spelling();
if clang::is_valid_identifier(&pretty_name) {
- name = pretty_name;
+ name = Some(pretty_name);
}
}
@@ -1161,8 +1166,7 @@ impl Type {
location,
None,
ctx,
- )
- .expect("Not able to resolve vector element?");
+ )?;
TypeKind::Vector(inner, ty.num_elements().unwrap())
}
CXType_ConstantArray => {
@@ -1189,7 +1193,9 @@ impl Type {
CXType_ObjCClass | CXType_ObjCInterface => {
let interface = ObjCInterface::from_ty(&location, ctx)
.expect("Not a valid objc interface?");
- name = interface.rust_name();
+ if !is_anonymous {
+ name = Some(interface.rust_name());
+ }
TypeKind::ObjCInterface(interface)
}
CXType_Dependent => {
@@ -1207,7 +1213,7 @@ impl Type {
}
};
- let name = if name.is_empty() { None } else { Some(name) };
+ name = name.filter(|n| !n.is_empty());
let is_const = ty.is_const() ||
(ty.kind() == CXType_ConstantArray &&
diff --git a/third_party/rust/bindgen/src/ir/var.rs b/third_party/rust/bindgen/src/ir/var.rs
index c6f121d74e..30fb0b5ee8 100644
--- a/third_party/rust/bindgen/src/ir/var.rs
+++ b/third_party/rust/bindgen/src/ir/var.rs
@@ -301,11 +301,11 @@ impl ClangSubItemParser for Var {
let ty = match Item::from_ty(&ty, cursor, None, ctx) {
Ok(ty) => ty,
Err(e) => {
- assert_eq!(
- ty.kind(),
- CXType_Auto,
+ assert!(
+ matches!(ty.kind(), CXType_Auto | CXType_Unexposed),
"Couldn't resolve constant type, and it \
- wasn't an nondeductible auto type!"
+ wasn't an nondeductible auto type or unexposed \
+ type!"
);
return Err(e);
}
--
2.40.1
From 2c22f8cc4756d3e492fe6be4be634fb592b4b0e3 Mon Sep 17 00:00:00 2001
From: Xi Ruoyao <xry111@xry111.site>
Date: Sun, 14 May 2023 03:37:04 +0800
Subject: [PATCH 2/4] add missing <cstdint>
---
dom/media/webrtc/sdp/RsdparsaSdpGlue.cpp | 1 +
gfx/2d/Rect.h | 1 +
toolkit/components/telemetry/pingsender/pingsender.cpp | 1 +
3 files changed, 3 insertions(+)
diff --git a/dom/media/webrtc/sdp/RsdparsaSdpGlue.cpp b/dom/media/webrtc/sdp/RsdparsaSdpGlue.cpp
index 8c8a0369c3..d43b4a1e0d 100644
--- a/dom/media/webrtc/sdp/RsdparsaSdpGlue.cpp
+++ b/dom/media/webrtc/sdp/RsdparsaSdpGlue.cpp
@@ -3,6 +3,7 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include <cstdint>
#include <string>
#include "sdp/RsdparsaSdpInc.h"
diff --git a/gfx/2d/Rect.h b/gfx/2d/Rect.h
index 4875ad6714..f52437bbdc 100644
--- a/gfx/2d/Rect.h
+++ b/gfx/2d/Rect.h
@@ -15,6 +15,7 @@
#include "mozilla/Maybe.h"
#include <cmath>
+#include <cstdint>
namespace mozilla {
diff --git a/toolkit/components/telemetry/pingsender/pingsender.cpp b/toolkit/components/telemetry/pingsender/pingsender.cpp
index 01fdb63c29..ceda3b1945 100644
--- a/toolkit/components/telemetry/pingsender/pingsender.cpp
+++ b/toolkit/components/telemetry/pingsender/pingsender.cpp
@@ -3,6 +3,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+#include <cstdint>
#include <cstdlib>
#include <cstring>
#include <ctime>
--
2.40.1
# HG changeset patch
# User Emilio Cobos Álvarez <emilio@crisal.io>
# Date 1682520906 0
# Node ID 1a15f95b880f3d4b5a427c750932c53a01b4897a
# Parent 17ea6f29654b2ff39d374073cec3e7116c1ec548
[PATCH 3/4] Bug 1829964 - Allow ambiguous glob reexports for now in autogenerated bindings. r=glandium
I started looking into removing these glob re-exports, but I couldn't
convince myself that the result was particularly better...
Differential Revision: https://phabricator.services.mozilla.com/D176473
diff --git a/layout/style/ServoBindings.toml b/layout/style/ServoBindings.toml
--- a/layout/style/ServoBindings.toml
+++ b/layout/style/ServoBindings.toml
@@ -35,16 +35,17 @@ headers = [
"mozilla/SizeOfState.h",
"nsCSSProps.h",
"nsMappedAttributes.h",
"nsNameSpaceManager.h",
]
raw-lines = [
# FIXME(emilio): Incrementally remove these "pub use"s. Probably
# mozilla::css and mozilla::dom are easier.
+ "#[allow(unknown_lints, ambiguous_glob_reexports)]",
"pub use self::root::*;",
"pub use self::root::mozilla::*;",
"pub use self::root::mozilla::css::*;",
"pub use self::root::mozilla::dom::*;",
]
hide-types = [
".*char_traits",
".*incompatible_char_type",
From 8b5b652d38e007e736bb442ccd5aa5ed699db100 Mon Sep 17 00:00:00 2001
From: Matthew Gregan <kinetik@flim.org>
Date: Thu, 16 Jun 2022 13:54:02 +1200
Subject: [PATCH 4/4] Fix `unstable-name-collisions` warning by using fully
qualified path.
---
mp4parse/src/lib.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/third_party/rust/mp4parse/src/lib.rs b/third_party/rust/mp4parse/src/lib.rs
index 567ee21d..4f3d7153 100644
--- a/third_party/rust/mp4parse/src/lib.rs
+++ b/third_party/rust/mp4parse/src/lib.rs
@@ -3506,8 +3506,13 @@ macro_rules! impl_mul {
type Output = $output;
fn mul(self, rhs: $rhs) -> Self::Output {
- static_assertions::const_assert!(<$output>::MAX <= <$inner>::MAX as u64);
- static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
+ static_assertions::const_assert!(
+ <$output as UpperBounded>::MAX <= <$inner>::MAX as u64
+ );
+ static_assertions::const_assert!(
+ <$lhs as UpperBounded>::MAX * <$rhs as UpperBounded>::MAX
+ <= <$output as UpperBounded>::MAX
+ );
let lhs: $inner = self.get().into();
let rhs: $inner = rhs.get().into();
--- firefox-102.12.0.orig/Cargo.lock 2023-05-30 01:34:26.000000000 +0800
+++ firefox-102.12.0/Cargo.lock 2023-06-04 18:52:58.494327811 +0800
@@ -3407,7 +3407,6 @@
[[package]]
name = "mp4parse"
version = "0.13.0"
-source = "git+https://github.com/mozilla/mp4parse-rust?rev=3bfc47d9a571d0842676043ba60716318e946c06#3bfc47d9a571d0842676043ba60716318e946c06"
dependencies = [
"bitreader",
"byteorder",
--- firefox-102.12.0.orig/Cargo.toml 2023-05-30 01:34:26.000000000 +0800
+++ firefox-102.12.0/Cargo.toml 2023-06-04 18:52:44.365719856 +0800
@@ -128,3 +128,7 @@
# Patch fallible_collections for issues with rustc 1.65.
[patch.crates-io.fallible_collections]
path = "third_party/rust/fallible_collections"
+
+# Patch mp4parse for issues with rustc-1.70.
+[patch."https://github.com/mozilla/mp4parse-rust"]
+mp4parse = { path = "third_party/rust/mp4parse" }

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,69 @@
new file mode 100644
--- /dev/null
+++ b/extensions/spellcheck/hunspell/patches/bug1838113.patch
@@ -0,0 +1,20 @@
+diff --git a/extensions/spellcheck/hunspell/src/csutil.cxx b/extensions/spellcheck/hunspell/src/csutil.cxx
+index 48e58ff4b2677..39a54d38023c8 100644
+--- a/extensions/spellcheck/hunspell/src/csutil.cxx
++++ b/extensions/spellcheck/hunspell/src/csutil.cxx
+@@ -108,6 +108,7 @@ static struct unicode_info2* utf_tbl = NULL;
+ static int utf_tbl_count =
+ 0; // utf_tbl can be used by multiple Hunspell instances
+
++#ifndef MOZILLA_CLIENT
+ void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mode)
+ {
+ #if defined(_WIN32) && defined(_MSC_VER)
+@@ -127,6 +128,7 @@ void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mod
+ #endif
+ stream.open(path, mode);
+ }
++#endif
+
+ std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
+ dest.clear();
--- a/extensions/spellcheck/hunspell/src/csutil.cxx
+++ b/extensions/spellcheck/hunspell/src/csutil.cxx
@@ -103,16 +103,17 @@ struct unicode_info2 {
unsigned short cupper;
unsigned short clower;
};
static struct unicode_info2* utf_tbl = NULL;
static int utf_tbl_count =
0; // utf_tbl can be used by multiple Hunspell instances
+#ifndef MOZILLA_CLIENT
void myopen(std::ifstream& stream, const char* path, std::ios_base::openmode mode)
{
#if defined(_WIN32) && defined(_MSC_VER)
#define WIN32_LONG_PATH_PREFIX "\\\\?\\"
if (strncmp(path, WIN32_LONG_PATH_PREFIX, 4) == 0) {
int len = MultiByteToWideChar(CP_UTF8, 0, path, -1, NULL, 0);
wchar_t* buff = new wchar_t[len];
wchar_t* buff2 = new wchar_t[len];
@@ -122,16 +123,17 @@ void myopen(std::ifstream& stream, const
}
delete [] buff;
delete [] buff2;
}
else
#endif
stream.open(path, mode);
}
+#endif
std::string& u16_u8(std::string& dest, const std::vector<w_char>& src) {
dest.clear();
std::vector<w_char>::const_iterator u2 = src.begin();
std::vector<w_char>::const_iterator u2_max = src.end();
while (u2 < u2_max) {
signed char u8;
if (u2->h) { // > 0xFF
--- a/extensions/spellcheck/hunspell/update.sh
+++ b/extensions/spellcheck/hunspell/update.sh
@@ -29,3 +29,4 @@ rm -rf ${tmpclonedir}
cd ${hunspell_dir}/src
patch -p5 < ../patches/bug1410214.patch
patch -p5 < ../patches/bug1739761.patch
+patch -p5 < ../patches/bug1838113.patch

38
user/zotero/icu74.patch Normal file
View file

@ -0,0 +1,38 @@
https://bugzilla.mozilla.org/show_bug.cgi?id=1862601
# HG changeset patch
# User André Bargull <andre.bargull@gmail.com>
# Date 1697435923 -7200
# Node ID d5f3b0c4f08a426ce00a153c04e177eecb6820e2
# Parent c63994f8259efdf6e745c960aa9e1409d5477049
Bug xxx - Part 12: Add new line break classes. r?
diff --git a/intl/lwbrk/LineBreaker.cpp b/intl/lwbrk/LineBreaker.cpp
--- a/intl/lwbrk/LineBreaker.cpp
+++ b/intl/lwbrk/LineBreaker.cpp
@@ -443,17 +443,23 @@ static int8_t GetClass(uint32_t u, LineB
/* JT = 34, [JT] */ CLASS_CHARACTER,
/* JV = 35, [JV] */ CLASS_CHARACTER,
/* CLOSE_PARENTHESIS = 36, [CP] */ CLASS_CLOSE_LIKE_CHARACTER,
/* CONDITIONAL_JAPANESE_STARTER = 37, [CJ] */ CLASS_CLOSE,
/* HEBREW_LETTER = 38, [HL] */ CLASS_CHARACTER,
/* REGIONAL_INDICATOR = 39, [RI] */ CLASS_CHARACTER,
/* E_BASE = 40, [EB] */ CLASS_BREAKABLE,
/* E_MODIFIER = 41, [EM] */ CLASS_CHARACTER,
- /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER};
+ /* ZWJ = 42, [ZWJ]*/ CLASS_CHARACTER,
+ /* AKSARA = 43, [AK] */ CLASS_CHARACTER,
+ /* AKSARA_PREBASE = 44, [AP] */ CLASS_CHARACTER,
+ /* AKSARA_START = 45, [AS] */ CLASS_CHARACTER,
+ /* VIRAMA_FINAL = 46, [VF] */ CLASS_CHARACTER,
+ /* VIRAMA = 47, [VI] */ CLASS_CHARACTER,
+ };
static_assert(U_LB_COUNT == mozilla::ArrayLength(sUnicodeLineBreakToClass),
"Gecko vs ICU LineBreak class mismatch");
auto cls = GetLineBreakClass(u);
MOZ_ASSERT(cls < mozilla::ArrayLength(sUnicodeLineBreakToClass));
// Overrides based on rules for the different line-break values given in

35
user/zotero/lfs64.patch Normal file
View file

@ -0,0 +1,35 @@
force stat() instead of stat64() on 32-bit
--
--- a/xpcom/io/nsLocalFileUnix.h
+++ b/xpcom/io/nsLocalFileUnix.h
@@ -21,7 +21,7 @@
// stat64 and lstat64 are deprecated on OS X. Normal stat and lstat are
// 64-bit by default on OS X 10.6+.
-#if defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
+#if 0 && defined(HAVE_STAT64) && defined(HAVE_LSTAT64) && !defined(XP_DARWIN)
# if defined(AIX)
# if defined STAT
# undef STAT
--- a/mozglue/baseprofiler/core/shared-libraries-linux.cc
+++ b/mozglue/baseprofiler/core/shared-libraries-linux.cc
@@ -178,7 +178,7 @@
return false;
}
-#if defined(__x86_64__) || defined(__aarch64__) || \
+#if 1 || defined(__x86_64__) || defined(__aarch64__) || \
(defined(__mips__) && _MIPS_SIM == _ABI64) || \
!(defined(GP_OS_linux) || defined(GP_OS_android))
--- a/security/sandbox/linux/broker/SandboxBrokerUtils.h
+++ b/security/sandbox/linux/broker/SandboxBrokerUtils.h
@@ -15,7 +15,7 @@
// calls. We'll intercept those and handle them in the stat functions
// but must be sure to use the right structure layout.
-#if defined(__NR_stat64) || defined(__NR_fstatat64)
+#if 0 && (defined(__NR_stat64) || defined(__NR_fstatat64) )
typedef struct stat64 statstruct;
# define statsyscall stat64
# define lstatsyscall lstat64

View file

@ -0,0 +1,32 @@
Patch-Source: https://github.com/mozilla/mp4parse-rust/commit/8d58b2d5fc7f552d585964354d8269bcca3d9251
--
From 8d58b2d5fc7f552d585964354d8269bcca3d9251 Mon Sep 17 00:00:00 2001
From: Matthew Gregan <kinetik@flim.org>
Date: Thu, 16 Jun 2022 13:54:02 +1200
Subject: [PATCH] Fix `unstable-name-collisions` warning by using fully
qualified path.
---
mp4parse/src/lib.rs | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/mp4parse/src/lib.rs b/mp4parse/src/lib.rs
index 567ee21d..4f3d7153 100644
--- a/third_party/rust/mp4parse/src/lib.rs
+++ b/third_party/rust/mp4parse/src/lib.rs
@@ -3506,8 +3506,13 @@ macro_rules! impl_mul {
type Output = $output;
fn mul(self, rhs: $rhs) -> Self::Output {
- static_assertions::const_assert!(<$output>::MAX <= <$inner>::MAX as u64);
- static_assertions::const_assert!(<$lhs>::MAX * <$rhs>::MAX <= <$output>::MAX);
+ static_assertions::const_assert!(
+ <$output as UpperBounded>::MAX <= <$inner>::MAX as u64
+ );
+ static_assertions::const_assert!(
+ <$lhs as UpperBounded>::MAX * <$rhs as UpperBounded>::MAX
+ <= <$output as UpperBounded>::MAX
+ );
let lhs: $inner = self.get().into();
let rhs: $inner = rhs.get().into();

View file

@ -0,0 +1,13 @@
prevents a call to ccache
diff --git a/python/mozbuild/mozbuild/controller/building.py b/python/mozbuild/mozbuild/controller/building.py
index bf7009a..011c012 100644
--- a/python/mozbuild/mozbuild/controller/building.py
+++ b/python/mozbuild/mozbuild/controller/building.py
@@ -570,6 +570,7 @@ class BuildMonitor(MozbuildObject):
)
def ccache_stats(self, ccache=None):
+ return None
ccache_stats = None
if ccache is None:

View file

@ -0,0 +1,30 @@
Patch-Source: https://github.com/chimera-linux/cports/blob/506127954653ccebf9b82df1452cce4ed0dae3b1/contrib/thunderbird/patches/ppc-musttail.patch
--
commit 5e66655e1456c9d26637ceaed3f4533b537322c4
Author: Daniel Kolesa <daniel@octaforge.org>
Date: Sat May 13 23:00:04 2023 +0200
disable musttail on ppc
41:38.04 LLVM ERROR: failed to perform tail call elimination on a call site marked musttail
41:38.04 PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
41:38.04 Stack dump:
41:38.04 0. Running pass 'Function Pass Manager' on module '/builddir/thunderbird-114.0_beta1/obj-powerpc64le-unknown-linux-musl/toolkit/library/build/../../../gfx/skia/SkOpts.o'.
41:38.04 1. Running pass 'PowerPC DAG->DAG Pattern Instruction Selection' on function '@_ZN8portableL15init_lane_masksEPNS_6ParamsEP21SkRasterPipelineStageffff'
41:38.95 clang-16: error: unable to execute command: Aborted
To be investigated later.
diff --git a/gfx/skia/skia/src/core/SkRasterPipeline.h b/gfx/skia/skia/src/core/SkRasterPipeline.h
index 766bb0c..88c6cb2 100644
--- a/gfx/skia/skia/src/core/SkRasterPipeline.h
+++ b/gfx/skia/skia/src/core/SkRasterPipeline.h
@@ -24,7 +24,7 @@ enum SkColorType : int;
struct SkImageInfo;
struct skcms_TransferFunction;
-#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32)
+#if __has_cpp_attribute(clang::musttail) && !defined(__EMSCRIPTEN__) && !defined(SK_CPU_ARM32) && !defined(__powerpc__)
#define SK_HAS_MUSTTAIL 1
#else
#define SK_HAS_MUSTTAIL 0

View file

@ -0,0 +1,23 @@
Patch-Source: https://github.com/chimera-linux/cports/blob/506127954653ccebf9b82df1452cce4ed0dae3b1/contrib/thunderbird/patches/ppc64-webrtc.patch
--
commit 010bfb0441168d51e0fffe98d1f50e0602e7947f
Author: Daniel Kolesa <daniel@octaforge.org>
Date: Sat May 13 23:40:41 2023 +0200
fix webrtc on ppc64
diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build
index 976cf37..d35d447 100644
--- a/third_party/libwebrtc/moz.build
+++ b/third_party/libwebrtc/moz.build
@@ -643,3 +643,10 @@ if CONFIG["CPU_ARCH"] == "x86_64" and CONFIG["OS_TARGET"] == "WINNT":
"/third_party/libwebrtc/modules/audio_processing/agc2/rnn_vad/vector_math_avx2_gn",
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_differ_sse2_gn"
]
+
+if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
+
+ DIRS += [
+ "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+ "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
+ ]

View file

@ -0,0 +1,12 @@
set rust crate lto to thin to not use fatlto for gkrust which ooms on 32-bit
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -94,7 +94,7 @@
# Never enable when coverage is enabled to work around https://github.com/rust-lang/rust/issues/90045.
ifndef MOZ_CODE_COVERAGE
ifeq (,$(findstring gkrust_gtest,$(RUST_LIBRARY_FILE)))
-cargo_rustc_flags += -Clto
+cargo_rustc_flags += -Clto=thin
endif
# We need -Cembed-bitcode=yes for all crates when using -Clto.
RUSTFLAGS += -Cembed-bitcode=yes

View file

@ -0,0 +1,798 @@
--- a/.cargo/config.in
+++ b/.cargo/config.in
@@ -55,19 +55,19 @@ git = "https://github.com/mozilla-spider
rev = "64ba08e24749616de2344112f226d1ef4ba893ae"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/application-services?rev=c82bccfa500813f273f4db0ead64fc73bfa2b34c"]
git = "https://github.com/mozilla/application-services"
rev = "c82bccfa500813f273f4db0ead64fc73bfa2b34c"
replace-with = "vendored-sources"
-[source."git+https://github.com/mozilla/audioipc?rev=ec6af6ecf8ba50b51f13d18f417de8cfb8460543"]
+[source."git+https://github.com/mozilla/audioipc?rev=6be424d75f1367e70f2f5ddcacd6d0237e81a6a9"]
git = "https://github.com/mozilla/audioipc"
-rev = "ec6af6ecf8ba50b51f13d18f417de8cfb8460543"
+rev = "6be424d75f1367e70f2f5ddcacd6d0237e81a6a9"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/cubeb-coreaudio-rs?rev=93b5c01a131f65c83c11aeb317f4583405c5eb79"]
git = "https://github.com/mozilla/cubeb-coreaudio-rs"
rev = "93b5c01a131f65c83c11aeb317f4583405c5eb79"
replace-with = "vendored-sources"
[source."git+https://github.com/mozilla/cubeb-pulse-rs?rev=cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9"]
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -230,32 +230,32 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c41dc008c1973ce58ff3cfc52df53814a9b7b78d73d95b071b5ff0ed4b2db3e1"
dependencies = [
"bitflags 1.999.999",
]
[[package]]
name = "audio_thread_priority"
-version = "0.26.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "8b7cd1bfd03dab20ad72e0c5e58d65818d62c0d199d8dec8361053d0f073dbae"
-dependencies = [
- "cfg-if 0.1.999",
+version = "0.30.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "a7e6839a6e8e72338137b3126c7fe61af95b9acc3076d2b7109696f808d1234f"
+dependencies = [
+ "cfg-if 1.0.0",
"dbus",
"libc",
"log",
"mach",
- "winapi",
+ "windows-sys",
]
[[package]]
name = "audioipc2"
version = "0.5.0"
-source = "git+https://github.com/mozilla/audioipc?rev=ec6af6ecf8ba50b51f13d18f417de8cfb8460543#ec6af6ecf8ba50b51f13d18f417de8cfb8460543"
+source = "git+https://github.com/mozilla/audioipc?rev=6be424d75f1367e70f2f5ddcacd6d0237e81a6a9#6be424d75f1367e70f2f5ddcacd6d0237e81a6a9"
dependencies = [
"arrayvec",
"ashmem",
"audio_thread_priority",
"bincode",
"byteorder",
"bytes",
"cc",
@@ -273,28 +273,28 @@ dependencies = [
"serde_derive",
"slab",
"windows-sys",
]
[[package]]
name = "audioipc2-client"
version = "0.5.0"
-source = "git+https://github.com/mozilla/audioipc?rev=ec6af6ecf8ba50b51f13d18f417de8cfb8460543#ec6af6ecf8ba50b51f13d18f417de8cfb8460543"
+source = "git+https://github.com/mozilla/audioipc?rev=6be424d75f1367e70f2f5ddcacd6d0237e81a6a9#6be424d75f1367e70f2f5ddcacd6d0237e81a6a9"
dependencies = [
"audio_thread_priority",
"audioipc2",
"cubeb-backend",
"log",
]
[[package]]
name = "audioipc2-server"
version = "0.5.0"
-source = "git+https://github.com/mozilla/audioipc?rev=ec6af6ecf8ba50b51f13d18f417de8cfb8460543#ec6af6ecf8ba50b51f13d18f417de8cfb8460543"
+source = "git+https://github.com/mozilla/audioipc?rev=6be424d75f1367e70f2f5ddcacd6d0237e81a6a9#6be424d75f1367e70f2f5ddcacd6d0237e81a6a9"
dependencies = [
"audio_thread_priority",
"audioipc2",
"cubeb-core",
"error-chain",
"log",
"once_cell",
"slab",
--- a/supply-chain/imports.lock
+++ b/supply-chain/imports.lock
@@ -38,16 +38,23 @@ user-name = "Amanieu d'Antras"
[[publisher.audio_thread_priority]]
version = "0.26.1"
when = "2022-03-22"
user-id = 1258
user-login = "padenot"
user-name = "Paul Adenot"
+[[publisher.audio_thread_priority]]
+version = "0.30.0"
+when = "2023-11-06"
+user-id = 1258
+user-login = "padenot"
+user-name = "Paul Adenot"
+
[[publisher.authenticator]]
version = "0.4.0-alpha.20"
when = "2023-08-24"
user-id = 175410
user-login = "jschanck"
user-name = "John Schanck"
[[publisher.authenticator]]
--- a/third_party/rust/audio_thread_priority/.cargo-checksum.json
+++ b/third_party/rust/audio_thread_priority/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"f2a927f4fdf4171eb2111ad9f770fd113d058d6d7dffa10fce7bd7577edda582","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"f0ecaf1b674f794cde0dc834028e074d4e4675d22ae96acf08b2ae1dceb3474e","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"975de6a74e0adb999a08bc41f08a3bd68fe11c154731bc12c43df546ddb32949","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"4ea9f6eb1902aff0126d1b957be7f723d599e9a8bbd75ca8013a2820ef5fe68a","src/rt_mach.rs":"e4587fdf640df37f251e50c6c9313f6a73eae4d54f4b8a84cefc6bc730e94be8","src/rt_win.rs":"c41f6e277051a92f8d38939cf9d78ee6deea736a4686b3bcd185492e47e1650a"},"package":"8b7cd1bfd03dab20ad72e0c5e58d65818d62c0d199d8dec8361053d0f073dbae"}
\ No newline at end of file
+{"files":{"Cargo.toml":"b66cf5a2203f39d8425d2b2170f64a5c7220ef76efa7ea14ad20ba99d3435e84","LICENSE":"32ee9dbf6196874fc9d406c54a888a6c4cbb9aa4a7f35b46befeaff43a78fe85","Makefile":"0f9a771cfb30c7c4b9961d82fdca4e9e229a955bb2e636474a4101389e18e938","README.md":"c123692b3b50dd621b896a8269814d609cbf1e532b461bf4a77854ddd607eb7a","atp_test.cpp":"8075a040941a65fb9e3f7cbf0535853ca6661c3ac442ec35569b42b24bbec797","audio_thread_priority.h":"f0ecaf1b674f794cde0dc834028e074d4e4675d22ae96acf08b2ae1dceb3474e","generate_osx_bindings.sh":"06e4e03450f788ced18d31fff5660919e6f6ec1119ddace363ffeb82f0518a71","src/lib.rs":"fe417e81a6677c581d9f617ff7989f08780465401b6fa22b6e3abfedf9e3e221","src/mach_sys.rs":"352560fcb9b41d877cff92e5b3b04d6dc68b1f30508ce4b9aed78940120a883e","src/rt_linux.rs":"27004821a29e6af73f9e13f4d1f060e024152c4cc379d6a0df38d6f5b61039ad","src/rt_mach.rs":"29f8c0397f14cecbac1f76394c2abfe0e05903b54486cf735f9a94a10c168643","src/rt_win.rs":"f2ba097cebf65252c27d9d6dcfbe1fcc041c4b312724bd98e080e114a4de3bb6"},"package":"a7e6839a6e8e72338137b3126c7fe61af95b9acc3076d2b7109696f808d1234f"}
\ No newline at end of file
--- a/third_party/rust/audio_thread_priority/Cargo.toml
+++ b/third_party/rust/audio_thread_priority/Cargo.toml
@@ -7,53 +7,59 @@
#
# If you are reading this file be aware that the original Cargo.toml
# will likely look very different (and much more reasonable).
# See Cargo.toml.orig for the original contents.
[package]
edition = "2018"
name = "audio_thread_priority"
-version = "0.26.1"
+version = "0.30.0"
authors = ["Paul Adenot <paul@paul.cx>"]
description = "Bump a thread to real-time priority, for audio work, on Linux, Windows and macOS"
+readme = "README.md"
license = "MPL-2.0"
repository = "https://github.com/padenot/audio_thread_priority"
[lib]
name = "audio_thread_priority"
-crate-type = ["staticlib", "rlib"]
+crate-type = [
+ "staticlib",
+ "rlib",
+]
+
[dependencies.cfg-if]
-version = "0.1"
+version = "1.0"
[dependencies.log]
version = "0.4"
[dependencies.simple_logger]
version = "0.4"
optional = true
+
[dev-dependencies.nix]
-version = "0.15.0"
+version = "0.26"
[features]
-default = ["with_dbus", "winapi"]
+default = ["with_dbus"]
terminal-logging = ["simple_logger"]
with_dbus = ["dbus"]
+
[target."cfg(target_os = \"linux\")".dependencies.dbus]
version = "0.6.4"
optional = true
[target."cfg(target_os = \"linux\")".dependencies.libc]
version = "0.2"
+
[target."cfg(target_os = \"macos\")".dependencies.libc]
version = "0.2"
[target."cfg(target_os = \"macos\")".dependencies.mach]
version = "0.3"
-[target."cfg(target_os = \"windows\")".dependencies.winapi]
-version = "0.3"
-features = ["avrt", "errhandlingapi", "minwindef"]
-optional = true
-[target."cfg(target_os = \"windows\")".dependencies.windows]
-version = "^0.32.0"
-features = ["Win32_Foundation", "Win32_System_Threading"]
-optional = true
+[target."cfg(target_os = \"windows\")".dependencies.windows-sys]
+version = "0.48"
+features = [
+ "Win32_Foundation",
+ "Win32_System_Threading",
+]
--- a/third_party/rust/audio_thread_priority/src/lib.rs
+++ b/third_party/rust/audio_thread_priority/src/lib.rs
@@ -253,34 +253,43 @@ pub extern "C" fn atp_get_current_thread
///
/// # Arguments
///
/// thread_info: the `atp_thread_info` structure to free.
///
/// # Return value
///
/// 0 in case of success, 1 otherwise (if `thread_info` is NULL).
+///
+/// # Safety
+///
+/// This function is safe only and only if the pointer comes from this library, of if is null.
#[no_mangle]
pub unsafe extern "C" fn atp_free_thread_info(thread_info: *mut atp_thread_info) -> i32 {
if thread_info.is_null() {
return 1;
}
- Box::from_raw(thread_info);
+ drop(Box::from_raw(thread_info));
0
}
/// Return a byte buffer containing serialized information about a thread, to promote it to
/// real-time from elsewhere, with a C API.
///
/// `bytes` MUST be `std::mem::size_of<RtPriorityThreadInfo>()` bytes long.
///
/// This is exposed in the C API as `ATP_THREAD_INFO_SIZE`.
///
/// This call is useful on Linux desktop only, when the process is sandboxed, cannot promote itself
/// directly, and the `atp_thread_info` struct must be passed via IPC.
+///
+/// # Safety
+///
+/// This function is safe only and only if the first pointer comes from this library, and the
+/// second pointer is at least ATP_THREAD_INFO_SIZE bytes long.
#[no_mangle]
pub unsafe extern "C" fn atp_serialize_thread_info(
thread_info: *mut atp_thread_info,
bytes: *mut libc::c_void,
) {
let thread_info = &mut *thread_info;
let source = thread_info.0.serialize();
std::ptr::copy(source.as_ptr(), bytes as *mut u8, source.len());
@@ -289,16 +298,20 @@ pub unsafe extern "C" fn atp_serialize_t
/// From a byte buffer, return a `RtPriorityThreadInfo`, with a C API.
///
/// This call is useful on Linux desktop only, when the process is sandboxed and
/// cannot promote itself directly.
///
/// # Arguments
///
/// A byte buffer containing a serializezd `RtPriorityThreadInfo`.
+///
+/// # Safety
+///
+/// This function is safe only and only if pointer is at least ATP_THREAD_INFO_SIZE bytes long.
#[no_mangle]
pub unsafe extern "C" fn atp_deserialize_thread_info(
in_bytes: *mut u8,
) -> *mut atp_thread_info {
let bytes = *(in_bytes as *mut [u8; std::mem::size_of::<RtPriorityThreadInfoInternal>()]);
let thread_info = RtPriorityThreadInfoInternal::deserialize(bytes);
Box::into_raw(Box::new(atp_thread_info(thread_info)))
}
@@ -364,16 +377,20 @@ pub struct atp_thread_info(RtPriorityThr
/// `atp_get_current_thread_info` on the thread to promote.
/// * `audio_buffer_frames` - the exact or an upper limit on the number of frames that have to be
/// rendered each callback, or 0 for a sensible default value.
/// * `audio_samplerate_hz` - the sample-rate for this audio stream, in Hz.
///
/// # Return value
///
/// A pointer to an `atp_handle` in case of success, NULL otherwise.
+///
+/// # Safety
+///
+/// This function is safe as long as the first pointer comes from this library.
#[no_mangle]
pub unsafe extern "C" fn atp_promote_thread_to_real_time(
thread_info: *mut atp_thread_info,
audio_buffer_frames: u32,
audio_samplerate_hz: u32,
) -> *mut atp_handle {
let thread_info = &mut *thread_info;
match promote_thread_to_real_time(thread_info.0, audio_buffer_frames, audio_samplerate_hz) {
@@ -386,16 +403,20 @@ pub unsafe extern "C" fn atp_promote_thr
///
/// # Arguments
///
/// `handle` - an opaque struct received from a promoting function.
///
/// # Return value
///
/// 0 in case of success, non-zero otherwise.
+///
+/// # Safety
+///
+/// This function is safe as long as the first pointer comes from this library, or is null.
#[no_mangle]
pub unsafe extern "C" fn atp_demote_thread_from_real_time(thread_info: *mut atp_thread_info) -> i32 {
if thread_info.is_null() {
return 1;
}
let thread_info = (*thread_info).0;
match demote_thread_from_real_time(thread_info) {
@@ -631,22 +652,22 @@ mod tests {
let info2 = thread_info_deserialize(bytes);
assert!(info == info2);
}
}
#[test]
fn test_remote_promotion() {
let (rd, wr) = pipe().unwrap();
- match fork().expect("fork failed") {
+ match unsafe { fork().expect("fork failed") } {
ForkResult::Parent{ child } => {
eprintln!("Parent PID: {}", getpid());
let mut bytes = [0_u8; std::mem::size_of::<RtPriorityThreadInfo>()];
match read(rd, &mut bytes) {
- Ok(_) => {
+ Ok(_) => {
let info = RtPriorityThreadInfo::deserialize(bytes);
match promote_thread_to_real_time(info, 0, 44100) {
Ok(_) => {
eprintln!("thread promotion in the child from the parent succeeded");
assert!(true);
}
Err(_) => {
eprintln!("promotion Err");
--- a/third_party/rust/audio_thread_priority/src/rt_linux.rs
+++ b/third_party/rust/audio_thread_priority/src/rt_linux.rs
@@ -3,16 +3,17 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
/* Widely copied from dbus-rs/dbus/examples/rtkit.rs */
extern crate dbus;
extern crate libc;
use std::cmp;
+use std::convert::TryInto;
use std::error::Error;
use std::io::Error as OSError;
use dbus::{BusType, Connection, Message, MessageItem, Props};
use crate::AudioThreadPriorityError;
const DBUS_SOCKET_TIMEOUT: i32 = 10_000;
@@ -107,27 +108,27 @@ fn rtkit_set_realtime(thread: u64, pid:
};
let c = Connection::get_private(BusType::System)?;
c.send_with_reply_and_block(m, DBUS_SOCKET_TIMEOUT)?;
Ok(())
}
/// Returns the maximum priority, maximum real-time time slice, and the current real-time time
/// slice for this process.
-fn get_limits() -> Result<(i64, u64, libc::rlimit64), AudioThreadPriorityError> {
+fn get_limits() -> Result<(i64, u64, libc::rlimit), AudioThreadPriorityError> {
let c = Connection::get_private(BusType::System)?;
let p = Props::new(
&c,
"org.freedesktop.RealtimeKit1",
"/org/freedesktop/RealtimeKit1",
"org.freedesktop.RealtimeKit1",
DBUS_SOCKET_TIMEOUT,
);
- let mut current_limit = libc::rlimit64 {
+ let mut current_limit = libc::rlimit {
rlim_cur: 0,
rlim_max: 0,
};
let max_prio = item_as_i64(p.get("MaxRealtimePriority")?)?;
if max_prio < 0 {
return Err(AudioThreadPriorityError::new(
"invalid negative MaxRealtimePriority",
@@ -136,36 +137,41 @@ fn get_limits() -> Result<(i64, u64, lib
let max_rttime = item_as_i64(p.get("RTTimeUSecMax")?)?;
if max_rttime < 0 {
return Err(AudioThreadPriorityError::new(
"invalid negative RTTimeUSecMax",
));
}
- if unsafe { libc::getrlimit64(libc::RLIMIT_RTTIME, &mut current_limit) } < 0 {
+ if unsafe { libc::getrlimit(libc::RLIMIT_RTTIME, &mut current_limit) } < 0 {
return Err(AudioThreadPriorityError::new_with_inner(
- "getrlimit64",
+ "getrlimit",
Box::new(OSError::last_os_error()),
));
}
Ok((max_prio, (max_rttime as u64), current_limit))
}
fn set_limits(request: u64, max: u64) -> Result<(), AudioThreadPriorityError> {
// Set a soft limit to the limit requested, to be able to handle going over the limit using
- // SIGXCPU. Set the hard limit to the maxium slice to prevent getting SIGKILL.
- let new_limit = libc::rlimit64 {
- rlim_cur: request,
- rlim_max: max,
+ // SIGXCPU. Set the hard limit to the maximum slice to prevent getting SIGKILL.
+ #[allow(clippy::useless_conversion)]
+ let new_limit = libc::rlimit {
+ rlim_cur: request
+ .try_into()
+ .map_err(|_| AudioThreadPriorityError::new("setrlimit"))?,
+ rlim_max: max
+ .try_into()
+ .map_err(|_| AudioThreadPriorityError::new("setrlimit"))?,
};
- if unsafe { libc::setrlimit64(libc::RLIMIT_RTTIME, &new_limit) } < 0 {
+ if unsafe { libc::setrlimit(libc::RLIMIT_RTTIME, &new_limit) } < 0 {
return Err(AudioThreadPriorityError::new_with_inner(
- "setrlimit64",
+ "setrlimit",
Box::new(OSError::last_os_error()),
));
}
Ok(())
}
pub fn promote_current_thread_to_real_time_internal(
@@ -267,43 +273,45 @@ pub fn set_real_time_hard_limit_internal
};
let budget_us = (buffer_frames * 1_000_000 / audio_samplerate_hz) as u64;
// It's only necessary to set RLIMIT_RTTIME to something when in the child, skip it if it's a
// remoting call.
let (_, max_rttime, _) = get_limits()?;
// Only take what we need, or cap at the system limit, no further.
- let rttime_request = cmp::min(budget_us, max_rttime as u64);
+ let rttime_request = cmp::min(budget_us, max_rttime);
set_limits(rttime_request, max_rttime)?;
Ok(())
}
/// Promote a thread (possibly in another process) identified by its tid, to real-time.
pub fn promote_thread_to_real_time_internal(
thread_info: RtPriorityThreadInfoInternal,
audio_buffer_frames: u32,
audio_samplerate_hz: u32,
) -> Result<RtPriorityHandleInternal, AudioThreadPriorityError> {
let RtPriorityThreadInfoInternal { pid, thread_id, .. } = thread_info;
let handle = RtPriorityHandleInternal { thread_info };
- let (_, _, limits) = get_limits()?;
set_real_time_hard_limit_internal(audio_buffer_frames, audio_samplerate_hz)?;
let r = rtkit_set_realtime(thread_id as u64, pid as u64, RT_PRIO_DEFAULT);
match r {
Ok(_) => Ok(handle),
Err(e) => {
- if unsafe { libc::setrlimit64(libc::RLIMIT_RTTIME, &limits) } < 0 {
+ let (_, _, limits) = get_limits()?;
+ if limits.rlim_cur != libc::RLIM_INFINITY
+ && unsafe { libc::setrlimit(libc::RLIMIT_RTTIME, &limits) } < 0
+ {
return Err(AudioThreadPriorityError::new_with_inner(
- "setrlimit64",
+ "setrlimit",
Box::new(OSError::last_os_error()),
));
}
Err(AudioThreadPriorityError::new_with_inner(
"Thread promotion error",
e,
))
}
--- a/third_party/rust/audio_thread_priority/src/rt_mach.rs
+++ b/third_party/rust/audio_thread_priority/src/rt_mach.rs
@@ -65,17 +65,17 @@ pub fn demote_current_thread_from_real_t
unsafe {
let mut h = rt_priority_handle;
let rv: kern_return_t = thread_policy_set(
h.tid,
THREAD_TIME_CONSTRAINT_POLICY,
(&mut h.previous_time_constraint_policy) as *mut _ as thread_policy_t,
THREAD_TIME_CONSTRAINT_POLICY_COUNT!(),
);
- if rv != KERN_SUCCESS as i32 {
+ if rv != KERN_SUCCESS {
return Err(AudioThreadPriorityError::new(
"thread demotion error: thread_policy_get: RT",
));
}
info!("thread {} priority restored.", h.tid);
}
@@ -114,17 +114,17 @@ pub fn promote_current_thread_to_real_ti
let mut rv: kern_return_t = thread_policy_get(
tid,
THREAD_TIME_CONSTRAINT_POLICY,
(&mut time_constraints) as *mut _ as thread_policy_t,
&mut count,
&mut get_default,
);
- if rv != KERN_SUCCESS as i32 {
+ if rv != KERN_SUCCESS {
return Err(AudioThreadPriorityError::new(
"thread promotion error: thread_policy_get: time_constraint",
));
}
rt_priority_handle.previous_time_constraint_policy = time_constraints;
let cb_duration = buffer_frames as f32 / (audio_samplerate_hz as f32) * 1000.;
@@ -144,17 +144,17 @@ pub fn promote_current_thread_to_real_ti
};
rv = thread_policy_set(
tid,
THREAD_TIME_CONSTRAINT_POLICY,
(&mut time_constraints) as *mut _ as thread_policy_t,
THREAD_TIME_CONSTRAINT_POLICY_COUNT!(),
);
- if rv != KERN_SUCCESS as i32 {
+ if rv != KERN_SUCCESS {
return Err(AudioThreadPriorityError::new(
"thread promotion error: thread_policy_set: time_constraint",
));
}
info!("thread {} bumped to real time priority.", tid);
}
--- a/third_party/rust/audio_thread_priority/src/rt_win.rs
+++ b/third_party/rust/audio_thread_priority/src/rt_win.rs
@@ -1,72 +1,43 @@
-#[cfg(feature = "windows")]
-mod os {
- pub use windows::Win32::Foundation::GetLastError;
- pub use windows::Win32::Foundation::HANDLE;
- pub use windows::Win32::Foundation::PSTR;
- pub use windows::Win32::System::Threading::{
- AvRevertMmThreadCharacteristics, AvSetMmThreadCharacteristicsA,
- };
-
- pub fn ok(rv: windows::Win32::Foundation::BOOL) -> bool {
- rv.as_bool()
- }
-
- pub fn invalid_handle(handle: HANDLE) -> bool {
- handle.is_invalid()
- }
-}
-#[cfg(feature = "winapi")]
-mod os {
- pub use winapi::shared::ntdef::HANDLE;
- pub use winapi::um::avrt::{AvRevertMmThreadCharacteristics, AvSetMmThreadCharacteristicsA};
- pub use winapi::um::errhandlingapi::GetLastError;
-
- pub fn ok(rv: winapi::shared::minwindef::BOOL) -> bool {
- rv != 0
- }
-
- #[allow(non_snake_case)]
- pub fn PSTR(ptr: *const u8) -> *const i8 {
- ptr as _
- }
-
- pub fn invalid_handle(handle: HANDLE) -> bool {
- handle.is_null()
- }
-}
+use windows_sys::s;
+use windows_sys::Win32::Foundation::GetLastError;
+use windows_sys::Win32::Foundation::FALSE;
+use windows_sys::Win32::Foundation::HANDLE;
+use windows_sys::Win32::System::Threading::{
+ AvRevertMmThreadCharacteristics, AvSetMmThreadCharacteristicsA,
+};
use crate::AudioThreadPriorityError;
use log::info;
#[derive(Debug)]
pub struct RtPriorityHandleInternal {
mmcss_task_index: u32,
- task_handle: os::HANDLE,
+ task_handle: HANDLE,
}
impl RtPriorityHandleInternal {
- pub fn new(mmcss_task_index: u32, task_handle: os::HANDLE) -> RtPriorityHandleInternal {
+ pub fn new(mmcss_task_index: u32, task_handle: HANDLE) -> RtPriorityHandleInternal {
RtPriorityHandleInternal {
mmcss_task_index,
task_handle,
}
}
}
pub fn demote_current_thread_from_real_time_internal(
rt_priority_handle: RtPriorityHandleInternal,
) -> Result<(), AudioThreadPriorityError> {
- let rv = unsafe { os::AvRevertMmThreadCharacteristics(rt_priority_handle.task_handle) };
- if !os::ok(rv) {
+ let rv = unsafe { AvRevertMmThreadCharacteristics(rt_priority_handle.task_handle) };
+ if rv == FALSE {
return Err(AudioThreadPriorityError::new(&format!(
"Unable to restore the thread priority ({:?})",
- unsafe { os::GetLastError() }
+ unsafe { GetLastError() }
)));
}
info!(
"task {} priority restored.",
rt_priority_handle.mmcss_task_index
);
@@ -74,24 +45,23 @@ pub fn demote_current_thread_from_real_t
}
pub fn promote_current_thread_to_real_time_internal(
_audio_buffer_frames: u32,
_audio_samplerate_hz: u32,
) -> Result<RtPriorityHandleInternal, AudioThreadPriorityError> {
let mut task_index = 0u32;
- let handle =
- unsafe { os::AvSetMmThreadCharacteristicsA(os::PSTR("Audio\0".as_ptr()), &mut task_index) };
+ let handle = unsafe { AvSetMmThreadCharacteristicsA(s!("Audio"), &mut task_index) };
let handle = RtPriorityHandleInternal::new(task_index, handle);
- if os::invalid_handle(handle.task_handle) {
+ if handle.task_handle == 0 {
return Err(AudioThreadPriorityError::new(&format!(
"Unable to restore the thread priority ({:?})",
- unsafe { os::GetLastError() }
+ unsafe { GetLastError() }
)));
}
info!(
"task {} bumped to real time priority.",
handle.mmcss_task_index
);
--- a/third_party/rust/audioipc2-client/.cargo-checksum.json
+++ b/third_party/rust/audioipc2-client/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"234b81b986ab93768ccacc68d973d6125e3769337d4b0a7b137d19d1666db8a4","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"86d31460a48a9bdc0ac4fbef522d267c26f68dd79a12e0cbc35b3a4b6f6449dc","src/lib.rs":"c4a6797734489280f6b97dd72c9e51a7bd7be4104592eece3929e29d45cbca4a","src/send_recv.rs":"859abe75b521eb4297c84b30423814b5b87f3c7741ad16fe72189212e123e1ac","src/stream.rs":"3101f4052e35c1600adafedc67aed92d7d5531ff0ff4845de0a5ea3cedef872d"},"package":null}
\ No newline at end of file
+{"files":{"Cargo.toml":"d7cfe88a0f0086d4216e3f4ad3de0620417fcbda61c9852476459a9249131996","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/context.rs":"86d31460a48a9bdc0ac4fbef522d267c26f68dd79a12e0cbc35b3a4b6f6449dc","src/lib.rs":"c4a6797734489280f6b97dd72c9e51a7bd7be4104592eece3929e29d45cbca4a","src/send_recv.rs":"859abe75b521eb4297c84b30423814b5b87f3c7741ad16fe72189212e123e1ac","src/stream.rs":"3101f4052e35c1600adafedc67aed92d7d5531ff0ff4845de0a5ea3cedef872d"},"package":null}
\ No newline at end of file
--- a/third_party/rust/audioipc2-client/Cargo.toml
+++ b/third_party/rust/audioipc2-client/Cargo.toml
@@ -16,15 +16,18 @@ version = "0.5.0"
authors = [
"Matthew Gregan <kinetik@flim.org>",
"Dan Glastonbury <dan.glastonbury@gmail.com>",
]
description = "Cubeb Backend for talking to remote cubeb server."
license = "ISC"
[dependencies]
-audio_thread_priority = "0.26"
cubeb-backend = "0.10"
log = "0.4"
+[dependencies.audio_thread_priority]
+version = "0.30"
+default-features = false
+
[dependencies.audioipc]
path = "../audioipc"
package = "audioipc2"
--- a/third_party/rust/audioipc2-server/.cargo-checksum.json
+++ b/third_party/rust/audioipc2-server/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"9c801164c20a9af8c43135848244112002bd07a05b1c7165c2eb7be2db23898b","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"06aff4fd1326aeabb16b01f81a6f3c59c1717ebe96285a063724830cdf30303a","src/server.rs":"ea839fe4607ba6b70a1ef5dfb2305eb668b148820c5590b87192609fbe3c9edd"},"package":null}
\ No newline at end of file
+{"files":{"Cargo.toml":"4e66d9ec1e8baa7ad01ace373a921bc019e38bcb23f782be1daa8578f40b6086","cbindgen.toml":"fb6abe1671497f432a06e40b1db7ed7cd2cceecbd9a2382193ad7534e8855e34","src/lib.rs":"06aff4fd1326aeabb16b01f81a6f3c59c1717ebe96285a063724830cdf30303a","src/server.rs":"ea839fe4607ba6b70a1ef5dfb2305eb668b148820c5590b87192609fbe3c9edd"},"package":null}
\ No newline at end of file
--- a/third_party/rust/audioipc2-server/Cargo.toml
+++ b/third_party/rust/audioipc2-server/Cargo.toml
@@ -16,21 +16,24 @@ version = "0.5.0"
authors = [
"Matthew Gregan <kinetik@flim.org>",
"Dan Glastonbury <dan.glastonbury@gmail.com>",
]
description = "Remote cubeb server"
license = "ISC"
[dependencies]
-audio_thread_priority = "0.26"
cubeb-core = "0.10.0"
log = "0.4"
once_cell = "1.2.0"
slab = "0.4"
+[dependencies.audio_thread_priority]
+version = "0.30"
+default-features = false
+
[dependencies.audioipc]
path = "../audioipc"
package = "audioipc2"
[dependencies.error-chain]
version = "0.12.0"
default-features = false
--- a/third_party/rust/audioipc2/.cargo-checksum.json
+++ b/third_party/rust/audioipc2/.cargo-checksum.json
@@ -1,1 +1,1 @@
-{"files":{"Cargo.toml":"8434bf0fc2131bdca6655fc0e6ff3b87218c92f342785dd453a4018ed1a70b52","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"65df9a97c6cdaa3faf72581f04ac289197b0b1797d69d22c1796e957ff1089e2","src/codec.rs":"38408b512d935cd7889a03b25dd14b36083ec4e6d2fcabd636182cf45e3d50bc","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"ba339eebdc2d8a6d0cb9b294344809e63e404e220fda643b63a8a3ff63a755e8","src/lib.rs":"3881e9069f37e824cbb5dacf1c37192c08b84068098fef96ede6f2ae284edfe3","src/messages.rs":"452362da2cace9a0f2e3134c190ecb6a9997f8be4036cde06643e17c6c238240","src/rpccore.rs":"025b6614f1c42b96b0a8e74fd7881032d338c66e0d67ec0af70f910a9e30ebe1","src/shm.rs":"f8bc0ab17e04b86a746aea7aa4eb15f402e29d80e0d2f9d7c22ac8375a0cea85","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"6f0236bf6cd66ccd237b268348a826ae1d266073c2adadcfaae703c556230065","src/sys/unix/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/sys/unix/mod.rs":"59835f0d5509940078b1820a54f49fc5514adeb3e45e7d21e3ab917431da2e74","src/sys/unix/msg.rs":"0e297d73bae9414184f85c2209cca0a3fde6d999a3f1d3f42faa3f56b6d57233","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
\ No newline at end of file
+{"files":{"Cargo.toml":"4d025a5bf0f59f660b3b52ec6a0da028f61269b17e4e33041b768ea07b8a9448","benches/serialization.rs":"d56855d868dab6aa22c8b03a61084535351b76c94b68d8b1d20764e352fe473f","build.rs":"65df9a97c6cdaa3faf72581f04ac289197b0b1797d69d22c1796e957ff1089e2","src/codec.rs":"38408b512d935cd7889a03b25dd14b36083ec4e6d2fcabd636182cf45e3d50bc","src/errors.rs":"67a4a994d0724397657581cde153bdfc05ce86e7efc467f23fafc8f64df80fa4","src/ipccore.rs":"ba339eebdc2d8a6d0cb9b294344809e63e404e220fda643b63a8a3ff63a755e8","src/lib.rs":"3881e9069f37e824cbb5dacf1c37192c08b84068098fef96ede6f2ae284edfe3","src/messages.rs":"452362da2cace9a0f2e3134c190ecb6a9997f8be4036cde06643e17c6c238240","src/rpccore.rs":"025b6614f1c42b96b0a8e74fd7881032d338c66e0d67ec0af70f910a9e30ebe1","src/shm.rs":"f8bc0ab17e04b86a746aea7aa4eb15f402e29d80e0d2f9d7c22ac8375a0cea85","src/sys/mod.rs":"e6fa1d260abf093e1f7b50185195e2d3aee0eb8c9774c6f253953b5896d838f3","src/sys/unix/cmsg.rs":"6f0236bf6cd66ccd237b268348a826ae1d266073c2adadcfaae703c556230065","src/sys/unix/cmsghdr.c":"d7344b3dc15cdce410c68669b848bb81f7fe36362cd3699668cb613fa05180f8","src/sys/unix/mod.rs":"59835f0d5509940078b1820a54f49fc5514adeb3e45e7d21e3ab917431da2e74","src/sys/unix/msg.rs":"0e297d73bae9414184f85c2209cca0a3fde6d999a3f1d3f42faa3f56b6d57233","src/sys/windows/mod.rs":"7eaabb76e62c6962b636320e2bbf79a78fce61659c799a798f7dd6d56b0be8a1"},"package":null}
\ No newline at end of file
--- a/third_party/rust/audioipc2/Cargo.toml
+++ b/third_party/rust/audioipc2/Cargo.toml
@@ -58,17 +58,17 @@ features = ["html_reports"]
[build-dependencies]
cc = "1.0"
[target."cfg(target_os = \"android\")".dependencies]
ashmem = "0.1.2"
[target."cfg(target_os = \"linux\")".dependencies.audio_thread_priority]
-version = "0.26.1"
+version = "0.30"
default-features = false
[target."cfg(unix)".dependencies]
arrayvec = "0.7"
iovec = "0.1"
libc = "0.2"
memmap2 = "0.5"
--- a/toolkit/library/rust/shared/Cargo.toml
+++ b/toolkit/library/rust/shared/Cargo.toml
@@ -20,18 +20,18 @@ xpcom = { path = "../../../../xpcom/rust
prefs_parser = { path = "../../../../modules/libpref/parser" }
static_prefs = { path = "../../../../modules/libpref/init/static_prefs" }
profiler_helper = { path = "../../../../tools/profiler/rust-helper", optional = true }
mozurl = { path = "../../../../netwerk/base/mozurl" }
webrender_bindings = { path = "../../../../gfx/webrender_bindings" }
cubeb-coreaudio = { git = "https://github.com/mozilla/cubeb-coreaudio-rs", rev = "93b5c01a131f65c83c11aeb317f4583405c5eb79", optional = true }
cubeb-pulse = { git = "https://github.com/mozilla/cubeb-pulse-rs", rev="cf48897be5cbe147d051ebbbe1eaf5fd8fb6bbc9", optional = true, features=["pulse-dlopen"] }
cubeb-sys = { version = "0.10.3", optional = true, features=["gecko-in-tree"] }
-audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "ec6af6ecf8ba50b51f13d18f417de8cfb8460543", optional = true }
-audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "ec6af6ecf8ba50b51f13d18f417de8cfb8460543", optional = true }
+audioipc2-client = { git = "https://github.com/mozilla/audioipc", rev = "6be424d75f1367e70f2f5ddcacd6d0237e81a6a9", optional = true }
+audioipc2-server = { git = "https://github.com/mozilla/audioipc", rev = "6be424d75f1367e70f2f5ddcacd6d0237e81a6a9", optional = true }
encoding_glue = { path = "../../../../intl/encoding_glue" }
authrs_bridge = { path = "../../../../dom/webauthn/authrs_bridge" }
gkrust_utils = { path = "../../../../xpcom/rust/gkrust_utils" }
gecko_logger = { path = "../../../../xpcom/rust/gecko_logger" }
rsdparsa_capi = { path = "../../../../dom/media/webrtc/sdp/rsdparsa_capi" }
# We have these to enforce common feature sets for said crates.
log = {version = "0.4", features = ["release_max_level_info"]}
cose-c = { version = "0.1.5" }
@@ -39,17 +39,17 @@ jsrust_shared = { path = "../../../../js
cascade_bloom_filter = { path = "../../../components/cascade_bloom_filter" }
cert_storage = { path = "../../../../security/manager/ssl/cert_storage" }
crypto_hash = { path = "../../../../security/manager/ssl/crypto_hash" }
data_storage = { path = "../../../../security/manager/ssl/data_storage" }
bitsdownload = { path = "../../../components/bitsdownload", optional = true }
storage = { path = "../../../../storage/rust" }
bookmark_sync = { path = "../../../components/places/bookmark_sync", optional = true }
chardetng_c = "0.1.1"
-audio_thread_priority = { version = "0.26.1", default_features = false, features = ["winapi"] }
+audio_thread_priority = { version = "0.30", default_features = false }
mdns_service = { path="../../../../dom/media/webrtc/transport/mdns_service", optional = true }
neqo_glue = { path = "../../../../netwerk/socket/neqo_glue" }
wgpu_bindings = { path = "../../../../gfx/wgpu_bindings" }
mapped_hyph = { git = "https://github.com/jfkthame/mapped_hyph.git", rev = "c7651a0cffff41996ad13c44f689bd9cd2192c01" }
fog_control = { path = "../../../components/glean" }
app_services_logger = { path = "../../../../services/common/app_services_logger" }
http_sfv = { path = "../../../../netwerk/base/http-sfv" }
unic-langid = { version = "0.9", features = ["likelysubtags"] }

View file

@ -0,0 +1,13 @@
diff --git a/third_party/rust/getrandom/src/util_libc.rs.orig b/third_party/rust/getrandom/src/util_libc.rs
index 3cecb1d..6316b38 100644
--- a/third_party/rust/getrandom/src/util_libc.rs.orig
+++ b/third_party/rust/getrandom/src/util_libc.rs
@@ -101,7 +101,7 @@ impl Weak {
cfg_if! {
if #[cfg(any(target_os = "linux", target_os = "emscripten"))] {
- use libc::open64 as open;
+ use libc::open as open;
} else {
use libc::open;
}

View file

@ -1,79 +0,0 @@
diff --git a/fetch_xulrunner.sh.orig b/fetch_xulrunner.sh
index b1e812f..ca3caa5 100755
--- a/fetch_xulrunner.sh.orig
+++ b/fetch_xulrunner.sh
@@ -114,15 +114,6 @@ function modify_omni {
replace_line 'MOZ_CRASHREPORTER:' 'MOZ_CRASHREPORTER: false \&\&' modules/AppConstants.jsm
replace_line 'MOZ_UPDATE_CHANNEL:.+' 'MOZ_UPDATE_CHANNEL: "none",' modules/AppConstants.jsm
replace_line '"https:\/\/[^\/]+mozilla.com.+"' '""' modules/AppConstants.jsm
-
- replace_line 'if \(!updateAuto\) \{' 'if (update.type == "major") {
- LOG("UpdateService:_selectAndInstallUpdate - prompting because it is a major update");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
- Services.obs.notifyObservers(update, "update-available", "show-prompt");
- return;
- }
- if (!updateAuto) {' modules/UpdateService.jsm
-
replace_line 'pref\("network.captive-portal-service.enabled".+' 'pref("network.captive-portal-service.enabled", false);' greprefs.js
replace_line 'pref\("network.connectivity-service.enabled".+' 'pref("network.connectivity-service.enabled", false);' greprefs.js
replace_line 'pref\("toolkit.telemetry.server".+' 'pref("toolkit.telemetry.server", "");' greprefs.js
@@ -368,31 +359,13 @@ fi
if [ $BUILD_LINUX == 1 ]; then
GECKO_VERSION="$GECKO_VERSION_LINUX"
- DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
- rm -rf firefox
-
- curl -O "$DOWNLOAD_URL/linux-i686/en-US/firefox-$GECKO_VERSION.tar.bz2"
- rm -rf firefox-i686
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-i686
-
- pushd firefox-i686
- modify_omni linux32
- popd
-
- rm "firefox-$GECKO_VERSION.tar.bz2"
-
- curl -O "$DOWNLOAD_URL/linux-x86_64/en-US/firefox-$GECKO_VERSION.tar.bz2"
rm -rf firefox-x86_64
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-x86_64
-
- pushd firefox-x86_64
- modify_omni linux64
- popd
-
- rm "firefox-$GECKO_VERSION.tar.bz2"
+ cp -r /usr/lib/firefox-esr firefox-x86_64
+
+ pushd firefox-x86_64
+ modify_omni linux64
+ popd
fi
echo Done
diff --git a/build.sh.orig b/build.sh
index 893f9fb..51ae170 100755
--- a/build.sh.orig
+++ b/build.sh
@@ -794,7 +794,7 @@ fi
# Linux
if [ $BUILD_LINUX == 1 ]; then
- for arch in "i686" "x86_64"; do
+ for arch in "x86_64"; do
runtime_path="${LINUX_RUNTIME_PATH_PREFIX}${arch}"
# Set up directory
@@ -807,7 +807,7 @@ if [ $BUILD_LINUX == 1 ]; then
cp -r "$runtime_path/"!(application.ini|browser|defaults|devtools-files|crashreporter|crashreporter.ini|firefox|pingsender|precomplete|removed-files|run-mozilla.sh|update-settings.ini|updater|updater.ini) "$APPDIR"
# Use our own launcher that calls the original Firefox executable with -app
- mv "$APPDIR"/firefox-bin "$APPDIR"/zotero-bin
+ mv "$APPDIR"/firefox-esr "$APPDIR"/zotero-bin
cp "$CALLDIR/linux/zotero" "$APPDIR"/zotero
# Copy Ubuntu launcher files

View file

@ -0,0 +1,63 @@
diff --git a/app/scripts/fetch_xulrunner.orig b/app/scripts/fetch_xulrunner
index 8b3d918..c6a96ff 100755
--- a/app/scripts/fetch_xulrunner.orig
+++ b/app/scripts/fetch_xulrunner
@@ -132,15 +132,6 @@ function modify_omni {
# Continue using app.update.auto in prefs.js on Windows
replace_line 'PER_INSTALLATION_PREFS_PLATFORMS = \["win"\]' 'PER_INSTALLATION_PREFS_PLATFORMS = []' modules/UpdateUtils.jsm
- # Prompt if major update is available instead of installing automatically on restart
- replace_line 'if \(!updateAuto\) \{' 'if (update.type == "major") {
- LOG("UpdateService:_selectAndInstallUpdate - prompting because it is a major update");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
- Services.obs.notifyObservers(update, "update-available", "show-prompt");
- return;
- }
- if (!updateAuto) {' modules/UpdateService.jsm
-
# Avoid console warning about resource://gre/modules/FxAccountsCommon.js
replace_line 'const logins = this._data.logins;' 'const logins = this._data.logins; if (this._data.logins.length != -1) return;' modules/LoginStore.jsm
@@ -470,36 +461,15 @@ fi
if [ $BUILD_LINUX == 1 ]; then
GECKO_VERSION="$GECKO_VERSION_LINUX"
- DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
+ rm -rf firefox-x86_64
- # Include 32-bit build if not in CI
- if [[ "${CI:-}" = "1" ]] || [[ "${SKIP_32:-}" = "1" ]]; then
- arches="x86_64"
- else
- arches="i686 x86_64"
- fi
- for arch in $arches; do
- xdir="firefox-$arch"
- rm -rf $xdir
-
- archived_file="firefox-$GECKO_VERSION-$arch.tar.bz2"
- if [ -e "$archived_file" ]; then
- echo "Using $archived_file"
- cp "$archived_file" "firefox-$GECKO_VERSION.tar.bz2"
- else
- curl -O "$DOWNLOAD_URL/linux-$arch/en-US/firefox-$GECKO_VERSION.tar.bz2"
- fi
-
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-$arch
+ cp -r /usr/lib/firefox-esr firefox-x86_64
+
+ pushd firefox-x86_64
+ modify_omni linux64
+ popd
- pushd firefox-$arch
- modify_omni
- popd
- echo $($SCRIPT_DIR/xulrunner_hash -p l) > hash-linux
- rm "firefox-$GECKO_VERSION.tar.bz2"
- done
fi
echo Done

View file

@ -0,0 +1,104 @@
diff --git a/app/build.sh b/app/build.sh
index 649d629..7d078b8 100755
--- a/app/build.sh
+++ b/app/build.sh
@@ -59,10 +59,7 @@ function abspath {
}
function check_lfs_file {
- if [ "$(head --bytes 5 "$1")" = "versi" ]; then
- echo "$1 not checked out -- install Git LFS and run 'git lfs pull'" >&2
- exit 1
- fi
+ return 0
}
SOURCE_DIR=""
@@ -840,18 +837,13 @@ if [ $BUILD_LINUX == 1 ]; then
cp -r "$runtime_path/"!(application.ini|browser|defaults|devtools-files|crashreporter|crashreporter.ini|firefox|pingsender|precomplete|removed-files|run-mozilla.sh|update-settings.ini|updater|updater.ini) "$APPDIR"
# Use our own launcher that calls the original Firefox executable with -app
- mv "$APPDIR"/firefox-bin "$APPDIR"/zotero-bin
+ mv "$APPDIR"/firefox-esr "$APPDIR"/zotero-bin
cp "$CALLDIR/linux/zotero" "$APPDIR"/zotero
# Copy Ubuntu launcher files
cp "$CALLDIR/linux/zotero.desktop" "$APPDIR"
cp "$CALLDIR/linux/set_launcher_icon" "$APPDIR"
- # Use our own updater, because Mozilla's requires updates signed by Mozilla
- check_lfs_file "$CALLDIR/linux/updater.tar.xz"
- tar xf "$CALLDIR/linux/updater.tar.xz" --to-stdout updater-$arch > "$APPDIR/updater"
- chmod 755 "$APPDIR/updater"
-
# Copy app files
rsync -a "$base_dir/" "$APPDIR/"
@@ -860,6 +852,7 @@ if [ $BUILD_LINUX == 1 ]; then
cp -RH "$CALLDIR/modules/zotero-libreoffice-integration/install" "$APPDIR/integration/libreoffice"
# Copy icons
+ mkdir -p "$APPDIR"/icons
cp "$CALLDIR/linux/icons/icon128.png" "$APPDIR/icons/"
cp "$CALLDIR/linux/icons/symbolic.svg" "$APPDIR/icons/"
diff --git a/app/scripts/fetch_xulrunner b/app/scripts/fetch_xulrunner
index 8b3d918..120b085 100755
--- a/app/scripts/fetch_xulrunner
+++ b/app/scripts/fetch_xulrunner
@@ -132,15 +132,6 @@ function modify_omni {
# Continue using app.update.auto in prefs.js on Windows
replace_line 'PER_INSTALLATION_PREFS_PLATFORMS = \["win"\]' 'PER_INSTALLATION_PREFS_PLATFORMS = []' modules/UpdateUtils.jsm
- # Prompt if major update is available instead of installing automatically on restart
- replace_line 'if \(!updateAuto\) \{' 'if (update.type == "major") {
- LOG("UpdateService:_selectAndInstallUpdate - prompting because it is a major update");
- AUSTLMY.pingCheckCode(this._pingSuffix, AUSTLMY.CHK_SHOWPROMPT_PREF);
- Services.obs.notifyObservers(update, "update-available", "show-prompt");
- return;
- }
- if (!updateAuto) {' modules/UpdateService.jsm
-
# Avoid console warning about resource://gre/modules/FxAccountsCommon.js
replace_line 'const logins = this._data.logins;' 'const logins = this._data.logins; if (this._data.logins.length != -1) return;' modules/LoginStore.jsm
@@ -470,36 +461,11 @@ fi
if [ $BUILD_LINUX == 1 ]; then
GECKO_VERSION="$GECKO_VERSION_LINUX"
- DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
+ pushd firefox-x86_64
+ modify_omni linux64
+ popd
- # Include 32-bit build if not in CI
- if [[ "${CI:-}" = "1" ]] || [[ "${SKIP_32:-}" = "1" ]]; then
- arches="x86_64"
- else
- arches="i686 x86_64"
- fi
- for arch in $arches; do
- xdir="firefox-$arch"
- rm -rf $xdir
-
- archived_file="firefox-$GECKO_VERSION-$arch.tar.bz2"
- if [ -e "$archived_file" ]; then
- echo "Using $archived_file"
- cp "$archived_file" "firefox-$GECKO_VERSION.tar.bz2"
- else
- curl -O "$DOWNLOAD_URL/linux-$arch/en-US/firefox-$GECKO_VERSION.tar.bz2"
- fi
-
- tar xvf firefox-$GECKO_VERSION.tar.bz2
- mv firefox firefox-$arch
-
- pushd firefox-$arch
- modify_omni
- popd
- echo $($SCRIPT_DIR/xulrunner_hash -p l) > hash-linux
- rm "firefox-$GECKO_VERSION.tar.bz2"
- done
fi
echo Done