Loading...
 

shimpsblog [en]

Compiling GnuPG VIII: Dependencies I

fmg Thursday March 20, 2025

Situation

Last time we observed that the simple approach is not sufficient to compile GnuPG developer version 2.5 on a Debian bookworm or Devuan daedalus system. This is due to the fact that this version needs more recent versions of libraries than provided by the distribution. The libraries themselves are available and can be downloaded from the GnuPG project, but we need to make them visible where and when they are needed.

Installation destination path

Whenever a piece of software is compiled and ready to be used, it should be installed to a dedicated location. Since we do not want to interfere with the distribution setup we choose the relative installation path install and the absolute path will result into /tmp/canary/install. Remember from last time where we are and create the chosen destination:

Copy to clipboard
$ pwd /tmp/canary/compile/gnupg-2.5.5 $ mkdir /tmp/canary/install

Configuration with prefix

libassuan
Copy to clipboard
cd ../libassuan-3.0.2 ./configure --prefix="/tmp/canary/install" make make install
libgpg-error
Copy to clipboard
cd ../libgpg-error-1.51 ./configure --prefix="/tmp/canary/install" make make install

With this-+libgpg-error+- library we can compile libgcrypt.

libgcrypt-1.11.0
Copy to clipboard
cd ../libgcrypt-1.11.0 ./configure --prefix="/tmp/canary/install" make make install

Now all missing parts from the gnupg configuration feedback are available.

gnupg I
Copy to clipboard
cd ../gnupg-2.5.5 ./configure --prefix="/tmp/canary/install" echo "There is a new problem"

There is another library missing: libksba.

Copy to clipboard
configure: *** *** You need libksba to build this program. *** This library is for example available at *** https://gnupg.org/ftp/gcrypt/libksba/ *** (at least version 1.6.3 using API 1 is required). ***

The required version 1.6.3 is provided by the distribution package libksba-dev but since we changed the configuration prefix it is not found anymore. This is odd. This does not happen in a similar situation with npth later. We need to either fine tune the configuration or build a self-contained environment. We chose the latter one:

libksba
Copy to clipboard
cd ../libksba-1.6.7 ./configure --prefix="/tmp/canary/install" make make install
gnupg II
Copy to clipboard
cd ../gnupg-2.5.5 ./configure --prefix="/tmp/canary/install" echo "There is another new problem"

Again there is a library missing: npth.:

Copy to clipboard
configure: *** *** It is now required to build with support for the *** New Portable Threads Library (nPth). Please install this *** library first. The library is for example available at *** https://gnupg.org/ftp/gcrypt/npth/ *** (at least version 1.2 (API 1) is required). ***

The configuration would be fine with the distribution package libnpth0-dev installed, but we compile from the sources.

npth
Copy to clipboard
cd ../npth-1.8 ./configure --prefix="/tmp/canary/install" make make install

Back to the main software again...

gnupg III
Copy to clipboard
cd ../gnupg-2.5.5 ./configure --prefix="/tmp/canary/install" make make install

The smoke test

Copy to clipboard
$ /tmp/canary/install/bin/gpg --version /tmp/canary/install/bin/gpg: error while loading shared libraries: libassuan.so.9: cannot open shared object file: No such file or directory

This is not the intended behaviour.

Copy to clipboard
$ LD_LIBRARY_PATH="/tmp/canary/install/lib" /tmp/canary/install/bin/gpg --version gpg (GnuPG) 2.5.5 libgcrypt 1.11.0 Copyright (C) 2025 g10 Code GmbH License GNU GPL-3.0-or-later <https://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Home: /home/alice/.gnupg Supported algorithms: Pubkey: RSA, Kyber, ELG, DSA, ECDH, ECDSA, EDDSA Cipher: IDEA, 3DES, CAST5, BLOWFISH, AES, AES192, AES256, TWOFISH, CAMELLIA128, CAMELLIA192, CAMELLIA256 Hash: SHA1, RIPEMD160, SHA256, SHA384, SHA512, SHA224 Compression: Uncompressed, ZIP, ZLIB

This is a first success. But there is a lot of fine tuning left to be done.

To be continued...