Update meson and subprojects

Few changes related to meson:
- GTest and boost were updated.
- Boost is now built locally in case it is not installed on system.
- Minor meson.build refactor.

Testing done:
- local build is working fine, when subprojects are not installed on the
  system,
- local build is working fine, when subprojects are installed on the
  system,
- yocto build is working fine.

Signed-off-by: Szymon Dompke <szymon.dompke@intel.com>
Change-Id: Ib62092946d6ffafb1884d1ba3eab97bed243dd12
diff --git a/subprojects/boost.wrap b/subprojects/boost.wrap
new file mode 100644
index 0000000..b10bf3d
--- /dev/null
+++ b/subprojects/boost.wrap
@@ -0,0 +1,10 @@
+[wrap-file]
+source_url = https://boostorg.jfrog.io/artifactory/main/release/1.80.0/source/boost_1_80_0.tar.bz2
+source_hash = 1e19565d82e43bc59209a168f5ac899d3ba471d55c7610c677d4ccf2c9c500c0
+source_filename = boost_1_80_0.tar.bz2
+
+directory = boost_1_80_0
+patch_directory = boost
+
+[provide]
+boost = boost_dep
diff --git a/subprojects/googletest.wrap b/subprojects/googletest.wrap
index f22e2fa..56da9ef 100644
--- a/subprojects/googletest.wrap
+++ b/subprojects/googletest.wrap
@@ -1,3 +1,3 @@
 [wrap-git]
 url = https://github.com/google/googletest
-revision = e2239ee6043f73722e7aa812a459f54a28552929
+revision = HEAD
diff --git a/subprojects/packagefiles/boost/meson.build b/subprojects/packagefiles/boost/meson.build
new file mode 100644
index 0000000..dab33f3
--- /dev/null
+++ b/subprojects/packagefiles/boost/meson.build
@@ -0,0 +1,29 @@
+project('boost', 'cpp',
+         version: '1.80.0',
+         meson_version: '>=0.56.0')
+
+cxx = meson.get_compiler('cpp')
+
+build_dir = join_paths(meson.current_source_dir(), 'build')
+r = run_command('[','!','-d', build_dir, ']', check: false)
+if r.returncode() == 0
+      r = run_command('./bootstrap.sh', '--with-libraries=coroutine', check: true)
+      r = run_command('./b2', 'install','--prefix=build', check: true)
+endif
+
+include_dir = join_paths('build', 'include')
+lib_dir = join_paths(meson.current_source_dir(), 'build', 'lib')
+
+custom_dep = declare_dependency(
+      link_args: ['-L' + lib_dir, '-Wl,-rpath-link,' + lib_dir])
+
+boost_inc = include_directories(include_dir, is_system:true)
+boost_dep = declare_dependency(
+       include_directories: boost_inc,
+       dependencies: [
+            cxx.find_library('boost_context', dirs: lib_dir, static: true),
+            cxx.find_library('boost_coroutine', dirs: lib_dir, static: true),
+            custom_dep
+      ])
+
+meson.override_dependency('boost', boost_dep)