diff --git a/cmdline/meson.build b/cmdline/meson.build new file mode 100644 index 00000000..779c7112 --- /dev/null +++ b/cmdline/meson.build @@ -0,0 +1,15 @@ +src = [ + 'cmdline.c', + 'stress.c', + 'main.c', +] + +inc = include_directories('.') + + +exe = executable( + 'delta', src, + dependencies: [etpan], + link_with: lib, + install: true, +) diff --git a/libs/netpgp/include/netpgp/openssl11stub.h b/libs/netpgp/include/netpgp/openssl11stub.h index 5d759ff8..56e949e6 100644 --- a/libs/netpgp/include/netpgp/openssl11stub.h +++ b/libs/netpgp/include/netpgp/openssl11stub.h @@ -1,3 +1,4 @@ +#if OPENSSL_VERSION_NUMBER < 0x10100000L int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) { @@ -131,3 +132,4 @@ int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) return 1; } +#endif diff --git a/libs/netpgp/meson.build b/libs/netpgp/meson.build new file mode 100644 index 00000000..dabcf187 --- /dev/null +++ b/libs/netpgp/meson.build @@ -0,0 +1,36 @@ +project('netpgp', 'c') + +zlib = dependency('zlib') +bzip2 = declare_dependency(link_args: '-lbz2') +openssl = dependency('openssl') +pthreads = dependency('threads') + +src = [ + 'src/compress.c', + 'src/create.c', + 'src/crypto.c', + 'src/keyring.c', + 'src/misc.c', + 'src/openssl_crypto.c', + 'src/packet-parse.c', + 'src/packet-show.c', + 'src/reader.c', + 'src/signature.c', + 'src/symmetric.c', + 'src/validate.c', + 'src/writer.c', +] +inc = include_directories('include') + + +lib = library( + 'netpgp', src, + dependencies: [zlib, bzip2, openssl, pthreads], + include_directories: inc, + install: true, +) + +dep = declare_dependency( + include_directories: inc, + link_with: lib, +) diff --git a/meson.build b/meson.build new file mode 100644 index 00000000..6db55362 --- /dev/null +++ b/meson.build @@ -0,0 +1,141 @@ +project( + 'deltachat-core', 'c', + license: 'GPLv3', + subproject_dir: 'libs', +) + + +# These get their information from pkg-config. +zlib = dependency('zlib') +openssl = dependency('openssl') +pthreads = dependency('threads') +sasl = dependency('libsasl2') +sqlite = dependency('sqlite3') + +# Sadly libetpan doesn't use pkg-config. +etpan_prefix = run_command('libetpan-config', ['--prefix']).stdout().strip() +etpan_cflags = run_command('libetpan-config', ['--cflags']).stdout().strip().split() +etpan_libs = run_command('libetpan-config', ['--libs']).stdout().strip().split() +etpan_inc_dir = join_paths(etpan_prefix, 'include') +etpan_inc = include_directories(etpan_inc_dir) +if etpan_cflags == '' + etpan = declare_dependency( + include_directories: etpan_inc, + link_args: etpan_libs, + ) +else + etpan = declare_dependency( + compile_args: etpan_cflags, + include_directories: etpan_inc, + link_args: etpan_libs, + ) +endif + +# Build bundled dependencies. +netpgp_proj = subproject('netpgp') +netpgp = netpgp_proj.get_variable('dep') + +# Build the library, stored in `lib`. +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', +# ) diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 00000000..75666c22 --- /dev/null +++ b/src/meson.build @@ -0,0 +1,79 @@ +lib_src = [ + 'mraheader.c', + 'mrapeerstate.c', + 'mrarray.c', + 'mrchat.c', + 'mrchatlist.c', + 'mrcontact.c', + 'mrdehtml.c', + 'mrhash.c', + 'mrimap.c', + 'mrjob.c', + 'mrkey.c', + 'mrkeyring.c', + 'mrloginparam.c', + 'mrlot.c', + 'mrmailbox.c', + 'mrmailbox_configure.c', + 'mrmailbox_e2ee.c', + 'mrmailbox_imex.c', + 'mrmailbox_log.c', + 'mrmailbox_tools.c', + 'mrmimefactory.c', + 'mrmimeparser.c', + 'mrmsg.c', + 'mrosnative.c', + 'mrparam.c', + 'mrpgp.c', + 'mrsaxparser.c', + 'mrsimplify.c', + 'mrsmtp.c', + 'mrsqlite3.c', + 'mrstock.c', + 'mrtools.c', +] +lib_hdr = [ + 'mraheader.h', + 'mrapeerstate.h', + 'mrarray.h', + 'mrchat.h', + 'mrchatlist.h', + 'mrcontact.h', + 'mrdehtml.h', + 'mrevent.h', + 'mrhash.h', + 'mrimap.h', + 'mrjob.h', + 'mrkey.h', + 'mrkeyring.h', + 'mrloginparam.h', + 'mrlot.h', + 'mrmailbox.h', + 'mrmailbox_internal.h', + 'mrmimefactory.h', + 'mrmimeparser.h', + 'mrmsg.h', + 'mrosnative.h', + 'mrparam.h', + 'mrpgp.h', + 'mrpoortext.h', + 'mrsaxparser.h', + 'mrsimplify.h', + 'mrsmtp.h', + 'mrsqlite3.h', + 'mrstock.h', + 'mrtools.h', +] +lib_inc = include_directories('.') + + +lib = library( + 'deltachat', lib_src, + dependencies: [zlib, openssl, pthreads, sasl, sqlite, etpan, netpgp], + include_directories: lib_inc, + install: true, +) +install_headers( + lib_hdr, + subdir: 'deltachat', +)