2021-08-10 20:34:42 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
|
|
|
, fetchurl
|
|
|
|
, cmake
|
2021-06-10 09:32:46 +00:00
|
|
|
, glib
|
|
|
|
, nss
|
|
|
|
, nspr
|
|
|
|
, atk
|
|
|
|
, at-spi2-atk
|
|
|
|
, libdrm
|
|
|
|
, expat
|
|
|
|
, libxcb
|
|
|
|
, libxkbcommon
|
|
|
|
, libX11
|
|
|
|
, libXcomposite
|
|
|
|
, libXdamage
|
|
|
|
, libXext
|
|
|
|
, libXfixes
|
|
|
|
, libXrandr
|
|
|
|
, mesa
|
|
|
|
, gtk3
|
|
|
|
, pango
|
|
|
|
, cairo
|
|
|
|
, alsa-lib
|
|
|
|
, dbus
|
|
|
|
, at-spi2-core
|
|
|
|
, cups
|
|
|
|
, libxshmfence
|
2022-01-31 08:44:56 +00:00
|
|
|
, obs-studio
|
2019-10-28 19:47:50 +00:00
|
|
|
}:
|
2018-05-29 02:10:18 +00:00
|
|
|
|
|
|
|
let
|
2023-11-21 17:27:56 +00:00
|
|
|
gl_rpath = lib.makeLibraryPath [
|
2024-11-07 09:43:39 +00:00
|
|
|
stdenv.cc.cc
|
2023-11-21 17:27:56 +00:00
|
|
|
];
|
|
|
|
|
2021-06-10 09:32:46 +00:00
|
|
|
rpath = lib.makeLibraryPath [
|
|
|
|
glib
|
|
|
|
nss
|
|
|
|
nspr
|
|
|
|
atk
|
|
|
|
at-spi2-atk
|
|
|
|
libdrm
|
|
|
|
expat
|
|
|
|
libxcb
|
|
|
|
libxkbcommon
|
|
|
|
libX11
|
|
|
|
libXcomposite
|
|
|
|
libXdamage
|
|
|
|
libXext
|
|
|
|
libXfixes
|
|
|
|
libXrandr
|
|
|
|
mesa
|
|
|
|
gtk3
|
|
|
|
pango
|
|
|
|
cairo
|
|
|
|
alsa-lib
|
|
|
|
dbus
|
|
|
|
at-spi2-core
|
|
|
|
cups
|
|
|
|
libxshmfence
|
|
|
|
];
|
2021-08-10 20:34:42 +00:00
|
|
|
platforms = {
|
|
|
|
"aarch64-linux" = {
|
|
|
|
platformStr = "linuxarm64";
|
|
|
|
projectArch = "arm64";
|
|
|
|
};
|
|
|
|
"x86_64-linux" = {
|
|
|
|
platformStr = "linux64";
|
|
|
|
projectArch = "x86_64";
|
|
|
|
};
|
|
|
|
};
|
2024-02-18 06:00:17 +00:00
|
|
|
platforms."aarch64-linux".sha256 = "16sbfk599h96wcsmpbxlwsvq0n1pssmm8dpwmjsqfrn1464dvs68";
|
|
|
|
platforms."x86_64-linux".sha256 = "1wa4nv28saz96kar9svdarfz6c4rnbcqz0rqxzl9zclnhfzhqdiw";
|
2021-08-10 20:34:42 +00:00
|
|
|
|
2024-04-05 02:30:31 +00:00
|
|
|
platformInfo = platforms.${stdenv.hostPlatform.system} or (throw "unsupported system ${stdenv.hostPlatform.system}");
|
2021-08-10 20:34:42 +00:00
|
|
|
in
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "cef-binary";
|
2024-02-18 06:00:17 +00:00
|
|
|
version = "121.3.13";
|
|
|
|
gitRevision = "5c4a81b";
|
|
|
|
chromiumVersion = "121.0.6167.184";
|
2019-10-28 19:47:50 +00:00
|
|
|
|
2018-05-29 02:10:18 +00:00
|
|
|
src = fetchurl {
|
2021-08-10 20:34:42 +00:00
|
|
|
url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2";
|
|
|
|
inherit (platformInfo) sha256;
|
2018-05-29 02:10:18 +00:00
|
|
|
};
|
2019-10-28 19:47:50 +00:00
|
|
|
|
2018-05-29 02:10:18 +00:00
|
|
|
nativeBuildInputs = [ cmake ];
|
2022-07-04 01:26:36 +00:00
|
|
|
cmakeFlags = [ "-DPROJECT_ARCH=${platformInfo.projectArch}" ];
|
2019-10-27 13:03:25 +00:00
|
|
|
makeFlags = [ "libcef_dll_wrapper" ];
|
2018-05-29 02:10:18 +00:00
|
|
|
dontStrip = true;
|
|
|
|
dontPatchELF = true;
|
2019-10-28 19:47:50 +00:00
|
|
|
|
2018-05-29 02:10:18 +00:00
|
|
|
installPhase = ''
|
|
|
|
mkdir -p $out/lib/ $out/share/cef/
|
|
|
|
cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
|
|
|
|
cp ../Release/libcef.so $out/lib/
|
2023-11-21 17:27:56 +00:00
|
|
|
cp ../Release/libEGL.so $out/lib/
|
|
|
|
cp ../Release/libGLESv2.so $out/lib/
|
2021-06-10 09:32:46 +00:00
|
|
|
patchelf --set-rpath "${rpath}" $out/lib/libcef.so
|
2023-11-21 17:27:56 +00:00
|
|
|
patchelf --set-rpath "${gl_rpath}" $out/lib/libEGL.so
|
|
|
|
patchelf --set-rpath "${gl_rpath}" $out/lib/libGLESv2.so
|
2018-05-29 02:10:18 +00:00
|
|
|
cp ../Release/*.bin $out/share/cef/
|
|
|
|
cp -r ../Resources/* $out/share/cef/
|
|
|
|
cp -r ../include $out/
|
|
|
|
'';
|
|
|
|
|
2022-01-31 08:44:56 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit obs-studio; # frequently breaks on CEF updates
|
|
|
|
};
|
2022-01-30 17:06:36 +00:00
|
|
|
passthru.updateScript = ./update.sh;
|
|
|
|
|
2021-01-21 17:00:13 +00:00
|
|
|
meta = with lib; {
|
2018-05-29 02:10:18 +00:00
|
|
|
description = "Simple framework for embedding Chromium-based browsers in other applications";
|
2021-06-10 09:32:46 +00:00
|
|
|
homepage = "https://cef-builds.spotifycdn.com/index.html";
|
2018-05-29 02:10:18 +00:00
|
|
|
maintainers = with maintainers; [ puffnfresh ];
|
2022-06-16 22:11:43 +00:00
|
|
|
sourceProvenance = with sourceTypes; [
|
|
|
|
fromSource
|
|
|
|
binaryNativeCode
|
|
|
|
];
|
2018-05-29 02:10:18 +00:00
|
|
|
license = licenses.bsd3;
|
2023-04-04 15:42:12 +00:00
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
2018-05-29 02:10:18 +00:00
|
|
|
};
|
|
|
|
}
|