本文整理了在 Ubuntu 系统上编译安装 TaskWarrior 的方法。在编译安装前有以下前置条件:
- 操作系统为 Ubuntu 最新稳定版;
- 安装 TaskWarrior 编译时依赖的第三方库:cmake、build-essential、libgnutls28-dev、libuuid。
安装第三方依赖库
$ sudo apt-get install cmake build-essential libgnutls28-dev libuuid
克隆 TaskWarrior 源码
$ git clone https://github.com/GothenburgBitFactory/taskwarrior.git
$ cd taskwarrior
生成 Makefile
cmake -DCMAKE_BUILD_TYPE=release .
-- Configuring C++17
-- System: Linux
-- Looking for libshared
-- Found libshared
-- Looking for SHA1 references
-- Found SHA1 reference: 7400e6ed6
-- Looking for GnuTLS
-- Looking for libuuid
-- Looking for uuid_unparse_lower
-- Looking for uuid_unparse_lower - found
-- Found libuuid
-- Configuring cmake.h
-- Configuring man pages
-- Configuring done
-- Generating done
-- Build files have been written to: </path/to/taskwarrior>
构建编译
$ make
Scanning dependencies of target columns
[ 0%] Building CXX object src/columns/CMakeFiles/columns.dir/Column.cpp.o
[ 1%] Building CXX object src/columns/CMakeFiles/columns.dir/ColDepends.cpp.o
[ 1%] Building CXX object src/columns/CMakeFiles/columns.dir/ColDescription.cpp.o
[ 3%] Building CXX object src/columns/CMakeFiles/columns.dir/ColDue.cpp.o
...
将已编译好的软件安装到系统
$ sudo make install
安装成功后,执行 task --version
验证:
$ task --version
2.6.2