]> git.sesse.net Git - plocate/blobdiff - meson.build
Release plocate 1.1.22.
[plocate] / meson.build
index d442f248e026c1802096758c10e76b6b29db3087..b5a2e362ee89fbfbdddb89240ae284140447574d 100644 (file)
@@ -1,9 +1,8 @@
-project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.6')
+project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.22')
 
 add_project_arguments('-DGROUPNAME="' + get_option('locategroup') + '"', language: 'cpp')
 add_project_arguments('-DUPDATEDB_CONF="/etc/updatedb.conf"', language: 'cpp')
-dbdir = join_paths(get_option('sharedstatedir'), 'plocate')
-dbfile = join_paths(dbdir, 'plocate.db')
+dbfile = join_paths(get_option('sharedstatedir'), get_option('dbpath'))
 add_project_arguments('-DDBFILE="' + dbfile + '"', language: 'cpp')
 add_project_arguments('-DPACKAGE_NAME="plocate"', language: 'cpp')
 add_project_arguments('-DPACKAGE_VERSION="' + meson.project_version() + '"', language: 'cpp')
@@ -56,7 +55,8 @@ update_script = configure_file(input: 'update-plocate.sh',
                output: 'update-plocate.sh',
                configuration: conf_data)
 
-meson.add_install_script('mkdir.sh', dbdir)
+fs = import('fs')
+meson.add_install_script('mkdir.sh', fs.parent(dbfile))
 
 if get_option('install_cron')
        install_data(update_script,
@@ -77,12 +77,17 @@ updatedb_conf_man = configure_file(input: 'updatedb.conf.5.in',
 install_man(updatedb_conf_man)
 
 if get_option('install_systemd')
-       systemd = dependency('systemd', required: false)
-       if systemd.found()
-               unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+       unitdir = get_option('systemunitdir')
+       if unitdir == ''
+               systemd = dependency('systemd', required: false)
+               if systemd.found()
+                       unitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir')
+               endif
+       endif
+       if unitdir != ''
                updatedb_service = configure_file(input: 'plocate-updatedb.service.in',
-                      output: 'plocate-updatedb.service',
-                      configuration: conf_data)
+                       output: 'plocate-updatedb.service',
+                       configuration: conf_data)
                install_data(updatedb_service, install_dir: unitdir)
                install_data('plocate-updatedb.timer', install_dir: unitdir)
        endif
@@ -93,11 +98,11 @@ endif
 # of calling into that directory to run make, and we're not
 # replicating their build system, so it has to be manual.
 pfordir = meson.source_root() + '/TurboPFor-Integer-Compression'
-if run_command('[', '-r', pfordir + '/libic.a', ']').returncode() == 0
+if run_command('[', '-r', pfordir + '/libic.a', ']', check: false).returncode() == 0
        turbopfordep = declare_dependency(
                include_directories: include_directories('TurboPFor-Integer-Compression'),
                dependencies: meson.get_compiler('cpp').find_library('ic', dirs: pfordir))
-       executable('bench', ['bench.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp'],
+       executable('bench', ['bench.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'complete_pread.cpp'],
                dependencies: [uringdep, turbopfordep],
                build_by_default: false,
                install: false)