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