diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index 94fa002ab20d..1954b392d17a 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -117,14 +117,113 @@ in stdenv.mkDerivation rec { ++ optional cupsSupport libgcrypt ++ optional pulseSupport pulseaudio; - prePatch = '' - # XXX: Figure out a way how to split these properly. - #cpflags="-dsr --no-preserve=mode" - cpflags="-dr" - cp $cpflags "${source.main}"/* . - cp $cpflags "${source.bundled}" third_party - cp $cpflags "${source.sandbox}" sandbox - chmod -R u+w . # XXX! + prePatch = let + lntree = [ "cp" "-dsr" "--no-preserve=mode" ]; + lntreeList = concatStringsSep ", " (map (arg: "'${arg}'") lntree); + lntreeSh = concatStringsSep " " lntree; + in '' + ${lntreeSh} "${source.main}"/* . + ${lntreeSh} "${source.sandbox}" sandbox + + ensureDir third_party + + # ONLY the dependencies we can't use from nixpkgs! + for bundled in ${concatStringsSep " " [ + # This is in preparation of splitting up the bundled sources into separate + # derivations so we some day can tremendously reduce build time. + "adobe" + "angle" + "cacheinvalidation" + "cld_2" + "codesighs" + "cros_dbus_cplusplus" + "cros_system_api" + "flot" + "freetype2" + "hunspell" + "iccjpeg" + "jinja2" + "JSON" + "jstemplate" + "khronos" + "leveldatabase" + "libaddressinput" + "libjingle" + "libmtp" + "libphonenumber" + "libsrtp" + "libXNVCtrl" + "libyuv" + "lss" + "lzma_sdk" + "markupsafe" + "mesa" + "modp_b64" + "mt19937ar" + "mtpd" + "npapi" + "ots" + "ply" + "protobuf" + "qcms" + "readability" + "safe_browsing" + "sfntly" + "skia" + "smhasher" + "speech-dispatcher" + "tcmalloc" + "trace-viewer" + "undoview" + "usb_ids" + "usrsctp" + "WebKit" + "webrtc" + "widevine" + "x86inc" + "yasm" + ]}; do + echo -n "Linking ${source.bundled}/$bundled to third_party/..." >&2 + ${lntreeSh} "${source.bundled}/$bundled" third_party/ + echo " done." >&2 + done + + # Everything else is decided based on gypFlags. + PYTHONPATH="build/linux/unbundle:$PYTHONPATH" python <