Skip to content
This repository has been archived by the owner on May 6, 2020. It is now read-only.

Commit

Permalink
Install Adobe Flash extension and Oracle JRE
Browse files Browse the repository at this point in the history
  • Loading branch information
Michal Rostecki committed Dec 29, 2016
1 parent 93e93ab commit 467765f
Show file tree
Hide file tree
Showing 7 changed files with 110 additions and 4 deletions.
1 change: 1 addition & 0 deletions .mozconfig
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,4 @@ ac_add_options --with-system-icu
ac_add_options --disable-tests
ac_add_options --disable-gstreamer
ac_add_options --disable-elf-hack
ac_add_options --enable-system-extemsion-dirs
9 changes: 9 additions & 0 deletions apply_extra
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh

mkdir flash-player
tar zxf flash-player.tar.gz -C flash-player

mkdir -p lib/mozilla/plugins
cp flash-player/libflashplayer.so lib/mozilla/plugins

rm -rf flash-player flash-player.tar.gz
31 changes: 31 additions & 0 deletions firefox-extension-dir.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From d13d06185de781cf4acff432f518ca3154096a4d Mon Sep 17 00:00:00 2001
From: Michal Rostecki <michal@kinvolk.io>
Date: Wed, 28 Dec 2016 17:13:05 +0100
Subject: [PATCH] Set /app/extra/lib/mozilla/plugins as an extension dir

---
xpcom/io/nsAppFileLocationProvider.cpp | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/xpcom/io/nsAppFileLocationProvider.cpp b/xpcom/io/nsAppFileLocationProvider.cpp
index 27ccd56..86d712d 100644
--- a/xpcom/io/nsAppFileLocationProvider.cpp
+++ b/xpcom/io/nsAppFileLocationProvider.cpp
@@ -187,13 +187,7 @@ nsAppFileLocationProvider::GetFile(const char* aProp, bool* aPersistent,
else if (nsCRT::strcmp(aProp, NS_SYSTEM_PLUGINS_DIR) == 0) {
#ifdef ENABLE_SYSTEM_EXTENSION_DIRS
static const char* const sysLPlgDir =
-#if defined(HAVE_USR_LIB64_DIR) && defined(__LP64__)
- "/usr/lib64/mozilla/plugins";
-#elif defined(__OpenBSD__) || defined (__FreeBSD__)
- "/usr/local/lib/mozilla/plugins";
-#else
- "/usr/lib/mozilla/plugins";
-#endif
+ "/app/extra/lib/mozilla/plugins";
rv = NS_NewNativeLocalFile(nsDependentCString(sysLPlgDir),
false, getter_AddRefs(localFile));
#else
--
2.9.3

19 changes: 18 additions & 1 deletion firefox.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
#!/bin/sh

exec /app/extra/bin/vlc
JRE_PLUGIN_FILENAME="libnpjp2.so"

mkdir -p $HOME/.mozilla/plugins
mkdir -p $HOME/.flatpak_extras/firefox

if [ ! -f $HOME/.mozilla/plugins/$JRE_PLUGIN_FILENAME ]; then
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com%2F; oraclelicense=accept-securebackup-cookie" "http://download.oracle.com/otn-pub/java/jdk/8u112-b15/jre-8u112-linux-x64.tar.gz"
tar zxf jre-8u112-linux-x64.tar.gz
cp -r jre1.8.0_112/{bin,lib,man,plugin} $HOME/.flatpak_extras/firefox
ln -s $HOME/.flatpak_extras/firefox/lib/amd64/libnpjp2.so $HOME/.mozilla/plugins/$JRE_PLUGIN_FILENAME
rm -rf jre1.8.0_112 jre-8u112-linux.x64.tar-gz
fi

export PATH="$HOME/.flatpak_extras/firefox/bin:$PATH"
export LD_LIBRARY_PATH="$HOME/.flatpak_extras/firefox/lib/amd64:$HOME/.flatpak_extras/firefox/lib/amd64/jli:$LD_LIBRARY_PATH"
export JAVA_HOME="$Home/.flatpak_extras/firefox"

exec /app/bin/firefox $@
2 changes: 1 addition & 1 deletion org.mozilla.firefox.desktop
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Type=Application
Name=Firefox web browser
GenericName=Web browser
Comment=Firefox web browser
Exec=firefox %u
Exec=firefox-wrapper %u
Icon=org.mozilla.firefox
Terminal=false
Categories=Network;WebBrowser;
46 changes: 44 additions & 2 deletions org.mozilla.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,16 @@
"runtime-version": "3.22",
"sdk": "org.gnome.Sdk",
"branch": "50.1.0",
"command": "firefox",
"command": "firefox-wrapper",
"separate-locales": false,
"finish-args": [
"--share=ipc",
"--socket=wayland",
"--socket=x11",
"--socket=pulseaudio",
"--share=network",
"--filesystem=home"
"--filesystem=home",
"--extra-data=flash-player.tar.gz:c721b59102d12597a8592f0e8d2fb3d65ccda33d8e499435fe02871b46874663:9698084::https://fpdownload.adobe.com/pub/flashplayer/pdc/24.0.0.186/flash_player_npapi_linux.x86_64.tar.gz"
],
"modules": [
{
Expand All @@ -37,6 +38,10 @@
"sources": [
{
"type": "archive",
"config-opts": [
"--enable-nls",
"--with-ssl=openssl"
],
"url": "https://download.gnome.org/sources/GConf/3.2/GConf-3.2.6.tar.xz",
"sha256": "1912b91803ab09a5eed34d364bf09fe3a2a9c96751fde03a4e0cfa51a04d784c"
}
Expand Down Expand Up @@ -122,6 +127,43 @@
{
"type": "patch",
"path": "firefox-makeinstall.patch"
},
{
"type": "patch",
"path": "firefox-extension-dir.patch"
}
]
},
{
"name": "wget",
"config-opts": [
"--enable-nls",
"--with-ssl=openssl"
],
"sources": [
{
"type": "archive",
"url": "https://ftp.gnu.org/gnu/wget/wget-1.18.tar.xz",
"sha256": "b5b55b75726c04c06fe253daec9329a6f1a3c0c1878e3ea76ebfebc139ea9cc1"
}
]
},
{
"name": "plugins",
"no-autogen": true,
"sources": [
{
"type": "file",
"path": "apply_extra"
},
{
"type": "file",
"path": "firefox.sh"
},
{
"type": "file",
"path": "plugins-Makefile",
"dest-filename": "Makefile"
}
]
}
Expand Down
6 changes: 6 additions & 0 deletions plugins-Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
all:
true

install:
install apply_extra /app/bin
install firefox.sh /app/bin/firefox-wrapper

0 comments on commit 467765f

Please sign in to comment.