59 lines
1.6 KiB
Bash
59 lines
1.6 KiB
Bash
#!/bin/bash
|
|
|
|
# Define source paths
|
|
SOURCE_PATH="/home/user/mozilla-central"
|
|
SOURCE_REPO="https://hg.mozilla.org/mozilla-central"
|
|
|
|
# Function to download Firefox source if not present
|
|
download_source() {
|
|
if [ ! -d "$SOURCE_PATH" ]; then
|
|
echo "Firefox source not found. Cloning from repository..."
|
|
hg clone $SOURCE_REPO $SOURCE_PATH || { echo "Failed to clone Firefox repository. Exiting."; exit 1; }
|
|
else
|
|
echo "Firefox source already exists."
|
|
fi
|
|
}
|
|
|
|
# Function to discard uncommitted changes
|
|
discard_changes() {
|
|
echo "Discarding uncommitted changes..."
|
|
hg revert --all --no-backup
|
|
}
|
|
|
|
# Function to clean build
|
|
clean_build() {
|
|
echo "Cleaning build..."
|
|
./mach clobber
|
|
}
|
|
|
|
# Function to update Mozilla repository
|
|
update_repo() {
|
|
echo "Updating Mozilla repository..."
|
|
hg pull -u || { echo "Failed to update Mozilla repository. Exiting."; exit 1; }
|
|
./mach update || { echo "Failed to update Mozilla repository. Exiting."; exit 1; }
|
|
}
|
|
|
|
# Function to update patches
|
|
update_patches() {
|
|
echo "Updating patches..."
|
|
git clone https://weforgecode.xyz/Spitfire/Branding.git || { echo "Failed to clone patches repository. Exiting."; exit 1; }
|
|
}
|
|
|
|
# Function to configure and build Spitfire
|
|
configure_and_build() {
|
|
echo "Configuring Spitfire..."
|
|
./mach configure || { echo "Configuration failed. Exiting."; exit 1; }
|
|
|
|
echo "Building Spitfire..."
|
|
./mach build || { echo "Build failed. Exiting."; exit 1; }
|
|
}
|
|
|
|
# Main script execution
|
|
download_source
|
|
discard_changes
|
|
clean_build
|
|
update_repo
|
|
update_patches
|
|
configure_and_build
|
|
|
|
echo "Spitfire build completed successfully."
|