pEp macOS Desktop adapter
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.

141 lines
3.7 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. # p≡p macOS Desktop adapter
  2. This adapter will sport three main features:
  3. - p≡p API via Apple XPC (not yet implemented)
  4. - p≡p API via p≡p JSON adapter (still provided by miniadapter)
  5. - p≡p Update Client
  6. ## Deployment
  7. PER_MACHINE_DIRECTORY="/Library/Application Support/pEp"
  8. PER_USER_DIRECTORY=$HOME/.pEp
  9. This software is supporting macOS 10.10 and later.
  10. ## Required Tools
  11. For building the engine, you need a working python3 environment and all dependencies:
  12. ```
  13. sudo port install git
  14. sudo port install mercurial
  15. sudo port install gmake
  16. sudo port install autoconf
  17. sudo port install libtool
  18. sudo port install automake
  19. sudo port install wget
  20. sudo port install capnproto
  21. pushd ~
  22. git clone https://gitea.pep.foundation/fdik/yml2
  23. popd
  24. curl https://sh.rustup.rs -sSf | sh
  25. ```
  26. add this to ~/.profile (create if it doesn't exist):
  27. ```
  28. source $HOME/.cargo/env
  29. export PATH="$HOME/.cargo/bin:$PATH"
  30. ```
  31. restart your Console (!)
  32. ```
  33. sudo port install pkgconfig
  34. rustup update
  35. ```
  36. Install Xcode (if not installed already)
  37. ## Apple IDs & Certificates
  38. ### Apple ID
  39. You need to have an Apple ID (connected to pEp team account) configured in Xcode . Ask `#service`, if you want to be added to the team account.
  40. ## Build Dependencies
  41. ```
  42. mkdir src_pEpMacOSAdapter
  43. cd src_pEpMacOSAdapter
  44. mkdir local
  45. export MACOSX_DEPLOYMENT_TARGET=10.10
  46. git clone -b OpenSSL_1_1_1g https://github.com/openssl/openssl.git
  47. pushd "openssl"
  48. ./Configure --prefix=$(pwd)/../local/ --openssldir=$(pwd)/../local/ssl darwin64-x86_64-cc
  49. make -j8
  50. make install
  51. popd
  52. git clone -b boost-1.73.0 --recursive https://github.com/boostorg/boost.git
  53. pushd "boost"
  54. ./bootstrap.sh --prefix=$(pwd)/../local/
  55. ./b2 --with-system --with-filesystem --with-program_options --with-thread
  56. ./b2 install
  57. popd
  58. git clone -b CRYPTOPP_8_2_0 https://github.com/weidai11/cryptopp
  59. pushd cryptopp
  60. export PREFIX=$(pwd)/../local/
  61. make -j8
  62. make install
  63. unset PREFIX
  64. popd
  65. git clone https://github.com/fdik/libetpan
  66. pushd libetpan
  67. ./autogen.sh --prefix=$(pwd)/../local/
  68. make install
  69. popd
  70. git clone http://pep-security.lu/gitlab/macos/sequoia4macos.git
  71. pushd sequoia4macos
  72. sh build.sh
  73. popd
  74. git clone https://pep-security.lu/gitlab/misc/sqlite.git
  75. git clone https://gitea.pep.foundation/pEp.foundation/pEpEngine
  76. git clone https://pep-security.lu/gitlab/iOS/CocoaLumberjack
  77. git clone http://pep-security.lu/gitlab/iOS/pep-toolbox.git
  78. git clone https://gitea.pep.foundation/pep.foundation/pEpObjCAdapter.git
  79. git clone https://gitea.pep.foundation/pEp.foundation/downloadclient
  80. git clone https://gitea.pep.foundation/fdik/pEpMacOSAdapter.git
  81. ```
  82. ## Build
  83. ### Using Xcode UI
  84. `open pEpMacOSAdapter/pEpMacOSAdapter.xcworkspace/`
  85. Build scheme "All" of pEpMacOSAdapter.xcworkspace
  86. ### Using terminal
  87. `xcodebuild -workspace "pEpMacOSAdapter.xcworkspace" -scheme "All" -configuration RELEASE`
  88. (or DEBUG)
  89. ### Build Dir & Build Artefacts
  90. You can find the build artefacts in the `build` folder odf the project or the used submodules:
  91. src_pEpMacOSAdapter/pEpMacOSAdapter/build/foundation.pEp.adapter.macOS.xpc
  92. src_pEpMacOSAdapter/pEpMacOSAdapter/Submodules/pEpNotifications/build/p≡p updates.app
  93. ## Implementation
  94. The implementation is split in to parts:
  95. 1. the working code is in pEpMacOSAdapter; the implementation is in Objective C
  96. 1. the User Interface is in pEpNotifications; the implementation is in Swift
  97. ### PEPMacOSAdapterProtocol, implemented with XPC
  98. see [PEPMacOSAdapterProtocol.h](https://gitea.pep.foundation/fdik/pEpMacOSAdapter/src/branch/master/pEpMacOSAdapter/PEPMacOSAdapterProtocol.h)
  99. This protocol is provided to the User Interface to get informed when a download was happening.
  100. When a subscription is active updateNow() can be used to search for immediate updates.