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