From 0f934ad96576a6ecf1b616a5a824cc253abb5b3d Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 18 Jul 2018 15:15:12 +0200 Subject: meson: improve generation of vcs_tag Signed-off-by: Igor Gnatenko --- meson.build | 1 + unittest/test_offline.cc | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index b14fe0c..258445e 100644 --- a/meson.build +++ b/meson.build @@ -53,6 +53,7 @@ version_cc_in = configure_file( version_cc = vcs_tag( input : version_cc_in, output : 'version.cc', + fallback : 'v@0@'.format(meson.project_version()), ) libnitrokey = library( 'nitrokey', diff --git a/unittest/test_offline.cc b/unittest/test_offline.cc index 92af78c..3f79fa8 100644 --- a/unittest/test_offline.cc +++ b/unittest/test_offline.cc @@ -179,7 +179,7 @@ TEST_CASE("Test version getter", "[fast]") { std::string s = library_version; std::string version("v[0-9]+\\.[0-9]+(\\.[0-9]+)?"); std::string git_suffix("-[0-9]+-g[0-9a-z]+"); - std::regex pattern(version + "(" + git_suffix + "|)"); + std::regex pattern(version + "(" + git_suffix + ")?"); REQUIRE(std::regex_match(s, pattern)); } -- cgit v1.2.3 From ec6769295de915ef2d4350b4ad51106d3b971874 Mon Sep 17 00:00:00 2001 From: Igor Gnatenko Date: Wed, 18 Jul 2018 15:24:56 +0200 Subject: meson: install udev rules Signed-off-by: Igor Gnatenko --- meson.build | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/meson.build b/meson.build index 258445e..f3be6b3 100644 --- a/meson.build +++ b/meson.build @@ -5,7 +5,7 @@ project( default_options : [ 'cpp_std=c++14' ], - meson_version : '>= 0.43.0', + meson_version : '>= 0.44.0', ) cxx = meson.get_compiler('cpp') host_system = host_machine.system() @@ -113,6 +113,12 @@ pkg.generate( install : true, ) +dep_udev = dependency('udev') +install_data( + 'data/41-nitrokey.rules', + install_dir : '@0@/rules.d'.format(dep_udev.get_pkgconfig_variable('udevdir')), +) + if get_option('tests') or get_option('offline-tests') dep_catch = dependency('catch', required : false) if not dep_catch.found() -- cgit v1.2.3