Commit e538beb4 authored by qzylinra's avatar qzylinra
Browse files

libcef: drop

parent 43972c5d
Loading
Loading
Loading
Loading
+27 −12
Original line number Diff line number Diff line
@@ -7,6 +7,7 @@
  nv-codec-headers-12,
  fetchFromGitHub,
  fetchpatch2,
  fetchurl,
  addDriverRunpath,
  autoAddDriverRunpath,
  cudaSupport ? config.cudaSupport,
@@ -68,19 +69,33 @@
let
  inherit (lib) optional optionals;

  cef = cef-binary.overrideAttrs (oldAttrs: {
    version = "138.0.17";
    __intentionallyOverridingVersion = true; # `cef-binary` uses the overridden `srcHash` values in its source FOD
    gitRevision = "ac9b751";
    chromiumVersion = "138.0.7204.97";
  selectSystem =
    attrs:
    attrs.${stdenv.hostPlatform.system} or (throw "Unsupported system ${stdenv.hostPlatform.system}");

    srcHash =
  cef = cef-binary.overrideAttrs (
    oldAttrs:
    let
      version = "6533";
      revision = "6";
    in
    {
        aarch64-linux = "sha256-kdO7c9oUfv0HK8wTmvYzw9S6EapnSGEQNCGN9D1JSL0=";
        x86_64-linux = "sha256-3qgIhen6l/kxttyw0z78nmwox62riVhlmFSGPkUot7g=";
      inherit version;

      src = fetchurl {
        url = "https://cdn-fastly.obsproject.com/downloads/cef_binary_${version}_linux_${
          selectSystem {
            aarch64-linux = "aarch64";
            x86_64-linux = "x86_64";
          }
        }_v${revision}.tar.xz";
        hash = selectSystem {
          aarch64-linux = "sha256-ZCUURp6qKaXIh4kQhNLnP33C10Bfffp3JrLbwkswmZk=";
          x86_64-linux = "sha256-eWMzVRmhnM3FIz9zNMWrAjAm4vPpoMxBcAfAnYZggUY=";
        };
      };
    }
      .${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
  });
  );
in
stdenv.mkDerivation (finalAttrs: {
  pname = "obs-studio";
+6 −9
Original line number Diff line number Diff line
@@ -23,19 +23,16 @@
  enableRS3 ? false,
}:
let
  cef = cef-binary.overrideAttrs (oldAttrs: {
  cef = cef-binary.override {
    version = "126.2.18";
    __intentionallyOverridingVersion = true; # `cef-binary` uses the overridden `srcHash` values in its source FOD
    gitRevision = "3647d39";
    chromiumVersion = "126.0.6478.183";

    srcHash =
      {
    srcHashes = {
      aarch64-linux = "sha256-Ni5aEbI+WuMnbT8gPWMONN5NkTySw7xJvnM6U44Njao=";
      x86_64-linux = "sha256-YwND4zsndvmygJxwmrCvaFuxjJO704b6aDVSJqpEOKc=";
      }
      .${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
  });
    };
  };
in
let
  bolt = stdenv.mkDerivation (finalAttrs: {
+107 −4
Original line number Diff line number Diff line
{
  libcef,
  lib,
  stdenv,
  fetchurl,
  glib,
  nss,
  nspr,
  atk,
  at-spi2-atk,
  libdrm,
  expat,
  libxkbcommon,
  libgbm,
  gtk3,
  pango,
  cairo,
  alsa-lib,
  dbus,
  at-spi2-core,
  cups,
  libGL,
  udev,
  systemdLibs,
  xorg,
  version ? "141.0.7",
  gitRevision ? "a5714cc",
  chromiumVersion ? "141.0.7390.108",
  buildType ? "Release",
  srcHashes ? {
    aarch64-linux = "sha256-2A0hVzUVMBemhjnFE/CrKs4CU96Qkxy8S/SieaEJjwE=";
    x86_64-linux = "sha256-tZzUxeXxbYP8YfIQLbiSyihPcjZM9cd2Ad8gGCSvdGk=";
  },
}:

libcef.overrideAttrs (oldAttrs: {
let
  gl_rpath = lib.makeLibraryPath [ stdenv.cc.cc ];

  rpath = lib.makeLibraryPath [
    glib
    nss
    nspr
    atk
    at-spi2-atk
    libdrm
    expat
    libxkbcommon
    libgbm
    gtk3
    pango
    cairo
    alsa-lib
    dbus
    at-spi2-core
    cups
    libGL
    udev
    systemdLibs
    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}");
in
stdenv.mkDerivation {
  pname = "cef-binary";
  inherit version;

  src = fetchurl {
    url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${
      selectSystem {
        aarch64-linux = "linuxarm64";
        x86_64-linux = "linux64";
      }
    }_minimal.tar.bz2";
    hash = selectSystem srcHashes;
  };

  dontStrip = true;

  dontPatchELF = true;

  installPhase = ''
    runHook preInstall

    cp -r .. $out
    sed 's/-O0/-O2/' -i cmake/cef_variables.cmake
    patchelf --set-rpath "${rpath}" --set-interpreter "${stdenv.cc.bintools.dynamicLinker}" ${buildType}/chrome-sandbox
    patchelf --add-needed libudev.so --set-rpath "${rpath}" ${buildType}/libcef.so
    patchelf --set-rpath "${gl_rpath}" ${buildType}/libEGL.so
    patchelf --add-needed libGL.so.1 --set-rpath "${gl_rpath}" ${buildType}/libGLESv2.so
    patchelf --set-rpath "${gl_rpath}" ${buildType}/libvk_swiftshader.so
    patchelf --set-rpath "${gl_rpath}" ${buildType}/libvulkan.so.1
    cp --recursive . $out

    runHook postInstall
  '';
})

  passthru = {
    inherit buildType;
    updateScript = ./update.sh;
  };

  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; [ binaryNativeCode ];
    license = lib.licenses.bsd3;
    platforms = builtins.attrNames srcHashes;
  };
}
+3 −3
Original line number Diff line number Diff line
@@ -3,7 +3,7 @@

set -euo pipefail

current_version=$(nix-instantiate --eval -E "with import ./. {}; libcef.version or (lib.getVersion libcef)" | tr -d '"')
current_version=$(nix-instantiate --eval -E "with import ./. {}; cef-binary or (lib.getVersion cef-binary)" | tr -d '"')

ROOT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"

@@ -23,7 +23,7 @@ fi
update_nix_value() {
    local key="$1"
    local value="${2:-}"
    sed -i "s|$key = \".*\"|$key = \"$value\"|" $ROOT/default.nix
    sed -i "s|$key ? \".*\"|$key ? \"$value\"|" $ROOT/package.nix
}

update_nix_value version "$cef_version"
@@ -39,5 +39,5 @@ for platform in "${platforms[@]}"; do
    read -r system arch <<< "$platform"
    url="https://cef-builds.spotifycdn.com/cef_binary_${cef_version}+g${git_revision}+chromium-${chromium_version}_linux${arch}_minimal.tar.bz2"
    hash=$(nix --extra-experimental-features nix-command hash convert --to sri --hash-algo sha256 "$(nix-prefetch-url --quiet "$url")")
    update-source-version libcef "$cef_version" "$hash" --system="$system" --ignore-same-version
    update-source-version cef-binary "$cef_version" "$hash" --system="$system" --ignore-same-version
done
+6 −10
Original line number Diff line number Diff line
@@ -38,19 +38,16 @@
}:

let
  cef = cef-binary.overrideAttrs (oldAttrs: {
  cef = cef-binary.override {
    version = "135.0.17"; # follow upstream. https://github.com/Almamu/linux-wallpaperengine/blob/b39f12757908eda9f4c1039613b914606568bb84/CMakeLists.txt#L47
    __intentionallyOverridingVersion = true; # `cef-binary` uses the overridden `srcHash` values in its source FOD
    gitRevision = "cbc1c5b";
    chromiumVersion = "135.0.7049.52";

    srcHash =
      {
    srcHashes = {
      aarch64-linux = "sha256-LK5JvtcmuwCavK7LnWmMF2UDpM5iIZOmsuZS/t9koDs=";
      x86_64-linux = "sha256-JKwZgOYr57GuosM31r1Lx3DczYs35HxtuUs5fxPsTcY=";
      }
      .${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
  });
    };
  };
in
stdenv.mkDerivation (finalAttrs: {
  pname = "linux-wallpaperengine";
@@ -102,7 +99,6 @@ stdenv.mkDerivation (finalAttrs: {
  ];

  cmakeFlags = [
    "-DCMAKE_BUILD_TYPE=${cef.buildType}"
    "-DCEF_ROOT=${cef}"
    "-DCMAKE_INSTALL_PREFIX=${placeholder "out"}/share/linux-wallpaperengine"
  ];
Loading