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等。

至此就没问题了。











猜你喜欢

转载自blog.csdn.net/u011803182/article/details/80283163
今日推荐