push sheeet
Some checks failed
Periodic Merges (6h) / master → staging-nixos (push) Failing after 12m50s
Periodic Merges (6h) / master → staging-next (push) Failing after 12m54s
Periodic Merges (24h) / merge-base(master,staging) → haskell-updates (push) Failing after 11m54s
Periodic Merges (6h) / staging-next → staging (push) Failing after 12m13s
Periodic Merges (24h) / staging-next-25.05 → staging-25.05 (push) Failing after 13m24s
Periodic Merges (24h) / release-25.05 → staging-next-25.05 (push) Failing after 14m28s

This commit is contained in:
Dark Steveneq
2025-10-09 14:15:47 +02:00
commit 646b892680
49168 changed files with 5897842 additions and 0 deletions

View File

@@ -0,0 +1,168 @@
{
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";
};
};
in
stdenv.mkDerivation (finalAttrs: {
pname = "libcef";
version = "140.1.14";
gitRevision = "eb1c06e";
chromiumVersion = "140.0.7339.185";
buildType = "Release";
srcHash = selectSystem {
aarch64-linux = "sha256-psgs+RcEYWKN4NneU4eVIaV2b7y+doxdPs9QWsN8dTA=";
x86_64-linux = "sha256-CDVzU+GIAU6hEutot90GMlAS8xEqD3uNLppgGq9d4mE=";
};
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"
];
};
})

View File

@@ -0,0 +1,43 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p curl gnused jq common-updater-scripts
set -euo pipefail
current_version=$(nix-instantiate --eval -E "with import ./. {}; libcef.version or (lib.getVersion libcef)" | tr -d '"')
ROOT="$(dirname "$(realpath "${BASH_SOURCE[0]}")")"
version_json=$(curl --silent https://cef-builds.spotifycdn.com/index.json | jq '[.linux64.versions[] | select (.channel == "stable")][0]')
cef_version=$(echo "$version_json" | jq -r '.cef_version' | cut -d'+' -f1)
git_revision=$(echo "$version_json" | jq -r '.cef_version' | cut -d'+' -f2 | cut -c 2-)
chromium_version=$(echo "$version_json" | jq -r '.chromium_version')
echo "Latest version: $cef_version"
echo "Current version: $current_version"
if [[ "$cef_version" == "$current_version" ]]; then
echo "Package is up-to-date"
exit 0
fi
update_nix_value() {
local key="$1"
local value="${2:-}"
sed -i "s|$key = \".*\"|$key = \"$value\"|" $ROOT/default.nix
}
update_nix_value version "$cef_version"
update_nix_value gitRevision "$git_revision"
update_nix_value chromiumVersion "$chromium_version"
declare -a platforms=(
"x86_64-linux 64"
"aarch64-linux arm64"
)
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
done