国产 无码 综合区,色欲AV无码国产永久播放,无码天堂亚洲国产AV,国产日韩欧美女同一区二区

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄

這篇具有很好參考價(jià)值的文章主要介紹了Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄。希望對(duì)大家有所幫助。如果存在錯(cuò)誤或未考慮完全的地方,請(qǐng)大家不吝賜教,您也可以點(diǎn)擊"舉報(bào)違法"按鈕提交疑問(wèn)。

Linux CEF(Chromium Embedded Framework)源碼下載編譯

背景

由于CEF默認(rèn)的二進(jìn)制分發(fā)包不支持音視頻播放,需要自行編譯源碼,將ffmpeg開關(guān)打開才能支持。這里介紹的是Linux平臺(tái)下的CEF源碼下載編譯過(guò)程。

Windows平臺(tái)參考:
《Windows 編譯CEF源碼詳細(xì)記錄》

前置條件

下載的過(guò)程非常艱辛,因?yàn)橛残砸蟊容^高。

  • 16GB RAM (推薦 32GB+ )
  • 120GB SSD硬盤空閑空間起步(避免機(jī)械硬盤)
  • 100Mbps帶寬(包括代理帶寬)以及100G以上的代理流量

這里額外說(shuō)明一下,下載過(guò)程總是失敗,大概率原因是因?yàn)榫W(wǎng)絡(luò)的問(wèn)題,尤其是網(wǎng)絡(luò)帶寬和代理帶寬。這里為什么要單獨(dú)提代理帶寬呢,因?yàn)楣居刑峁┐矸?wù),但是只有10Mbps,所以會(huì)導(dǎo)致下載超時(shí),服務(wù)端關(guān)閉連接。

注意,由于一些因素,下載代碼的環(huán)境是基于WSL,編譯的時(shí)候是在UOS V20 1050系統(tǒng)上,但總體差異不大,相關(guān)路徑會(huì)有區(qū)別,仍有參考價(jià)值。

接下來(lái)開始下載CEF的代碼

下載

創(chuàng)建目錄結(jié)構(gòu)

首先,先創(chuàng)建目錄結(jié)構(gòu),最終的目錄結(jié)構(gòu)如下:

~/CEF/
  automate/
    automate-git.py   <-- CEF build script
  chromium_git/
    cef/              <-- CEF source checkout
    chromium/
      src/            <-- Chromium source checkout
    update.[bat|sh]   <-- Bootstrap script for automate-git.py
  depot_tools/        <-- Chromium build tools

可以使用以下命令,創(chuàng)建目錄

mkdir CEF && cd CEF && mkdir automate && mkdir chromium_git

終端設(shè)置代理

這一步非常重要,因?yàn)樾枰尳K端走代理,才能正常下載代碼

設(shè)置終端代理

export http_proxy=127.0.0.1:7890
export https_proxy=127.0.0.1:7890

通常情況下,這樣就可以了,但由于公司的代理問(wèn)題,設(shè)置了代理之后,bitbucket.org域名無(wú)法訪問(wèn),所以我這里將bitbucket.org域名排除在外,這一步因人而異,但基本是不需要這一步的。

export no_proxy=localhost,bitbucket.org

驗(yàn)證代理是否設(shè)置成功

leoya@leoya-PC:~$ curl -I https://chromium.googlesource.com
HTTP/1.1 200 Connection established

HTTP/2 200 
content-security-policy: script-src 'nonce-WfQMl6EHcID6PtyTna5LNQ' 'unsafe-inline' 'strict-dynamic' https: http: 'unsafe-eval';object-src 'none';base-uri 'self';report-uri https://csp.withgoogle.com/csp/gerritcodereview/1
content-type: text/html; charset=utf-8
strict-transport-security: max-age=31536000; includeSubDomains; preload
x-content-type-options: nosniff
x-frame-options: SAMEORIGIN
x-xss-protection: 0
date: Fri, 30 Jun 2023 02:04:17 GMT
alt-svc: h3=":443"; ma=2592000,h3-29=":443"; ma=2592000

這里通過(guò)curl去獲取響應(yīng)信息,能獲取到狀態(tài)碼200或者304,即說(shuō)明訪問(wèn)正常??梢灶~外對(duì)bitbucket.org也測(cè)試一下,如果訪問(wèn)失敗,那說(shuō)明需要將它排除在代理規(guī)則內(nèi),通過(guò)上述方法或者代理軟件(如clash)設(shè)置代理規(guī)則為直連即可。

設(shè)置git代理

git config --global http.proxy 127.0.0.1:7890
git config --global https.proxy 127.0.0.1:7890

下載腳本

在CEF根目錄下,下載depot_tools,并配置環(huán)境變量

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git
export PATH=/home/leoya/CEF/depot_tools:$PATH

下載automate-git.py腳本,這里需要在CEF/automate目錄下

cd automate/
wget https://bitbucket.org/chromiumembedded/cef/raw/master/tools/automate/automate-git.py

創(chuàng)建 ~/CEF/chromium_git/update.sh腳本

#!/bin/bash
python3 ../automate/automate-git.py --download-dir=/home/leoya/CEF/chromium_git --depot-tools-dir=/home/leoya/CEF/depot_tools --no-distrib --no-build

執(zhí)行腳本

設(shè)置權(quán)限并執(zhí)行

chmod 755 update.sh
./update.sh

接下來(lái)就是無(wú)盡的等待。

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

這里要特別注意depot_tools的更新進(jìn)度,每次執(zhí)行腳本的時(shí)候,它都會(huì)先更新depot_tools,如果更新狀態(tài)過(guò)慢,可能網(wǎng)絡(luò)有問(wèn)題。

下載cef倉(cāng)庫(kù)的時(shí)候一般是沒(méi)什么問(wèn)題的。

這里最關(guān)鍵的是下載chromium源碼的環(huán)節(jié),因?yàn)槟_本執(zhí)行中斷往往就是在這個(gè)環(huán)節(jié)。因?yàn)榫W(wǎng)絡(luò)穩(wěn)定性、下載速率等問(wèn)題,導(dǎo)致出錯(cuò)。

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

當(dāng)你看到Still working on字樣的時(shí)候,恭喜你,你已經(jīng)邁過(guò)了最艱難的環(huán)節(jié),接下來(lái)就是下載終端,重試的成本也比較低,因?yàn)椴挥弥匦孪螺dchromium源碼。

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium
Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

接下來(lái)見證下載成功的時(shí)刻?。?!

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium

報(bào)錯(cuò)信息總結(jié)

以下原因解釋不一定正確,僅供參考
1.

[1:38:14] error: RPC failed; curl 56 GnuTLS recv error (-9):Error decoding the received TLS packet.[1:30:14] fatal:the remote end hung up unexpectedly
[1:30:14] fatail:"early EOF
[1:30:14] fatat: index-pack failed1:30:16]

Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄,CEF,linux,cef,chromium
這里大概率是網(wǎng)絡(luò)不穩(wěn)定導(dǎo)致下載中斷

error: RPC failed; curl 18 transfer closed with outstanding read data remaining
fatal: 遠(yuǎn)端意外掛斷了
fatal: 過(guò)早的文件結(jié)束符(EOF)
fatal: index-pack 失敗

這個(gè)就是因?yàn)橄螺d速率太慢,導(dǎo)致長(zhǎng)時(shí)間占用連接,服務(wù)端就主動(dòng)關(guān)閉了連接。

編譯 CEF

接下來(lái)即可修改ffmpeg文件以添加音視頻的支持了

設(shè)置ffmpeg

chromium_git/chromium/src/third_party/ffmpeg/chromium/config/Chromium/linux/x64/config_components.h文件的宏#define CONFIG_SIPR_PARSER 1由0設(shè)置為1,即啟用。

生成工程

終端輸入

export GN_DEFINES="use_sysroot=true symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"
  • ffmpeg_branding和proprietary_codecs 表示開啟多媒體編解碼支持,但默認(rèn)僅支持一小部分,想要支持更多可修改上面 ffmpeg 配置文件。
  • is_official_build 決定了是否是編譯正式版本,指定該參數(shù)為 true 基本上都是為了產(chǎn)品發(fā)布使用,同時(shí)也會(huì)在創(chuàng)建解決方案的時(shí)候生成帶有 sandbox 的解決方案,而不指定這個(gè)參數(shù)是沒(méi)有的。
  • use_jumbo_build 官方資料默認(rèn)指定,表示是否啟用試驗(yàn)性的 jumbo 編譯,編譯過(guò)程會(huì)加快很多(至少快 1 小時(shí)),但是占用 CPU 和內(nèi)存(尤其是內(nèi)存)會(huì)劇增。
  • is_component_build 官方資料默認(rèn)指定,但我們沒(méi)有開啟,這個(gè)參數(shù)表示是否啟用組件化編譯,設(shè)置為 true 以后,base、ffmpeg 等等都會(huì)被編譯為動(dòng)態(tài)庫(kù),使用時(shí)也是動(dòng)態(tài)鏈接,編譯出來(lái)的 cef_sandbox 只有幾兆大小,并且你需要復(fù)制很多 dll 文件到項(xiàng)目目錄下才能運(yùn)行。

這里需要注意幾個(gè)參數(shù)use_vaapi如果未設(shè)置為false,即使安裝了vaapi,也會(huì)出現(xiàn)頭文件的一些錯(cuò)誤信息。

chrome_pgo_phase=0 禁用pgo文件。

use_gnome_keyring設(shè)置為false

進(jìn)入code/chromium_git/chromium/src/cef路徑,執(zhí)行腳本,生成工程文件

./cef_create_projects.sh

問(wèn)題處理

在生成工程的過(guò)程中,我這里遇到了很多錯(cuò)誤,大多是缺失庫(kù)。

printing:printing_unittests
ERROR at dynamically parsed input that //printing/BUILD.gn:464:16 loaded :1:1: Invalid token in literal value
-------------------------------------
^
See //BUILD.gn:287:15: which caused the file to be included.                                                  
    deps += [ "http://printing:printing_unittests" ]
              ^------------------------------
Traceback (most recent call last):                                                                            
  File "tools/gclient_hook.py", line 149, in <module>
    RunAction(src_dir, cmd)
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/cef/tools/gclient_util.py", line 36, in RunAction
    command, cwd=dir, always_show_header=True, print_stdout=True)
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/depot_tools/gclient_utils.py", line 716, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), command_output.getvalue(), None)
subprocess2.CalledProcessError: Command 'gn gen out/Debug_GN_x64' returned non-zero exit status 1 in /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src
ERROR at dynamically parsed input that //printing/BUILD.gn:464:16 loaded :1:1: Invalid token in literal value
-------------------------------------
^
See //BUILD.gn:287:15: which caused the file to be included.                                                  
    deps += [ "http://printing:printing_unittests" ]
              ^------------------------------

缺失庫(kù),安裝libcups2-dev庫(kù)即可

sudo apt install libcups2-dev
Package glib-2.0 was not found in the pkg-config search path
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py glib-2.0
Returned 1.
stderr:

Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Could not run pkg-config.

See //cef/BUILD.gn:2090:5: whence it was called.
    pkg_config("glib") {
    ^-------------------
See //BUILD.gn:283:15: which caused the file to be included.                                                  
    deps += [ "http://cef" ]
              ^------
Traceback (most recent call last):                                                                            
  File "tools/gclient_hook.py", line 149, in <module>
    RunAction(src_dir, cmd)
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/cef/tools/gclient_util.py", line 36, in RunAction
    command, cwd=dir, always_show_header=True, print_stdout=True)
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/depot_tools/gclient_utils.py", line 716, in CheckCallAndFilter
    rv, args, kwargs.get('cwd', None), command_output.getvalue(), None)
subprocess2.CalledProcessError: Command 'gn gen out/Debug_GN_x64' returned non-zero exit status 1 in /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py glib-2.0
Returned 1.
stderr:

Package glib-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `glib-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'glib-2.0' found
Could not run pkg-config.

See //cef/BUILD.gn:2090:5: whence it was called.
    pkg_config("glib") {
    ^-------------------
See //BUILD.gn:283:15: which caused the file to be included.                                                  
    deps += [ "http://cef" ]

安裝

sudo apt install libglib2.0-dev
Package gnome-keyring-1 was not found in the pkg-config search path.
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py gnome-keyring-1
Returned 1.
stderr:

Package gnome-keyring-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gnome-keyring-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gnome-keyring-1' found
Could not run pkg-config.

這里就是前面提到的需要將use_gnome_keyring設(shè)置為false禁用掉。

終端輸入,將其禁用

export GN_DEFINES="use_sysroot=true symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"
Package dbus-1 was not found in the pkg-config search path
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py dbus-1
Returned 1.
stderr:

Package dbus-1 was not found in the pkg-config search path.
Perhaps you should add the directory containing `dbus-1.pc'
to the PKG_CONFIG_PATH environment variable
No package 'dbus-1' found
Could not run pkg-config.

安裝

sudo apt install libdbus-1-dev
Package nss was not found in the pkg-config search path
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py nss -v -lssl3
Returned 1.
stderr:

Package nss was not found in the pkg-config search path.
Perhaps you should add the directory containing `nss.pc'
to the PKG_CONFIG_PATH environment variable
No package 'nss' found
Could not run pkg-config.

安裝

sudo apt install libnss3-dev
Package libva was not found in the pkg-config search path
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py libva
Returned 1.
stderr:

Package libva was not found in the pkg-config search path.
Perhaps you should add the directory containing `libva.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libva' found
Could not run pkg-config.

安裝

sudo apt install libva-dev
Package gbm was not found in the pkg-config search path
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
    pkgresult = exec_script(pkg_config_script, args, "value")
                ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Debug_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/build/config/linux/pkg-config.py gbm
Returned 1.
stderr:

Package gbm was not found in the pkg-config search path.
Perhaps you should add the directory containing `gbm.pc'
to the PKG_CONFIG_PATH environment variable
No package 'gbm' found
Could not run pkg-config.
sudo apt install libgbm-dev
run “gclient runhooks” to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments

即pgo文件問(wèn)題

ERROR at //build/config/compiler/pgo/BUILD.gn:81:23: Script returned non-zero exit code.
      pgo_data_path = exec_script("http://tools/update_pgo_profiles.py",
                      ^----------
Current dir: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Release_GN_x64/
Command: python3 /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py --target linux get_profile_path
Returned 1.
stderr:

Traceback (most recent call last):
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 154, in <module>
    sys.exit(main())
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 150, in main
    return args.func(args)
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/tools/update_pgo_profiles.py", line 122, in _get_profile_path
    profile_path)
RuntimeError: requested profile "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/chrome/build/pgo_profiles/chrome-linux-5672-1683023364-b47f9a07c616c94cac9f564aa6b00a8aaaec191a.profdata" doesn't exist, please make sure "checkout_pgo_profiles" is set to True in the "custom_vars" section of your .gclient file, e.g.: 
solutions = [ 
  { 
    "name": "src", 
    # ...  
    "custom_vars": { 
      "checkout_pgo_profiles": True, 
    }, 
  }, 
], 
and then run "gclient runhooks" to download it. You can also simply disable the PGO optimizations by setting |chrome_pgo_phase = 0| in your GN arguments.

See //build/config/BUILDCONFIG.gn:352:3: which caused the file to be included.
  "http://build/config/compiler/pgo:default_pgo_flags",

嘗試了下載pgo文件,但失敗,于是將其chrome_pgo_phase禁用

export GN_DEFINES="use_sysroot=false symbol_level=1 is_cfi=false use_thin_lto=false use_vaapi=false ffmpeg_branding=Chrome proprietary_codecs=true is_official_build=true use_gnome_keyring=false chrome_pgo_phase=0"

若還是提示此錯(cuò)誤,則可修改chromium_git/chromium/src/build/config/compiler/pgo/pgo.gni文件,最后的位置處加上chrome_pgo_phase = 0

  chrome_pgo_phase = 0
  if (!dcheck_always_on && is_official_build &&
      # TODO(crbug.com/1052397): Remove chromeos_is_browser_only once
      # target_os switch for lacros-chrome is completed.
      # TODO(crbug.com/1336055): Update this now-outdated condition with regard
      # to chromecast and determine whether chromeos_is_browser_only is
      # obsolete.
      (is_high_end_android || is_win || is_mac || is_fuchsia ||
       (is_linux && !is_castos && !chromeos_is_browser_only))) {
    chrome_pgo_phase = 2
  }
# 手動(dòng)添加
  chrome_pgo_phase = 0
  # When using chrome_pgo_phase = 2, read profile data from this path.
  pgo_data_path = ""
}

當(dāng)問(wèn)題都解決后,就可以開始編譯源碼了。

開始編譯

code/chromium_git/chromium/src路徑下

# debug lib
ninja -C out/Debug_GN_x64 cefclient cefsimple ceftests chrome_sandbox
# release lib
ninja -C out/Release_GN_x64 cefclient cefsimple ceftests chrome_sandbox

這里直接執(zhí)行的第二條命令

在編譯過(guò)程中,也會(huì)出現(xiàn)錯(cuò)誤,不過(guò)好在是增量編譯,報(bào)錯(cuò)不會(huì)影響已經(jīng)編譯好的產(chǎn)物。

問(wèn)題處理
gperf錯(cuò)誤
sudo apt install gperf
No module named ‘importlib_metadata’
Traceback (most recent call last):
  File "../../third_party/blink/renderer/bindings/scripts/generate_bindings.py", line 12, in <module>
    import bind_gen
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/__init__.py", line 36, in <module>
    from .callback_function import generate_callback_functions
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/callback_function.py", line 8, in <module>
    from .blink_v8_bridge import blink_class_name
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/blink_v8_bridge.py", line 8, in <module>
    from .code_node import FormatNode
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/code_node.py", line 13, in <module>
    from .mako_renderer import MakoRenderer
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/blink/renderer/bindings/scripts/bind_gen/mako_renderer.py", line 7, in <module>
    import mako.runtime
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/mako/mako/mako/runtime.py", line 14, in <module>
    from mako import compat
  File "/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/third_party/mako/mako/mako/compat.py", line 68, in <module>
    import importlib_metadata  # noqa
ModuleNotFoundError: No module named 'importlib_metadata'
[559/47120] CXX obj/v8/cppgc_base/heap-consistency.o
ninja: build stopped: subcommand failed.

這個(gè)錯(cuò)誤提示是最明顯的了,安裝python的importlib_metadata庫(kù)即可

pip3 install importlib_metadata

如果pip命令未找到,那么先安裝pip再執(zhí)行上面的命令

sudo apt install python3-pip
fatal error: ‘pulse/pulseaudio.h’ file not found
gen/media/audio/pulse/pulse_stubs.cc:17:10: fatal error: 'pulse/pulseaudio.h' file not found
#include <pulse/pulseaudio.h>
         ^~~~~~~~~~~~~~~~~~~~
1 error generated.                                                                                            
[6644/46562] CXX obj/extensions/common/api/generated_api_types/networking_private.o
ninja: build stopped: subcommand failed.
sudo apt install libpulse-dev 
fatal error: ‘curl/curl.h’ file not found
../../third_party/crashpad/crashpad/util/net/http_transport_libcurl.cc:17:10: fatal error: 'curl/curl.h' file not found
#include <curl/curl.h>
         ^~~~~~~~~~~~~
1 error generated.                                                                                            
[845/39891] CXX obj/third_party/crashpad/crashpad/util/util/metrics.o
ninja: build stopped: subcommand failed.
sudo apt install libcurl4-openssl-dev
fatal error: ‘pci/pci.h’ file not found
../../third_party/angle/src/gpu_info_util/SystemInfo_libpci.cpp:12:10: fatal error: 'pci/pci.h' file not found
#include <pci/pci.h>
         ^~~~~~~~~~~
1 error generated.                                                                                            
[3735/39047] CXX obj/third_party/vulkan-deps/vulkan-validation-layers/src/VkLayer_khronos_validation/chassis.o
ninja: build stopped: subcommand failed.
sudo apt install libpci-dev
fatal error: ‘a(chǎn)lsa/asoundlib.h’ file not found
../../media/midi/midi_manager_alsa.h:8:10: fatal error: 'alsa/asoundlib.h' file not found
#include <alsa/asoundlib.h>
         ^~~~~~~~~~~~~~~~~~
1 error generated.                                                                                            
[4066/35313] CXX obj/media/mojo/mojom/speech_recognition/speech_recognition.mojom.o
ninja: build stopped: subcommand failed.
sudo apt install libasound2-dev
fatal error: ‘gssapi.h’ file not found
../../net/http/http_auth_gssapi_posix.h:26:10: fatal error: 'gssapi.h' file not found
#include <gssapi.h>
         ^~~~~~~~~~
1 error generated.                                                                                            
[483/31248] CXX obj/net/net/http_cache_transaction.o
ninja: build stopped: subcommand failed.
 sudo apt install libkrb5-dev

當(dāng)編譯完成時(shí),終端顯示內(nèi)容:

Leou@Leou-PC:/media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src$ ninja -C out/Debug_GN_x64 cefclient cefsimple ceftests chrome_sandbox
ninja: Entering directory `out/Debug_GN_x64'
[57156/57156] LINK ./ceftests

生成CEF二進(jìn)制分發(fā)包

記得選上--x64-build,否則默認(rèn)為x86,會(huì)提示找不到頭文件。生成的路徑為/code/chromium_git/chromium/src/cef/binary_districhromium/src/cef/binary_distrib,會(huì)默認(rèn)打包為zip壓縮包

code/chromium_git/chromium/src/cef/tools$
# 打包Release
./make_distrib.sh --ninja-build --minimal --x64-build

生成的包名:
cef_binary_113.3.5+g0b33855+chromium-113.0.5672.129_linux64_minimal

# 同時(shí)打包Debug和Release
./make_distrib.sh --ninja-build --x64-build

生成的包名:

cef_binary_113.3.5+g0b33855+chromium-113.0.5672.129_linux64

ERROR: Please install Doxygen
ERROR: No docs generated.
Traceback (most recent call last):
  File "make_distrib.py", line 1251, in <module>
    copy_files_list(build_dir, dst_dir, binaries)
  File "make_distrib.py", line 325, in copy_files_list
    raise Exception('Missing required path: %s' % source_path)
Exception: Missing required path: /media/Leou/53e0f2ac-c225-409c-ad9d-0cf8392c641f/code/chromium_git/chromium/src/out/Release_GN_x64/chrome_sandbox
sudo apt install doxygen

當(dāng)然也可以禁用生成doc文檔,就不需要安裝了。

總結(jié)

由于是事后記錄,出錯(cuò)的問(wèn)題未記錄解決方案難免有疏漏。我在下載、編譯、生成的階段中,都會(huì)出現(xiàn)很多問(wèn)題,但總體而言,Linux平臺(tái)的CEF源碼編譯還算比較順暢。

https://bitbucket.org/chromiumembedded/cef/wiki/BranchesAndBuilding
https://bitbucket.org/chromiumembedded/cef/wiki/MasterBuildQuickStart.md
https://zhuanlan.zhihu.com/p/133675543
https://keqingrong.cn/blog/2021-12-20-building-chromium-on-windows/
https://www.mycode.net.cn/language/cpp/2784.html文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-633078.html

到了這里,關(guān)于Linux CEF(Chromium Embedded Framework)源碼下載編譯詳細(xì)記錄的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!

本文來(lái)自互聯(lián)網(wǎng)用戶投稿,該文觀點(diǎn)僅代表作者本人,不代表本站立場(chǎng)。本站僅提供信息存儲(chǔ)空間服務(wù),不擁有所有權(quán),不承擔(dān)相關(guān)法律責(zé)任。如若轉(zhuǎn)載,請(qǐng)注明出處: 如若內(nèi)容造成侵權(quán)/違法違規(guī)/事實(shí)不符,請(qǐng)點(diǎn)擊違法舉報(bào)進(jìn)行投訴反饋,一經(jīng)查實(shí),立即刪除!

領(lǐng)支付寶紅包贊助服務(wù)器費(fèi)用

相關(guān)文章

  • Linux內(nèi)核源碼下載地址及方式

    HTTP地址(https://www.kernel.org/pub/)提供了HTTP協(xié)議的下載方式,您可以使用瀏覽器或wget等工具下載內(nèi)核源碼。 GIT地址(https://git.kernel.org/)提供了Git協(xié)議的方式,您可以使用Git客戶端工具克隆內(nèi)核源碼倉(cāng)庫(kù)。 RSYNC地址(rsync://rsync.kernel.org/pub/)提供了rsync協(xié)議的下載方式,您可以

    2024年02月03日
    瀏覽(27)
  • Linux:tomcat (源碼包安裝)(官網(wǎng)下載-安裝-啟動(dòng)-配置-等等等-----從入門到入土)

    Linux:tomcat (源碼包安裝)(官網(wǎng)下載-安裝-啟動(dòng)-配置-等等等-----從入門到入土)

    Apache Tomcat?軟件是一個(gè)開源實(shí)現(xiàn)?Jakarta Servlet、Jakarta?Server Pages、Jakarta Expression?Language、Jakarta WebSocket、Jakarta?Annotations?和?Jakarta Authentication?規(guī)范。?這些規(guī)范是Jakarta EE平臺(tái)的一部分。 Apache Tomcat軟件是在開放和參與式中開發(fā)的。 環(huán)境,并在?Apache 許可證版本 2?下發(fā)布。這

    2024年02月10日
    瀏覽(16)
  • 國(guó)內(nèi)鏡像:極速下載編譯WebRTC源碼(For Android/Linux/IOS)(二十四)

    國(guó)內(nèi)鏡像:極速下載編譯WebRTC源碼(For Android/Linux/IOS)(二十四)

    簡(jiǎn)介: CSDN博客專家,專注Android/Linux系統(tǒng),分享多mic語(yǔ)音方案、音視頻、編解碼等技術(shù),與大家一起成長(zhǎng)! 優(yōu)質(zhì)專欄: Audio工程師進(jìn)階系列 【 原創(chuàng)干貨持續(xù)更新中…… 】?? 優(yōu)質(zhì)專欄: 多媒體系統(tǒng)工程師系列 【 原創(chuàng)干貨持續(xù)更新中…… 】?? 人生格言: 人生從來(lái)沒(méi)有捷徑

    2024年01月17日
    瀏覽(20)
  • Linux學(xué)習(xí)之Ubuntu 20.04在github下載源碼安裝Openresty 1.19.3.1

    Linux學(xué)習(xí)之Ubuntu 20.04在github下載源碼安裝Openresty 1.19.3.1

    參考的博文:《在 Ubuntu 上使用源碼安裝 OpenResty》 《OpenResty 安裝安裝詳解-Ubuntu》 《Linux學(xué)習(xí)之CentOS 7源碼安裝openresty》 https://openresty.org/en/download.html是官網(wǎng)下載網(wǎng)址,頁(yè)面往下拉有下載的鏈接。 https://github.com/openresty/openresty 是github上的鏈接。 可以點(diǎn)擊上圖中 tags 進(jìn)入有不同

    2024年02月11日
    瀏覽(24)
  • cefsharp120.2.70(cef120.2.7Chromium6099.234)升級(jí)測(cè)試及其他H264版本

    cefsharp120.2.70(cef120.2.7Chromium6099.234)升級(jí)測(cè)試及其他H264版本

    此版本cefsharp 120.2.70 (cef 120.2.7) 無(wú)重大更新,因官方倉(cāng)庫(kù)打不開,不知道具體更新內(nèi)容,已測(cè)無(wú)異常。 支持H264推薦版本:V100,V109,V111,V119版本,其他V114,V115,V108,V107 支持win7最后版本v109.x 支持NET4.5.2最后版本v114.x 請(qǐng)關(guān)注收藏欄目進(jìn)行交流,感謝您的支持 最低支持NET4.6.2 建議用

    2024年01月25日
    瀏覽(61)
  • git下載源碼及環(huán)境搭建下載源碼之后端(一)

    git下載源碼及環(huán)境搭建下載源碼之后端(一)

    下載源碼 使用 windows + R 使用cmd調(diào)用命令框下載gitee云上面的 源碼文件 輸入命令: Git clone (此處拼接gitee源代碼 地址) 若使用 git 命令 clone 項(xiàng)目時(shí) 我們需要在系統(tǒng)變量中進(jìn)行配置,配置流程如下所示: 計(jì)算機(jī)—右鍵—屬性–高級(jí)系統(tǒng)設(shè)置—高級(jí)–環(huán)境變量—系統(tǒng)變量–p

    2024年02月16日
    瀏覽(33)
  • Linux 編譯CEF源碼詳細(xì)記錄

    Linux 編譯CEF源碼詳細(xì)記錄

    Linux CEF(Chromium Embedded Framework)源碼下載編譯 由于CEF默認(rèn)的二進(jìn)制分發(fā)包不支持音視頻播放,需要自行編譯源碼,將ffmpeg開關(guān)打開才能支持。這里介紹的是Linux平臺(tái)下的CEF源碼下載編譯過(guò)程。 Windows平臺(tái)參考: 《Windows 編譯CEF源碼詳細(xì)記錄》 下載的過(guò)程非常艱辛,因?yàn)橛残砸?/p>

    2024年02月13日
    瀏覽(13)
  • Android源碼下載

    Android源碼下載

    ? ??最近在做Monkey二次開發(fā)的工作,邊弄邊在這里記錄下(多平臺(tái)發(fā)布),順便可以和大家一起討論下; ?Monkey的編譯依賴于Android源碼,所以要修改Monkey后打新jar包,需要完整的Android源碼環(huán)境。 ? ? ? ? 整理了下Android源碼的下載流程; ? ? ? ? 參考文檔:source.downloadin

    2024年02月07日
    瀏覽(26)
  • 易支付源碼最新版開源開發(fā)搭建附源碼下載

    易支付源碼最新版開源開發(fā)搭建附源碼下載

    預(yù)計(jì)到2024年,全球電子商務(wù)銷售額將達(dá)到6萬(wàn)億美元,零售商將實(shí)體店轉(zhuǎn)移到網(wǎng)上從未像現(xiàn)在這樣容易。商家可以建立自己的網(wǎng)站,在網(wǎng)上列出他們的實(shí)體產(chǎn)品,完成支付并發(fā)展他們的業(yè)務(wù),甚至不用離開沙發(fā)?,F(xiàn)在,數(shù)字化轉(zhuǎn)型已經(jīng)從店面擴(kuò)展到產(chǎn)品本身。 不管你是否意識(shí)

    2024年04月11日
    瀏覽(30)
  • Android 源碼下載(詳細(xì)版)

    Android 源碼下載(詳細(xì)版)

    經(jīng)典好文推薦,通過(guò)閱讀本文,您將收獲以下知識(shí)點(diǎn): 一、下載AOSP前的準(zhǔn)備 二、國(guó)內(nèi)網(wǎng)絡(luò)下 clone 清華大學(xué)開源軟件鏡像 三、編寫Python腳本,開始下載android-10.0.0_r40 源碼 四、源碼下載工具包 五、參考文獻(xiàn) 想在國(guó)內(nèi)網(wǎng)絡(luò)下載AOSP源碼,需要電腦配置如下環(huán)境 1.安裝Git 2.安裝

    2024年02月12日
    瀏覽(28)

覺得文章有用就打賞一下文章作者

支付寶掃一掃打賞

博客贊助

微信掃一掃打賞

請(qǐng)作者喝杯咖啡吧~博客贊助

支付寶掃一掃領(lǐng)取紅包,優(yōu)惠每天領(lǐng)

二維碼1

領(lǐng)取紅包

二維碼2

領(lǐng)紅包