README-OSX.md
author Dirk Zimmermann <dirk@pep-project.org>
Tue, 22 Nov 2016 15:14:28 +0100
changeset 1414 26697bb8bc2c
parent 1317 0e6df10f76c4
child 1415 8c9d32441394
permissions -rw-r--r--
README-OSX.md
dirk@821
     1
# Building for OS X/macOS
dirk@707
     2
dirk@821
     3
See also README.txt for general information.
dirk@821
     4
dirk@821
     5
## Dependencies
dirk@821
     6
dirk@821
     7
### MacPorts
dirk@821
     8
dirk@821
     9
Install [MacPorts](https://www.macports.org/) for your
dirk@821
    10
[version of OS X/macOS](https://www.macports.org/install.php).
dirk@821
    11
dirk@821
    12
Note that you need [Xcode installed](https://www.macports.org/install.php)
dirk@821
    13
for MacPorts, and for building the engine. You also need to accept Xcode's EULA.
dirk@821
    14
dirk@821
    15
#### MacPorts dependencies
dirk@706
    16
dirk@706
    17
```
dirk@821
    18
sudo port install mercurial
dirk@821
    19
sudo port install py27-lxml
dirk@821
    20
sudo port install gpgme
dirk@1317
    21
sudo port install automake
dirk@821
    22
sudo port install asn1c
dirk@821
    23
sudo port install zlib
dirk@821
    24
```
dirk@821
    25
dirk@1414
    26
There are others, please refer to the engine README.txt.
dirk@1414
    27
dirk@1414
    28
Make sure that `python` is a version 2 one:
dirk@1414
    29
dirk@1414
    30
```
dirk@1414
    31
sudo port select python python27
dirk@1414
    32
```
dirk@1414
    33
dirk@821
    34
### Other dependecies
dirk@821
    35
dirk@821
    36
#### [yml2](https://fdik.org/yml/toolchain)
dirk@821
    37
dirk@821
    38
Install into your home directory:
dirk@821
    39
dirk@821
    40
```
dirk@821
    41
pushd ~
dirk@1082
    42
hg clone https://cacert.pep.foundation/dev/repos/yml2/
dirk@821
    43
popd
dirk@821
    44
```
dirk@821
    45
dirk@821
    46
#### libetpan
dirk@821
    47
dirk@821
    48
Note: libetpan needs libz and libiconv, but the libiconv from MacPorts is not compatible, some
dirk@821
    49
functions seem to have been renamed there. Therefore the dynlib from OS X is used.
dirk@821
    50
dirk@821
    51
```
dirk@821
    52
git clone https://github.com/fdik/libetpan libetpan-osx
dirk@821
    53
cd libetpan-osx/
dirk@821
    54
./autogen.sh
dirk@706
    55
make
dirk@821
    56
cp ./src/.libs/libetpan.a ~/lib/
dirk@821
    57
```
dirk@821
    58
dirk@821
    59
### Configuration
dirk@821
    60
dirk@821
    61
You can change some defaults by editing `Makefile.conf`. But this readme assumes you don't.
dirk@821
    62
dirk@821
    63
### Build
dirk@821
    64
dirk@821
    65
```
dirk@821
    66
make clean
dirk@821
    67
make all
dirk@821
    68
make db
dirk@821
    69
```
dirk@821
    70
dirk@821
    71
Done! The result should be (among others):
dirk@821
    72
dirk@821
    73
```
dirk@821
    74
./src/libpEpEngine.a
dirk@821
    75
./src/libpEpEngine.dylib
dirk@821
    76
```
dirk@821
    77
dirk@821
    78
### Install
dirk@821
    79
dirk@821
    80
Install (you might need sudo for some commands, depending on how your system is set up):
dirk@821
    81
dirk@821
    82
```
dirk@706
    83
make install
dirk@821
    84
make -C db install
dirk@821
    85
```
dirk@821
    86
dirk@821
    87
Since the `system.db` rarely changes, `make -C db install` is not needed for every build.
dirk@821
    88
dirk@821
    89
### Run tests
dirk@821
    90
dirk@1414
    91
If you installed the test keys in your keyring (README.txt),
dirk@1414
    92
this should just work:
dirk@821
    93
dirk@821
    94
```
dirk@821
    95
make test
dirk@706
    96
```
dirk@706
    97
dirk@670
    98
# Building for iOS
dirk@670
    99
dirk@670
   100
This is done with Xcode. Simply add `pEpEngine.xcodeproj` to
dirk@670
   101
your project and add a dependency to the target `pEpEngine`
dirk@670
   102
(in `Target Dependencies` in your `Build Phases`.
dirk@670
   103
dirk@670
   104
Usually you just integrate `pEpiOSAdapter.xcodeproj`.