chromium: add build flags and system libs

This is lifted from the Arch build recipe:
https://git.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/chromium

using system libjpeg still doesn't work for some reason, otherwise the
build runs fine

authored by Herwig Hochleitner and committed by Robin Gloster bb397093 8dc869e3

+14 -9
+11 -3
pkgs/applications/networking/browsers/chromium/common.nix
··· 60 60 in attrs: concatStringsSep " " (attrValues (mapAttrs toFlag attrs)); 61 61 62 62 gnSystemLibraries = [ 63 - "ffmpeg" "flac" "harfbuzz-ng" "libwebp" "libxslt" "yasm" "snappy" # "libpng" "libjpeg" 63 + "flac" "harfbuzz-ng" "libwebp" "libxslt" "yasm" "opus" "snappy" "libpng" "zlib" 64 + # "libjpeg" # fails with multiple undefined references to chromium_jpeg_* 65 + # "re2" # fails with linker errors 66 + # "ffmpeg" # https://crbug.com/731766 64 67 ]; 65 68 66 69 opusWithCustomModes = libopus.override { ··· 73 76 libpng libcap 74 77 xdg_utils yasm minizip libwebp 75 78 libusb1 re2 zlib 76 - ffmpeg harfbuzz libxslt harfbuzz-icu libxml2 79 + ffmpeg harfbuzz-icu libxslt libxml2 77 80 ]; 78 81 79 82 # build paths and release info ··· 182 185 enable_hotwording = enableHotwording; 183 186 enable_widevine = enableWideVine; 184 187 use_cups = cupsSupport; 185 - } // { 188 + 186 189 treat_warnings_as_errors = false; 187 190 is_clang = false; 191 + clang_use_chrome_plugins = false; 192 + remove_webcore_debug_symbols = true; 193 + use_gtk3 = true; 194 + enable_swiftshader = false; 195 + fieldtrial_testing_like_official_build = true; 188 196 189 197 # Google API keys, see: 190 198 # http://www.chromium.org/developers/how-tos/api-keys
+3 -6
pkgs/applications/networking/browsers/chromium/default.nix
··· 1 1 { newScope, stdenv, makeWrapper, makeDesktopItem, ed 2 - , glib, gtk2, gtk3, gnome2, gnome3, gsettings_desktop_schemas 2 + , glib, gtk3, gnome3, gsettings_desktop_schemas 3 3 4 4 # package customization 5 5 , channel ? "stable" ··· 67 67 68 68 inherit (stdenv.lib) versionAtLeast; 69 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 - 73 70 in stdenv.mkDerivation { 74 71 name = "chromium${suffix}-${version}"; 75 72 inherit version; ··· 78 75 makeWrapper ed 79 76 80 77 # needed for GSETTINGS_SCHEMAS_PATH 81 - gsettings_desktop_schemas glib gtk 78 + gsettings_desktop_schemas glib gtk3 82 79 83 80 # needed for XDG_ICON_DIRS 84 - gnome.defaultIconTheme 81 + gnome3.defaultIconTheme 85 82 ]; 86 83 87 84 outputs = ["out" "sandbox"];