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