]> git.sesse.net Git - plocate/blobdiff - meson.build
Proof-of-concept of using ICU for strength-zero searches.
[plocate] / meson.build
index 9fd6b267f3554dcdb78cdb4c149be5e1653df269..c3551054cde32f62dc37ced5abc66062b1e69149 100644 (file)
@@ -1,9 +1,8 @@
-project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.12-pre')
+project('plocate', 'cpp', default_options: ['buildtype=debugoptimized','cpp_std=c++17'], version: '1.1.16-pre')
 
 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')
@@ -14,6 +13,7 @@ uringdep = dependency('liburing', required: false)
 zstddep = dependency('libzstd')
 threaddep = dependency('threads')
 atomicdep = cxx.find_library('atomic', required: false)
+icudep = dependency('icu-i18n')
 
 if not uringdep.found()
        add_project_arguments('-DWITHOUT_URING', language: 'cpp')
@@ -32,16 +32,16 @@ if cxx.compiles(code, name: 'function multiversioning')
 endif
 
 executable('plocate', ['plocate.cpp', 'io_uring_engine.cpp', 'turbopfor.cpp', 'parse_trigrams.cpp', 'serializer.cpp', 'access_rx_cache.cpp', 'needle.cpp', 'complete_pread.cpp'],
-       dependencies: [uringdep, zstddep, threaddep, atomicdep],
+       dependencies: [uringdep, zstddep, threaddep, atomicdep, icudep],
        install: true,
        install_mode: ['rwxr-sr-x', 'root', get_option('locategroup')])
 executable('plocate-build', ['plocate-build.cpp', 'database-builder.cpp'],
-       dependencies: [zstddep],
+       dependencies: [zstddep, icudep],
        install: true,
        install_dir: get_option('sbindir'))
 updatedb_progname = get_option('updatedb_progname')
 executable(updatedb_progname, ['updatedb.cpp', 'database-builder.cpp', 'conf.cpp', 'lib.cpp', 'bind-mount.cpp', 'complete_pread.cpp'],
-       dependencies: [zstddep, threaddep],
+       dependencies: [zstddep, threaddep, icudep],
        install: true,
        install_dir: get_option('sbindir'))
 
@@ -56,7 +56,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,