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.

123 lines
2.7 KiB

6 years ago
6 years ago
6 years ago
  1. # Building for OS X/macOS
  2. See also README.txt for general information.
  3. ## Dependencies
  4. ### MacPorts
  5. Install [MacPorts](https://www.macports.org/) for your
  6. [version of OS X/macOS](https://www.macports.org/install.php).
  7. Note that you need [Xcode installed](https://www.macports.org/install.php)
  8. for MacPorts, and for building the engine. You also need to accept Xcode's EULA.
  9. *Note*: Use the script `macports_env.sh` (or a similar one) to set up a clean build environment
  10. before building the engine:
  11. ```
  12. . macports_env.sh
  13. ```
  14. If you don't use that environment, please make sure you've set up all search paths correctly.
  15. #### MacPorts dependencies
  16. ```
  17. sudo port install mercurial
  18. sudo port install py27-lxml
  19. sudo port install gpgme
  20. sudo port install autoconf
  21. sudo port install asn1c
  22. sudo port install zlib
  23. ```
  24. ### Other dependecies
  25. #### [yml2](https://fdik.org/yml/toolchain)
  26. Install into your home directory:
  27. ```
  28. pushd ~
  29. hg clone https://cacert.pep.foundation/dev/repos/yml2/
  30. popd
  31. ```
  32. #### libetpan
  33. Note: libetpan needs libz and libiconv, but the libiconv from MacPorts is not compatible, some
  34. functions seem to have been renamed there. Therefore the dynlib from OS X is used.
  35. ```
  36. git clone https://github.com/fdik/libetpan libetpan-osx
  37. cd libetpan-osx/
  38. ./autogen.sh
  39. make
  40. cp ./src/.libs/libetpan.a ~/lib/
  41. ```
  42. ##### libetpan with xcodebuild
  43. The build with autoconf (see previous section) is preferred. This is just for completeness.
  44. *Don't actually build libetpan with xcodebuild.*
  45. ```
  46. git clone https://github.com/fdik/libetpan libetpan-osx
  47. cd libetpan-osx/build-mac
  48. xcodebuild -project libetpan.xcodeproj/ -target "static libetpan"
  49. mkdir ~/lib
  50. cp build/Release/libetpan.a ~/lib/
  51. ```
  52. ### Configuration
  53. You can change some defaults by editing `Makefile.conf`. But this readme assumes you don't.
  54. ### Build
  55. ```
  56. make clean
  57. make all
  58. make db
  59. ```
  60. Done! The result should be (among others):
  61. ```
  62. ./src/libpEpEngine.a
  63. ./src/libpEpEngine.dylib
  64. ```
  65. ### Install
  66. Install (you might need sudo for some commands, depending on how your system is set up):
  67. ```
  68. make install
  69. make -C db install
  70. ```
  71. Since the `system.db` rarely changes, `make -C db install` is not needed for every build.
  72. ### Run tests
  73. Make sure that you add `/opt/local/lib` to each definition of `LD_LIBRARY_PATH`
  74. in `test/Makefile`. This ensures that libgpgme will be found:
  75. ```
  76. test: pEpEngineTest
  77. LD_LIBRARY_PATH=/opt/local/lib:~/lib:../src ./pEpEngineTest
  78. ```
  79. ```
  80. make test
  81. ```
  82. # Building for iOS
  83. This is done with Xcode. Simply add `pEpEngine.xcodeproj` to
  84. your project and add a dependency to the target `pEpEngine`
  85. (in `Target Dependencies` in your `Build Phases`.
  86. Usually you just integrate `pEpiOSAdapter.xcodeproj`.