p≡p engine
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

147 lines
4.2 KiB

  1. <!-- Copyright 2015-2021, pEp foundation, Switzerland
  2. This file is part of the pEp Engine
  3. This file may be used under the terms of the Creative Commons Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0) License
  4. See CC_BY-SA.txt -->
  5. # Build instructions for Debian 9 and 10
  6. We assume the user keeps sources under `~/pep-src`. There is no single
  7. installation prefix: each package is built, or when supported installed, in
  8. either its source directory or in a subdirectory of its source directory.
  9. Rationale: we do not pollute the user system, uninstalling is trivial.
  10. This is Unix: we assume no spaces in user names.
  11. ~~~
  12. mkdir -p ~/pep-src
  13. ~~~
  14. # Installing packaged dependencies
  15. ~~~
  16. # general
  17. apt install -y git
  18. # libetpan
  19. apt install -y git build-essential automake libtool
  20. # asn1c
  21. apt install -y git build-essential automake libtool autoconf
  22. # sequoia
  23. apt install git rustc cargo clang libclang-dev make pkg-config nettle-dev libssl-dev capnproto libsqlite3-dev
  24. # engine
  25. apt install -y uuid-dev libgpgme-dev libsqlite3-dev sqlite3
  26. # optional: developer documentation
  27. apt install -y doxygen pandoc
  28. ~~~
  29. # Installing unpackaged dependencies
  30. ## YML2
  31. ~~~
  32. mkdir -p ~/pep-src/yml2
  33. git clone https://gitea.pep.foundation/fdik/yml2.git ~/pep-src/yml2
  34. ~~~
  35. ## libetpan
  36. pEp Engine requires libetpan with a set of patches that have not been upstreamed yet.
  37. ~~~
  38. mkdir -p ~/pep-src/libetpan
  39. git clone https://gitea.pep.foundation/pEp.foundation/libetpan.git ~/pep-src/libetpan
  40. cd ~/pep-src/libetpan
  41. mkdir ~/pep-src/libetpan/build
  42. ./autogen.sh --prefix="$HOME/pep-src/libetpan/build"
  43. make
  44. make install
  45. ~~~
  46. ## asn1c
  47. ~~~
  48. mkdir -p ~/pep-src/asn1c
  49. git clone git://github.com/vlm/asn1c.git ~/pep-src/asn1c
  50. cd ~/pep-src/asn1c
  51. git checkout tags/v0.9.28 -b pep-engine
  52. autoreconf -iv
  53. mkdir ~/pep-src/asn1c/build
  54. ./configure --prefix="$HOME/pep-src/asn1c/build"
  55. make
  56. make install
  57. ~~~
  58. ## sequoia
  59. ~~~
  60. git clone https://gitlab.com/sequoia-pgp/sequoia
  61. cd ~/pep-src/sequoia
  62. git checkout openpgp/v1.3.0
  63. # Make an optimised sequoia build.
  64. cargo build --all --release -j16
  65. ~~~
  66. This alternative for the last line above is faster, but generates compiled libraries
  67. in `~/pep-src/sequoia/target/debug` instead of `~/pep-src/sequoia/target/release`:
  68. several definitions below need to be adapted.
  69. ~~~
  70. # Alternative: make a debugging sequoia build.
  71. cargo build --all -j16
  72. ~~~
  73. # pEp Engine
  74. ~~~
  75. mkdir -p ~/pep-src/pep-engine
  76. git clone https://gitea.pep.foundation/pEp.foundation/pEpEngine ~/pep-src/pep-engine
  77. cd ~/pep-src/pep-engine
  78. mkdir build
  79. ~~~
  80. Edit the build configuration to your needs in `Makefile.conf`, or create a `local.conf` in your source directory (the same containing `Makefile.conf`) that sets any of the make variables documented in `Makefile.conf`. All the default values for the build configuration variables on each platform are documented in `Makefile.conf`.
  81. If a dependency is not found in your system's default include or library paths, you will have to specify the according paths in a make variable. Typically, this has to be done at least for YML2, libetpan and asn1c.
  82. For a more detailed explanation of the mechanics of these build configuration files, and overriding defaults, see the comments in `Makefile.conf`.
  83. The following `./local.conf` example should work in the configuration described here.
  84. ~~~
  85. PREFIX=$(HOME)/pep-src/pep-engine/build
  86. PER_MACHINE_DIRECTORY=$(PREFIX)/share/pEp
  87. YML2_PATH=$(HOME)/pep-src/yml2
  88. ETPAN_LIB=-L$(HOME)/pep-src/libetpan/build/lib
  89. ETPAN_INC=-I$(HOME)/pep-src/libetpan/build/include
  90. ASN1C=$(HOME)/pep-src/asn1c/build/bin/asn1c
  91. ASN1C_INC=-I$(HOME)/pep-src/asn1c/build/share/asn1c
  92. SEQUOIA_INC=-I$(HOME)/pep-src/sequoia/openpgp-ffi/include
  93. SEQUOIA_LDFLAGS=-L$(HOME)/pep-src/sequoia/target/release
  94. GTEST_SRC_DIR=$(HOME)/pep-src/googletest/googletest
  95. GTEST_INC_DIR=$(HOME)/pep-src/googletest/googletest/include
  96. GTEST_PL=$(HOME)/pep-src/gtest-parallel/gtest_parallel.py
  97. ~~~
  98. The engine is built as follows:
  99. ~~~
  100. make all
  101. make db
  102. ~~~
  103. The unit tests can be run without the engine library being installed, however `system.db` must be installed:
  104. ~~~
  105. make -C db install
  106. ~~~
  107. Since `system.db` rarely changes, its installation is not needed for every build.
  108. Tests can be compiled and executed with the following commands:
  109. ~~~
  110. make -C test compile
  111. make test
  112. ~~~