aboutsummaryrefslogtreecommitdiff
path: root/browser/linux
diff options
context:
space:
mode:
authorBeatLink <beatlink@protonmail.com>2019-07-26 00:16:56 -0500
committerBeatLink <beatlink@protonmail.com>2019-07-26 00:16:56 -0500
commit83f3b6604b4954d8a2813cb4dc1106fef828d6b1 (patch)
tree82357ceddeb7438f8987cbea0eb603caa27f1105 /browser/linux
parentfix ci/cd (diff)
downloadlibrewolf-linux-83f3b6604b4954d8a2813cb4dc1106fef828d6b1.tar.gz
librewolf-linux-83f3b6604b4954d8a2813cb4dc1106fef828d6b1.tar.bz2
librewolf-linux-83f3b6604b4954d8a2813cb4dc1106fef828d6b1.zip
Simplify and compartmentalise scripts, separate packaging into gitlab jobs
Diffstat (limited to 'browser/linux')
-rw-r--r--browser/linux/README.md2
-rwxr-xr-xbrowser/linux/appimage/build_appimage.sh9
-rw-r--r--browser/linux/binary_tarball/build_tarball.sh22
-rwxr-xr-xbrowser/linux/build.sh17
-rwxr-xr-xbrowser/linux/flatpak/build_flatpak.sh11
5 files changed, 39 insertions, 22 deletions
diff --git a/browser/linux/README.md b/browser/linux/README.md
index 568e529..f09f6af 100644
--- a/browser/linux/README.md
+++ b/browser/linux/README.md
@@ -11,4 +11,4 @@ This folder contains all the required material to build the browser on Linux pla
### Instructions
* Run build.sh inside this folder.
-* Packages will be saved in the 'build_output' folder.
+* Packages will be saved in the repository root folder.
diff --git a/browser/linux/appimage/build_appimage.sh b/browser/linux/appimage/build_appimage.sh
index 436f5f7..4ca7bf0 100755
--- a/browser/linux/appimage/build_appimage.sh
+++ b/browser/linux/appimage/build_appimage.sh
@@ -1,15 +1,18 @@
#!/bin/sh
printf "\n\n------------------------------------ APPIMAGE BUILD -----------------------------------------\n";
+# Aborts the script upon any faliure
+set -e;
+
# Sets up script variables
BINARY_TARBALL=$1
-APPIMAGE_CONTENT_FOLDER=$2
-APPIMAGE_FILE=$3
+APPIMAGE_FILE=$2
_BINARY_TARBALL_EXTRACTED_FOLDER=./librewolf;
_BUILD_APPIMAGE_FILE=./LibreWolf*.AppImage;
_APPIMAGETOOL_DOWNLOAD_URL=https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage;
_APPIMAGETOOL_EXTRACTED_FOLDER=./squashfs-root;
_APPIMAGETOOL_FILE=./appimagetool;
+_APPIMAGE_CONTENT_FOLDER=./content
# Extracts the binary tarball
printf "\nExtracting librewolf binary tarball\n";
@@ -17,7 +20,7 @@ tar -xvf $BINARY_TARBALL;
# Copy appimage resources to main tarball
printf "Copying AppImage resources to binary tarball folder\n";
-cp -vrT $APPIMAGE_CONTENT_FOLDER $_BINARY_TARBALL_EXTRACTED_FOLDER;
+cp -vrT $_APPIMAGE_CONTENT_FOLDER $_BINARY_TARBALL_EXTRACTED_FOLDER;
# Downloads appimage tool
printf "\nDownloading AppImage Tool\n";
diff --git a/browser/linux/binary_tarball/build_tarball.sh b/browser/linux/binary_tarball/build_tarball.sh
new file mode 100644
index 0000000..91cf4ae
--- /dev/null
+++ b/browser/linux/binary_tarball/build_tarball.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+printf "\n------------------------------------- BINARY TARBALL BUILD ------------------------------------------\n";
+
+# Aborts the script upon any faliure
+set -e;
+
+# Sets up script variables
+BINARY_TARBALL=$1;
+_SCRIPT_FOLDER=$(realpath $(dirname $0));
+_REPOSITORY_FOLDER=$(realpath $_SCRIPT_FOLDER/../../../);
+_BINARY_TARBALL_SOURCE_FOLDER=$_SCRIPT_FOLDER/compile;
+_BINARY_TARBALL_SOURCE_CONTENT_FOLDER=$_REPOSITORY_FOLDER/browser/common/source_files/;
+_BINARY_TARBALL_SETTINGS_FOLDER=$_REPOSITORY_FOLDER/settings;
+_BINARY_TARBALL_LAUNCH_SCRIPT=$_SCRIPT_FOLDER/binary_tarball/content/launch_librewolf.sh;
+
+# Executes the build
+$_SCRIPT_FOLDER/1_Install_Dependencies.sh;
+$_SCRIPT_FOLDER/2_Download_Source_Code.sh $_BINARY_TARBALL_SOURCE_FOLDER;
+$_SCRIPT_FOLDER/3_Configure_Source_Code.sh $_BINARY_TARBALL_SOURCE_FOLDER $_BINARY_TARBALL_SOURCE_CONTENT_FOLDER;
+$_SCRIPT_FOLDER/4_Build_Binary_Tarball.sh $_BINARY_TARBALL_SOURCE_FOLDER $BINARY_TARBALL;
+$_SCRIPT_FOLDER/5_Configure_Binary_Tarball.sh $BINARY_TARBALL $_BINARY_TARBALL_SETTINGS_FOLDER $_BINARY_TARBALL_LAUNCH_SCRIPT;
+
diff --git a/browser/linux/build.sh b/browser/linux/build.sh
index e7ea79d..850e8ad 100755
--- a/browser/linux/build.sh
+++ b/browser/linux/build.sh
@@ -7,25 +7,14 @@ set -e;
# Sets up script variables
SCRIPT_FOLDER=$(realpath $(dirname $0));
REPOSITORY_FOLDER=$(realpath $SCRIPT_FOLDER/../../);
-BINARY_TARBALL_SOURCE_FOLDER=$SCRIPT_FOLDER/compile;
-BINARY_TARBALL_SOURCE_CONTENT_FOLDER=$REPOSITORY_FOLDER/browser/common/source_files/;
-BINARY_TARBALL_SETTINGS_FOLDER=$REPOSITORY_FOLDER/settings;
-BINARY_TARBALL_LAUNCH_SCRIPT=$SCRIPT_FOLDER/binary_tarball/content/launch_librewolf.sh;
BINARY_TARBALL=$REPOSITORY_FOLDER/LibreWolf.tar.bz2;
-APPIMAGE_CONTENT=$SCRIPT_FOLDER/appimage/content;
APPIMAGE_FILE=$REPOSITORY_FOLDER/LibreWolf.AppImage;
-FLATPAK_JSON_FILE=$SCRIPT_FOLDER/flatpak/content/io.gitlab.LibreWolf.json;
FLATPAK_REPO=$REPOSITORY_FOLDER/librewolf-flatpak-repo;
FLATPAK_BUNDLE=$REPOSITORY_FOLDER/LibreWolf.flatpak;
-# Executes the build
-$SCRIPT_FOLDER/binary_tarball/scripts/1_Install_Dependencies.sh;
-$SCRIPT_FOLDER/binary_tarball/scripts/2_Download_Source_Code.sh $BINARY_TARBALL_SOURCE_FOLDER;
-$SCRIPT_FOLDER/binary_tarball/scripts/3_Configure_Source_Code.sh $BINARY_TARBALL_SOURCE_FOLDER $BINARY_TARBALL_SOURCE_CONTENT_FOLDER;
-$SCRIPT_FOLDER/binary_tarball/scripts/4_Build_Binary_Tarball.sh $BINARY_TARBALL_SOURCE_FOLDER $BINARY_TARBALL;
-$SCRIPT_FOLDER/binary_tarball/scripts/5_Configure_Binary_Tarball.sh $BINARY_TARBALL $BINARY_TARBALL_SETTINGS_FOLDER $BINARY_TARBALL_LAUNCH_SCRIPT;
-$SCRIPT_FOLDER/appimage/build_appimage.sh $BINARY_TARBALL $APPIMAGE_CONTENT $APPIMAGE_FILE;
-$SCRIPT_FOLDER/flatpak/build_flatpak.sh $BINARY_TARBALL $FLATPAK_JSON_FILE $FLATPAK_REPO $FLATPAK_BUNDLE;
+$SCRIPT_FOLDER/binary_tarball/build_tarball.sh $BINARY_TARBALL;
+$SCRIPT_FOLDER/appimage/build_appimage.sh $BINARY_TARBALL $APPIMAGE_FILE;
+$SCRIPT_FOLDER/flatpak/build_flatpak.sh $BINARY_TARBALL $FLATPAK_REPO $FLATPAK_BUNDLE;
diff --git a/browser/linux/flatpak/build_flatpak.sh b/browser/linux/flatpak/build_flatpak.sh
index 4ba1ab2..b65ecc9 100755
--- a/browser/linux/flatpak/build_flatpak.sh
+++ b/browser/linux/flatpak/build_flatpak.sh
@@ -1,11 +1,13 @@
#!/bin/sh
printf "\n\n---------------------------------------- FLATPAK BUILD --------------------------------------------\n";
+# Aborts the script upon any faliure
+set -e;
+
# Setup Script Variables
BINARY_TARBALL=$1;
-FLATPAK_JSON_FILE=$2;
-FLATPAK_REPO=$3;
-FLATPAK_BUNDLE=$4;
+FLATPAK_REPO=$2;
+FLATPAK_BUNDLE=$3;
_APT_SOURCE_LIST=/etc/apt/source.list;
_APT_REPO='deb http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu bionic main'
_APT_REPO_KEY=FA577F07;
@@ -13,6 +15,7 @@ _APT_PACKAGES_TO_INSTALL="flatpak flatpak-builder";
_FLATHUB_REPO="flathub https://flathub.org/repo/flathub.flatpakrepo";
_FLATHUB_PACKAGES_TO_INSTALL="org.gnome.Platform/x86_64/3.32 org.gnome.Sdk/x86_64/3.32";
_EXTRACTED_BINARY_TARBALL_FOLDER=./librewolf
+_FLATPAK_JSON_FILE=./content/io.gitlab.LibreWolf.json;
_FLATPAK_BUILD_SOURCE_FOLDER=./source;
_FLATPAK_BUILD_FOLDER=build-dir;
@@ -39,7 +42,7 @@ mkdir $_FLATPAK_BUILD_SOURCE_FOLDER && mv $_EXTRACTED_BINARY_TARBALL_FOLDER $_FL
# Build Repo
printf "\nBuilding flatpak repository\n";
-cp "$FLATPAK_JSON_FILE" ./;
+cp "$_FLATPAK_JSON_FILE" ./;
flatpak-builder --disable-rofiles-fuse --repo="$FLATPAK_REPO" "$_FLATPAK_BUILD_FOLDER" io.gitlab.LibreWolf.json;
# Build bundle
bgstack15