From 781022de46fd821ee0683d7e81de1a16f48e9b82 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:47:07 +0300 Subject: [PATCH 1/6] chromium.mkDerivation: use ninja from nativeBuildInputs Also move Python packages there. --- pkgs/applications/networking/browsers/chromium/common.nix | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index ea66703f166d..2acf5627756a 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -88,6 +88,11 @@ let nativeBuildInputs = [ gn which python2Packages.python perl pkgconfig ]; + nativeBuildInputs = [ + ninja which perl pkgconfig python + python2Packages.ply python2Packages.jinja2 + ]; + buildInputs = defaultDependencies ++ [ nspr nss systemd utillinux alsaLib @@ -95,7 +100,6 @@ let glib gtk2 dbus_glib libXScrnSaver libXcursor libXtst mesa pciutils protobuf speechd libXdamage - python2Packages.ply python2Packages.jinja2 ] ++ optional gnomeKeyringSupport libgnome_keyring3 ++ optionals gnomeSupport [ gnome.GConf libgcrypt ] ++ optional enableSELinux libselinux @@ -182,7 +186,7 @@ let buildPhase = let buildCommand = target: '' - "${ninja}/bin/ninja" -C "${buildPath}" \ + ninja -C "${buildPath}" \ -j$NIX_BUILD_CORES -l$NIX_BUILD_CORES \ "${target}" '' + optionalString (target == "mksnapshot" || target == "chrome") '' From 3effe0b9b5458387798961dc510f626bf6e39b0e Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:49:02 +0300 Subject: [PATCH 2/6] chromium: export version --- pkgs/applications/networking/browsers/chromium/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index d014999a667c..fdc22a5be006 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -108,7 +108,7 @@ in stdenv.mkDerivation { cp -v "${desktopItem}/share/applications/"* "$out/share/applications" ''; - inherit (chromium.browser) meta packageName; + inherit (chromium.browser) meta packageName version; passthru = { inherit (chromium) upstream-info browser; From b2eb9f4a9609ee319a6e136a1aac3c035c0c079c Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:48:05 +0300 Subject: [PATCH 3/6] chromium.mkDerivation: run {pre,post}Configure This allows us to add custom steps. --- pkgs/applications/networking/browsers/chromium/common.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 2acf5627756a..bc581445450e 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -177,11 +177,15 @@ let } // (extraAttrs.gnFlags or {})); configurePhase = '' + runHook preConfigure + # This is to ensure expansion of $out. libExecPath="${libExecPath}" python build/linux/unbundle/replace_gn_files.py \ --system-libraries ${toString gnSystemLibraries} gn gen --args=${escapeShellArg gnFlags} out/Release + + runHook postConfigure ''; buildPhase = let From 003fa8fed5480d3e22d518aeeba1d62809809279 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:40:39 +0300 Subject: [PATCH 4/6] gn: remove Chromium depends on bundled versioon of gn. It's also chromium-specific build tool, so it's not feasible to package. --- .../networking/browsers/chromium/common.nix | 10 ++- .../tools/build-managers/gn/default.nix | 80 ------------------- pkgs/top-level/all-packages.nix | 2 - 3 files changed, 6 insertions(+), 86 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/gn/default.nix diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index bc581445450e..a99a5059d18c 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -1,4 +1,4 @@ -{ stdenv, gn, ninja, which +{ stdenv, ninja, which # default dependencies , bzip2, flac, speex, libopus @@ -86,10 +86,8 @@ let src = upstream-info.main; - nativeBuildInputs = [ gn which python2Packages.python perl pkgconfig ]; - nativeBuildInputs = [ - ninja which perl pkgconfig python + ninja which python2Packages.python perl pkgconfig python2Packages.ply python2Packages.jinja2 ]; @@ -179,6 +177,10 @@ let configurePhase = '' runHook preConfigure + # Build gn + python tools/gn/bootstrap/bootstrap.py -v -s --no-clean + PATH="$PWD/out/Release:$PATH" + # This is to ensure expansion of $out. libExecPath="${libExecPath}" python build/linux/unbundle/replace_gn_files.py \ diff --git a/pkgs/development/tools/build-managers/gn/default.nix b/pkgs/development/tools/build-managers/gn/default.nix deleted file mode 100644 index 6fdd250913c9..000000000000 --- a/pkgs/development/tools/build-managers/gn/default.nix +++ /dev/null @@ -1,80 +0,0 @@ -{ stdenv, fetchgit, fetchurl, python2, ninja, libevent, xdg-user-dirs }: - -let - date = "20161008"; - - sourceTree = { - "src/base" = { - rev = "e71a514e60b085cc92bf6ef951ec329f52c79f9f"; - sha256 = "0zycbssmd2za0zij8czcs1fr66fi12f1g5ysc8fzkf8khbs5h6a9"; - }; - "src/build" = { - rev = "17093d45bf738e9ae4b6294492860ee65218a657"; - sha256 = "0i9py78c3f46sc789qvdhmgjgyrghysbqjgr67iypwphw52jv2dz"; - }; - "src/tools/gn" = { - rev = "9ff32cf3f1f4ad0212ac674b6303e7aa68f44f3f"; - sha256 = "14jr45k5fgcqk9d18fd77sijlqavvnv0knndh74zyb0b60464hz1"; - }; - "testing/gtest" = { - rev = "585ec31ea716f08233a815e680fc0d4699843938"; - sha256 = "0csn1cza66851nmxxiw42smsm3422mx67vcyykwn0a71lcjng6rc"; - }; - }; - - mkDepend = path: attrs: fetchgit { - url = "https://chromium.googlesource.com/chromium/${path}"; - inherit (attrs) rev sha256; - }; - -in stdenv.mkDerivation rec { - name = "gn-${version}"; - version = "0.0.0.${date}"; - - unpackPhase = '' - ${with stdenv.lib; concatStrings (mapAttrsToList (path: sha256: '' - dest=source/${escapeShellArg (removePrefix "src/" path)} - mkdir -p "$(dirname "$dest")" - cp --no-preserve=all -rT ${escapeShellArg (mkDepend path sha256)} "$dest" - '') sourceTree)} - ( mkdir -p source/third_party - cd source/third_party - unpackFile ${xdg-user-dirs.src} - mv * xdg_user - ) - ''; - - sourceRoot = "source"; - - postPatch = '' - # GN's bootstrap script relies on shebangs (which are relying on FHS paths), - # except when on Windows. So instead of patchShebang-ing it, let's just - # force the same behaviour as on Windows. - sed -i -e '/^def *check_call/,/^[^ ]/ { - s/is_win/True/ - }' tools/gn/bootstrap/bootstrap.py - - # Patch out Chromium-bundled libevent and xdg_user_dirs - sed -i -e '/static_libraries.*libevent/,/^ *\]\?[})]$/d' \ - tools/gn/bootstrap/bootstrap.py - ''; - - NIX_LDFLAGS = "-levent"; - - nativeBuildInputs = [ python2 ninja ]; - buildInputs = [ libevent ]; - - buildPhase = '' - python2 tools/gn/bootstrap/bootstrap.py -v -s --no-clean - ''; - - installPhase = '' - install -vD out_bootstrap/gn "$out/bin/gn" - ''; - - meta = { - description = "A meta-build system that generates NinjaBuild files"; - homepage = "https://chromium.googlesource.com/chromium/src/tools/gn/"; - license = stdenv.lib.licenses.bsd3; - }; -} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index e9e20f795fcf..c0295234ffd3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -6372,8 +6372,6 @@ with pkgs; global = callPackage ../development/tools/misc/global { }; - gn = callPackage ../development/tools/build-managers/gn { }; - gnome_doc_utils = callPackage ../development/tools/documentation/gnome-doc-utils {}; gnum4 = callPackage ../development/tools/misc/gnum4 { }; From c5b07975d8926a65b433679e00f80e1db8f59fb3 Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:42:06 +0300 Subject: [PATCH 5/6] chromium.mkDerivation: update flags * Remove libselinux flag: it's no longer supported; * Use new gold flags. --- pkgs/applications/networking/browsers/chromium/common.nix | 7 ++----- pkgs/applications/networking/browsers/chromium/default.nix | 3 +-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index a99a5059d18c..8b852d4b6d3c 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -20,7 +20,6 @@ , libexif ? null # only needed for Chromium before version 51 # package customization -, enableSELinux ? false, libselinux ? null , enableNaCl ? false , enableHotwording ? false , enableWideVine ? false @@ -100,7 +99,6 @@ let pciutils protobuf speechd libXdamage ] ++ optional gnomeKeyringSupport libgnome_keyring3 ++ optionals gnomeSupport [ gnome.GConf libgcrypt ] - ++ optional enableSELinux libselinux ++ optionals cupsSupport [ libgcrypt cups ] ++ optional pulseSupport libpulseaudio ++ optional (versionAtLeast version "56.0.0.0") gtk3; @@ -139,8 +137,8 @@ let gnFlags = mkGnFlags ({ linux_use_bundled_binutils = false; - linux_use_bundled_gold = false; - linux_use_gold_flags = true; + use_gold = true; + gold_path = "${stdenv.cc}/bin"; is_debug = false; proprietary_codecs = false; @@ -151,7 +149,6 @@ let enable_nacl = enableNaCl; enable_hotwording = enableHotwording; enable_widevine = enableWideVine; - selinux = enableSELinux; use_cups = cupsSupport; } // { treat_warnings_as_errors = false; diff --git a/pkgs/applications/networking/browsers/chromium/default.nix b/pkgs/applications/networking/browsers/chromium/default.nix index fdc22a5be006..fdda4f1122e8 100644 --- a/pkgs/applications/networking/browsers/chromium/default.nix +++ b/pkgs/applications/networking/browsers/chromium/default.nix @@ -2,7 +2,6 @@ # package customization , channel ? "stable" -, enableSELinux ? false , enableNaCl ? false , enableHotwording ? false , gnomeSupport ? false, gnome ? null @@ -22,7 +21,7 @@ let upstream-info = (callPackage ./update.nix {}).getChannel channel; mkChromiumDerivation = callPackage ./common.nix { - inherit enableSELinux enableNaCl enableHotwording gnomeSupport gnome + inherit enableNaCl enableHotwording gnomeSupport gnome gnomeKeyringSupport proprietaryCodecs cupsSupport pulseSupport enableWideVine; }; From 748e7b287b6a086f289dae9a2acf890168673b2d Mon Sep 17 00:00:00 2001 From: Nikolay Amiantov Date: Wed, 8 Feb 2017 22:42:42 +0300 Subject: [PATCH 6/6] chromium: update dev and beta chromiumBeta: 56.0.2924.76 -> 57.0.2987.21 chromiumDev: 57.0.2987.19 -> 58.0.3000.4 --- .../networking/browsers/chromium/common.nix | 4 ++-- .../networking/browsers/chromium/upstream-info.nix | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/applications/networking/browsers/chromium/common.nix b/pkgs/applications/networking/browsers/chromium/common.nix index 8b852d4b6d3c..dac821a4898f 100644 --- a/pkgs/applications/networking/browsers/chromium/common.nix +++ b/pkgs/applications/networking/browsers/chromium/common.nix @@ -104,9 +104,9 @@ let ++ optional (versionAtLeast version "56.0.0.0") gtk3; patches = [ - ./patches/glibc-2.24.patch ./patches/nix_plugin_paths_52.patch - ] ++ optional enableWideVine ./patches/widevine.patch; + ] ++ optional (versionOlder version "57.0") ./patches/glibc-2.24.patch + ++ optional enableWideVine ./patches/widevine.patch; postPatch = '' # We want to be able to specify where the sandbox is via CHROME_DEVEL_SANDBOX diff --git a/pkgs/applications/networking/browsers/chromium/upstream-info.nix b/pkgs/applications/networking/browsers/chromium/upstream-info.nix index 899f66cb2b0c..32a3713682e7 100644 --- a/pkgs/applications/networking/browsers/chromium/upstream-info.nix +++ b/pkgs/applications/networking/browsers/chromium/upstream-info.nix @@ -1,14 +1,14 @@ # This file is autogenerated from update.sh in the same directory. { beta = { - sha256 = "0f1w9cba99s9hy6fdqkr39yhkay4kid72vdrgs4as5lwdci8xc6g"; - sha256bin64 = "13hfkkgqywjapz01q3cy0i3ick1s24qhpl40by21c38nwbqplivw"; - version = "56.0.2924.76"; + sha256 = "0mwwscybips1kazl0rva3jdswfzfb7yp90ggqgk27z2ndp0qj8b3"; + sha256bin64 = "17n0jcysxi99v8hwlg7f69nrs2y5z87644145a8r53l809hkvkrk"; + version = "57.0.2987.21"; }; dev = { - sha256 = "0vw9l66412b9zd8v5l0i518mvfwf313gvh1ywxkf48lpjpi03qwh"; - sha256bin64 = "1iagza9qjlr61149g6cmiak82898xrrhvk516xrssap2qkb6kyzp"; - version = "57.0.2987.19"; + sha256 = "18gsj415cdlllp95q8pv1s3hhjg8cmjb6kwrvbr5mjdvsvj0ianf"; + sha256bin64 = "0z58rwz00bq61d24h8jynhzxanbh0m9wi04jbczci3681b4zyiyh"; + version = "58.0.3000.4"; }; stable = { sha256 = "1q2kg85pd6lv036w7lsss5mhiiva9rx4f0410sbn9bnazhghib4s";