summary refs log tree commit diff
path: root/pkgs/applications
diff options
context:
space:
mode:
authorDominik Xaver Hörl <hoe.dom@gmx.de>2021-02-09 09:11:44 +0100
committerDominik Xaver Hörl <hoe.dom@gmx.de>2021-02-09 19:52:54 +0100
commitac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e (patch)
tree556d182660924c5ee5288c0b19d12e639ae7abc6 /pkgs/applications
parenta073dd54aa89a3a2e4c18ee4ab266f32738452d7 (diff)
downloadnixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar.gz
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar.bz2
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar.lz
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar.xz
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.tar.zst
nixpkgs-ac2e3ef2709cb2ee0be5fff77ceb55a653a89e5e.zip
firefox/wrapper: clean up plugin related code
Diffstat (limited to 'pkgs/applications')
-rw-r--r--pkgs/applications/networking/browsers/firefox/wrapper.nix57
1 files changed, 21 insertions, 36 deletions
diff --git a/pkgs/applications/networking/browsers/firefox/wrapper.nix b/pkgs/applications/networking/browsers/firefox/wrapper.nix
index 96a4e15adf8..ed88bf587d5 100644
--- a/pkgs/applications/networking/browsers/firefox/wrapper.nix
+++ b/pkgs/applications/networking/browsers/firefox/wrapper.nix
@@ -51,27 +51,6 @@ let
       alsaSupport = browser.alsaSupport or false;
       pipewireSupport = browser.pipewireSupport or false;
 
-      # FIXME: This should probably be an assertion now?
-      plugins =
-        let
-          removed = lib.filter (a: builtins.hasAttr a cfg) [
-            "enableAdobeFlash"
-            "enableAdobeReader"
-            "enableBluejeans"
-            "enableDjvu"
-            "enableFriBIDPlugin"
-            "enableGoogleTalkPlugin"
-            "enableMPlayer"
-            "enableVLC"
-            "icedtea"
-            "jre"
-          ];
-        in if removed != [] then
-          throw "Your configuration mentions ${lib.concatMapStringsSep ", " (p: browserName + "." + p) removed}. All plugin related options have been removed, since Firefox from version 52 onwards no longer supports npapi plugins (see https://support.mozilla.org/en-US/kb/npapi-plugins)."
-        else
-          []
-        ;
-
       nativeMessagingHosts =
         ([ ]
           ++ lib.optional (cfg.enableBrowserpass or false) (lib.getBin browserpass)
@@ -164,7 +143,24 @@ let
       #                           #
       #############################
 
-    in stdenv.mkDerivation {
+      # TODO: remove this after the next release (21.03)
+      configPlugins = lib.filter (a: builtins.hasAttr a cfg) [
+        "enableAdobeFlash"
+        "enableAdobeReader"
+        "enableBluejeans"
+        "enableDjvu"
+        "enableFriBIDPlugin"
+        "enableGoogleTalkPlugin"
+        "enableMPlayer"
+        "enableVLC"
+        "icedtea"
+        "jre"
+      ];
+      pluginsError =
+        "Your configuration mentions ${lib.concatMapStringsSep ", " (p: browserName + "." + p) configPlugins}. All plugin related options have been removed, since Firefox from version 52 onwards no longer supports npapi plugins (see https://support.mozilla.org/en-US/kb/npapi-plugins).";
+
+    in if configPlugins != [] then throw pluginsError else
+      (stdenv.mkDerivation {
       inherit pname version;
 
       desktopItem = makeDesktopItem {
@@ -262,12 +258,9 @@ let
 
         makeWrapper "$oldExe" \
           "$out${browser.execdir or "/bin"}/${browserName}${nameSuffix}" \
-            --suffix-each MOZ_PLUGIN_PATH ':' "$plugins" \
             --suffix LD_LIBRARY_PATH ':' "$libs" \
             --suffix-each GTK_PATH ':' "$gtk_modules" \
-            --suffix-each LD_PRELOAD ':' "$(cat $(filterExisting $(addSuffix /extra-ld-preload $plugins)))" \
             --prefix PATH ':' "${xdg-utils}/bin" \
-            --prefix-contents PATH ':' "$(filterExisting $(addSuffix /extra-bin-path $plugins))" \
             --suffix PATH ':' "$out${browser.execdir or "/bin"}" \
             --set MOZ_APP_LAUNCHER "${browserName}${nameSuffix}" \
             --set MOZ_SYSTEM_DIR "$out/lib/mozilla" \
@@ -351,9 +344,6 @@ let
 
       preferLocalBuild = true;
 
-      # Let each plugin tell us (through its `mozillaPlugin') attribute
-      # where to find the plugin in its tree.
-      plugins = map (x: x + x.mozillaPlugin) plugins;
       libs = lib.makeLibraryPath libs + ":" + lib.makeSearchPathOutput "lib" "lib64" libs;
       gtk_modules = map (x: x + x.gtkModule) gtk_modules;
 
@@ -362,14 +352,9 @@ let
       disallowedRequisites = [ stdenv.cc ];
 
       meta = browser.meta // {
-        description =
-          browser.meta.description
-          + " (with plugins: "
-          + lib.concatStrings (lib.intersperse ", " (map (x: x.name) plugins))
-          + ")";
+        description = browser.meta.description;
         hydraPlatforms = [];
         priority = (browser.meta.priority or 0) - 1; # prefer wrapper over the package
       };
-    };
-in
-  lib.makeOverridable wrapper
+    });
+in lib.makeOverridable wrapper