git.iko.soy/typeable/nixpkgs
on master help sign in
chrome: fix fallout from #26512

Fixes broken save dialogue (causes chrome to crash) and missing icons.

commit39fd9444020e2de89514db9297b27a57a9369eac authorCharles Strahan <charles@cstrahan.com> dateFri 16 Jun 2017, 01:49 (9 years ago) parent8a8f040
2 files changed+39−5
pkgs/applications/networking/browsers/chromium/default.nix+22−3 pkgs/applications/networking/browsers/google-chrome/default.nix+17−2
pkgs/applications/networking/browsers/chromium/default.nix+22−3
@@ -1,4 +1,5 @@
11{ newScope, stdenv, makeWrapper, makeDesktopItem, ed
2+, glib, gtk2, gtk3, gnome2, gnome3, gsettings_desktop_schemas
23
34# package customization
45, channel ? "stable"
@@ -62,10 +63,26 @@ let
6263
6364 sandboxExecutableName = chromium.browser.passthru.sandboxExecutableName;
6465
66+ version = chromium.browser.version;
67+
68+ inherit (stdenv.lib) versionAtLeast;
69+
70+ gtk = if (versionAtLeast version "59.0.0.0") then gtk3 else gtk2;
71+ gnome = if (versionAtLeast version "59.0.0.0") then gnome3 else gnome2;
72+
6573in stdenv.mkDerivation {
66− name = "chromium${suffix}-${chromium.browser.version}";
74+ name = "chromium${suffix}-${version}";
75+ inherit version;
6776
68− buildInputs = [ makeWrapper ed ];
77+ buildInputs = [
78+ makeWrapper ed
79+
80+ # needed for GSETTINGS_SCHEMAS_PATH
81+ gsettings_desktop_schemas glib gtk
82+
83+ # needed for XDG_ICON_DIRS
84+ gnome.defaultIconTheme
85+ ];
6986
7087 outputs = ["out" "sandbox"];
7188
@@ -92,6 +109,8 @@ in stdenv.mkDerivation {
92109 # libredirect causes chromium to deadlock on startup
93110 export LD_PRELOAD="\$(echo -n "\$LD_PRELOAD" | tr ':' '\n' | grep -v /lib/libredirect\\\\.so$ | tr '\n' ':')"
94111
112+ export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
113+
95114 .
96115 w
97116 EOF
@@ -107,7 +126,7 @@ in stdenv.mkDerivation {
107126 cp -v "${desktopItem}/share/applications/"* "$out/share/applications"
108127 '';
109128
110− inherit (chromium.browser) meta packageName version;
129+ inherit (chromium.browser) meta packageName;
111130
112131 passthru = {
113132 inherit (chromium) upstream-info browser;
pkgs/applications/networking/browsers/google-chrome/default.nix+17−2
@@ -31,6 +31,9 @@
3131
3232# Only needed for getting information about upstream binaries
3333, chromium
34+
35+, gsettings_desktop_schemas
36+, gnome2, gnome3
3437}:
3538
3639with stdenv.lib;
@@ -42,6 +45,9 @@ let
4245 withCustomModes = true;
4346 };
4447
48+ gtk = if (versionAtLeast version "59.0.0.0") then gtk3 else gtk2;
49+ gnome = if (versionAtLeast version "59.0.0.0") then gnome3 else gnome2;
50+
4551 deps = [
4652 glib fontconfig freetype pango cairo libX11 libXi atk gconf nss nspr
4753 libXcursor libXext libXfixes libXrender libXScrnSaver libXcomposite libxcb
@@ -53,7 +59,7 @@ let
5359 flac harfbuzz icu libpng opusWithCustomModes snappy speechd
5460 bzip2 libcap
5561 ] ++ optional pulseSupport libpulseaudio
56− ++ (if (versionAtLeast version "59.0.0.0") then [gtk3] else [gtk2]);
62+ ++ [ gtk ];
5763
5864 suffix = if channel != "stable" then "-" + channel else "";
5965
@@ -64,7 +70,15 @@ in stdenv.mkDerivation rec {
6470
6571 src = binary;
6672
67− buildInputs = [ patchelf ];
73+ buildInputs = [
74+ patchelf
75+
76+ # needed for GSETTINGS_SCHEMAS_PATH
77+ gsettings_desktop_schemas glib gtk
78+
79+ # needed for XDG_ICON_DIRS
80+ gnome.defaultIconTheme
81+ ];
6882
6983 unpackPhase = ''
7084 ar x $src
@@ -109,6 +123,7 @@ in stdenv.mkDerivation rec {
109123 #!${bash}/bin/sh
110124 export LD_LIBRARY_PATH=$rpath\''${LD_LIBRARY_PATH:+:\$LD_LIBRARY_PATH}
111125 export PATH=$binpath\''${PATH:+:\$PATH}
126+ export XDG_DATA_DIRS=$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH\''${XDG_DATA_DIRS:+:}\$XDG_DATA_DIRS
112127 $out/share/google/$appname/google-$appname ${commandLineArgs} "\$@"
113128 EOF
114129 chmod +x $exe