nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib
2, stdenv
3, fetchurl
4, cmake
5, glib
6, nss
7, nspr
8, atk
9, at-spi2-atk
10, libdrm
11, expat
12, libxcb
13, libxkbcommon
14, libX11
15, libXcomposite
16, libXdamage
17, libXext
18, libXfixes
19, libXrandr
20, mesa
21, gtk3
22, pango
23, cairo
24, alsa-lib
25, dbus
26, at-spi2-core
27, cups
28, libxshmfence
29}:
30
31let
32 rpath = lib.makeLibraryPath [
33 glib
34 nss
35 nspr
36 atk
37 at-spi2-atk
38 libdrm
39 expat
40 libxcb
41 libxkbcommon
42 libX11
43 libXcomposite
44 libXdamage
45 libXext
46 libXfixes
47 libXrandr
48 mesa
49 gtk3
50 pango
51 cairo
52 alsa-lib
53 dbus
54 at-spi2-core
55 cups
56 libxshmfence
57 ];
58 platforms = {
59 "aarch64-linux" = {
60 platformStr = "linuxarm64";
61 projectArch = "arm64";
62 sha256 = "1j93qawh9h6k2ic70i10npppv5f9dch961lc1wxwsi68daq8r081";
63 };
64 "i686-linux" = {
65 platformStr = "linux32";
66 projectArch = "x86";
67 sha256 = "0ki4zr8ih06kirgbpxbinv4baw3qvacx208q6qy1cvpfh6ll4fwb";
68 };
69 "x86_64-linux" = {
70 platformStr = "linux64";
71 projectArch = "x86_64";
72 sha256 = "1ja711x9fdlf21qw1k9xn3lvjc5zsfgnjga1w1r8sysam73jk7xj";
73 };
74 };
75
76 platformInfo = builtins.getAttr stdenv.targetPlatform.system platforms;
77in
78stdenv.mkDerivation rec {
79 pname = "cef-binary";
80 version = "90.6.7";
81 gitRevision = "19ba721";
82 chromiumVersion = "90.0.4430.212";
83
84 src = fetchurl {
85 url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2";
86 inherit (platformInfo) sha256;
87 };
88
89 nativeBuildInputs = [ cmake ];
90 cmakeFlags = "-DPROJECT_ARCH=${platformInfo.projectArch}";
91 makeFlags = [ "libcef_dll_wrapper" ];
92 dontStrip = true;
93 dontPatchELF = true;
94
95 installPhase = ''
96 mkdir -p $out/lib/ $out/share/cef/
97 cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
98 cp ../Release/libcef.so $out/lib/
99 patchelf --set-rpath "${rpath}" $out/lib/libcef.so
100 cp ../Release/*.bin $out/share/cef/
101 cp -r ../Resources/* $out/share/cef/
102 cp -r ../include $out/
103 '';
104
105 meta = with lib; {
106 description = "Simple framework for embedding Chromium-based browsers in other applications";
107 homepage = "https://cef-builds.spotifycdn.com/index.html";
108 maintainers = with maintainers; [ puffnfresh ];
109 license = licenses.bsd3;
110 platforms = [ "i686-linux" "x86_64-linux" "aarch64-linux" ];
111 };
112}