VeraCrypt文档-Linux构建指南

 Linux Build Guide

Linux构建指南

This guide describes how to set up a Linux System to build VeraCrypt from source and how to perform compilation.

本指南介绍了如何设置Linux系统以从源代码构建VeraCrypt以及如何执行编译。

The procedure for a Ubuntu 22.04 LTS system is described here as an example, the procedure for other Linux systems is analogous.

这里以Ubuntu 22.04 LTS系统的过程为例进行描述,其他Linux系统的过程类似。

The following components are required for compiling VeraCrypt:

编译VeraCrypt需要以下组件:

  1. GNU Make
  2. GNU C/C++ Compiler
  3. YASM 1.3.0
  4. pkg-config
  5. wxWidgets 3.x shared library and header files installed by the system or wxWidgets 3.x library source code

    系统安装的wxWidgets 3.x共享库和头文件或wxWidget 3.x库源代码
     

  6. FUSE library and header files

    FUSE库和头文件
     

  7. PCSC-lite library and header files

    PCSC-lite库和头文件

Below are the procedure steps. Clicking on any of the link takes directly to the related step:

以下是程序步骤。单击任何链接可直接进入相关步骤:

  • Installation of GNU Make
  • GNU Make的安装
  • Installation of GNU C/C++ Compiler
  • GNU C/C++编译器的安装
  • Installation of YASM
  • YASM的安装
  • Installation of pkg-config
  • pkg-config的安装
  • Installation of wxWidgets 3.2
  • wxWidgets 3.2的安装
  • Installation of libfuse
  • libfuse的安装
  • Installation of libpcsclite
  • libpcsclite的安装
  • Download VeraCrypt
  • 下载VeraCrypt
  • Compile VeraCrypt
  • 编译VeraCrypt

They can also be performed by running the below list of commands in a terminal or by copying them to a script:

也可以通过在终端中运行以下命令列表或将其复制到脚本来执行这些操作:

sudo apt update
sudo apt install -y build-essential yasm pkg-config libwxgtk3.0-gtk3-dev
sudo apt install -y libfuse-dev git libpcsclite-dev
git clone https://github.com/veracrypt/VeraCrypt.git
cd ~/VeraCrypt/src
make

Installation of GNU Make

GNU Make的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install build-essential

Installation of GNU C/C++ Compiler

GNU C/C++编译器的安装

If the build-essential were already installed in the step before, this step can be skipped.

如果在之前的步骤中已经安装了基本构建,则可以跳过此步骤。

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    sudo apt update
    sudo apt install build-essential

Installation of YASM

YASM的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install yasm

Installation of pkg-config

pkg-config的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install pkg-config

Installation of wxWidgets 3.2

wxWidgets 3.2的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install libwxgtk3.0-gtk3-dev

Installation of libfuse

libfuse的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install libfuse-dev

Installation of libpcsclite

libpcsclite的安装

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install libpcsclite-dev

Download VeraCrypt

下载VeraCrypt

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    sudo apt update
    sudo apt install git
    git clone https://github.com/veracrypt/VeraCrypt.git

Compile VeraCrypt

编译VeraCrypt

Remarks:

评论

  • By default, a universal executable supporting both graphical and text user interface (through the switch --text) is built.
    On Linux, a console-only executable, which requires no GUI library, can be built using the 'NOGUI' parameter.
    For that, you need to dowload wxWidgets sources, extract them to a location of your choice and then run the following commands:
    make NOGUI=1 WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources wxbuild
    make NOGUI=1 WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources
  • 默认情况下,将构建一个同时支持图形和文本用户界面的通用可执行文件(通过开关--text)。
    在Linux上,可以使用“NOGUI”参数构建仅限控制台的可执行文件,该文件不需要GUI库。
    为此,需要向下加载wxWidgets源,将它们提取到选择的位置,然后运行以下命令:
    make NOGUI=1 WXSTATIC=1 WX_ROOT=/path/到/wxWidgetsSources wxbuild make NOGUE=1 WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources
  • If you are not using the system wxWidgets library, you will have to download and use wxWidgets sources like the remark above but this time the following commands should be run to build GUI version of VeraCrypt (NOGUI is not specified):
    make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources wxbuild
    make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources
  • 如果没有使用系统wxWidgets库,将不得不下载并使用wxWidget源代码,如上文所述,但这次应该运行以下命令来构建VeraCrypt的GUI版本(未指定NOGUI):
    make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources wxbuild
    make WXSTATIC=1 WX_ROOT=/path/to/wxWidgetsSources

Steps:

步骤:

  1. Open a terminal
    打开一个终端
  2. Execute the following commands:
    执行以下命令:
    cd ~/VeraCrypt/src
    make
  3. If successful, the VeraCrypt executable should be located in the directory 'Main'.
    如果成功,VeraCrypt可执行文件应位于目录“Main”中。