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