aboutsummaryrefslogtreecommitdiff
path: root/browser/linux
diff options
context:
space:
mode:
authorBeatLink <beatlink@protonmail.com>2019-07-14 01:39:32 -0500
committerBeatLink <beatlink@protonmail.com>2019-07-14 01:39:32 -0500
commite04f1370d109fe44fc5fa2a312211d13ab88ef7f (patch)
tree26d4a823549634426bac784c9146fa1f78d80d82 /browser/linux
parentMove install script in preparation for settings rewrite (diff)
downloadlibrewolf-linux-e04f1370d109fe44fc5fa2a312211d13ab88ef7f.tar.gz
librewolf-linux-e04f1370d109fe44fc5fa2a312211d13ab88ef7f.tar.bz2
librewolf-linux-e04f1370d109fe44fc5fa2a312211d13ab88ef7f.zip
Implement Flatpak build
Diffstat (limited to 'browser/linux')
-rwxr-xr-xbrowser/linux/build.sh42
-rw-r--r--browser/linux/resources/flatpak/io.gitlab.LibreWolf.json25
-rw-r--r--browser/linux/resources/flatpak/io.gitlab.librewolf-community32
3 files changed, 63 insertions, 36 deletions
diff --git a/browser/linux/build.sh b/browser/linux/build.sh
index a85d8b9..4499453 100755
--- a/browser/linux/build.sh
+++ b/browser/linux/build.sh
@@ -17,6 +17,7 @@ BRANDING_FOLDER=$SOURCE_FOLDER/browser/branding/librewolf;
ICON_FOLDER=$REPOSITORY_FOLDER/branding/icon/;
PACKAGE_FILE="librewolf*.tar.bz2";
APPIMAGE_RESOURCE_FOLDER=$SCRIPT_FOLDER/resources/appimage;
+FLATPAK_MANIFEST_FILE=$SCRIPT_FOLDER/resources/flatpak/io.gitlab.LibreWolf.json;
printf "SCRIPT_FOLDER: $SCRIPT_FOLDER\n";
printf "REPOSITORY_FOLDER: $REPOSITORY_FOLDER\n";
printf "SOURCE_FOLDER: $SOURCE_FOLDER\n";
@@ -24,6 +25,7 @@ printf "BRANDING_FOLDER: $BRANDING_FOLDER\n";
printf "ICON_FOLDER: $ICON_FOLDER\n";
printf "PACKAGE_FILE: $PACKAGE_FILE\n";
printf "APPIMAGE_RESOURCE_FOLDER: $APPIMAGE_RESOURCE_FOLDER\n";
+printf "FLATPAK_MANIFEST_FILE: $FLATPAK_MANIFEST_FILE\n";
printf "\n\n-------------------------------------- PREBUILD ---------------------------------------------\n";
@@ -122,6 +124,8 @@ tar -xvf ./$PACKAGE_FILE;
printf "\nCopying librewolf settings to extracted binary tarball\n";
cp -r $REPOSITORY_FOLDER/settings ./librewolf/settings;
+printf "\n\n--------------------------------- BINARY TARBALL RECREATION --------------------------------------\n";
+
# Repacks the binary tarball
printf "\nRecompressing binary tarball\n";
tar -jcvf ./$PACKAGE_FILE librewolf;
@@ -161,10 +165,40 @@ printf "\nRemoving AppImage tool\n";
rm -f ./appimagetool;
rm -rf ./squashfs-root;
+
+printf "\n\n---------------------------------------- FLATPAK BUILD --------------------------------------------\n";
+
+# Install flatpak
+printf "\nInstalling Flatpak Builder\n";
+sudo add-apt-repository -y ppa:alexlarsson/flatpak;
+sudo apt update;
+sudo apt install -y flatpak flatpak-builder;
+
+# Install build dependencies
+printf "\nInstalling flatpak build dependencies\n";
+flatpak install -y org.gnome.Platform//3.32 org.gnome.Sdk//3.32;
+
+# Prepare for flatpak build
+printf "\nPreparing files for flatpak build\n";
+mkdir "source";
+cp -r ./librewolf ./source/librewolf;
+
+# Build Repo and standalone bundle
+printf "\nBuilding flatpak repository and bundle\n";
+flatpak-builder --repo=librewolf-flatpak-repo build-dir $FLATPAK_MANIFEST_FILE;
+flatpak build-bundle librewolf-flatpak-repo LibreWolf.flatpak $FLATPAK_MANIFEST_FILE master;
+
+# move repo and bundle to build output here
+printf "\nMoving repository and bundle to build output folder\n";
+mv libreWolf-flatpak-repo build_output;
+mv LibreWolf.flatpak build_output;
+
+# Clean up flatpak files
+printf "\nCleaning up flatpak related files\n";
+rm -rf ./build-dir;
+rm -rf ./source;
+rm -rf ./.flatpak-builder;
+
# Delete the extracted binary tarball folder
printf "\nDeleting extracted binary tarball folder\n";
rm -rf ./librewolf;
-
-#printf "\n\n---------------------------------------- FLATPAK BUILD --------------------------------------------\n";
-#sudo apt install flatpak-builder;
-
diff --git a/browser/linux/resources/flatpak/io.gitlab.LibreWolf.json b/browser/linux/resources/flatpak/io.gitlab.LibreWolf.json
new file mode 100644
index 0000000..0e2b549
--- /dev/null
+++ b/browser/linux/resources/flatpak/io.gitlab.LibreWolf.json
@@ -0,0 +1,25 @@
+{
+ "app-id": "io.gitlab.LibreWolf",
+ "runtime": "org.gnome.Platform",
+ "runtime-version": "3.32",
+ "sdk": "org.gnome.Sdk",
+ "command": "librewolf",
+ "modules": [{
+ "name": "librewolf",
+ "buildsystem": "simple",
+ "build-commands": [
+ "mkdir -p /app/share && mv librewolf -t /app/share",
+ "mkdir -p /app/bin && ln -s /app/share/librewolf/librewolf /app/bin/"
+ ],
+ "sources": [{
+ "type": "dir",
+ "path": "source"
+ }]
+ }],
+ "finish-args": [
+ "--share=ipc", "--socket=x11", /* X11 + XShm access */
+ "--socket=wayland", /* Wayland access */
+ "--filesystem=home:rw", /* We want full fs access so we can read the files */
+ "--share=network" /* Needs to talk to the network: */
+ ]
+}
diff --git a/browser/linux/resources/flatpak/io.gitlab.librewolf-community b/browser/linux/resources/flatpak/io.gitlab.librewolf-community
deleted file mode 100644
index 55cf8b2..0000000
--- a/browser/linux/resources/flatpak/io.gitlab.librewolf-community
+++ /dev/null
@@ -1,32 +0,0 @@
-{
- "app-id": "io.gitlab.LibreWolf",
- "runtime": "org.gnome.Platform",
- "runtime-version": "3.22",
- "sdk": "org.gnome.Sdk",
- "command": "librewolf",
- "finish-args": [
- /* X11 + XShm access */
- "--share=ipc", "--socket=x11",
- /* Wayland access */
- "--socket=wayland",
- /* We want full fs access so we can read the files */
- "--filesystem=home:rw",
- /* Needs to talk to the network: */
- "--share=network"
- ],
- "modules": [
- {
- "name": "librewolf",
- "buildsystem": "simple",
- "build-commands": [
- "install -D hello.sh /app/bin/hello.sh"
- ],
- "sources": [
- {
- "type": "file",
- "path": "hello.sh"
- }
- ]
- }
- ]
-}
bgstack15