Browse Source

Documenting macOS build, using MacPorts

Dirk Zimmermann 6 years ago
4 changed files with 120 additions and 13 deletions
  1. +0
  2. +105
  3. +14
  4. +1

+ 0
- 3
Makefile.conf View File

@ -11,9 +11,6 @@ YML2PROC=$(HOME)/yml2/yml2proc
# TODO: For brew this is /usr/local/share/asn1c
# On BSDs, it might be that as well. How to check?
# For now, it just works, even when it doesn't exist.
# C makros (not environment variables) to overwrite:

+ 105
- 9 View File

@ -1,23 +1,119 @@
# Dependencies
# Building for OS X/macOS
You need a working [asn1c](
See also README.txt for general information.
## Dependencies
### MacPorts
Install [MacPorts]( for your
[version of OS X/macOS](
Note that you need [Xcode installed](
for MacPorts, and for building the engine. You also need to accept Xcode's EULA.
*Note*: Use the script `` (or a similar one) to set up a clean build environment
before building the engine:
brew install asn1c
# Building for OS X
If you don't use that environment, please make sure you've set up all search paths correctly.
#### MacPorts dependencies
sudo port install mercurial
sudo port install py27-lxml
sudo port install gpgme
sudo port install autoconf
sudo port install asn1c
sudo port install zlib
### Other dependecies
#### [yml2](
* TODO: which dependencies can be fetched via "brew" and which have to be compiled manually?
Install into your home directory:
## Build libetpan
pushd ~
curl -LO
tar xf yml2.tar.bz2
rm yml2.tar.bz2*
#### libetpan
Note: libetpan needs libz and libiconv, but the libiconv from MacPorts is not compatible, some
functions seem to have been renamed there. Therefore the dynlib from OS X is used.
cd pEpEngine <--- huh? to build libetpan???
autoreconf -vfi
git clone libetpan-osx
cd libetpan-osx/
cp ./src/.libs/libetpan.a ~/lib/
##### libetpan with xcodebuild
The build with autoconf (see previous section) is preferred. This is just for completeness.
*Don't actually build libetpan with xcodebuild.*
git clone libetpan-osx
cd libetpan-osx/build-mac
xcodebuild -project libetpan.xcodeproj/ -target "static libetpan"
mkdir ~/lib
cp build/Release/libetpan.a ~/lib/
### Configuration
You can change some defaults by editing `Makefile.conf`. But this readme assumes you don't.
### Build
make clean
make all
make db
Done! The result should be (among others):
### Install
Install (you might need sudo for some commands, depending on how your system is set up):
make install
make -C db install
Since the `system.db` rarely changes, `make -C db install` is not needed for every build.
### Run tests
Make sure that you add `/opt/local/lib` to each definition of `LD_LIBRARY_PATH`
in `test/Makefile`. This ensures that libgpgme will be found:
test: pEpEngineTest
LD_LIBRARY_PATH=/opt/local/lib:~/lib:../src ./pEpEngineTest
make test
# Building for iOS

+ 14
- 0 View File

@ -0,0 +1,14 @@
# Typical pure MacPorts environment
# Restrict to MacPorts
export PATH=/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin
# Make sure the Apple python (which will be triggered by the makefile)
# has access to the Python libs installed for MacPorts
export PYTHONPATH=/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/
# YML processing might complain about that. Make sure the locale exists (locale -a)
export LC_ALL=en_US.UTF-8
# Search paths for includes used when doing YML processing
export YML_PATH=~/yml2/

+ 1
- 1
src/Makefile View File

@ -14,7 +14,7 @@ LD?=clang
CFLAGS?=-I$(GPGME_IN)/include -I$(HOME)/include -I/opt/local/include $(OPTIMIZE) -pedantic \
LDFLAGS?=-lc -shared -arch x86_64 \
-L$(HOME)/lib -L/opt/local/lib -letpan -lsqlite3 -L../asn.1 -lasn1
-L$(HOME)/lib -L/usr/lib -L/opt/local/lib -letpan -lsqlite3 -L../asn.1 -lasn1 -lz -liconv
$(error don't know how to make for $(BUILD_FOR) on $(BUILD_ON))