README-OSX.md
author Damiano Boppart
Mon, 20 Mar 2017 16:14:27 +0100
changeset 1681 97db633df271
parent 1513 e7f7e42385b5
child 1682 1a6a30a2b30c
permissions -rw-r--r--
Update README for macOS
     1 This file is under Creative Commons License 3.0 cc-by-sa
     2 
     3 # Building for OS X/macOS
     4 See also README.txt for general information.
     5 
     6 For compiling pEp Engine and its dependencies, make sure you have the LANG variable set. Some source files contain unicode characters, and python (assuming files are ascii) will fail.
     7 
     8 ```
     9 export LANG=en_US.UTF-8
    10 ```
    11 
    12 ## Dependencies
    13 
    14 ### MacPorts
    15 [Install MacPorts](https://www.macports.org/install.php) for your version of OS X/macOS.
    16 
    17 If MacPorts is already installed on your machine, but was installed by a different user, make sure your `PATH` variable is set as follows in `~/.profile`:
    18 
    19 ```
    20 export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
    21 ```
    22 
    23 Install dependencies packaged with MacPorts as follows.
    24 
    25 ```
    26 sudo port install mercurial py27-lxml gpgme automake asn1c zlib openssl libiconv cyrus-sasl2
    27 ```
    28 
    29 Make sure that `python` is a version 2 one:
    30 
    31 ```
    32 sudo port select python python27
    33 ```
    34 
    35 ### Other Dependecies
    36 
    37 #### [yml2](https://fdik.org/yml/toolchain)
    38 Install into your home directory:
    39 
    40 ```
    41 pushd ~
    42 hg clone https://cacert.pep.foundation/dev/repos/yml2/
    43 popd
    44 ```
    45 
    46 #### libetpan
    47 
    48 Note: libetpan needs libz and libiconv, but the libiconv from MacPorts is not compatible, some
    49 functions seem to have been renamed there. Therefore the dynlib from OS X is used.
    50 
    51 ```
    52 git clone https://github.com/fdik/libetpan
    53 cd libetpan
    54 ./autogen.sh --prefix "$HOME"
    55 make
    56 make install
    57 ```
    58 
    59 ## Building pEp Engine
    60 
    61 ### Configuration
    62 You can change some defaults by editing `Makefile.conf`. The following variable needs to be set appropriately:
    63 
    64 ```
    65 LIBGPGME=/opt/local/lib/libgpgme.11.dylib
    66 ```
    67 
    68 ### Build
    69 
    70 ```
    71 make clean
    72 make all
    73 make db
    74 ```
    75 
    76 ### Installation
    77 
    78 ```
    79 make install
    80 sudo make -C db install
    81 ```
    82 
    83 Since the `system.db` rarely changes, the last step is not needed for every build. If you would like to be able to install the engine without `sudo`, ensure that your user can write the file `/usr/local/share/pEp/system.db`. This is not recommended for production machines.
    84 
    85 ### Run tests
    86 
    87 If you installed the test keys in your keyring (see: README.txt), this should just work:
    88 
    89 ```
    90 make test
    91 ```
    92 
    93 # Building for iOS
    94 
    95 This is done with Xcode. Simply add `pEpEngine.xcodeproj` to
    96 your project and add a dependency to the target `pEpEngine`
    97 (in `Target Dependencies` in your `Build Phases`.
    98 
    99 Usually you just integrate `pEpiOSAdapter.xcodeproj`.