Skip to content

Commit

Permalink
Merge pull request deltachat#82 from flub/master
Browse files Browse the repository at this point in the history
Update build instructions for meson
  • Loading branch information
r10s committed Dec 29, 2017
2 parents fd3a475 + 5555705 commit 1849bd8
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 114 deletions.
71 changes: 56 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,21 +44,62 @@ GPL-compatible licence. For details, please have a look at the [LICENSE file](h
Build
--------------------------------------------------------------------------------

The Delta Chat Core Library relies on the following external libs:

- [LibEtPan](https://github.com/dinhviethoa/libetpan), [OpenSSL](https://www.openssl.org/); for
compilation, use eg. the following commands: `./autogen.sh; make;
sudo make install prefix=/usr`
To link against LibEtPan, add `libetpan-config --libs` in backticks to your
project. This should also add the needed OpenSSL libraries.

- [SQLite](http://sqlite.org/) is available on most systems, however, you
will also need the headers, please look for packages as `libsqlite3-dev`.
To link against SQLite, add `-lsqlite3` to your project.

Alternatively, use the ready-to-use files from the libs-directory which are
suitable for common system. You'll also find a fork of the needed Netpgp
library there.
Deta Chat Core can be built as a library using the
[meson](http://mesonbuild.com) build system. It depends on a number
of external libraries, most of which are detected using
[pkg-config](https://www.freedesktop.org/wiki/Software/pkg-config/).
Usually this just works automatically when the depending libraries are
installed correctly.

It is easiest to install all of these using your system libraries.
Please note that you may need "development" packages installed for
these to work.

- [LibEtPan](https://github.com/dinhviethoa/libetpan); this does not
use `pkg-config`, instead ships with a `libetpan-config` binary
which must be in the PATH to be picked up by the build system.

- [OpenSSL](https://www.openssl.org/)

- [SQLite](http://sqlite.org/)

- [zlib](http://zlib.net)

- libsasl

- [bzip2](http://bzip.org)

To build you need to have [meson](http://mesonbuild.com) and
[ninja](https://ninja-build.org) installed as well.

On Debian stretch you can install all these using: `apt install
libetpan-dev libssl-dev libsqlite3-dev libsasl2-dev libbz2-dev
zlib1g-dev meson ninja-build`.

Onece all dependencies are installed creating a build is as follows,
starting from the project's root directory:

```
mkdir builddir
cd builddir
meson
# optionally configure some parameters
# run `meson configure` to see the options, e.g.
meson config -Dlibdir=lib
ninja
sudo ninja install
sudo ldconfig
```

The install keeps a log of which files where installed. Uninstalling
is thus supported too:
```
ninja uninstall
```

Note that the above assumes `/usr/local/lib` is configured somewhere
in `/etc/ld.so.conf` or `/etc/ld.so.conf.d/*`, which is fairly
standard.

---

Expand Down
99 changes: 0 additions & 99 deletions meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -40,102 +40,3 @@ subdir('src')

# Build the binaries.
subdir('cmdline')


# gen_files = run_command('gen_files.py')
# sources = gen_files.stdout().strip().split('\n')

# gen_includes = run_command('gen_includes.py')
# includes = gen_includes.stdout().strip().split('\n')
# inc = include_directories(includes)

# add_global_arguments(
# '-Wall',
# '-fexceptions',
# '-DHAVE_CONFIG_H',
# '-DMR_USE_MIME_DEBUG',
# '-DHAVE_ICONV',
# '-DSQLITE_OMIT_LOAD_EXTENSION',
# '-DMR_E2EE_DEFAULT_ENABLED=1',
# language: 'c',
# )

# lib_src = [
# 'src/mraheader.c',
# 'src/mrapeerstate.c',
# 'src/mrarray.c',
# 'src/mrchat.c',
# 'src/mrchatlist.c',
# 'src/mrcontact.c',
# 'src/mrdehtml.c',
# 'src/mrhash.c',
# 'src/mrimap.c',
# 'src/mrjob.c',
# 'src/mrkey.c',
# 'src/mrkeyring.c',
# 'src/mrloginparam.c',
# 'src/mrlot.c',
# 'src/mrmailbox.c',
# 'src/mrmailbox_configure.c',
# 'src/mrmailbox_e2ee.c',
# 'src/mrmailbox_imex.c',
# 'src/mrmailbox_log.c',
# 'src/mrmailbox_tools.c',
# 'src/mrmimefactory.c',
# 'src/mrmimeparser.c',
# 'src/mrmsg.c',
# 'src/mrosnative.c',
# 'src/mrparam.c',
# 'src/mrpgp.c',
# 'src/mrsaxparser.c',
# 'src/mrsimplify.c',
# 'src/mrsmtp.c',
# 'src/mrsqlite3.c',
# 'src/mrstock.c',
# 'src/mrtools.c',
# ]
# lib_hdr = [
# 'src/mraheader.h',
# 'src/mrapeerstate.h',
# 'src/mrarray.h',
# 'src/mrchat.h',
# 'src/mrchatlist.h',
# 'src/mrcontact.h',
# 'src/mrdehtml.h',
# 'src/mrevent.h',
# 'src/mrhash.h',
# 'src/mrimap.h',
# 'src/mrjob.h',
# 'src/mrkey.h',
# 'src/mrkeyring.h',
# 'src/mrloginparam.h',
# 'src/mrlot.h',
# 'src/mrmailbox.h',
# 'src/mrmailbox_internal.h',
# 'src/mrmimefactory.h',
# 'src/mrmimeparser.h',
# 'src/mrmsg.h',
# 'src/mrosnative.h',
# 'src/mrparam.h',
# 'src/mrpgp.h',
# 'src/mrpoortext.h',
# 'src/mrsaxparser.h',
# 'src/mrsimplify.h',
# 'src/mrsmtp.h',
# 'src/mrsqlite3.h',
# 'src/mrstock.h',
# 'src/mrtools.h',
# ]
# lib_inc = include_directories('src')


# library(
# 'deltachat', lib_src,
# dependencies: [zlib, openssl, pthreads, sasl, etpan],
# include_directories: lib_inc,
# install: true,
# )
# install_headers(
# lib_hdr,
# subdir: 'deltachat',
# )

0 comments on commit 1849bd8

Please sign in to comment.