firefox: support for native messaging hosts in wrapper

This commit is contained in:
Rostislav Beneš 2017-11-12 21:18:31 +01:00
parent 7ebacd1a43
commit 8fab6c9520
3 changed files with 31 additions and 2 deletions

View File

@ -0,0 +1,14 @@
diff --git a/toolkit/xre/nsXREDirProvider.cpp b/toolkit/xre/nsXREDirProvider.cpp
index 380c1c1..255539f 100644
--- a/toolkit/xre/nsXREDirProvider.cpp
+++ b/toolkit/xre/nsXREDirProvider.cpp
@@ -306,7 +306,8 @@ GetSystemParentDirectory(nsIFile** aFile)
"/usr/lib/mozilla"
#endif
);
- rv = NS_NewNativeLocalFile(dirname, false, getter_AddRefs(localDir));
+ const char* pathVar = PR_GetEnv("MOZ_SYSTEM_DIR");
+ rv = NS_NewNativeLocalFile((pathVar && *pathVar) ? nsDependentCString(pathVar) : reinterpret_cast<const nsCString&>(dirname), false, getter_AddRefs(localDir));
#endif
if (NS_SUCCEEDED(rv)) {

View File

@ -13,7 +13,7 @@ rec {
}; };
patches = patches =
[ ./no-buildconfig.patch ] [ ./no-buildconfig.patch ./env_var_for_system_dir.patch ]
++ lib.optional stdenv.isi686 (fetchpatch { ++ lib.optional stdenv.isi686 (fetchpatch {
url = "https://hg.mozilla.org/mozilla-central/raw-rev/15517c5a5d37"; url = "https://hg.mozilla.org/mozilla-central/raw-rev/15517c5a5d37";
sha256 = "1ba487p3hk4w2w7qqfxgv1y57vp86b8g3xhav2j20qd3j3phbbn7"; sha256 = "1ba487p3hk4w2w7qqfxgv1y57vp86b8g3xhav2j20qd3j3phbbn7";
@ -38,6 +38,9 @@ rec {
sha512 = "d80c7219548391d8a47b6e404662ea41e6acfa264a67d69365e76dd8943077e388ab24b030850919f8fc6681c11486bdbaaf170d441c861f4a12cedbe08955ab"; sha512 = "d80c7219548391d8a47b6e404662ea41e6acfa264a67d69365e76dd8943077e388ab24b030850919f8fc6681c11486bdbaaf170d441c861f4a12cedbe08955ab";
}; };
patches =
[ ./env_var_for_system_dir.patch ];
meta = firefox.meta // { meta = firefox.meta // {
description = "A web browser built from Firefox Extended Support Release source tree"; description = "A web browser built from Firefox Extended Support Release source tree";
}; };
@ -128,6 +131,9 @@ in rec {
rev = "tor-browser-52.3.0esr-7.0-1-slnos"; rev = "tor-browser-52.3.0esr-7.0-1-slnos";
sha256 = "0szbf8gjbl4dnrb4igy4mq5858i1y6ki4skhdw63iqqdd8w9v4yv"; sha256 = "0szbf8gjbl4dnrb4igy4mq5858i1y6ki4skhdw63iqqdd8w9v4yv";
}; };
patches =
[ ./env_var_for_system_dir.patch ];
} // commonAttrs) {}; } // commonAttrs) {};
tor-browser = tor-browser-7-0; tor-browser = tor-browser-7-0;

View File

@ -1,4 +1,4 @@
{ stdenv, lib, makeDesktopItem, makeWrapper, config { stdenv, lib, makeDesktopItem, makeWrapper, lndir, config
## various stuff that can be plugged in ## various stuff that can be plugged in
, flashplayer, hal-flash , flashplayer, hal-flash
@ -47,6 +47,9 @@ let
++ lib.optional (cfg.enableEsteid or false) esteidfirefoxplugin ++ lib.optional (cfg.enableEsteid or false) esteidfirefoxplugin
++ lib.optional (cfg.enableVLC or false) vlc_npapi ++ lib.optional (cfg.enableVLC or false) vlc_npapi
); );
nativeMessagingHosts =
([ ]
);
libs = (if ffmpegSupport then [ ffmpeg ] else with gst_all; [ gstreamer gst-plugins-base ]) libs = (if ffmpegSupport then [ ffmpeg ] else with gst_all; [ gstreamer gst-plugins-base ])
++ lib.optional gssSupport kerberos ++ lib.optional gssSupport kerberos
++ lib.optionals (cfg.enableQuakeLive or false) ++ lib.optionals (cfg.enableQuakeLive or false)
@ -98,6 +101,7 @@ in stdenv.mkDerivation {
--prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \ --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
--suffix PATH ':' "$out/bin" \ --suffix PATH ':' "$out/bin" \
--set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \ --set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \
--set MOZ_SYSTEM_DIR "$out/lib/mozilla" \
${lib.optionalString (!ffmpegSupport) ${lib.optionalString (!ffmpegSupport)
''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"'' ''--prefix GST_PLUGIN_SYSTEM_PATH : "$GST_PLUGIN_SYSTEM_PATH"''
+ lib.optionalString (browser ? gtk3) + lib.optionalString (browser ? gtk3)
@ -117,6 +121,11 @@ in stdenv.mkDerivation {
install -D -t $out/share/applications $desktopItem/share/applications/* install -D -t $out/share/applications $desktopItem/share/applications/*
mkdir -p $out/lib/mozilla
for ext in ${toString nativeMessagingHosts}; do
${lndir}/bin/lndir -silent $ext/lib/mozilla $out/lib/mozilla
done
# For manpages, in case the program supplies them # For manpages, in case the program supplies them
mkdir -p $out/nix-support mkdir -p $out/nix-support
echo ${browser} > $out/nix-support/propagated-user-env-packages echo ${browser} > $out/nix-support/propagated-user-env-packages