From d6b11ed722ae4ba60e5b67fba03b2be7bef3093d Mon Sep 17 00:00:00 2001 From: aszlig Date: Sun, 20 Mar 2016 16:44:34 +0100 Subject: chromium/source: Move patches into its own subdir We're going to reference the patches in the Chromium main build rather than applying it to the sources. So as a first step, this should keep the patches away from the "source" subdirectory so we can make it flat. Signed-off-by: aszlig --- .../browsers/chromium/patches/build_fixes_46.patch | 14 ++++ .../chromium/patches/nix_plugin_paths_46.patch | 75 ++++++++++++++++++++++ .../chromium/patches/nix_plugin_paths_50.patch | 75 ++++++++++++++++++++++ .../browsers/chromium/patches/widevine.patch | 12 ++++ .../browsers/chromium/source/build_fixes_46.patch | 14 ---- .../browsers/chromium/source/default.nix | 8 +-- .../chromium/source/nix_plugin_paths_46.patch | 75 ---------------------- .../chromium/source/nix_plugin_paths_50.patch | 75 ---------------------- .../browsers/chromium/source/widevine.patch | 12 ---- 9 files changed, 180 insertions(+), 180 deletions(-) create mode 100644 pkgs/applications/networking/browsers/chromium/patches/build_fixes_46.patch create mode 100644 pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_46.patch create mode 100644 pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_50.patch create mode 100644 pkgs/applications/networking/browsers/chromium/patches/widevine.patch delete mode 100644 pkgs/applications/networking/browsers/chromium/source/build_fixes_46.patch delete mode 100644 pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_46.patch delete mode 100644 pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_50.patch delete mode 100644 pkgs/applications/networking/browsers/chromium/source/widevine.patch diff --git a/pkgs/applications/networking/browsers/chromium/patches/build_fixes_46.patch b/pkgs/applications/networking/browsers/chromium/patches/build_fixes_46.patch new file mode 100644 index 00000000000..c0aeb5d3a56 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/build_fixes_46.patch @@ -0,0 +1,14 @@ +diff --git a/chrome/test/data/webui_test_resources.grd b/chrome/test/data/webui_test_resources.grd +index 6f8530d..f92a76a 100644 +--- a/chrome/test/data/webui_test_resources.grd ++++ b/chrome/test/data/webui_test_resources.grd +@@ -6,9 +6,4 @@ + + + +- +- +- +- +- + diff --git a/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_46.patch b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_46.patch new file mode 100644 index 00000000000..7482be7062d --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_46.patch @@ -0,0 +1,75 @@ +diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc +index 74bf041..5f34198 100644 +--- a/chrome/common/chrome_paths.cc ++++ b/chrome/common/chrome_paths.cc +@@ -66,21 +66,14 @@ static base::LazyInstance + g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; + + // Gets the path for internal plugins. +-bool GetInternalPluginsDirectory(base::FilePath* result) { +-#if defined(OS_MACOSX) && !defined(OS_IOS) +- // 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 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); + } + + #if defined(OS_WIN) +@@ -253,11 +246,11 @@ 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_PEPPER_FLASH_PLUGIN: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH")) + return false; + cur = cur.Append(kPepperFlashBaseDirectory); + break; +@@ -314,7 +307,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; +@@ -349,7 +342,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")); +@@ -366,7 +359,7 @@ bool PathProvider(int key, base::FilePath* result) { + // In the component case, this is the source adapter. Otherwise, it is the + // actual Pepper module that gets loaded. + case chrome::FILE_WIDEVINE_CDM_ADAPTER: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE")) + return false; + cur = cur.AppendASCII(kWidevineCdmAdapterFileName); + break; diff --git a/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_50.patch b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_50.patch new file mode 100644 index 00000000000..062098a8522 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/nix_plugin_paths_50.patch @@ -0,0 +1,75 @@ +diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc +index 74bf041..5f34198 100644 +--- a/chrome/common/chrome_paths.cc ++++ b/chrome/common/chrome_paths.cc +@@ -66,21 +66,14 @@ static base::LazyInstance + 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 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); + } + + #if defined(OS_WIN) +@@ -253,11 +246,11 @@ 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_PEPPER_FLASH_PLUGIN: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH")) + return false; + cur = cur.Append(kPepperFlashBaseDirectory); + break; +@@ -314,7 +307,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; +@@ -349,7 +342,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")); +@@ -366,7 +359,7 @@ bool PathProvider(int key, base::FilePath* result) { + // In the component case, this is the source adapter. Otherwise, it is the + // actual Pepper module that gets loaded. + case chrome::FILE_WIDEVINE_CDM_ADAPTER: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE")) + return false; + cur = cur.AppendASCII(kWidevineCdmAdapterFileName); + break; diff --git a/pkgs/applications/networking/browsers/chromium/patches/widevine.patch b/pkgs/applications/networking/browsers/chromium/patches/widevine.patch new file mode 100644 index 00000000000..45048cada87 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/patches/widevine.patch @@ -0,0 +1,12 @@ +diff -upr chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h +--- chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 01:18:59.000000000 +0300 ++++ chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 09:09:49.157260050 +0300 +@@ -14,4 +14,8 @@ + // - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available + // as a string, e.g., "1.0.123.456"). + ++#include "third_party/widevine/cdm/widevine_cdm_common.h" ++#define WIDEVINE_CDM_AVAILABLE ++#define WIDEVINE_CDM_VERSION_STRING "@WIDEVINE_VERSION@" ++ + #endif // WIDEVINE_CDM_VERSION_H_ diff --git a/pkgs/applications/networking/browsers/chromium/source/build_fixes_46.patch b/pkgs/applications/networking/browsers/chromium/source/build_fixes_46.patch deleted file mode 100644 index c0aeb5d3a56..00000000000 --- a/pkgs/applications/networking/browsers/chromium/source/build_fixes_46.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff --git a/chrome/test/data/webui_test_resources.grd b/chrome/test/data/webui_test_resources.grd -index 6f8530d..f92a76a 100644 ---- a/chrome/test/data/webui_test_resources.grd -+++ b/chrome/test/data/webui_test_resources.grd -@@ -6,9 +6,4 @@ - - - -- -- -- -- -- - diff --git a/pkgs/applications/networking/browsers/chromium/source/default.nix b/pkgs/applications/networking/browsers/chromium/source/default.nix index a566c4bb1c8..bc646f6b252 100644 --- a/pkgs/applications/networking/browsers/chromium/source/default.nix +++ b/pkgs/applications/networking/browsers/chromium/source/default.nix @@ -42,11 +42,11 @@ in stdenv.mkDerivation { ''; patches = [ - ./build_fixes_46.patch - ./widevine.patch + ../patches/build_fixes_46.patch + ../patches/widevine.patch (if versionOlder version "50.0.0.0" - then ./nix_plugin_paths_46.patch - else ./nix_plugin_paths_50.patch) + then ../patches/nix_plugin_paths_46.patch + else ../patches/nix_plugin_paths_50.patch) ]; patchPhase = let diff --git a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_46.patch b/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_46.patch deleted file mode 100644 index 7482be7062d..00000000000 --- a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_46.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc -index 74bf041..5f34198 100644 ---- a/chrome/common/chrome_paths.cc -+++ b/chrome/common/chrome_paths.cc -@@ -66,21 +66,14 @@ static base::LazyInstance - g_invalid_specified_user_data_dir = LAZY_INSTANCE_INITIALIZER; - - // Gets the path for internal plugins. --bool GetInternalPluginsDirectory(base::FilePath* result) { --#if defined(OS_MACOSX) && !defined(OS_IOS) -- // 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 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); - } - - #if defined(OS_WIN) -@@ -253,11 +246,11 @@ 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_PEPPER_FLASH_PLUGIN: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH")) - return false; - cur = cur.Append(kPepperFlashBaseDirectory); - break; -@@ -314,7 +307,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; -@@ -349,7 +342,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")); -@@ -366,7 +359,7 @@ bool PathProvider(int key, base::FilePath* result) { - // In the component case, this is the source adapter. Otherwise, it is the - // actual Pepper module that gets loaded. - case chrome::FILE_WIDEVINE_CDM_ADAPTER: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE")) - return false; - cur = cur.AppendASCII(kWidevineCdmAdapterFileName); - break; diff --git a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_50.patch b/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_50.patch deleted file mode 100644 index 062098a8522..00000000000 --- a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_50.patch +++ /dev/null @@ -1,75 +0,0 @@ -diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc -index 74bf041..5f34198 100644 ---- a/chrome/common/chrome_paths.cc -+++ b/chrome/common/chrome_paths.cc -@@ -66,21 +66,14 @@ static base::LazyInstance - 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 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); - } - - #if defined(OS_WIN) -@@ -253,11 +246,11 @@ 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_PEPPER_FLASH_PLUGIN: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "PEPPERFLASH")) - return false; - cur = cur.Append(kPepperFlashBaseDirectory); - break; -@@ -314,7 +307,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; -@@ -349,7 +342,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")); -@@ -366,7 +359,7 @@ bool PathProvider(int key, base::FilePath* result) { - // In the component case, this is the source adapter. Otherwise, it is the - // actual Pepper module that gets loaded. - case chrome::FILE_WIDEVINE_CDM_ADAPTER: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "WIDEVINE")) - return false; - cur = cur.AppendASCII(kWidevineCdmAdapterFileName); - break; diff --git a/pkgs/applications/networking/browsers/chromium/source/widevine.patch b/pkgs/applications/networking/browsers/chromium/source/widevine.patch deleted file mode 100644 index 45048cada87..00000000000 --- a/pkgs/applications/networking/browsers/chromium/source/widevine.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -upr chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h ---- chromium-42.0.2311.90.orig/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 01:18:59.000000000 +0300 -+++ chromium-42.0.2311.90/third_party/widevine/cdm/widevine_cdm_version.h 2015-04-15 09:09:49.157260050 +0300 -@@ -14,4 +14,8 @@ - // - WIDEVINE_CDM_VERSION_STRING (with the version of the CDM that's available - // as a string, e.g., "1.0.123.456"). - -+#include "third_party/widevine/cdm/widevine_cdm_common.h" -+#define WIDEVINE_CDM_AVAILABLE -+#define WIDEVINE_CDM_VERSION_STRING "@WIDEVINE_VERSION@" -+ - #endif // WIDEVINE_CDM_VERSION_H_ -- cgit 1.4.1