$OpenBSD: patch-meson_build,v 1.5 2018/02/11 09:05:59 rsadowski Exp $

Index: meson.build
--- meson.build.orig
+++ meson.build
@@ -25,7 +25,7 @@ jsoncpp_gen_sources = configure_file(
   output : 'version.h',
   configuration : jsoncpp_cdata,
   install : true,
-  install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'json')
+  install_dir : join_paths(get_option('prefix'), get_option('includedir'), 'jsoncpp', 'json')
 )
 
 jsoncpp_headers = [
@@ -43,8 +43,11 @@ jsoncpp_include_directories = include_directories('inc
 
 install_headers(
   jsoncpp_headers,
-  subdir : 'json')
+  subdir : 'jsoncpp/json')
 
+thread_dep = dependency('threads')
+no_asneeded = '-Wl,--no-as-needed'
+
 jsoncpp_lib = library(
   'jsoncpp',
   [ jsoncpp_gen_sources,
@@ -55,12 +58,15 @@ jsoncpp_lib = library(
     'src/lib_json/json_writer.cpp'],
   soversion : 20,
   install : true,
+  dependencies : thread_dep,
+  link_args : no_asneeded,
   include_directories : jsoncpp_include_directories)
 
 import('pkgconfig').generate(
   libraries : jsoncpp_lib,
   version : meson.project_version(),
   name : 'jsoncpp',
+  subdirs : 'jsoncpp',
   filebase : 'jsoncpp',
   description : 'A C++ library for interacting with JSON')
 
@@ -68,6 +74,8 @@ import('pkgconfig').generate(
 jsoncpp_dep = declare_dependency(
   include_directories : jsoncpp_include_directories,
   link_with : jsoncpp_lib,
+  dependencies : thread_dep,
+  link_args : no_asneeded,
   version : meson.project_version(),
   sources : jsoncpp_gen_sources)
 
@@ -81,6 +89,8 @@ jsoncpp_test = executable(
     'src/test_lib_json/main.cpp'],
   include_directories : jsoncpp_include_directories,
   link_with : jsoncpp_lib,
+  dependencies : thread_dep,
+  link_args : no_asneeded,
   install : false)
 test(
   'unittest_jsoncpp_test',
@@ -90,6 +100,8 @@ jsontestrunner = executable(
   'jsontestrunner',
   'src/jsontestrunner/main.cpp',
   include_directories : jsoncpp_include_directories,
+  dependencies : thread_dep,
+  link_args : no_asneeded,
   link_with : jsoncpp_lib,
   install : false)
 test(
