From 58fd4f672f08a323f86a6a2eb57069be83893084 Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Thu, 11 Jun 2015 18:23:58 +0200 Subject: [PATCH 1/5] Chromium: Update and build fixes. Changes included: - Update versions. - Use gyp package not gyp_svn1977. - Remove icu from buildInputs, since this causes a build error due to inferference with use_system_icu=false. - Remove the hack that inserts the absolute path into gyp files, and pass `--depth .` to gyp. This resolves the `third_party/angle` gyp error. - Do a normal copy of the source code not a symlink copy. This resolves some link error where the symlinks interfere with relative paths (seems like because gyp resolves symlinks first). Note, this used to be worked around with the absolute path insertion hack. - Change the bucketURL in update.nix to https (for more secure updates). --- .../networking/browsers/chromium/common.nix | 17 +++++-------- .../browsers/chromium/source/sources.nix | 24 +++++++++---------- .../browsers/chromium/source/update.nix | 2 +- 3 files changed, 19 insertions(+), 24 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 1f6c272aceb2..d3a0c86daf4c 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -1,7 +1,7 @@ { stdenv, fetchurl, ninja, which # default dependencies -, bzip2, flac, speex, icu, libopus +, bzip2, flac, speex, libopus , libevent, expat, libjpeg, snappy , libpng, libxml2, libxslt, libcap , xdg_utils, yasm, minizip, libwebp @@ -84,7 +84,7 @@ let }; defaultDependencies = [ - bzip2 flac speex icu opusWithCustomModes + bzip2 flac speex opusWithCustomModes libevent expat libjpeg snappy libpng libxml2 libxslt libcap xdg_utils yasm minizip libwebp @@ -113,7 +113,7 @@ let glib gtk dbus_glib libXScrnSaver libXcursor libXtst mesa pciutils protobuf speechd libXdamage - pythonPackages.gyp_svn1977 pythonPackages.ply pythonPackages.jinja2 + pythonPackages.gyp pythonPackages.ply pythonPackages.jinja2 ] ++ optional gnomeKeyringSupport libgnome_keyring3 ++ optionals gnomeSupport [ gnome.GConf libgcrypt ] ++ optional enableSELinux libselinux @@ -124,15 +124,10 @@ let # be fixed, then try again to unbundle everything into separate # derivations. prePatch = '' - cp -dsr --no-preserve=mode "${source.main}"/* . - cp -dsr --no-preserve=mode "${source.sandbox}" sandbox + cp -dr --no-preserve=mode "${source.main}"/* . + cp -dr --no-preserve=mode "${source.sandbox}" sandbox cp -dr "${source.bundled}" third_party chmod -R u+w third_party - - # Hardcode source tree root in all gyp files - find -iname '*.gyp*' \( -type f -o -type l \) \ - -exec sed -i -e 's|<(DEPTH)|'"$(pwd)"'|g' {} + \ - -exec chmod u+w {} + ''; postPatch = optionalString (versionOlder version "42.0.0.0") '' @@ -200,7 +195,7 @@ let # This is to ensure expansion of $out. libExecPath="${libExecPath}" python build/linux/unbundle/replace_gyp_files.py ${gypFlags} - python build/gyp_chromium -f ninja --depth "$(pwd)" ${gypFlags} + python build/gyp_chromium -f ninja --depth . ${gypFlags} ''; buildPhase = let diff --git a/pkgs/applications/networking/browsers/chromium/source/sources.nix b/pkgs/applications/networking/browsers/chromium/source/sources.nix index e1144a44afb2..3adbbab8392b 100644 --- a/pkgs/applications/networking/browsers/chromium/source/sources.nix +++ b/pkgs/applications/networking/browsers/chromium/source/sources.nix @@ -1,21 +1,21 @@ # This file is autogenerated from update.sh in the parent directory. { dev = { - version = "43.0.2327.5"; - sha256 = "0k9jpzm1n7d3zv6f77vz33jcvmnbxnl6plabvlrf8w83kbzhi76n"; - sha256bin32 = "1dm4xp0x02kqj82giw45qd2z12wf22h2bs0d3hnlz050innxgcb6"; - sha256bin64 = "1b13g44y704llsnw68840zmaahj1hwzram50v8fqmff44w1b0bxb"; + version = "45.0.2421.0"; + sha256 = "1qc80y0mhwnvxrvpc3csskgb536wq34c0fgk19h1qb4xc62lxhsk"; + sha256bin32 = "1xqhyrlmh00md6i1q4wr0xihqbvcpshzscnjclrn53dlw5zs2s89"; + sha256bin64 = "0akdhwwdfcbqfh65a82zigbhsi8sbhhw6904cjprb3bmv4l3c598"; }; beta = { - version = "42.0.2311.39"; - sha256 = "0qiyg8bg9f1daf8v2jlrv54lis7156h44ak42jdx96xanvj2rvj0"; - sha256bin32 = "0v4dr2a3n51dais2mg0dml0rmqfmalfj0zgp20a4kkarbpih1x0v"; - sha256bin64 = "19638ik9qgfmxpzdry0qwkwpzvhlbs2h2nn1kwsjja5j49817ksx"; + version = "44.0.2403.39"; + sha256 = "15c4adg0r9ym3pxya7vv4d148gv2pdwaaymxvvw511fjwffdv71n"; + sha256bin32 = "1gaypkah10y31gb5f7vnyv0v73z5zjznmsp6vh2m4hfajx7s55jn"; + sha256bin64 = "1j1ma6asl3ibjv3apyw24vhyi1qy64f586w8jizqzp4h962gj95c"; }; stable = { - version = "41.0.2272.89"; - sha256 = "1saxcyqp8pz496qwdgl4dqxll6l9icbljm56w1rrkxgwrrvl4iwk"; - sha256bin32 = "19srg0isp1k4fwixwjxm1j88bnqx9sb349n992i038c3h8raa1v4"; - sha256bin64 = "1fb8ffgbsjsij7bd1qawa03z9pybasfig1cmdzwybmlwg2fdlvfv"; + version = "43.0.2357.124"; + sha256 = "09m8bb5f17mx6cd3h5irslw07h2s0drda35v17vcr7qfhk8jdh92"; + sha256bin32 = "15n2fla1ixrqzi0in0vyl8n5wkv20fpd96lff65rwr9diylz287p"; + sha256bin64 = "0x6igpcf29zmwqgphvy9nm527k9g7na2cvgc5nimw4fs5dakzzjr"; }; } diff --git a/pkgs/applications/networking/browsers/chromium/source/update.nix b/pkgs/applications/networking/browsers/chromium/source/update.nix index 27af85de5465..e639cdb087bc 100644 --- a/pkgs/applications/networking/browsers/chromium/source/update.nix +++ b/pkgs/applications/networking/browsers/chromium/source/update.nix @@ -9,7 +9,7 @@ let then import ./sources.nix else null; - bucketURL = "http://commondatastorage.googleapis.com/" + bucketURL = "https://commondatastorage.googleapis.com/" + "chromium-browser-official"; debURL = "https://dl.google.com/linux/chrome/deb/pool/main/g"; From 6a8afa4bb35ee9cffb8e62f5a294adc781b9d348 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 11 Jun 2015 19:34:29 +0200 Subject: [PATCH 2/5] chromium: Fix plugin_paths patch for version 44. The pepper effects plugin has been removed and migrated to NaCl, so I'm just dropping the hunk of that patch. Upstream reviow URL: https://codereview.chromium.org/1085393003 Signed-off-by: aszlig --- .../browsers/chromium/source/default.nix | 13 ++- .../chromium/source/nix_plugin_paths_44.patch | 84 +++++++++++++++++++ 2 files changed, 90 insertions(+), 7 deletions(-) create mode 100644 pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_44.patch diff --git a/pkgs/applications/networking/browsers/chromium/source/default.nix b/pkgs/applications/networking/browsers/chromium/source/default.nix index 54430bb5be9f..a3a466314845 100644 --- a/pkgs/applications/networking/browsers/chromium/source/default.nix +++ b/pkgs/applications/networking/browsers/chromium/source/default.nix @@ -18,7 +18,7 @@ let "s,^/,," ]); - pre42 = versionOlder version "42.0.0.0"; + pre44 = versionOlder version "44.0.0.0"; in stdenv.mkDerivation { name = "chromium-source-${version}"; @@ -47,10 +47,10 @@ in stdenv.mkDerivation { done ''; - patches = if pre42 then [ - ./sandbox_userns_36.patch ./nix_plugin_paths.patch - ] else [ + patches = if pre44 then [ ./nix_plugin_paths_42.patch + ] else [ + ./nix_plugin_paths_44.patch ]; patchPhase = let @@ -73,11 +73,10 @@ in stdenv.mkDerivation { -e 's|/bin/echo|echo|' \ -e "/python_arch/s/: *'[^']*'/: '""'/" \ "$out/build/common.gypi" "$main/chrome/chrome_tests.gypi" - '' + optionalString useOpenSSL '' - cat $opensslPatches | patch -p1 -d "$bundled/openssl/openssl" - '' + optionalString (!pre42) '' sed -i -e '/LOG.*no_suid_error/d' \ "$main/content/browser/browser_main_loop.cc" + '' + optionalString useOpenSSL '' + cat $opensslPatches | patch -p1 -d "$bundled/openssl/openssl" ''; preferLocalBuild = true; diff --git a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_44.patch b/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_44.patch new file mode 100644 index 000000000000..326da7f420a5 --- /dev/null +++ b/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths_44.patch @@ -0,0 +1,84 @@ +diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc +index 8a205a6..d5c24e1 100644 +--- a/chrome/common/chrome_paths.cc ++++ b/chrome/common/chrome_paths.cc +@@ -97,21 +97,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); + } + + } // namespace +@@ -248,11 +241,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; +@@ -285,7 +278,7 @@ bool PathProvider(int key, base::FilePath* result) { + cur = cur.Append(FILE_PATH_LITERAL("script.log")); + break; + case chrome::FILE_FLASH_PLUGIN: +- if (!GetInternalPluginsDirectory(&cur)) ++ if (!GetInternalPluginsDirectory(&cur, "FILEFLASH")) + return false; + cur = cur.Append(kInternalFlashPluginFileName); + break; +@@ -308,7 +301,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; +@@ -343,7 +336,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")); +@@ -372,7 +365,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; From af54ddf8b635e2897db64d775317e33a42c259e2 Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 11 Jun 2015 19:36:28 +0200 Subject: [PATCH 3/5] chromium: Drop plugin_paths patch for old versions. The patch was for versions prior to version 22, so we no longer need it. Signed-off-by: aszlig --- .../chromium/source/nix_plugin_paths.patch | 99 ------------------- 1 file changed, 99 deletions(-) delete mode 100644 pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths.patch diff --git a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths.patch b/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths.patch deleted file mode 100644 index 0220d0429413..000000000000 --- a/pkgs/applications/networking/browsers/chromium/source/nix_plugin_paths.patch +++ /dev/null @@ -1,99 +0,0 @@ -diff --git a/chrome/common/chrome_paths.cc b/chrome/common/chrome_paths.cc -index 8a205a6..d5c24e1 100644 ---- a/chrome/common/chrome_paths.cc -+++ b/chrome/common/chrome_paths.cc -@@ -97,21 +97,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); - } - - } // namespace -@@ -248,11 +241,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; -@@ -285,7 +278,7 @@ bool PathProvider(int key, base::FilePath* result) { - cur = cur.Append(FILE_PATH_LITERAL("script.log")); - break; - case chrome::FILE_FLASH_PLUGIN: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "FILEFLASH")) - return false; - cur = cur.Append(kInternalFlashPluginFileName); - break; -@@ -295,12 +288,12 @@ bool PathProvider(int key, base::FilePath* result) { - cur = cur.Append(chrome::kPepperFlashPluginFilename); - break; - case chrome::FILE_PDF_PLUGIN: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "PDF")) - return false; - cur = cur.Append(kInternalPDFPluginFileName); - break; - case chrome::FILE_EFFECTS_PLUGIN: -- if (!GetInternalPluginsDirectory(&cur)) -+ if (!GetInternalPluginsDirectory(&cur, "FILE_EFFECTS")) - return false; - cur = cur.Append(kEffectsPluginFileName); - break; -@@ -308,7 +301,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; -@@ -343,7 +336,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")); -@@ -372,7 +365,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; From f3ca1cc2382acdeaa992ea599d34086b32605b92 Mon Sep 17 00:00:00 2001 From: Ambroz Bizjak Date: Thu, 11 Jun 2015 20:58:05 +0200 Subject: [PATCH 4/5] gyp: 2015-05-17 -> 2015-06-11 --- pkgs/top-level/python-packages.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index c65fe86c3829..58b2a9ee213e 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5920,12 +5920,12 @@ let gyp = buildPythonPackage rec { name = "gyp-${version}"; - version = "2015-05-15"; + version = "2015-06-11"; src = pkgs.fetchgit { url = "https://chromium.googlesource.com/external/gyp.git"; - rev = "9f594095c5b14f8bc518081a660e77890c294861"; - sha256 = "1xqi44alnw9c31jg2hz7flz5nabq003b4jyin12h3s9zl82y6vd5"; + rev = "fdc7b812f99e48c00e9a487bd56751bbeae07043"; + sha256 = "176sdxkva2irr1v645nn4q6rwc6grbb1wxj82n7x9hh09q4bxqcz"; }; patches = optionals pkgs.stdenv.isDarwin [ From d15777fac98f26d5f7ab599a86bc418105ebcd4f Mon Sep 17 00:00:00 2001 From: aszlig Date: Thu, 11 Jun 2015 21:28:16 +0200 Subject: [PATCH 5/5] gyp: Remove old SVN version to build Chromium. This reverts commit b26de392522176b9a176eb21bb5be4a5ac8d9062. We no longer need this version because Chromium now builds with the latest gyp version, see 58fd4f672f08a323f86a6a2eb57069be83893084. Signed-off-by: aszlig --- pkgs/top-level/python-packages.nix | 22 ---------------------- 1 file changed, 22 deletions(-) diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 58b2a9ee213e..c625301926b7 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5941,28 +5941,6 @@ let }; }; - # Needed to build Chromium until #7402 is fixed. - gyp_svn1977 = pkgs.lowPrio (buildPythonPackage rec { - rev = "1977"; - name = "gyp-r${rev}"; - - src = pkgs.fetchsvn { - url = "http://gyp.googlecode.com/svn/trunk"; - inherit rev; - sha256 = "0vnr75yd3bidysiwl9lljvf1dv6v9m9xqdnx0hdgyl92w689n9j8"; - }; - - patches = optionals pkgs.stdenv.isDarwin [ - ../development/python-modules/gyp/no-darwin-cflags.patch - ]; - - meta = { - homepage = http://code.google.com/p/gyp; - license = licenses.bsd3; - description = "Generate Your Projects"; - }; - }); - guessit = buildPythonPackage rec { version = "0.9.4"; name = "guessit-${version}";