Update build script: can now build AppImages
move internal script variables to a unified section simplify bootstrap download command add cleanup commands
This commit is contained in:
parent
15f30a5d53
commit
f966259cf9
1 changed files with 71 additions and 29 deletions
100
browser/build.sh
100
browser/build.sh
|
|
@ -8,18 +8,24 @@ export SHELL=/bin/bash;
|
||||||
printf "\nSetting up script variables\n";
|
printf "\nSetting up script variables\n";
|
||||||
SCRIPT_FOLDER=$(realpath $(dirname $0));
|
SCRIPT_FOLDER=$(realpath $(dirname $0));
|
||||||
REPOSITORY_FOLDER=$(realpath $SCRIPT_FOLDER/../);
|
REPOSITORY_FOLDER=$(realpath $SCRIPT_FOLDER/../);
|
||||||
|
BRANDING_FOLDER=$SCRIPT_FOLDER/resources/source_files/browser/branding/librewolf;
|
||||||
|
ICON_FILE=$REPOSITORY_FOLDER/branding/icon/icon.svg;
|
||||||
|
PACKAGE_FILE="librewolf*.tar.bz2";
|
||||||
|
APPIMAGE_RESOURCE_FOLDER=$SCRIPT_FOLDER/resources/appimage/;
|
||||||
printf "SCRIPT_FOLDER: $SCRIPT_FOLDER\n";
|
printf "SCRIPT_FOLDER: $SCRIPT_FOLDER\n";
|
||||||
printf "REPOSITORY_FOLDER: $REPOSITORY_FOLDER\n";
|
printf "REPOSITORY_FOLDER: $REPOSITORY_FOLDER\n";
|
||||||
|
printf "BRANDING_FOLDER: $BRANDING_FOLDER\n";
|
||||||
|
printf "ICON_FILE: $ICON_FILE\n";
|
||||||
|
printf "PACKAGE_FILE: $PACKAGE_FILE\n";
|
||||||
|
printf "APPIMAGE_RESOURCE_FOLDER: $APPIMAGE_RESOURCE_FOLDER\n";
|
||||||
|
|
||||||
# Installs some needed dependencies
|
# Installs some needed dependencies
|
||||||
printf "\nInstalling script dependencies\n";
|
printf "\nInstalling script dependencies\n";
|
||||||
sudo apt update;
|
sudo apt update;
|
||||||
sudo apt install python python3 inkscape wget -y;
|
sudo apt install python python3 inkscape wget -y;
|
||||||
|
|
||||||
printf "\n\n------------------------------------ ICON GENERATION ----------------------------------------\n";
|
printf "\n\n---------------------------------- ICON GENERATION ------------------------------------------\n";
|
||||||
|
|
||||||
ICON_FILE=$REPOSITORY_FOLDER/branding/icon/icon.svg;
|
|
||||||
BRANDING_FOLDER=$SCRIPT_FOLDER/resources/source_files/browser/branding/librewolf;
|
|
||||||
printf "\nGenerating icons from $ICON_FILE and moving to $BRANDING_FOLDER\n";
|
printf "\nGenerating icons from $ICON_FILE and moving to $BRANDING_FOLDER\n";
|
||||||
|
|
||||||
# Linux Icons
|
# Linux Icons
|
||||||
|
|
@ -35,19 +41,18 @@ inkscape -z -f $ICON_FILE -e $BRANDING_FOLDER/VisualElements_150.png -w 150 -h15
|
||||||
|
|
||||||
# TODO: Add Apple Icons
|
# TODO: Add Apple Icons
|
||||||
|
|
||||||
printf "\n\n--------------------------------------- PREBUILD --------------------------------------------\n";
|
printf "\n\n-------------------------------------- PREBUILD ---------------------------------------------\n";
|
||||||
|
|
||||||
# Downloads and runs bootstrapper to install dependencies.
|
# Downloads and runs bootstrapper to install dependencies.
|
||||||
printf "\nRunning bootstrapper to install build dependencies\n";
|
printf "\nRunning bootstrapper to install build dependencies\n";
|
||||||
wget -nv -O - \
|
wget https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py;
|
||||||
https://hg.mozilla.org/mozilla-central/raw-file/default/python/mozboot/bin/bootstrap.py \
|
python ./bootstrap.py --application-choice=browser --no-interactive;
|
||||||
| python - --application-choice=browser --no-interactive;
|
|
||||||
|
|
||||||
# adds the new rust install to PATH
|
# adds the new rust install to PATH
|
||||||
printf "\nAdding new rust install to PATH\n";
|
printf "\nAdding new rust install to PATH\n";
|
||||||
. $HOME/.cargo/env;
|
. $HOME/.cargo/env;
|
||||||
|
|
||||||
printf "\n\n---------------------------------------- BUILD ----------------------------------------------\n";
|
printf "\n\n--------------------------------------- BUILD -----------------------------------------------\n";
|
||||||
|
|
||||||
# Creates and enters the folder where compiling will take place
|
# Creates and enters the folder where compiling will take place
|
||||||
printf "\nCreating compile folder\n";
|
printf "\nCreating compile folder\n";
|
||||||
|
|
@ -62,46 +67,83 @@ hg clone https://hg.mozilla.org/releases/mozilla-release;
|
||||||
printf "\nCopying branding to firefox source code\n";
|
printf "\nCopying branding to firefox source code\n";
|
||||||
cp -r $SCRIPT_FOLDER/resources/source_files/* mozilla-release;
|
cp -r $SCRIPT_FOLDER/resources/source_files/* mozilla-release;
|
||||||
|
|
||||||
# Bootstraps, builds and packages librewolf
|
|
||||||
cd mozilla-release;
|
cd mozilla-release;
|
||||||
printf "\nRunning bootstrapper to install build dependencies\n";
|
|
||||||
|
# Bootstraps librewolf again (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;
|
./mach bootstrap --application-choice=browser --no-interactive;
|
||||||
|
|
||||||
|
# Builds librewolf
|
||||||
printf "\nBuilding LibreWolf\n";
|
printf "\nBuilding LibreWolf\n";
|
||||||
./mach build;
|
./mach build;
|
||||||
|
|
||||||
|
# Packages LibreWolf
|
||||||
printf "\nPackaging LibreWolf\n";
|
printf "\nPackaging LibreWolf\n";
|
||||||
./mach package;
|
./mach package;
|
||||||
cd $SCRIPT_FOLDER;
|
|
||||||
|
|
||||||
printf "\n\n-------------------------------------- POSTBUILD --------------------------------------------\n";
|
cd $SCRIPT_FOLDER;
|
||||||
|
|
||||||
# moves the packaged tarball to the main folder
|
# moves the packaged tarball to the main folder
|
||||||
printf "\nRelocating binary tarball to script folder\n"
|
printf "\nRelocating binary tarball to script folder\n"
|
||||||
cp ./compile_folder/mozilla-release/obj*/dist/librewolf*.tar.bz2 ./;
|
cp ./compile_folder/mozilla-release/obj*/dist/librewolf*.tar.bz2 ./;
|
||||||
|
|
||||||
# Remove the compile folder
|
|
||||||
printf "\nDeleting the compile_folder\n";
|
|
||||||
rm -rf ./compile_folder;
|
|
||||||
|
|
||||||
printf "\n\n--------------------------------- SETTINGS INTEGRATION --------------------------------------\n";
|
printf "\n\n--------------------------------- SETTINGS INTEGRATION --------------------------------------\n";
|
||||||
|
|
||||||
# Adds the librefox config files to the packaged tarball
|
# Extracts the binary tarball
|
||||||
PACKAGE_FILE_NAME="librewolf*.tar.bz2\n";
|
|
||||||
printf "\nExtracting librewolf binary tarball\n";
|
printf "\nExtracting librewolf binary tarball\n";
|
||||||
tar -xvf ./$PACKAGE_FILE_NAME;
|
tar -xvf ./$PACKAGE_FILE;
|
||||||
|
|
||||||
|
# Adds the librefox config files to the packaged tarball
|
||||||
printf "\nCopying librewolf settings to extracted binary tarball\n";
|
printf "\nCopying librewolf settings to extracted binary tarball\n";
|
||||||
cp -r $REPOSITORY_FOLDER/settings/* ./librewolf;
|
cp -r $REPOSITORY_FOLDER/settings/* ./librewolf;
|
||||||
|
|
||||||
|
# Repacks the binary tarball
|
||||||
printf "\nRecompressing binary tarball\n";
|
printf "\nRecompressing binary tarball\n";
|
||||||
tar -jcvf ./$PACKAGE_FILE_NAME librewolf;
|
tar -jcvf ./$PACKAGE_FILE librewolf;
|
||||||
|
|
||||||
|
# Moves the final binary tarball to build_output
|
||||||
|
printf "\nMoving binary tarball to build_output folder\n";
|
||||||
|
mv $PACKAGE_FILE $SCRIPT_FOLDER/build_output/;
|
||||||
|
|
||||||
|
printf "\n\n------------------------------------ APPIMAGE BUILD -----------------------------------------\n";
|
||||||
|
|
||||||
|
# Copy and generate icons
|
||||||
|
printf "\nGenerating AppImage Icons\n";
|
||||||
|
cp $ICON_FILE $APPIMAGE_RESOURCE_FOLDER/librewolf.svg;
|
||||||
|
ln -rs $APPIMAGE_RESOURCE_FOLDER/librewolf.svg $SCRIPT_FOLDER/resources/appimage/.DirIcon;
|
||||||
|
|
||||||
|
# Copy appimage resources to main tarball
|
||||||
|
printf "Copying AppImage resources to binary tarball folder\n";
|
||||||
|
cp -vrT $APPIMAGE_RESOURCE_FOLDER ./librewolf;
|
||||||
|
|
||||||
|
# Downloads appimage tool
|
||||||
|
printf "\nDownloading AppImage Tool\n";
|
||||||
|
wget https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage;
|
||||||
|
chmod +x ./appimagetool-x86_64.AppImage;
|
||||||
|
|
||||||
|
# Generate AppImage
|
||||||
|
printf "\nGenerating AppImage\n";
|
||||||
|
./appimagetool-x86_64.AppImage ./librewolf;
|
||||||
|
chmod +x ./LibreWolf*.AppImage;
|
||||||
|
|
||||||
|
# Move AppImage to build_output folder
|
||||||
|
printf "\nMoving AppImage to build_output folder\n";
|
||||||
|
mv ./LibreWolf*.AppImage ./build_output;
|
||||||
|
|
||||||
|
printf "\n\n---------------------------------------- CLEANUP --------------------------------------------\n";
|
||||||
|
|
||||||
|
# Remove the compile folder
|
||||||
|
printf "\nDeleting the compile_folder\n";
|
||||||
|
rm -rvf ./compile_folder;
|
||||||
|
|
||||||
|
# Delete the extracted binary tarball folder
|
||||||
printf "\nDeleting extracted binary tarball folder\n";
|
printf "\nDeleting extracted binary tarball folder\n";
|
||||||
rm -rvf ./librewolf;
|
rm -rvf ./librewolf;
|
||||||
|
|
||||||
# BUILD APP IMAGE #################################################################################
|
# Delete the appimage tool
|
||||||
# cp -r $BINARY_FOLDER ./app_image_build_folder
|
printf "\nRemoving AppImage tool\n";
|
||||||
# Adds the librefox config files to the packaged tarball
|
rm -vf ./appimagetool-x86_64.AppImage
|
||||||
# PACKAGE_FILE_NAME="librewolf*.tar.bz2";
|
|
||||||
# tar -xvf ./$PACKAGE_FILE_NAME;
|
|
||||||
# cp -r ../settings/* ./librewolf;
|
|
||||||
# tar -jcvf ./$PACKAGE_FILE_NAME librewolf;
|
|
||||||
# rm -rvf ./librewolf;
|
|
||||||
|
|
||||||
|
|
||||||
|
# Delete the bootstrapper script
|
||||||
|
printf "\nRemoving bootstrapper.py\n";
|
||||||
|
rm -f ./bootstrap.py;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue