aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhrxi <hrrrxi@gmail.com>2023-06-12 23:43:23 +0200
committerfiaxh <fiaxh@users.noreply.github.com>2023-10-06 15:25:12 +0200
commit7dd0e0aa4a4dffa9efa0fdf7c8929ac0e1611530 (patch)
treec2541c216e264d84cbbe34b050aba0f806be9fd6
parent7dd12e7dec0706b0d78f99e7014ee3a12079f1c6 (diff)
downloaddino-7dd0e0aa4a4dffa9efa0fdf7c8929ac0e1611530.tar.gz
dino-7dd0e0aa4a4dffa9efa0fdf7c8929ac0e1611530.zip
meson: Add crypto-vala library
-rw-r--r--crypto-vala/CMakeLists.txt2
-rw-r--r--crypto-vala/crypto-vala.deps2
-rw-r--r--crypto-vala/meson.build23
-rw-r--r--crypto-vala/vapi/libgcrypt.vapi (renamed from crypto-vala/vapi/gcrypt.vapi)0
-rw-r--r--meson.build3
5 files changed, 29 insertions, 1 deletions
diff --git a/crypto-vala/CMakeLists.txt b/crypto-vala/CMakeLists.txt
index f1f3f9d7..6dec5292 100644
--- a/crypto-vala/CMakeLists.txt
+++ b/crypto-vala/CMakeLists.txt
@@ -14,7 +14,7 @@ SOURCES
"src/random.vala"
"src/srtp.vala"
CUSTOM_VAPIS
- "${CMAKE_CURRENT_SOURCE_DIR}/vapi/gcrypt.vapi"
+ "${CMAKE_CURRENT_SOURCE_DIR}/vapi/libgcrypt.vapi"
"${CMAKE_CURRENT_SOURCE_DIR}/vapi/libsrtp2.vapi"
PACKAGES
${CRYPTO_VALA_PACKAGES}
diff --git a/crypto-vala/crypto-vala.deps b/crypto-vala/crypto-vala.deps
new file mode 100644
index 00000000..c029e7af
--- /dev/null
+++ b/crypto-vala/crypto-vala.deps
@@ -0,0 +1,2 @@
+gio-2.0
+glib-2.0
diff --git a/crypto-vala/meson.build b/crypto-vala/meson.build
new file mode 100644
index 00000000..c3feb4d1
--- /dev/null
+++ b/crypto-vala/meson.build
@@ -0,0 +1,23 @@
+dependencies = [
+ dep_gio,
+ dep_glib,
+ dep_libgcrypt,
+ dep_libsrtp2,
+]
+sources = files(
+ 'src/cipher.vala',
+ 'src/cipher_converter.vala',
+ 'src/error.vala',
+ 'src/random.vala',
+ 'src/srtp.vala',
+)
+c_args = [
+ '-DG_LOG_DOMAIN="crypto-vala"',
+]
+vala_args = [
+ '--vapidir', meson.current_source_dir() / 'vapi',
+]
+lib_crypto_vala = library('crypto-vala', sources, c_args: c_args, vala_args: vala_args, dependencies: dependencies, version: '0.0', install: true, install_dir: [true, true, true])
+dep_crypto_vala = declare_dependency(link_with: lib_crypto_vala, include_directories: include_directories('.'))
+
+install_data('crypto-vala.deps', install_dir: get_option('datadir') / 'vala/vapi') # TODO: workaround for https://github.com/mesonbuild/meson/issues/9756
diff --git a/crypto-vala/vapi/gcrypt.vapi b/crypto-vala/vapi/libgcrypt.vapi
index 0fa69a02..0fa69a02 100644
--- a/crypto-vala/vapi/gcrypt.vapi
+++ b/crypto-vala/vapi/libgcrypt.vapi
diff --git a/meson.build b/meson.build
index e08255e1..d0888be3 100644
--- a/meson.build
+++ b/meson.build
@@ -15,6 +15,8 @@ dep_gtk4 = dependency('gtk4')
dep_icu_uc = dependency('icu-uc')
dep_libadwaita = dependency('libadwaita-1')
dep_libcanberra = dependency('libcanberra')
+dep_libgcrypt = dependency('libgcrypt')
+dep_libsrtp2 = dependency('libsrtp2')
dep_libsoup = dependency('libsoup-3.0')
dep_m = meson.get_compiler('c').find_library('m', required: false)
dep_sqlite3 = dependency('sqlite3', version: '>=3.24')
@@ -26,4 +28,5 @@ subdir('qlite')
subdir('xmpp-vala')
subdir('libdino')
subdir('main')
+subdir('crypto-vala')
subdir('plugins')