aboutsummaryrefslogtreecommitdiff
path: root/browser/linux/flatpak
diff options
context:
space:
mode:
Diffstat (limited to 'browser/linux/flatpak')
-rw-r--r--browser/linux/flatpak/build_flatpak.sh44
-rw-r--r--browser/linux/flatpak/content/io.gitlab.LibreWolf.json25
2 files changed, 69 insertions, 0 deletions
diff --git a/browser/linux/flatpak/build_flatpak.sh b/browser/linux/flatpak/build_flatpak.sh
new file mode 100644
index 0000000..c2f487d
--- /dev/null
+++ b/browser/linux/flatpak/build_flatpak.sh
@@ -0,0 +1,44 @@
+
+printf "\n\n---------------------------------------- FLATPAK BUILD --------------------------------------------\n";
+
+# Install flatpak
+# Installs some needed dependencies
+printf "\nInstalling script dependencies\n";
+apt update;
+apt install -y gnupg2;
+
+echo 'deb http://ppa.launchpad.net/alexlarsson/flatpak/ubuntu bionic main' >> /etc/apt/source.list;
+apt-key adv --keyserver keyserver.ubuntu.com --recv-keys FA577F07;
+apt update;
+apt install -y flatpak flatpak-builder;
+
+# Install build dependencies
+printf "\nInstalling flatpak build dependencies\n";
+flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo;
+flatpak install -y org.gnome.Platform/x86_64/3.32 org.gnome.Sdk/x86_64/3.32;
+
+# Prepare for flatpak build
+printf "\nPreparing files for flatpak build\n";
+mkdir "source";
+cp -r ./librewolf ./source/librewolf;
+cp $SCRIPT_FOLDER/resources/flatpak/io.gitlab.LibreWolf.json ./io.gitlab.LibreWolf.json;
+
+# Build Repo and standalone bundle
+printf "\nBuilding flatpak repository and bundle\n";
+flatpak-builder --repo=librewolf-flatpak-repo build-dir io.gitlab.LibreWolf.json;
+flatpak build-bundle librewolf-flatpak-repo LibreWolf.flatpak io.gitlab.LibreWolf 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;
diff --git a/browser/linux/flatpak/content/io.gitlab.LibreWolf.json b/browser/linux/flatpak/content/io.gitlab.LibreWolf.json
new file mode 100644
index 0000000..0e2b549
--- /dev/null
+++ b/browser/linux/flatpak/content/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: */
+ ]
+}
bgstack15