From b28c07e4023c744acda5985c080ba0ccbf9f0164 Mon Sep 17 00:00:00 2001 From: BeatLink Date: Sun, 21 Jul 2019 00:30:19 -0500 Subject: update all scripts --- .../binary_tarball/content/launch_librewolf.sh | 2 ++ .../scripts/1_Install_Dependencies.sh | 16 +++++++--------- .../scripts/2_Download_Source_Code.sh | 10 ++++++---- .../scripts/3_Configure_Source_Code.sh | 20 +++++++++++--------- .../scripts/4_Build_Binary_Tarball.sh | 20 ++++++++++++-------- .../scripts/5_Configure_Binary_Tarball.sh | 21 ++++++++++----------- 6 files changed, 48 insertions(+), 41 deletions(-) (limited to 'browser/linux/binary_tarball') diff --git a/browser/linux/binary_tarball/content/launch_librewolf.sh b/browser/linux/binary_tarball/content/launch_librewolf.sh index f8b099d..26c1bd5 100755 --- a/browser/linux/binary_tarball/content/launch_librewolf.sh +++ b/browser/linux/binary_tarball/content/launch_librewolf.sh @@ -14,6 +14,8 @@ if [ "$1" = "--install-settings" ]; then fi # Sets up settings links +mkdir -p $INSTALL_FOLDER/defaults/pref/; +mkdir -p $INSTALL_FOLDER/distribution/; ln -s $PROFILE_SETTINGS_FOLDER/local-settings.js $INSTALL_FOLDER/defaults/pref/local-settings.js; ln -s $PROFILE_SETTINGS_FOLDER/policies.json $INSTALL_FOLDER/distribution/policies.json; ln -s $PROFILE_SETTINGS_FOLDER/librewolf.cfg $INSTALL_FOLDER/librewolf.cfg; diff --git a/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh b/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh index 0230e0d..c241e6b 100755 --- a/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh +++ b/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh @@ -1,12 +1,10 @@ #!/bin/sh - printf "\n\n-------------------------------------- DEPENDENCY INSTALLATION ---------------------------------------------\n"; -printf "\nInstalling dependencies\n"; -apt-get update -qq && apt-get install -qqy mercurial wget; #python python3 wget; -# wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py; -# python ./bootstrap.py --application-choice=browser --no-interactive || true -# rm -f ./bootstrap.py; -# adds the new rust install to PATH -# printf "\nAdding new rust install to PATH\n"; -#. $HOME/.cargo/env; +# Setup Script Variables +_DEPENDENCIES="mercurial wget"; + +# Installs Dependencies +printf "\nInstalling dependencies\n"; +apt-get -qq update; +apt-get -qqy install $_DEPENDENCIES; diff --git a/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh b/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh index c973038..ac022a1 100755 --- a/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh +++ b/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh @@ -1,9 +1,11 @@ #!/bin/sh +printf "\n\n--------------------------------- SOURCE CODE DOWNLOAD --------------------------------------\n"; -COMPILE_FOLDER=$1 +# Setup Script Variables +SOURCE_FOLDER=$1; +_SOURCE_CODE_URL="https://hg.mozilla.org/releases/mozilla-release"; -printf "\n\n--------------------------------- SOURCE CODE DOWNLOAD --------------------------------------\n"; -# Clones the firefox source code for compiling +# Clone Firefox Source Code printf "\nCloning Firefox Source Code\n"; -hg clone https://hg.mozilla.org/releases/mozilla-release $COMPILE_FOLDER; +hg clone $_SOURCE_CODE_URL $SOURCE_FOLDER; diff --git a/browser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh b/browser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh index e4e3a9a..9adc430 100755 --- a/browser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh +++ b/browser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh @@ -1,15 +1,17 @@ #!/bin/sh - -SOURCE_CODE_FOLDER=$1 -FOLDER_TO_ADD=$2 - printf "\n\n------------------------------ FINAL PREBUILD CONFIGURATION ---------------------------------\n"; -# Copies our custom source code changes (mostly branding) to the source code -printf "\nCopying custom files to firefox source code\n"; -cp -r $FOLDER_TO_ADD/* $SOURCE_CODE_FOLDER/; +# Setup Script Variables +SOURCE_CODE_FOLDER=$1; +SOURCE_CODE_CUSTOMIZATION_FOLDER=$2; +_POCKET_SED_STRING="s/'pocket'/#'pocket'/g"; +_POCKET_FILE=$SOURCE_CODE_FOLDER/browser/components/moz.build; + +# Copy Source Code Changes to Source Code +printf "\nCopying branding and source code changes to firefox source code\n"; +cp -r $SOURCE_CODE_CUSTOMIZATION_FOLDER/* $SOURCE_CODE_FOLDER/; -# Disables pocket +# Disables Pocket printf "\nDisabling Pocket\n"; -sed -i "s/'pocket'/#'pocket'/g" $SOURCE_CODE_FOLDER/browser/components/moz.build; +sed -i $_POCKET_SED_STRING $_POCKET_FILE; diff --git a/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh b/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh index 8faac49..5f3ebe5 100755 --- a/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh +++ b/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh @@ -1,30 +1,34 @@ #!/bin/sh +printf "\n\n--------------------------------------- BUILD -----------------------------------------------\n"; +# Setup Script Variables SOURCE_FOLDER=$1; OUTPUT_TARBALL=$2; +_SOURCE_CODE_BINARY_TARBALL_LOCATION="./obj*/dist/librewolf*.tar.bz2"; # Prevents build from breaking in CI/CD environments export SHELL=/bin/bash; -printf "SHELL=$SHELL\n"; -printf "\n\n--------------------------------------- BUILD -----------------------------------------------\n"; -cd $SOURCE_FOLDER +# Changes current folder to the source code folder +cd $SOURCE_FOLDER; -# Installs build dependencies (using the ./mach script inside the source code) +# Runs bootstrapper to install dependencies printf "\nRunning bootstrapper to install build dependencies (using ./mach script within source code)\n"; ./mach bootstrap --application-choice=browser --no-interactive; -cd $SOURCE_FOLDER; - +# Executes the actual build printf "\nBuilding LibreWolf\n"; ./mach build; +# Packages the build into a binary tarball printf "\nPackaging LibreWolf\n"; ./mach package; +# Moves the packaged tarball to the specified location printf "\nMoving Binary Tarball to output location\n"; -mv ./obj*/dist/librewolf*.tar.bz2 $OUTPUT_TARBALL; +mv $_SOURCE_CODE_BINARY_TARBALL_LOCATION $OUTPUT_TARBALL; -printf "\nDeleting the compile_folder\n"; +# Deletes the source code +printf "\nDeleting source code\n"; rm -rf $SOURCE_FOLDER; diff --git a/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh b/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh index f859f11..c7dd3b7 100755 --- a/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh +++ b/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh @@ -1,24 +1,23 @@ #!/bin/sh - -BINARY_TARBALL=$1 -SETTINGS_FOLDER_TO_ADD=$2 -LAUNCHER_SCRIPT=$3 - printf "\n\n--------------------------------- SETTINGS INTEGRATION --------------------------------------\n"; +# Setup Script Variables +BINARY_TARBALL=$1; +SETTINGS_FOLDER=$2; +LAUNCHER_SCRIPT=$3; +_EXTRACTED_TARBALL_FOLDER=./librewolf; + # Extracts the binary tarball printf "\nExtracting librewolf binary tarball\n"; -tar -xvf ./$BINARY_TARBALL; +tar -xvf $BINARY_TARBALL; # Adds the librefox config files to the packaged tarball printf "\nCopying librewolf settings to extracted binary tarball\n"; -cp -r $SETTINGS_FOLDER_TO_ADD ./librewolf/settings; -cp $LAUNCHER_SCRIPT ./librewolf/launch_librewolf.sh; -mkdir -p ./librewolf/defaults/pref/; -mkdir -p ./librewolf/distribution/; +cp -r $SETTINGS_FOLDER $_EXTRACTED_TARBALL_FOLDER$/settings; +cp $LAUNCHER_SCRIPT $_EXTRACTED_TARBALL_FOLDER/launch_librewolf.sh; # Repacks the binary tarball printf "\nRecompressing binary tarball\n"; -tar -jcvf ./$BINARY_TARBALL librewolf; +tar -jcvf $BINARY_TARBALL $_EXTRACTED_TARBALL_FOLDER; -- cgit