You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
David Alarcon 674235538e IOSAD-191 Move pEpMessageWithAllFieldsFilled to PEPTypesTestUtil. 1 year ago
PEPObjCAdapterTypes IOSAD-191 Refactor some code. 1 year ago
PEPObjCAdapterTypesTests_iOS IOSAD-191 Move pEpMessageWithAllFieldsFilled to PEPTypesTestUtil. 1 year ago
PEPObjCAdapterTypesTests_macOS IOSAD-191 Reorganize PEPObjCAdapterTypesTests test files. 1 year ago
PEPObjCAdapterTypes_iOS IOSAD-186 adds support for Swift clients (module maps) 2 years ago
PEPObjCAdapterTypes_macOS adds macOS lib target 2 years ago
PEPObjCAdapter_iOS IOSAD-186 adds support for Swift clients (module maps) 2 years ago
PEPObjCAdapter_macOS adds ObjCAdapter static lib target 2 years ago
Subprojects/SampleApp IOSAD-186 rm needless import 1 year ago
pEpObjCAdapter merge master 1 year ago
pEpObjCAdapter.xcodeproj IOSAD-191 Delete PEPMessageTest and PEPAttachmentTests. Add PEPMessage+SecureCodingTest tests. Delete some unused code. some refactor. 1 year ago
pEpObjCAdapter.xcworkspace IOSAD-186 renames Sample App 1 year ago
pEpObjCTests IOSAD-186 test target builds 2 years ago
pEpiOSAdapterTests initial commit 7 years ago
yml2 IOSAD-63 trying to use yml2 for PEPMessage 5 years ago
.gitignore adds gitignore 1 year ago
README.md IOSAD-186 builds fine. Client still needs libz and libiconf linked to dynamic, system version. Could not force libetpan to link them statically yet. 2 years ago

README.md

WIP

HowToBuild static lib for macOS

Deployment

PER_MACHINE_DIRECTORY="/Library/Application Support/pEp"
PER_USER_DIRECTORY=$HOME/.pEp

Required Tools

For building the engine, you need a working python3 environment and all dependencies:

sudo port install git
sudo port install mercurial
sudo port install gmake
sudo port install autoconf
sudo port install libtool
sudo port install automake
sudo port install wget
sudo port install capnproto
pushd ~
hg clone https://pep.foundation/dev/repos/yml2/
popd
curl https://sh.rustup.rs -sSf | sh

add this to ~/.profile (create if it doesn't exist):

source $HOME/.cargo/env
export PATH="$HOME/.cargo/bin:$PATH"

restart your Console (!)

sudo port install pkgconfig
rustup update

Install Xcode (if not installed already)

Apple IDs & Certificates

Apple ID

You need to have an Apple ID (connected to pEp team account) configured in Xcode . Ask #service, if you want to be added to the team account.

Build Dependencies

mkdir src_pEpObjCAdapter_macOS
cd src_pEpObjCAdapter_macOS
mkdir local

export MACOSX_DEPLOYMENT_TARGET=10.10

git clone -b OpenSSL_1_1_1g https://github.com/openssl/openssl.git
pushd "openssl"
./Configure --prefix=$(pwd)/../local/ --openssldir=$(pwd)/../local/ssl darwin64-x86_64-cc
make
make install
popd

						git clone https://github.com/fdik/libetpan
						pushd libetpan
						./autogen.sh --prefix=$(pwd)/../local/
						make install
						popd

GMP_VERSION="6.1.2"
GMP_DIR="gmp-${GMP_VERSION}"
TARBALL="gmp-${GMP_VERSION}.tar.bz2"
wget -nc https://gmplib.org/download/gmp/"${TARBALL}"
tar xvf "${TARBALL}"
pushd ${GMP_DIR}
PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=$(pwd)/../local/lib/pkgconfig ./configure --host=${HOST} --prefix=$(pwd)/../local/
make -j4
make install
popd
rm -rf "${TARBALL}"

HOST="x86_64-apple-darwin10.0.0"

NETTLE_VERSION="3.4.1"
NETTLE_DIR="nettle-${NETTLE_VERSION}"
TARBALL=nettle-${NETTLE_VERSION}.tar.gz
wget -nc https://ftp.gnu.org/gnu/nettle/nettle-${NETTLE_VERSION}.tar.gz
tar xvf "${TARBALL}"
pushd ${NETTLE_DIR}
PKG_CONFIG_ALLOW_CROSS=1 PKG_CONFIG_PATH=$(pwd)/../local/lib/pkgconfig ./configure --host=${HOST} --prefix=$(pwd)/../local/ --with-lib-path=$(pwd)/../local/lib --with-include-path=$(pwd)/../local/include
make -j4
make install
popd
rm -rf "${TARBALL}"

git clone -b "pep-engine" --depth 1 https://gitlab.com/sequoia-pgp/sequoia.git
pushd sequoia
make build-release PYTHON=disable
make install PYTHON=disable PREFIX=$(pwd)/../local/
popd

git clone git://github.com/vlm/asn1c.git
pushd asn1c
git checkout tags/v0.9.28 -b pep-engine
autoreconf -iv
./configure --prefix=$(pwd)/../local/
make install
popd

ICONV_VERSION="1.16"
ICONV_DIR="libiconv-${ICONV_VERSION}"
TARBALL="libiconv-${ICONV_VERSION}.tar.gz"
wget -nc https://ftp.gnu.org/pub/gnu/libiconv/${TARBALL}
tar xvf "${TARBALL}"
pushd ${ICONV_DIR}
./configure --prefix=$(pwd)/../local/ --enable-static
make -j 4
make install
popd

# //BUFF: weget and build libz too and link it to libetpan. Rm linking dynamic lib in client afterwards.

git clone https://github.com/fdik/libetpan
pushd libetpan
# //BUFF: This is not working (afaics). libetpan is still using the systems dynamic iconv lib. I was unable yet to force libetpan to use libiconv.a
unset CFLAGS
unset LDFLAGS
export LDFLAGS="-Wl/Users/buff/workspace/pEp/src_pEpObjCAdapter_macOS/local/libiconv.a" 
./autogen.sh --prefix=$(pwd)/../local/ --enable-shared=no
make install
popd
#BAD, required due to ios libetpan sub project. RM after moving out of project or even better being able to build macOS libetpan with the Xcode project
rm -rf libetpan
git clone https://pep-security.lu/gitlab/misc/libetpan.git

git clone https://pep-security.lu/gitlab/misc/sqlite.git
hg clone https://pep.foundation/dev/repos/pEpEngine
hg clone https://pep.foundation/dev/repos/pEpObjCAdapter

Build

Using Xcode UI

open pEpMacOSAdapter/pEpObjCAdapter.xcworkspace/

Build scheme "All" of pEpObjCAdapter.xcworkspace

Using terminal

xcodebuild -workspace "pEpObjCAdapter.xcworkspace" -scheme "PEPObjCAdapter_macOS" -configuration RELEASE

(or DEBUG)

Build Dir & Build Artefacts

You can find the build artefacts in the pEpMacOSAdapter/build folder