symbol Asset 1

Installing RNP

Binaries that will be installed:

  • rnp

  • rnpkeys

On macOS using Homebrew

We provide a Homebrew tap for easy installation of RNP on macOS.

brew tap rnpgp/rnp
brew install rnp

On RHEL and CentOS via YUM

We provide pre-built packages for RHEL and CentOS at our YUM repository hosted at GitHub.

rpm --import https://github.com/riboseinc/yum/raw/master/ribose-packages.pub
curl -L https://github.com/riboseinc/yum/raw/master/ribose.repo > /etc/yum.repos.d/ribose.repo
yum install -y rnp

On Ubuntu

Prerequisite: please ensure git is installed on the system.

# Clone the repository by version tag (or omit it to get the latest sources)
git clone https://github.com/rnpgp/rnp.git -b v0.14.0

# Install required packages
sudo apt install g++-8 cmake libbz2-dev zlib1g-dev libjson-c-dev \
  build-essential python-minimal

# Download, build and install Botan2
wget -qO- https://botan.randombit.net/releases/Botan-2.14.0.tar.xz | tar xvJ
cd Botan-2.14.0
./configure.py --prefix=/usr
make
sudo make install
cd ..

# CMake encourages building outside of the source directory.
mkdir rnp-build
cd rnp-build

# Run CMake
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=on \
  -DBUILD_TESTING=off ../rnp/

# Compile
make

# Install
sudo make install

On Debian

Prerequisite: please ensure git is installed on the system.

# Clone the repository by version tag (or omit it to get the latest sources)
git clone https://github.com/rnpgp/rnp.git -b v0.14.0

# Enable access to `testing` packages by editing /etc/apt/sources.list
# deb http://deb.debian.org/debian testing main

# Install required packages
sudo apt install g++-8 cmake libbz2-dev zlib1g-dev libjson-c-dev \
  libbotan-2-dev build-essential

# Cmake recommend out-of-source builds
mkdir rnp-build
cd rnp-build

# Cmake it
cmake -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_SHARED_LIBS=on \
  -DBUILD_TESTING=off ../rnp/

# Compile and install
sudo make install

Compile from source

Clone this repo, or download a release and expand it.

Enter the source folder and run the following commands:

cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DBUILD_SHARED_LIBS=on \
  -DBUILD_TESTING=off .

make install

On Windows

Using MSYS/MinGW

From a clean MSYS2 install, please first update pacman and install required packages via the msys console.

pacman -Syu --noconfirm --needed

# Most likely you'll need to close msys console and run it again:
pacman -Syu --noconfirm --needed

# Install packages
pacman --noconfirm -S --needed tar zlib-devel libbz2-devel git automake autoconf libtool automake-wrapper gnupg2 make pkgconfig mingw64/mingw-w64-x86_64-cmake mingw64/mingw-w64-x86_64-gcc mingw64/mingw-w64-x86_64-json-c mingw64/mingw-w64-x86_64-libbotan mingw64/mingw-w64-x86_64-python3

Then clone the RNP repository and build it.

# CMake encourages building outside of the source directory.
mkdir rnp-build
cd rnp-build

# Add MinGW's lib and bin to PATH so dependency dll/lib files can be found
export PATH="/c/msys64/mingw64/lib:/c/msys64/mingw64/bin:$PATH"

# Run CMake
cmake -DBUILD_SHARED_LIBS=yes -G "MSYS Makefiles" ../rnp

# Compile and install
make && make install

Using Microsoft Visual Studio 2019

Install vcpkg according to these instructions:

Set the VCPKG_ROOT environment variable to the vcpkg root folder.

vcpkg install bzip2 zlib botan json-c getopt dirent python3[core,enable-shared]

There are two ways to compile and install:

  • If you open the MSVC IDE at this folder, it will pick up CMakeSettings.json to find the vcpkg path using the VCPKG_ROOT environment variable.

  • Otherwise, the following steps will perform a console build for CMake:

    # CMake encourages out-of source builds.
    mkdir rnp-build
    cd rnp-build
    cmake -B . -G "Visual Studio 16 2019" -A x64 -DCMAKE_TOOLCHAIN_FILE=%VCPKG_ROOT%\scripts\buildsystems\vcpkg.cmake -DCMAKE_BUILD_TYPE=Release ../rnp
    cmake --build . --config Release
    cmake --install .

When running rnp.exe and rnpkeys.exe, please ensure that the following dependencies are available on path (or inside the same folder as the executables):

  • librnp.dll

  • botan.dll

  • bz2.dll

  • getopt.dll

  • json-c.dll

  • zlib1.dll

You may check dependencies and their paths via ntldd.exe in the MSYS command prompt.