当前位置:   article > 正文

在银河麒麟上编译运行firefox_麒麟系统离线安装火狐浏览器

麒麟系统离线安装火狐浏览器

1.关闭系统安全认证(可选)

不关闭会一直弹各种确认框,让你授权

sudo setstatus disable
  • 1

2.安装git

sudo apt-get update
sudo apt-get install git
  • 1
  • 2

3.下载源码

git clone https://github.com/mozilla/gecko-dev.git
  • 1

或者使用国内镜像

git clone https://gitee.com/mirrors/gecko-dev.git
  • 1

这里推荐国内镜像,速度比较快
(注:源码必须选择git或者hg方式下载的代码,否则构建系统可能不支持)

如果使用hg,则需要安装hg,这里不做介绍
hg clone https://hg.mozilla.org/mozilla-central
gecko-dev是mozilla-central的github仓库

4.bootstrap

4.1.一些问题的预处理

cd gecko-dev
  • 1

问题1:NotImplementedError: Bootstrap support for this Linux distro not yet available: kylin

vi python/mozboot/mozboot/bootstrap.py
  • 1

找到DEBIAN_DISTROS =
在里面添加kylin字段

问题2:ERROR: Could not find pip3.

sudo apt-get install python3-pip
  • 1


问题3:安装rustc编译器失败

sudo apt-get install curl
curl https://sh.rustup.rs/ > rustup-init.sh
chmod +x rustup-init.sh && ./rustup-init.sh
  • 1
  • 2
  • 3

提示:

1) Proceed with installation (default)
2) Customize installation
3) Cancel installation

输入1,敲enter键

vim ~/.cargo/config
  • 1

输入

[source.crates-io]
replace-with = 'tuna'

[source.tuna]
registry = "https://mirrors.tuna.tsinghua.edu.cn/git/crates.io-index.git"
  • 1
  • 2
  • 3
  • 4
  • 5

保存退出

source $HOME/.cargo/env
cargo install cbindgen
  • 1
  • 2

4.2.运行bootstrap

./mach bootstrap
  • 1

提示:
Press ENTER/RETURN to continue or CTRL+c to abort.
敲enter键

提示:Please choose the version of Firefox you want to build:
1. Firefox for Desktop Artifact Mode [default]
2. Firefox for Desktop
3. GeckoView/Firefox for Android Artifact Mode
4. GeckoView/Firefox for Android
5. SpiderMonkey JavaScript engine
输入2,敲enter键

提示:一些软件的安装
您希望继续执行吗? [Y/n]
输入Y,敲enter键

提示:How would you like to continue?
1. Install a modern Mercurial via pip [default]
2. Install a legacy Mercurial via apt
3. Do not install Mercurial
输入1,敲enter键

提示:Could not find a Rust compiler.
Will try to install Rust.
在这边会卡住,直接ctrl + c退出

提示:Would you like to run a few configuration steps to ensure Git is optimally configured? (Yn):
输入n,敲enter键

提示:Will you be submitting commits to Mozilla? (Yn):
输入n,敲enter键

提示:Would you like to enable build system telemetry? (Yn):
输入n,敲enter键

5.configure

5.1.安装clang

sudo apt-get install clang
  • 1

5.2.安装node.js(>=10.23.1)

mkdir ~/tmp
cd ~/tmp
wget https://nodejs.org/dist/v16.14.2/node-v16.14.2-linux-arm64.tar.gz
tar -zxvf node-v16.14.2-linux-arm64.tar.gz
sudo cp node-v16.14.2-linux-arm64/* /usr/ -r
cd -
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6

5.3.执行configure

./mach configure
  • 1

如果出现ERROR: Cannot find unzip
可以

unset UNZIP
./mach configure
  • 1
  • 2

6.build

6.1.安装lld

sudo apt-get install lld
sudo ln -s /usr/bin/wasm-ld-10 /usr/bin/wasm-ld
  • 1
  • 2

6.2.安装libclang_rt.builtins-wasm32.a

这个要和lld的版本对应,因为我本地是10.0的版本所以就下载了10.0的对应版本

cd ~/tmp
wget https://github.com/WebAssembly/wasi-sdk/releases/download/wasi-sdk-10/libclang_rt.builtins-wasm32-wasi-10.0.tar.gz
tar -zxvf libclang_rt.builtins-wasm32-wasi-10.0.tar.gz
sudo cp -r lib/wasi /usr/lib/llvm-10/lib/clang/10.0.0/lib/
cd -
  • 1
  • 2
  • 3
  • 4
  • 5

6.3.执行build

./mach build
  • 1

7.run

./mach run
  • 1

即可运行firefox

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/繁依Fanyi0/article/detail/203138
推荐阅读
相关标签
  

闽ICP备14008679号