天天看點

ubuntu16.04編譯CEF的arm版的步驟及問題

#!/bin/sh -e

#1

mkdir ~/cef_arm2/automate

mkdir ~/cef_arm2/chromium_git

#2

cd ~/cef_arm2

curl 'https://chromium.googlesource.com/chromium/src/+/master/build/install-build-deps.sh?format=TEXT' | base64 -d > install-build-deps.sh

chmod 755 install-build-deps.sh

sudo ./install-build-deps.sh --arm

#3

sudo apt-get install libgtkglext1-dev

#4

cd ~/cef_arm2

git clone https://chromium.googlesource.com/chromium/tools/depot_tools.git

#5

export PATH=~/cef_arm2/depot_tools:$PATH

$6

cd ~/cef_arm2/automate

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

#7.1

#建立~/git/cef_arm2/chromium_git/update.sh腳本,将下面的内容寫入update.sh腳本中

#!/bin/bash

export CEF_USE_GN=1

export GYP_DEFINES=target_arch=arm

export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=0 arm_float_abi=hard enable_vr=false"

python ../automate/automate-git.py --download-dir=~/cef_arm2/chromium_git --depot-tools-dir=~/cef_arm2/depot_tools --arm-build --no-distrib

#7.2

chmod +x update.sh

sudo ./update.sh

#第七步會失敗,失敗之後切換到目錄~/git/cef_arm2/chromium_git/chromium/src之後,執行下面的這條python腳本,然後再重新執行第七步。

#before step 7 you should install-sysroot for arm

#~/git/cef_arm2/chromium_git/chromium/src

export CEF_USE_GN=1

export GYP_DEFINES=target_arch=arm

export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=1 arm_float_abi=hard enable_vr=false"

./build/linux/sysroot_scripts/install-sysroot.py --arch=arm

#8.1

#if use_sysroot=true is not write into GN_DEFINES only Debug_GN_x64 and Release_GN_x64 was build.

# add use_sysroot=true it will gen Debug_GN_arm and Release_GN_arm 

#建立~/git/cef_arm2/chromium_git/chromium/src/cef/create.sh腳本,并将下面的内容寫入到create.sh中

#!/bin/bash

export PATH=~/cef_arm2/depot_tools:$PATH

export CEF_USE_GN=1

export GYP_DEFINES=target_arch=arm

export GN_DEFINES="is_official_build=true use_sysroot=true use_allocator=none symbol_level=0 arm_float_abi=hard enable_vr=false"

./cef_create_projects.sh

#8.2

chmod +x create.sh

./create.sh

#9

cd ~/cef_arm2/chromium_git/chromium/src

ninja -C out/Release_GN_arm cef chrome_sandbox

#10

#Run make_distrib.sh with the --arm-build command-line flag to generate a binary distribution from the ARM build.

make_distrib.sh --arm-build 

在以上的過程中,我在第一步./install-build-deps.sh --arm遇到的問題如下:

已下載下傳 323 kB,耗時 2分 8秒 (2 519 B/s)            

正在讀取軟體包清單... 完成

W: 倉庫 “http://ppa.launchpad.net/u-szeged/sedkit/ubuntu xenial Release” 沒有 Release 檔案。

N: 無法認證來自該源的資料,是以使用它會帶來潛在風險。

N: 參見 apt-secure(8) 手冊以了解倉庫建立和使用者配置方面的細節。

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/binary-amd64/Packages  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/binary-i386/Packages  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/binary-all/Packages  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/i18n/Translation-zh_CN  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/i18n/Translation-zh  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/i18n/Translation-en  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/dep11/Components-amd64.yml  404  Not Found

W: 無法下載下傳 http://ppa.launchpad.net/u-szeged/sedkit/ubuntu/dists/xenial/main/dep11/icons-64x64.tar  404  Not Found

W: 部分索引檔案下載下傳失敗。如果忽略它們,那将轉而使用舊的索引檔案。

E:。。。。。。(這個地方沒記錄下來,出現Error之後就不會再往下面繼續執行了)。

後來按照網上的方法,更改了下載下傳源/etc/apt/sources.list之後,過一段時間之後執行./install-build-deps.sh --arm,就出現了後續的下載下傳依賴軟體包的過程,然後再往下執行,基本沒什麼問題了。

在執行ninja -C out/Release_GN_arm cef chrome_sandbox的時候,可能會提示找不到頭檔案,你需要在obj目錄下找到對應的*.o對應的*.ninja配置檔案,自己填入頭檔案的絕對路徑即可。-I/xxx/xxx/gtk.h等。

至此就沒問題了。