如何在 Ubuntu 18.04 上从源代码构建“ungoogled-chromium”?

如何在 Ubuntu 18.04 上从源代码构建“ungoogled-chromium”?

到此时为止,我已经投入了大约一个小时,并且开始感到内心有点无力。

ungoogled-chromium从以下网址下载了版本 71.0.3578.98-2GitHub。我将tar.gz文件解压到我的主文件夹中。然后,使用“任何 Linux 发行版”部分的说明构建说明。我按照说明添加了LLVM APT 仓库。我将 Bionic(18.04)的指定行添加到我的/etc/apt/sources.list文件中,并使用以下命令检索密钥:

wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add -
sudo apt-get update

此输出这些错误看起来像这样:

E: The repository 'https:/dl.winehq.org/wine-builds/ubuntu bionic Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
W: GPG error: http://apt.llvm.org/bionic llvm-toolchain-bionic InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 15CF4D18AF4F7421

然后我(虽然我知道它不会起作用)运行:

sudo apt-get install clang-8 lld-8 llvm-8-dev python python3 ninja-build

并且所有 LLVM 包都无法安装。

这是我第一次从源代码构建,所以我知道不可避免地会犯一些令人讨厌的新手错误。

答案1

首先,如果您不想从源代码构建,他们提供了已为 Ubuntu 18.04 构建的二进制文件:

搭建说明可从以下网址获取:

这指定您可以构建 LLVM 7,而不需要安装 LLVM 8 来为 Ubuntu Bionic (18.04) 构建

构建应该尽可能简单:

sudo apt install packaging-dev python3 ninja-build

# Run from inside the clone of the repository
mkdir -p build/src

./get_package.py PACKAGE_TYPE_HERE build/src/debian
cd build/src

# Use dpkg-checkbuilddeps (from dpkg-dev) or mk-build-deps (from devscripts) to check for additional packages.
# If necessary, change the dependencies in debian/control to accommodate your environment.
# If necessary, modify AR, NM, CC, and CXX variables in debian/rules
debian/rules setup-local-src
dpkg-buildpackage -b -uc

相关内容