Merge pull request #268619 from tweag/lib-descriptions
[NixPkgs.git] / pkgs / development / libraries / libcef / default.nix
blob2fb83097c02af55e379ade3867f9328c3403ffe5
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 , obs-studio
32 let
33   rpath = lib.makeLibraryPath [
34     glib
35     nss
36     nspr
37     atk
38     at-spi2-atk
39     libdrm
40     expat
41     libxcb
42     libxkbcommon
43     libX11
44     libXcomposite
45     libXdamage
46     libXext
47     libXfixes
48     libXrandr
49     mesa
50     gtk3
51     pango
52     cairo
53     alsa-lib
54     dbus
55     at-spi2-core
56     cups
57     libxshmfence
58   ];
59   platforms = {
60     "aarch64-linux" = {
61       platformStr = "linuxarm64";
62       projectArch = "arm64";
63     };
64     "x86_64-linux" = {
65       platformStr = "linux64";
66       projectArch = "x86_64";
67     };
68   };
69   platforms."aarch64-linux".sha256 = "12sp58nxa3nv800badv62vpvc30hyb0ykywdaxgv9y8pswp9lq0z";
70   platforms."x86_64-linux".sha256 = "0vzzwq1k6bv9d209yg3samvfnfwj7s58y9r3p3pd98wxa9iyzf4j";
72   platformInfo = builtins.getAttr stdenv.hostPlatform.system platforms;
74 stdenv.mkDerivation rec {
75   pname = "cef-binary";
76   version = "117.2.4";
77   gitRevision = "5053a95";
78   chromiumVersion = "117.0.5938.150";
80   src = fetchurl {
81     url = "https://cef-builds.spotifycdn.com/cef_binary_${version}+g${gitRevision}+chromium-${chromiumVersion}_${platformInfo.platformStr}_minimal.tar.bz2";
82     inherit (platformInfo) sha256;
83   };
85   nativeBuildInputs = [ cmake ];
86   cmakeFlags = [ "-DPROJECT_ARCH=${platformInfo.projectArch}" ];
87   makeFlags = [ "libcef_dll_wrapper" ];
88   dontStrip = true;
89   dontPatchELF = true;
91   installPhase = ''
92     mkdir -p $out/lib/ $out/share/cef/
93     cp libcef_dll_wrapper/libcef_dll_wrapper.a $out/lib/
94     cp ../Release/libcef.so $out/lib/
95     patchelf --set-rpath "${rpath}" $out/lib/libcef.so
96     cp ../Release/*.bin $out/share/cef/
97     cp -r ../Resources/* $out/share/cef/
98     cp -r ../include $out/
99   '';
101   passthru.tests = {
102     inherit obs-studio; # frequently breaks on CEF updates
103   };
104   passthru.updateScript = ./update.sh;
106   meta = with lib; {
107     description = "Simple framework for embedding Chromium-based browsers in other applications";
108     homepage = "https://cef-builds.spotifycdn.com/index.html";
109     maintainers = with maintainers; [ puffnfresh ];
110     sourceProvenance = with sourceTypes; [
111       fromSource
112       binaryNativeCode
113     ];
114     license = licenses.bsd3;
115     platforms = [ "x86_64-linux" "aarch64-linux" ];
116   };