Something went wrong. Try again.
What happens if I push all of nixpkgs
Something went wrong. Try again.
3.9 kB · 168 lines
Nix
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169{ lib, stdenv, fetchurl, cmake, glib, nss, nspr, atk, at-spi2-atk, libdrm, expat, libxcb, libxkbcommon, libX11, libXcomposite, libXdamage, libXext, libXfixes, libXrandr, libgbm, gtk3, pango, cairo, alsa-lib, dbus, at-spi2-core, cups, libxshmfence, libGL, udev, systemd, obs-studio, xorg,}:
let gl_rpath = lib.makeLibraryPath [ stdenv.cc.cc ];
rpath = lib.makeLibraryPath [ glib nss nspr atk at-spi2-atk libdrm expat libxcb libxkbcommon libX11 libXcomposite libXdamage libXext libXfixes libXrandr libgbm gtk3 pango cairo alsa-lib dbus at-spi2-core cups libxshmfence libGL udev systemd xorg.libxcb xorg.libX11 xorg.libXcomposite xorg.libXdamage xorg.libXext xorg.libXfixes xorg.libXrandr xorg.libxshmfence ];
selectSystem = attrs: attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system ${stdenv.hostPlatform.system}");
platformInfo = selectSystem { aarch64-linux = { platformStr = "linuxarm64"; projectArch = "arm64"; }; x86_64-linux = { platformStr = "linux64"; projectArch = "x86_64"; }; };instdenv.mkDerivation (finalAttrs: { pname = "libcef"; version = "138.0.17"; gitRevision = "ac9b751"; chromiumVersion = "138.0.7204.97"; buildType = "Release";
srcHash = selectSystem { aarch64-linux = "sha256-kdO7c9oUfv0HK8wTmvYzw9S6EapnSGEQNCGN9D1JSL0="; x86_64-linux = "sha256-3qgIhen6l/kxttyw0z78nmwox62riVhlmFSGPkUot7g="; };
src = fetchurl { url = "https://cef-builds.spotifycdn.com/cef_binary_${finalAttrs.version}+g${finalAttrs.gitRevision}+chromium-${finalAttrs.chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2"; hash = finalAttrs.srcHash; };
nativeBuildInputs = [ cmake ];
cmakeFlags = [ "-DPROJECT_ARCH=${platformInfo.projectArch}" ];
makeFlags = [ "libcef_dll_wrapper" ];
dontStrip = true;
dontPatchELF = true;
preInstall = '' patchelf --set-rpath "${rpath}" --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" ../${finalAttrs.buildType}/chrome-sandbox patchelf --add-needed libudev.so --set-rpath "${rpath}" ../${finalAttrs.buildType}/libcef.so patchelf --set-rpath "${gl_rpath}" ../${finalAttrs.buildType}/libEGL.so patchelf --add-needed libGL.so.1 --set-rpath "${gl_rpath}" ../${finalAttrs.buildType}/libGLESv2.so patchelf --set-rpath "${gl_rpath}" ../${finalAttrs.buildType}/libvk_swiftshader.so patchelf --set-rpath "${gl_rpath}" ../${finalAttrs.buildType}/libvulkan.so.1 '';
installPhase = '' runHook preInstall
mkdir -p $out/lib/ $out/share/cef/ $out/libexec/cef/ cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/ cp ../${finalAttrs.buildType}/libcef.so $out/lib/ cp ../${finalAttrs.buildType}/libEGL.so $out/lib/ cp ../${finalAttrs.buildType}/libGLESv2.so $out/lib/ cp ../${finalAttrs.buildType}/libvk_swiftshader.so $out/lib/ cp ../${finalAttrs.buildType}/libvulkan.so.1 $out/lib/ cp ../${finalAttrs.buildType}/chrome-sandbox $out/libexec/cef/ cp ../${finalAttrs.buildType}/*.bin ../${finalAttrs.buildType}/*.json $out/share/cef/ cp -r ../Resources/* $out/share/cef/ cp -r ../include $out/
runHook postInstall '';
passthru = { updateScript = ./update.sh; tests = { inherit obs-studio; # frequently breaks on CEF updates }; };
meta = { description = "Simple framework for embedding Chromium-based browsers in other applications"; homepage = "https://cef-builds.spotifycdn.com/index.html"; maintainers = with lib.maintainers; [ puffnfresh ]; sourceProvenance = with lib.sourceTypes; [ fromSource binaryNativeCode ]; license = lib.licenses.bsd3; platforms = [ "x86_64-linux" "aarch64-linux" ]; };})