README.md
author Andreas Buff <andreas.buff@buffhaltestelle.de>
Thu, 09 Mar 2017 10:59:56 +0100
changeset 1802 de3923fd9d72
parent 1787 550d952433bd
child 2074 418bda2186dc
permissions -rw-r--r--
publishes main build schemes, mentions workspace in readme.
dirk@59
     1
# How to build
dirk@59
     2
dirk@59
     3
## Prerequisites
dirk@59
     4
dirk@813
     5
### Package managers
dirk@813
     6
dirk@1148
     7
MacPorts for installing all dependencies:
dirk@813
     8
dirk@813
     9
Install [MacPorts](https://www.macports.org/) for your
dirk@813
    10
[version of OS X/macOS](https://www.macports.org/install.php).
dirk@813
    11
hernani@156
    12
### Install CAcert root certificates
hernani@156
    13
hernani@156
    14
Import the root certificates of the community-driven CAcert project
hernani@157
    15
in order to deal with the Mercurial repositories via https; for Mac
hernani@158
    16
OS X follow (the GUI or commandline) instructions provided:
hernani@156
    17
hernani@156
    18
http://wiki.cacert.org/FAQ/ImportRootCert#Mac_OS_X
hernani@156
    19
hernani@158
    20
Before using, please check the authenticity of the certificate(s)
hernani@159
    21
downloaded.
hernani@158
    22
hernani@158
    23
The fingerprints should be:
hernani@158
    24
hernani@158
    25
* Class 1 PKI Key (SHA1): 13:5C:EC:36:F4:9C:B8:E9:3B:1A:B2:70:CD:80:88:46:76:CE:8F:33 
hernani@158
    26
* Class 3 PKI Key (SHA1): AD:7C:3F:64:FC:44:39:FE:F4:E9:0B:E8:F4:7C:6C:FA:8A:AD:FD:CE
hernani@158
    27
hernani@158
    28
(Cf. http://www.cacert.org/index.php?id=3)
hernani@158
    29
dirk@211
    30
### Dependencies of prerequisites
dirk@211
    31
dirk@1148
    32
For building the engine, you need a working python2 environment
dirk@1148
    33
and all dependencies:
dirk@1148
    34
dirk@1148
    35
```
dirk@1225
    36
sudo port install python27
dirk@1148
    37
sudo port install asn1c
dirk@1148
    38
sudo port install py27-lxml
dirk@1148
    39
dirk@1148
    40
sudo port install python_select
dirk@1224
    41
sudo port select python python27
dirk@1148
    42
```
dirk@211
    43
dirk@609
    44
### Other dependecies
dirk@609
    45
dirk@609
    46
#### pEpEngine: [yml2](https://fdik.org/yml/toolchain)
dirk@609
    47
dirk@609
    48
Clone into your home directory:
dirk@609
    49
dirk@609
    50
```
dirk@609
    51
pushd ~
dirk@609
    52
hg clone https://cacert.pep.foundation/dev/repos/yml2/
dirk@609
    53
popd
dirk@609
    54
```
dirk@609
    55
ana@683
    56
## Setup instructions
dirk@113
    57
dirk@59
    58
```
dirk@59
    59
mkdir ~/src
dirk@59
    60
cd ~/src
dirk@59
    61
dirk@59
    62
git clone https://github.com/fdik/libetpan
dirk@59
    63
dirk@62
    64
hg clone https://cacert.pep.foundation/dev/repos/pantomime-iOS/
dirk@59
    65
hg clone https://cacert.pep.foundation/dev/repos/netpgp-et
dirk@59
    66
hg clone https://cacert.pep.foundation/dev/repos/pEpEngine
dirk@59
    67
hg clone https://cacert.pep.foundation/dev/repos/pEpiOSAdapter
dirk@807
    68
hg clone https://cacert.pep.foundation/dev/repos/MailModel/
dirk@1787
    69
hg clone https://cacert.pep.foundation/dev/repos/libAccountSettings/
dirk@59
    70
dirk@62
    71
hg clone https://cacert.pep-security.ch/dev/repos/pEp_for_iOS/
dirk@59
    72
```
dirk@83
    73
dirk@83
    74
Note that netpgp includes a static openssl, and pEpEngine a static libcurl. For
dirk@83
    75
rebuilding see the respective scripts. But you should not have to do that for iOS.
dirk@113
    76
dirk@1148
    77
### UI Tests
dirk@1148
    78
dirk@1148
    79
Set up working account for UI tests. After copying, fill in working account:
dirk@1148
    80
dirk@1148
    81
```
dirk@1148
    82
cp ./pEpForiOSUITests/UITestData.swift.sample ./pEpForiOSUITests/UITestData.swift
dirk@1148
    83
```
andreas@1802
    84
### Build Project
andreas@1802
    85
andreas@1802
    86
Open pEpForiOS.xcworkspace and build schema "pEp".
dirk@1148
    87
dirk@949
    88
### Unit Tests
dirk@113
    89
dirk@1777
    90
You need to create a copy of TestDataImpl/sample.swift as TestDataImpl.swift
dirk@1777
    91
and populate it with corresponding (valid) settings to run the tests successfully.
dirk@986
    92
dirk@986
    93
The tests will not compile without a syntactically correct TestData.swift.
dirk@211
    94
dirk@113
    95
```
dirk@1777
    96
cp pEpForiOSTests/Util/TestData_sample.swift pEpForiOSTests/Util/TestData.swift
dirk@113
    97
```