summary refs log tree commit diff
diff options
context:
space:
mode:
authorYuriy Taraday <yorik.sar@gmail.com>2018-05-12 04:19:56 +0400
committerYuriy Taraday <yorik.sar@gmail.com>2018-05-31 00:27:14 +0400
commit72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8 (patch)
treedd9c6b53b3d24be232118e48da16ca6931056572
parent584006a85e3daed5a8e5719fd6a4d6b82d0252f3 (diff)
downloadnixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar.gz
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar.bz2
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar.lz
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar.xz
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.tar.zst
nixlib-72d7b5ddb14a8b5903f01c7b40f216a0a6149fb8.zip
chromium: fix nix_plugin_paths for 68+
-rw-r--r--pkgs/applications/networking/browsers/chromium/common.nix5
-rw-r--r--pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_68.patch70
2 files changed, 74 insertions, 1 deletions
diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix
index defbfbd121d1..4718cc6c1ede 100644
--- a/pkgs/applications/networking/browsers/chromium/common.nix
+++ b/pkgs/applications/networking/browsers/chromium/common.nix
@@ -138,12 +138,13 @@ let
       ++ optional pulseSupport libpulseaudio;
 
     patches = [
-      ./patches/nix_plugin_paths_52.patch
       # As major versions are added, you can trawl the gentoo and arch repos at
       # https://gitweb.gentoo.org/repo/gentoo.git/plain/www-client/chromium/
       # https://git.archlinux.org/svntogit/packages.git/tree/trunk?h=packages/chromium
       # for updated patches and hints about build flags
     # (gentooPatch "<patch>" "0000000000000000000000000000000000000000000000000000000000000000")
+    ]  ++ optionals (versionRange "66" "68") [
+      ./patches/nix_plugin_paths_52.patch
     ]  ++ optionals (versionRange "66" "67") [
       (gentooPatch "chromium-webrtc-r0.patch" "0wp4zivbv2wpgiwmiznbq1aw4w98mvwjvdy36cpfmnvr8yw430pd")
       (gentooPatch "chromium-ffmpeg-r1.patch" "1k8agaqsvg0w0s6s5wh346ih02cc86vr0vwyshw2q9vafa0jvmq4")
@@ -154,6 +155,8 @@ let
       (githubPatch "ba4141e451f4e0b1b19410b1b503bd32e150df06" "1cjxw1f9fin6z12b0mcxnxf2mdjb0n3chwz7mgvmp9yij8qhqnxj")
       (githubPatch "b34ed1e6524479d61ee944ebf6ca7389ea47e563" "1s13zw93nsyr259dzck6gbhg4x46qg5sg14djf4bvrrc6hlkiczw")
       (githubPatch "4f2b52281ce1649ea8347489443965ad33262ecc" "1g59izkicn9cpcphamdgrijs306h5b9i7i4pmy134asn1ifiax5z")
+    ]  ++ optionals (versionAtLeast version "68") [
+      ./patches/nix_plugin_paths_68.patch
     ] ++ optional enableWideVine ./patches/widevine.patch
       ++ optionals (stdenv.isAarch64 && versionRange "65" "67") [
         ./patches/skia_buildfix.patch
diff --git a/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_68.patch b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_68.patch
new file mode 100644
index 000000000000..c90e98e72fa1
--- /dev/null
+++ b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_68.patch
@@ -0,0 +1,70 @@
+diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc
+index f4e119d..d9775bd 100644
+--- a/chrome/common/chrome_paths.cc
++++ b/chrome/common/chrome_paths.cc
+@@ -68,21 +68,14 @@ static base::LazyInstance<base::FilePath>
+     g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER;
+ 
+ // Gets the path for internal plugins.
+-bool GetInternalPluginsDirectory(base::FilePath* result) {
+-#if defined(OS_MACOSX)
+-  // If called from Chrome, get internal plugins from a subdirectory of the
+-  // framework.
+-  if (base::mac::AmIBundled()) {
+-    *result = chrome::GetFrameworkBundlePath();
+-    DCHECK(!result->empty());
+-    *result = result->Append("Internet Plug-Ins");
+-    return true;
+-  }
+-  // In tests, just look in the module directory (below).
+-#endif
+-
+-  // The rest of the world expects plugins in the module directory.
+-  return base::PathService::Get(base::DIR_MODULE, result);
++bool GetInternalPluginsDirectory(base::FilePath* result,
++                                 const std::string& ident) {
++  std::string full_env = std::string("NIX_CHROMIUM_PLUGIN_PATH_") + ident;
++  const char* value = getenv(full_env.c_str());
++  if (value == NULL)
++      return PathService::Get(base::DIR_MODULE, result);
++  else
++      *result = base::FilePath(value);
+ }
+ 
+ // Gets the path for bundled implementations of components. Note that these
+@@ -272,7 +265,7 @@ bool PathProvider(int key, base::FilePath* result) {
+       create_dir = true;
+       break;
+     case chrome::DIR_INTERNAL_PLUGINS:
+-      if (!GetInternalPluginsDirectory(&cur))
++      if (!GetInternalPluginsDirectory(&cur, "ALL"))
+         return false;
+       break;
+     case chrome::DIR_COMPONENTS:
+@@ -280,7 +273,7 @@ bool PathProvider(int key, base::FilePath* result) {
+         return false;
+       break;
+     case chrome::DIR_PEPPER_FLASH_PLUGIN:
+-      if (!GetInternalPluginsDirectory(&cur))
++      if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH"))
+         return false;
+       cur = cur.Append(kPepperFlashBaseDirectory);
+       break;
+@@ -323,7 +316,7 @@ bool PathProvider(int key, base::FilePath* result) {
+     // We currently need a path here to look up whether the plugin is disabled
+     // and what its permissions are.
+     case chrome::FILE_NACL_PLUGIN:
+-      if (!GetInternalPluginsDirectory(&cur))
++      if (!GetInternalPluginsDirectory(&cur, "NACL"))
+         return false;
+       cur = cur.Append(kInternalNaClPluginFileName);
+       break;
+@@ -358,7 +351,7 @@ bool PathProvider(int key, base::FilePath* result) {
+         cur = cur.DirName();
+       }
+ #else
+-      if (!GetInternalPluginsDirectory(&cur))
++      if (!GetInternalPluginsDirectory(&cur, "PNACL"))
+         return false;
+ #endif
+       cur = cur.Append(FILE_PATH_LITERAL("pnacl"));