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.

137 lines
3.1 KiB

5 years ago
  1. This file is under Creative Commons License 3.0 cc-by-sa
  2. # Building for OS X/macOS
  3. See also README.txt for general information.
  4. For compiling pEp Engine and its dependencies, make sure you have the LANG variable set. Some source files contain unicode characters, and python (assuming files are ascii) will fail.
  5. ```
  6. export LANG=en_US.UTF-8
  7. ```
  8. ## Dependencies
  9. ### MacPorts
  10. [Install MacPorts](https://www.macports.org/install.php) for your version of OS X/macOS.
  11. If MacPorts is already installed on your machine, but was installed by a different user, make sure your `PATH` variable is set as follows in `~/.profile`:
  12. ```
  13. export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
  14. ```
  15. Install dependencies packaged with MacPorts as follows.
  16. ```
  17. sudo port install mercurial py27-lxml gpgme autoconf automake libtool asn1c zlib openssl libiconv cyrus-sasl2
  18. ```
  19. Make sure that `python` is a version 2 one:
  20. ```
  21. sudo port select python python27
  22. ```
  23. ### NetPGP (if not GPGME)
  24. #### Prepare :
  25. Get OpenSSL and build/install it as shared library.
  26. ```
  27. wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1u.tar.gz
  28. tar xvfz openssl-1.0.1u.tar.gz
  29. cd openssl-1.0.1u
  30. ./Configure darwin64-x86_64-cc --prefix=$HOME shared
  31. make install
  32. ```
  33. Get and autoconf NetPGP
  34. ```
  35. cd $SRC
  36. hg clone https://cacert.pep.foundation/dev/repos/netpgp-et/
  37. cd netpgp-et
  38. autoreconf -i
  39. ```
  40. #### Build
  41. Important : LDFLAGS is set to help finding OpenSSL shared lib. If not set,
  42. system's default libcrypto may silently be used instead, causing memory
  43. corruption or crash at runtime.
  44. ```
  45. mkdir netpgp_debug
  46. cd netpgp_debug
  47. $SRC/netpgp-et/configure --with-openssl=$HOME --prefix=$HOME CPPFLAGS=-DDEBUG CXXFLAGS="-g -O0" LDFLAGS="-L${HOME}/lib"
  48. make
  49. make install
  50. ```
  51. ### Other Dependecies
  52. #### [yml2](https://fdik.org/yml/toolchain)
  53. Install into your home directory:
  54. ```
  55. pushd ~
  56. hg clone https://cacert.pep.foundation/dev/repos/yml2/
  57. popd
  58. ```
  59. #### libetpan
  60. Note: libetpan needs libz and libiconv, but the libiconv from MacPorts is not compatible, some
  61. functions seem to have been renamed there. Therefore the dynlib from OS X is used.
  62. ```
  63. git clone https://github.com/fdik/libetpan
  64. cd libetpan
  65. ./autogen.sh --prefix "$HOME"
  66. make
  67. make install
  68. ```
  69. ## Building pEp Engine
  70. ### Configuration
  71. You can change some defaults by editing `Makefile.conf`. The following variable needs to be set appropriately:
  72. ```
  73. LIBGPGME=/opt/local/lib/libgpgme.11.dylib
  74. ```
  75. ### Build
  76. ```
  77. make clean
  78. make all
  79. make db
  80. ```
  81. ### Installation
  82. ```
  83. make install
  84. sudo make -C db install
  85. ```
  86. Since the `system.db` rarely changes, the last step is not needed for every build. If you would like to be able to install the engine without `sudo`, ensure that your user can write the file `/usr/local/share/pEp/system.db`. This is not recommended for production machines.
  87. ### Run tests
  88. If you installed the test keys in your keyring (see: README.txt), this should just work:
  89. ```
  90. cd test
  91. make test
  92. ```
  93. # Building for iOS
  94. This is done with Xcode. Simply add `pEpEngine.xcodeproj` to
  95. your project and add a dependency to the target `pEpEngine`
  96. (in `Target Dependencies` in your `Build Phases`.
  97. Usually you just integrate `pEpiOSAdapter.xcodeproj`.