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