From aeeb67bfcb3f3d8ad0d5e22cf0c7a5c4acfa17ae Mon Sep 17 00:00:00 2001 From: Julien Langlois Date: Sat, 10 Aug 2019 19:09:55 -0400 Subject: Rework to avoid a full rebuild for widevine. --- .../networking/browsers/chromium/browser.nix | 45 +--------------------- 1 file changed, 2 insertions(+), 43 deletions(-) (limited to 'pkgs/applications/networking/browsers/chromium/browser.nix') diff --git a/pkgs/applications/networking/browsers/chromium/browser.nix b/pkgs/applications/networking/browsers/chromium/browser.nix index e41c3b777f8..29fdb117733 100644 --- a/pkgs/applications/networking/browsers/chromium/browser.nix +++ b/pkgs/applications/networking/browsers/chromium/browser.nix @@ -1,47 +1,8 @@ -{ stdenv, mkChromiumDerivation, channel, upstream-info, gcc, glib, nspr, nss, patchelfUnstable, enableWideVine }: +{ stdenv, mkChromiumDerivation, channel }: with stdenv.lib; -let - mkrpath = p: "${makeSearchPathOutput "lib" "lib64" p}:${makeLibraryPath p}"; - widevine = stdenv.mkDerivation { - name = "chromium-binary-plugin-widevine"; - - src = upstream-info.binary; - - nativeBuildInputs = [ patchelfUnstable ]; - - phases = [ "unpackPhase" "patchPhase" "installPhase" "checkPhase" ]; - - unpackCmd = let - chan = if upstream-info.channel == "dev" then "chrome-unstable" - else if upstream-info.channel == "stable" then "chrome" - else "chrome-${upstream-info.channel}"; - in '' - mkdir -p plugins - ar p "$src" data.tar.xz | tar xJ -C plugins --strip-components=4 \ - ./opt/google/${chan}/libwidevinecdm.so - ''; - - doCheck = true; - checkPhase = '' - ! find -iname '*.so' -exec ldd {} + | grep 'not found' - ''; - - PATCH_RPATH = mkrpath [ gcc.cc glib nspr nss ]; - - patchPhase = '' - patchelf --set-rpath "$PATCH_RPATH" libwidevinecdm.so - ''; - - installPhase = '' - install -vD libwidevinecdm.so \ - "$out/lib/libwidevinecdm.so" - ''; - - meta.platforms = platforms.x86_64; - }; -in mkChromiumDerivation (base: rec { +mkChromiumDerivation (base: rec { name = "chromium-browser"; packageName = "chromium"; buildTargets = [ "mksnapshot" "chrome_sandbox" "chrome" ]; @@ -91,8 +52,6 @@ in mkChromiumDerivation (base: rec { -e '/\[Desktop Entry\]/a\' \ -e 'StartupWMClass=chromium-browser' \ $out/share/applications/chromium-browser.desktop - - ${optionalString enableWideVine "ln -s ${widevine}/lib/libwidevinecdm.so \"$libExecPath/libwidevinecdm.so\""} ''; passthru = { inherit sandboxExecutableName; }; -- cgit 1.4.1