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