diff --git a/meson.build b/meson.build
index 9d4d68969b29dbae666d6ff543164317367cc1e4..9b8c905c82dc8778923aba73c784493fbfd67459 100644
--- a/meson.build
+++ b/meson.build
@@ -29,6 +29,8 @@ depspeexdsp = dependency('speexdsp')
 depyamlcpp = dependency('yaml-cpp', version: '>= 0.5.1', required: false)
 if not depyamlcpp.found()
     depyamlcpp = modcmake.subproject('yaml-cpp', cmake_options: [
+        '-DCMAKE_BUILD_TYPE=Release',
+        '-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
         '-DYAML_CPP_BUILD_TOOLS=OFF',
         '-DYAML_CPP_BUILD_TESTS=OFF',
         '-DYAML_CPP_BUILD_CONTRIB=OFF',
@@ -36,6 +38,20 @@ if not depyamlcpp.found()
     ]).dependency('yaml-cpp')
 endif
 
+deplibarchive = dependency('libarchive', version: '>= 3.4.0', required: false)
+if not deplibarchive.found()
+    deplibarchive = modcmake.subproject('libarchive', cmake_options: [
+        '-DCMAKE_BUILD_TYPE=Release',
+        '-DCMAKE_INSTALL_LIBDIR=lib',
+        '-DCMAKE_POSITION_INDEPENDENT_CODE=ON',
+        '-DENABLE_TEST=OFF',
+        '-DENABLE_TAR=OFF',
+        '-DENABLE_CPIO=OFF',
+        '-DENABLE_CAT=OFF',
+        '-DENABLE_LIBXML2=OFF'
+    ]).dependency('archive_static')
+endif
+
 depjsoncpp = dependency('jsoncpp', version: '>= 1.6.5',
                         fallback: ['jsoncpp', 'jsoncpp_dep'], default_options: ['default_library=static'])
 depzlib = dependency('zlib', fallback: ['zlib', 'zlib_dep'], default_options: ['default_library=static'])
diff --git a/src/meson.build b/src/meson.build
index 2a82eabe56f901a1ff38c1aff34944b452dcdd4b..c0859718a525069899c1481c0a9f3325b7202583 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -133,6 +133,7 @@ libjami_dependencies = [
     depspeex,
     depspeexdsp,
     depyamlcpp,
+    deplibarchive,
     depjsoncpp,
     depzlib
 ]
diff --git a/subprojects/libarchive.wrap b/subprojects/libarchive.wrap
new file mode 100644
index 0000000000000000000000000000000000000000..24898ce13af6fe70f415d5d53648785272198dfb
--- /dev/null
+++ b/subprojects/libarchive.wrap
@@ -0,0 +1,6 @@
+[wrap-file]
+directory = libarchive-3.4.3
+
+source_url = https://github.com/libarchive/libarchive/releases/download/v3.4.3/libarchive-3.4.3.tar.gz
+source_filename = libarchive-3.4.3.tar.gz
+source_hash = ee1e749213c108cb60d53147f18c31a73d6717d7e3d2481c157e1b34c881ea39