diff options
author | Rasmus Thomsen <oss@cogitri.dev> | 2020-04-16 23:32:02 +0200 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2020-10-09 16:09:19 +0300 |
commit | fe1de720d02ae91856ec966801f69b1f1a8e3168 (patch) | |
tree | b6acb1123ab776c296351be8fd52b445a0c65e31 /src/meson.build | |
parent | efe0c4afecb9fd3da2ab4849d2b8edd5bea14d08 (diff) | |
download | apk-tools-fe1de720d02ae91856ec966801f69b1f1a8e3168.tar.gz apk-tools-fe1de720d02ae91856ec966801f69b1f1a8e3168.tar.bz2 apk-tools-fe1de720d02ae91856ec966801f69b1f1a8e3168.tar.xz apk-tools-fe1de720d02ae91856ec966801f69b1f1a8e3168.zip |
build: add support for building with meson
Diffstat (limited to 'src/meson.build')
-rw-r--r-- | src/meson.build | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/src/meson.build b/src/meson.build new file mode 100644 index 0000000..070a55b --- /dev/null +++ b/src/meson.build @@ -0,0 +1,117 @@ +libapk_src = [ + 'blob.c', + 'commit.c', + 'common.c', + 'database.c', + 'hash.c', + 'io.c', + 'io_archive.c', + 'io_url.c', + 'io_gunzip.c', + 'package.c', + 'print.c', + 'solver.c', + 'version.c', +] + +libapk_headers = [ + 'apk_applet.h', + 'apk_archive.h', + 'apk_blob.h', + 'apk_database.h', + 'apk_defines.h', + 'apk_hash.h', + 'apk_io.h', + 'apk_openssl.h', + 'apk_package.h', + 'apk_print.h', + 'apk_provider_data.h', + 'apk_solver_data.h', + 'apk_solver.h', + 'apk_version.h', +] + +apk_src = [ + 'apk.c', + 'app_add.c', + 'app_audit.c', + 'app_cache.c', + 'app_del.c', + 'app_dot.c', + 'app_fetch.c', + 'app_fix.c', + 'app_index.c', + 'app_info.c', + 'app_list.c', + 'app_manifest.c', + 'app_policy.c', + 'app_update.c', + 'app_upgrade.c', + 'app_search.c', + 'app_stats.c', + 'app_verify.c', + 'app_version.c', +] + +apk_cargs = [ + '-DAPK_VERSION="' + meson.project_version() + '"', + '-D_ATFILE_SOURCE', +] + +libapk = library( + 'apk', + libapk_src, + version: meson.project_version(), + install: true, + dependencies: [ + libfetch_dep, + zlib_dep, + openssl_dep, + ], + c_args: apk_cargs, +) + +libapk_dep = declare_dependency( + link_with: libapk, +) + +if not subproject + pkgc.generate( + libapk, + name: 'apk', + version: meson.project_version(), + ) + + install_headers( + libapk_headers, + subdir: 'apk', + ) +endif + +if(lua_dep.found()) + luaapk_src = [ + 'lua-apk.c', + ] + + libluaapk = library( + 'luaapk', + luaapk_src, + dependencies: [lua_dep, libapk_dep], + install: true, + install_dir: lua_dep.get_pkgconfig_variable('libdir'), + c_args: apk_cargs, + ) +endif + +apk_exe = executable( + 'apk', + apk_src, + install: not subproject, + dependencies: [ + libapk_dep, + zlib_dep, + openssl_dep, + libfetch_dep.partial_dependency(includes: true), + ], + c_args: apk_cargs, +) |