Compiling GnuPG XVII: Order Of Compilation

fmg Tuesday April 29, 2025

Situation

Last time pinentry appeared as final missing piece to have a complete working self compiled GnuPG suite. To avoid old software and libraries from the distribution to the possible extend, we choose eight tarballs from the GnuPG Download page to be compiled.

Some parts require newer self compiled versions of libraries, other might benefit but can be compiled with the older versions from the distribution. It is an annoying exercise to figure the dependencies out by studying the documentation or the ldd output without being able to see them. Therefore I created an ASCII graph as pictorial support for understanding the situation.

ASCII Dependency Graph

The dependency graph has got two entry points, i.e. libraries to start with. These require no other libraries from the project itself and can be compiled against the distribution: libgpg-error and npth. Then there are two exit points, which provide the tools for usage of GnuPG: gnupg and pinentry. These tarballs are supposed to be compiled at the end. The order of compilation of the other four tarballs can be obtained from the dependency graph. There is one rule: compilation order in vertical path direction must always be downwards. The order in horizontal direction is given by arrows, but there is some redundancy in the graph, which makes the graph a little bit bigger, but this avoids possible misunderstandings by ignoring the arrows. The vertical rule should be enough to have an intuitive understanding of the digraph character. And another point: explicit dependencies are explicit paths without an intermediate library, e.g. everything except npth depends on libgpg-error and can be reached from it by a path not meeting any other library, as shown in the graph.

Copy to clipboard
L0 libgpg-error | | | +---->----+---->----+--------->---------+---->----+ | | | | | | | | | | | | L1 npth | | | | | | | | | | | | | | | | | | | L2 | | libgcrypt | | | | | | | | | | | | | | | | | L3 | libksba +--------->---------+ libassuan | | | | | | | | | | | | | +---->----+ +----<----+ | | | | | | | | | | | | | | | | | | | | | +----<----+ +---->----+ | | | | | | | | | | | | L4 | | ntbtls +----<----+ | | | | | | | | | | | | | | | +---->----+---->----+---------<---------+ | | | | | | | L5 gnupg pinentry

Best Practice

There is no unique order fixed by the graph, thus parts of the order can be considered as suggestion or recommendation. If you use the order from the download page (see above) and move GnuPG (devel) to the end of the list, this order should work, too.

  1. libgpg-error
  2. npth
  3. libgcrypt
  4. libksba
  5. libassuan
  6. ntbtls
  7. gnupg
  8. pinentry

In the future libgpg-error will be renamed gpgrt.

To be continued...


Codeberg OOC.md


Permalink: https://blog.shimps.org/blogpost445-Compiling-GnuPG-XVII-Order-Of-Compilation