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.

125 lines
3.1 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. hg clone https://pep.foundation/dev/repos/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
  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
  62. make install
  63. unset PREFIX
  64. popd
  65. hg clone https://pep.foundation/dev/repos/downloadclient/
  66. git clone https://gitea.pep.foundation/fdik/pEpMacOSAdapter.git
  67. ```
  68. ## Build
  69. ### Using Xcode UI
  70. `open pEpMacOSAdapter/pEpMacOSAdapter.xcworkspace/`
  71. Build scheme "All" of pEpMacOSAdapter.xcworkspace
  72. ### Using terminal
  73. `xcodebuild -workspace "pEpMacOSAdapter.xcworkspace" -scheme "All" -configuration RELEASE`
  74. (or DEBUG)
  75. ### Build Dir & Build Artefacts
  76. You can find the build artefacts in the `build` folder odf the project or the used submodules:
  77. src_pEpMacOSAdapter/pEpMacOSAdapter/build/foundation.pEp.adapter.macOS.xpc
  78. src_pEpMacOSAdapter/pEpMacOSAdapter/Submodules/pEpNotifications/build/p≡p updates.app
  79. ## Implementation
  80. The implementation is split in to parts:
  81. 1. the working code is in pEpMacOSAdapter; the implementation is in Objective C
  82. 1. the User Interface is in pEpNotifications; the implementation is in Swift
  83. ### PEPMacOSAdapterProtocol, implemented with XPC
  84. see [PEPMacOSAdapterProtocol.h](https://gitea.pep.foundation/fdik/pEpMacOSAdapter/src/branch/master/pEpMacOSAdapter/PEPMacOSAdapterProtocol.h)
  85. This protocol is provided to the User Interface to get informed when a download was happening.
  86. When a subscription is active updateNow() can be used to search for immediate updates.