Update build scripts for Linux ARM64

This doesn't include an ARM updater, so those lines in build.sh need to
be commented out for the build to succeed.

Addresses #3515
This commit is contained in:
Dan Stillman 2025-02-21 06:31:01 -05:00
parent 6eb8a80e12
commit 735ae1cf09
6 changed files with 46 additions and 29 deletions

View file

@ -8,7 +8,7 @@ ID=zotero@zotero.org
[Gecko]
MinVersion=128.0
MaxVersion=128.99.*
MaxVersion=140.99.*
[XRE]
EnableExtensionManager=1

View file

@ -925,7 +925,7 @@ if [ $BUILD_LINUX == 1 ]; then
if [[ "${ZOTERO_TEST:-}" = "1" ]] || [[ "${SKIP_32:-}" = "1" ]]; then
archs="x86_64"
else
archs="i686 x86_64"
archs="i686 x86_64 arm64"
fi
for arch in $archs; do
@ -982,9 +982,9 @@ if [ $BUILD_LINUX == 1 ]; then
if [ $PACKAGE == 1 ]; then
# Create tar
rm -f "$DIST_DIR/Zotero-${VERSION}_linux-$arch.tar.bz2"
rm -f "$DIST_DIR/Zotero-${VERSION}_linux-$arch.tar.xz"
cd "$STAGE_DIR"
tar -cjf "$DIST_DIR/Zotero-${VERSION}_linux-$arch.tar.bz2" "Zotero_linux-$arch"
tar -cJf "$DIST_DIR/Zotero-${VERSION}_linux-$arch.tar.xz" "Zotero_linux-$arch"
fi
done
fi

View file

@ -1,9 +1,9 @@
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
# Version of Gecko to build with
GECKO_VERSION_MAC="128.9.0esr"
GECKO_VERSION_LINUX="128.9.0esr"
GECKO_VERSION_WIN="128.9.0esr"
GECKO_VERSION_MAC="128.7.0esr"
GECKO_VERSION_LINUX="140.0esr"
GECKO_VERSION_WIN="128.6.0esr"
RUST_VERSION=1.78.0
# URL prefix for custom builds of Firefox components

View file

@ -75,7 +75,11 @@ fi
if [ "`uname`" = "Darwin" ]; then
command="Zotero.app/Contents/MacOS/zotero"
elif [ "`uname`" = "Linux" ]; then
command="Zotero_linux-x86_64/zotero"
if [[ "`uname -m`" = "aarch64" ]]; then
command="Zotero_linux-arm64/zotero"
else
command="Zotero_linux-x86_64/zotero"
fi
elif [ "`uname -o 2> /dev/null`" = "Cygwin" ]; then
command="Zotero_win-x64/zotero.exe"
else

View file

@ -395,15 +395,15 @@ function modify_omni {
<html:link rel="stylesheet" href="chrome:\/\/zotero-platform\/content\/zotero.css"' \
chrome/toolkit/content/global/commonDialog.xhtml
# commonDialog.xhtml can be opened via Services.prompt in the Profile Manager, so check for a profile first
replace_line '<script>' \
'<script>
replace_line 'function commonDialogOnLoad\(\) \{' \
'function commonDialogOnLoad() {
try {
Services.dirsvc.get(\"ProfD\", Ci.nsIFile);
Services.scriptloader.loadSubScript(\"chrome:\/\/zotero\/content\/include.js\", this);
Services.scriptloader.loadSubScript(\"chrome:\/\/zotero\/content\/titlebar.js\", this);
Services.scriptloader.loadSubScript(\"chrome:\/\/zotero\/content\/customElements.js\", this);
} catch (e) {}' \
chrome/toolkit/content/global/commonDialog.xhtml
chrome/toolkit/content/global/commonDialog.js
# Use native checkbox instead of Firefox-themed version in prompt dialogs
replace_line '<xul:checkbox' '<xul:checkbox native=\"true\"' chrome/toolkit/content/global/commonDialog.xhtml
@ -623,34 +623,43 @@ if [ $BUILD_LINUX == 1 ]; then
DOWNLOAD_URL="https://ftp.mozilla.org/pub/firefox/releases/$GECKO_VERSION"
# Include 32-bit build if not in CI
if [[ "${CI:-}" = "1" ]] || [[ "${SKIP_32:-}" = "1" ]]; then
# CI only needs x86_64
if [[ "${CI:-}" = "1" ]]; then
arches="x86_64"
# Specific architecture (used by dir_build)
elif [[ -n "${ARCH:-}" ]]; then
arches="$ARCH"
# Not specified; fetch all
else
arches="i686 x86_64"
arches="i686 x86_64 arm64"
fi
for arch in $arches; do
xdir="firefox-$arch"
rm -rf $xdir
archived_file="firefox-$GECKO_VERSION-$arch.tar.bz2"
archived_file="firefox-$GECKO_VERSION-$arch.tar.xz"
if [ -e "$archived_file" ]; then
echo "Using $archived_file"
cp "$archived_file" "firefox-$GECKO_VERSION.tar.bz2"
cp "$archived_file" "firefox-$GECKO_VERSION.tar.xz"
else
curl -O "$DOWNLOAD_URL/linux-$arch/en-US/firefox-$GECKO_VERSION.tar.bz2"
if [ $arch = "arm64" ]; then
moz_arch=aarch64
else
moz_arch=$arch
fi
curl -O "$DOWNLOAD_URL/linux-$moz_arch/en-US/firefox-$GECKO_VERSION.tar.xz"
# Store local copy of unmodified app
cp "firefox-$GECKO_VERSION.tar.bz2" "$archived_file"
cp "firefox-$GECKO_VERSION.tar.xz" "$archived_file"
fi
tar xvf firefox-$GECKO_VERSION.tar.bz2
tar xvf firefox-$GECKO_VERSION.tar.xz
mv firefox firefox-$arch
pushd firefox-$arch
modify_omni $arch
popd
echo $($SCRIPT_DIR/xulrunner_hash -p l) > hash-linux
rm "firefox-$GECKO_VERSION.tar.bz2"
rm "firefox-$GECKO_VERSION.tar.xz"
done
fi

View file

@ -140,15 +140,16 @@ for version in "$FROM" "$TO"; do
WIN32_ARCHIVE="Zotero-${version}_win32.zip"
WIN_X64_ARCHIVE="Zotero-${version}_win-x64.zip"
WIN_ARM64_ARCHIVE="Zotero-${version}_win-arm64.zip"
LINUX_X86_ARCHIVE="Zotero-${version}_linux-i686.tar.bz2"
LINUX_X86_64_ARCHIVE="Zotero-${version}_linux-x86_64.tar.bz2"
LINUX_X86_ARCHIVE="Zotero-${version}_linux-i686.tar.xz"
LINUX_X86_64_ARCHIVE="Zotero-${version}_linux-x86_64.tar.xz"
LINUX_ARM64_ARCHIVE="Zotero-${version}_linux-arm64.tar.xz"
CACHE_DIR="$ROOT_DIR/cache"
if [ ! -e "$CACHE_DIR" ]; then
mkdir "$CACHE_DIR"
fi
for archive in "$MAC_ARCHIVE" "$WIN32_ARCHIVE" "$WIN_X64_ARCHIVE" "$WIN_ARM64_ARCHIVE" "$LINUX_X86_ARCHIVE" "$LINUX_X86_64_ARCHIVE"; do
for archive in "$MAC_ARCHIVE" "$WIN32_ARCHIVE" "$WIN_X64_ARCHIVE" "$WIN_ARM64_ARCHIVE" "$LINUX_X86_ARCHIVE" "$LINUX_X86_64_ARCHIVE" "$LINUX_ARM64_ARCHIVE"; do
if [[ $archive = "$MAC_ARCHIVE" ]] && [[ $BUILD_MAC != 1 ]]; then
continue
fi
@ -167,6 +168,9 @@ for version in "$FROM" "$TO"; do
if [[ $archive = "$LINUX_X86_64_ARCHIVE" ]] && [[ $BUILD_LINUX != 1 ]]; then
continue
fi
if [[ $archive = "$LINUX_ARM64_ARCHIVE" ]] && [[ $BUILD_LINUX != 1 ]]; then
continue
fi
ETAG_FILE="$CACHE_DIR/$archive.etag"
@ -244,14 +248,14 @@ for version in "$FROM" "$TO"; do
# Unpack Linux tarballs
if [ $BUILD_LINUX == 1 ]; then
if [[ -f "$LINUX_X86_ARCHIVE" ]] && [[ -f "$LINUX_X86_64_ARCHIVE" ]]; then
for build in "$LINUX_X86_ARCHIVE" "$LINUX_X86_64_ARCHIVE"; do
tar -xjf "$build"
if [[ -f "$LINUX_X86_ARCHIVE" ]] && [[ -f "$LINUX_X86_64_ARCHIVE" ]] && [[ -f "$LINUX_ARM64_ARCHIVE" ]]; then
for build in "$LINUX_X86_ARCHIVE" "$LINUX_X86_64_ARCHIVE" "$LINUX_ARM64_ARCHIVE"; do
tar -xf "$build"
rm "$build"
done
INCREMENTALS_FOUND=1
else
echo "$LINUX_X86_ARCHIVE/$LINUX_X86_64_ARCHIVE not found"
echo "$LINUX_X86_ARCHIVE/$LINUX_X86_64_ARCHIVE/$LINUX_ARM64_ARCHIVE not found"
fi
fi
@ -263,7 +267,7 @@ export MOZ_PRODUCT_VERSION="$TO"
export MAR_CHANNEL_ID="$CHANNEL"
CHANGES_MADE=0
for build in "mac" "win32" "win-x64" "win-arm64" "linux-i686" "linux-x86_64"; do
for build in "mac" "win32" "win-x64" "win-arm64" "linux-i686" "linux-x86_64" "linux-arm64"; do
if [[ $build == "mac" ]]; then
if [[ $BUILD_MAC == 0 ]]; then
continue
@ -273,7 +277,7 @@ for build in "mac" "win32" "win-x64" "win-arm64" "linux-i686" "linux-x86_64"; do
if ([[ $build == "win32" ]] || [[ $build == "win-x64" ]] || [[ $build == "win-arm64" ]]) && [[ $BUILD_WIN == 0 ]]; then
continue
fi
if ([[ $build == "linux-i686" ]] || [[ $build == "linux-x86_64" ]]) && [[ $BUILD_LINUX == 0 ]]; then
if ([[ $build == "linux-i686" ]] || [[ $build == "linux-x86_64" ]] || [[ $build == "linux-arm64" ]]) && [[ $BUILD_LINUX == 0 ]]; then
continue
fi
dir="Zotero_$build"