aboutsummaryrefslogtreecommitdiff
path: root/browser/linux/binary_tarball/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'browser/linux/binary_tarball/scripts')
-rwxr-xr-xbrowser/linux/binary_tarball/scripts/1_Install_Dependencies.sh12
-rwxr-xr-xbrowser/linux/binary_tarball/scripts/2_Download_Source_Code.sh9
-rwxr-xr-xbrowser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh15
-rwxr-xr-xbrowser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh30
-rwxr-xr-xbrowser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh24
5 files changed, 90 insertions, 0 deletions
diff --git a/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh b/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh
new file mode 100755
index 0000000..0230e0d
--- /dev/null
+++ b/browser/linux/binary_tarball/scripts/1_Install_Dependencies.sh
@@ -0,0 +1,12 @@
+#!/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;
diff --git a/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh b/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh
new file mode 100755
index 0000000..c973038
--- /dev/null
+++ b/browser/linux/binary_tarball/scripts/2_Download_Source_Code.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+COMPILE_FOLDER=$1
+
+printf "\n\n--------------------------------- SOURCE CODE DOWNLOAD --------------------------------------\n";
+# Clones the firefox source code for compiling
+printf "\nCloning Firefox Source Code\n";
+hg clone https://hg.mozilla.org/releases/mozilla-release $COMPILE_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
new file mode 100755
index 0000000..e4e3a9a
--- /dev/null
+++ b/browser/linux/binary_tarball/scripts/3_Configure_Source_Code.sh
@@ -0,0 +1,15 @@
+#!/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/;
+
+# Disables pocket
+printf "\nDisabling Pocket\n";
+sed -i "s/'pocket'/#'pocket'/g" $SOURCE_CODE_FOLDER/browser/components/moz.build;
+
diff --git a/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh b/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh
new file mode 100755
index 0000000..85ded58
--- /dev/null
+++ b/browser/linux/binary_tarball/scripts/4_Build_Binary_Tarball.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+SOURCE_FOLDER=$1;
+OUTPUT_TARBALL=$2;
+
+# Prevents build from breaking in CI/CD environments
+export SHELL=/bin/bash;
+printf "SHELL=$SHELL\n";
+
+printf "\n\n--------------------------------------- BUILD -----------------------------------------------\n";
+cd $SOURCE_FOLDER
+
+# Installs build dependencies (using the ./mach script inside the source code)
+printf "\nRunning bootstrapper to install build dependencies (using ./mach script within source code)\n";
+./mach bootstrap --application-choice=browser --no-interactive;
+
+cd $SOURCE_FOLDER;
+
+printf "\nBuilding LibreWolf\n";
+./mach build;
+
+printf "\nPackaging LibreWolf\n";
+./mach package;
+
+printf "\nMoving Binary Tarball to output location\n";
+mv ./obj*/dist/librewolf*.tar.bz2 $OUTPUT_TARBALL;
+
+printf "\nDeleting the compile_folder\n";
+rm -rf ./;
+
diff --git a/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh b/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh
new file mode 100755
index 0000000..346f702
--- /dev/null
+++ b/browser/linux/binary_tarball/scripts/5_Configure_Binary_Tarball.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+PACKAGE_FILE=$1
+SETTINGS_FOLDER_TO_ADD=$2 #$REPOSITORY_FOLDER/settings
+LAUNCHER_SCRIPT=$3 #$SCRIPT_FOLDER/resources/launch_librewolf.sh
+
+printf "\n\n--------------------------------- SETTINGS INTEGRATION --------------------------------------\n";
+
+# Extracts the binary tarball
+printf "\nExtracting librewolf binary tarball\n";
+tar -xvf ./$PACKAGE_FILE;
+
+# 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/;
+
+# Repacks the binary tarball
+printf "\nRecompressing binary tarball\n";
+tar -jcvf ./$PACKAGE_FILE librewolf;
+
+
bgstack15