1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-28 05:00:58 +01:00

Merge pull request #13706 from xokdvium/meson-format

meson: Apply formatting universally
This commit is contained in:
John Ericson 2025-08-06 20:50:44 -04:00 committed by GitHub
commit c4c3203b7b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
75 changed files with 469 additions and 476 deletions

View file

@ -1,4 +1,5 @@
project('nix-external-api-docs',
project(
'nix-external-api-docs',
version : files('.version'),
meson_version : '>= 1.1',
license : 'LGPL-2.1-or-later',
@ -10,7 +11,7 @@ doxygen_cfg = configure_file(
input : 'doxygen.cfg.in',
output : 'doxygen.cfg',
configuration : {
'PROJECT_NUMBER': meson.project_version(),
'PROJECT_NUMBER' : meson.project_version(),
'OUTPUT_DIRECTORY' : meson.current_build_dir(),
'src' : fs.parent(fs.parent(meson.project_source_root())),
},
@ -20,7 +21,7 @@ doxygen = find_program('doxygen', native : true, required : true)
custom_target(
'external-api-docs',
command : [ doxygen , doxygen_cfg ],
command : [ doxygen, doxygen_cfg ],
input : [
doxygen_cfg,
],

View file

@ -1,4 +1,5 @@
project('nix-internal-api-docs',
project(
'nix-internal-api-docs',
version : files('.version'),
meson_version : '>= 1.1',
license : 'LGPL-2.1-or-later',
@ -10,7 +11,7 @@ doxygen_cfg = configure_file(
input : 'doxygen.cfg.in',
output : 'doxygen.cfg',
configuration : {
'PROJECT_NUMBER': meson.project_version(),
'PROJECT_NUMBER' : meson.project_version(),
'OUTPUT_DIRECTORY' : meson.current_build_dir(),
'BUILD_ROOT' : meson.build_root(),
'src' : fs.parent(fs.parent(meson.project_source_root())) / 'src',
@ -21,7 +22,7 @@ doxygen = find_program('doxygen', native : true, required : true)
custom_target(
'internal-api-docs',
command : [ doxygen , doxygen_cfg ],
command : [ doxygen, doxygen_cfg ],
input : [
doxygen_cfg,
],

View file

@ -1,6 +1,6 @@
# Public headers directory
include_dirs = [include_directories('../..')]
include_dirs = [ include_directories('../..') ]
headers = files(
'built-path.hh',

View file

@ -1,4 +1,6 @@
project('nix-cmd', 'cpp',
project(
'nix-cmd',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -16,8 +18,7 @@ subdir('nix-meson-build-support/deps-lists')
configdata = configuration_data()
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-store'),
@ -31,11 +32,18 @@ subdir('nix-meson-build-support/subprojects')
nlohmann_json = dependency('nlohmann_json', version : '>= 3.9')
deps_public += nlohmann_json
lowdown = dependency('lowdown', version : '>= 0.9.0', required : get_option('markdown'))
lowdown = dependency(
'lowdown',
version : '>= 0.9.0',
required : get_option('markdown'),
)
deps_private += lowdown
configdata.set('HAVE_LOWDOWN', lowdown.found().to_int())
# The API changed slightly around terminal initialization.
configdata.set('HAVE_LOWDOWN_1_4', lowdown.version().version_compare('>= 1.4.0').to_int())
configdata.set(
'HAVE_LOWDOWN_1_4',
lowdown.version().version_compare('>= 1.4.0').to_int(),
)
readline_flavor = get_option('readline-flavor')
if readline_flavor == 'editline'
@ -50,7 +58,7 @@ endif
configdata.set(
'USE_READLINE',
(readline_flavor == 'readline').to_int(),
description: 'Use readline instead of editline',
description : 'Use readline instead of editline',
)
config_priv_h = configure_file(
@ -89,10 +97,10 @@ this_library = library(
config_priv_h,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
install_headers(headers, subdir : 'nix/cmd', preserve_path : true)

View file

@ -2,14 +2,14 @@
option(
'markdown',
type: 'feature',
description: 'Enable Markdown rendering in the Nix binary (requires lowdown)',
type : 'feature',
description : 'Enable Markdown rendering in the Nix binary (requires lowdown)',
)
option(
'readline-flavor',
type : 'combo',
choices : ['editline', 'readline'],
choices : [ 'editline', 'readline' ],
value : 'editline',
description : 'Which library to use for nice line editing with the Nix language REPL',
)

View file

@ -1,4 +1,6 @@
project('nix-expr-c', 'cpp',
project(
'nix-expr-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -33,7 +35,7 @@ sources = files(
'nix_api_value.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_expr.h',
@ -50,7 +52,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -6,5 +6,4 @@ headers = files(
'libexpr.hh',
'nix_api_expr.hh',
'value/context.hh',
# hack for trailing newline
)

View file

@ -1,4 +1,6 @@
project('nix-expr-test-support', 'cpp',
project(
'nix-expr-test-support',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -14,8 +16,7 @@ cxx = meson.get_compiler('cpp')
subdir('nix-meson-build-support/deps-lists')
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-test-support'),
@ -47,7 +48,7 @@ this_library = library(
include_directories : include_dirs,
# TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326
# is available. See also ../libutil/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-expr-tests', 'cpp',
project(
'nix-expr-tests',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -19,8 +21,7 @@ deps_private_maybe_subproject = [
dependency('nix-expr-c'),
dependency('nix-expr-test-support'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -62,7 +63,7 @@ sources = files(
'value/value.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
@ -72,7 +73,7 @@ this_exe = executable(
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
# TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
install : true,
)
@ -80,7 +81,7 @@ test(
meson.project_name(),
this_exe,
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'_NIX_TEST_UNIT_DATA' : meson.current_source_dir() / 'data',
},
protocol : 'gtest',
)

View file

@ -1,13 +1,13 @@
# Public headers directory
include_dirs = [include_directories('../..')]
include_dirs = [ include_directories('../..') ]
config_pub_h = configure_file(
configuration : configdata_pub,
output : 'config.hh',
)
headers = [config_pub_h] + files(
headers = [ config_pub_h ] + files(
'attr-path.hh',
'attr-set.hh',
'eval-cache.hh',

View file

@ -1,4 +1,6 @@
project('nix-expr', 'cpp',
project(
'nix-expr',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -17,8 +19,7 @@ subdir('nix-meson-build-support/deps-lists')
configdata_pub = configuration_data()
configdata_priv = configuration_data()
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-store'),
@ -39,8 +40,8 @@ endforeach
boost = dependency(
'boost',
modules : ['container', 'context'],
include_type: 'system',
modules : [ 'container', 'context' ],
include_type : 'system',
)
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we
# put in `deps_other`.
@ -70,7 +71,7 @@ toml11 = dependency(
'toml11',
version : '>=3.7.0',
method : 'cmake',
include_type: 'system',
include_type : 'system',
)
deps_other += toml11
@ -113,8 +114,7 @@ lexer_tab = custom_target(
command : [
'flex',
'-Cf', # Use full scanner tables
'--outfile',
'@OUTPUT0@',
'--outfile', '@OUTPUT0@',
'--header-file=' + '@OUTPUT1@',
'@INPUT0@',
],
@ -175,10 +175,10 @@ this_library = library(
generated_headers,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
install_headers(headers, subdir : 'nix/expr', preserve_path : true)

View file

@ -1,3 +1,5 @@
option('gc', type : 'feature',
option(
'gc',
type : 'feature',
description : 'enable garbage collection in the Nix expression evaluator (requires Boehm GC)',
)

View file

@ -1,4 +1,6 @@
project('nix-fetchers-c', 'cpp',
project(
'nix-fetchers-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -35,7 +37,7 @@ sources = files(
'nix_api_fetchers.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_fetchers.h',
@ -53,7 +55,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-fetchers-tests', 'cpp',
project(
'nix-fetchers-tests',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -19,8 +21,7 @@ deps_private_maybe_subproject = [
dependency('nix-fetchers'),
dependency('nix-fetchers-c'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -44,7 +45,7 @@ sources = files(
'public-key.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
@ -53,7 +54,7 @@ this_exe = executable(
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
# TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest
install : true,
)
@ -62,7 +63,7 @@ test(
meson.project_name(),
this_exe,
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'_NIX_TEST_UNIT_DATA' : meson.current_source_dir() / 'data',
},
protocol : 'gtest',
)

View file

@ -1,4 +1,4 @@
include_dirs = [include_directories('../..')]
include_dirs = [ include_directories('../..') ]
headers = files(
'attrs.hh',

View file

@ -1,4 +1,6 @@
project('nix-fetchers', 'cpp',
project(
'nix-fetchers',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -16,8 +18,7 @@ subdir('nix-meson-build-support/deps-lists')
configuration_data()
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-store'),
@ -62,7 +63,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-flake-c', 'cpp',
project(
'nix-flake-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -35,7 +37,7 @@ sources = files(
'nix_api_flake.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_flake.h',
@ -53,7 +55,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-flake-tests', 'cpp',
project(
'nix-flake-tests',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -19,8 +21,7 @@ deps_private_maybe_subproject = [
dependency('nix-flake'),
dependency('nix-flake-c'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -40,7 +41,7 @@ sources = files(
'url-name.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
@ -49,7 +50,7 @@ this_exe = executable(
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
# TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest
install : true,
)
@ -58,9 +59,9 @@ test(
meson.project_name(),
this_exe,
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'NIX_CONFIG': 'extra-experimental-features = flakes',
'HOME': meson.current_build_dir() / 'test-home',
'_NIX_TEST_UNIT_DATA' : meson.current_source_dir() / 'data',
'NIX_CONFIG' : 'extra-experimental-features = flakes',
'HOME' : meson.current_build_dir() / 'test-home',
},
protocol : 'gtest',
)

View file

@ -1,6 +1,6 @@
# Public headers directory
include_dirs = [include_directories('../..')]
include_dirs = [ include_directories('../..') ]
headers = files(
'flake.hh',

View file

@ -1,4 +1,6 @@
project('nix-flake', 'cpp',
project(
'nix-flake',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -14,8 +16,7 @@ cxx = meson.get_compiler('cpp')
subdir('nix-meson-build-support/deps-lists')
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-store'),
@ -40,10 +41,10 @@ endforeach
sources = files(
'config.cc',
'flake-primops.cc',
'flake.cc',
'flakeref.cc',
'lockfile.cc',
'flake-primops.cc',
'settings.cc',
'url-name.cc',
)
@ -59,7 +60,7 @@ this_library = library(
generated_headers,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-main-c', 'cpp',
project(
'nix-main-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -31,7 +33,7 @@ sources = files(
'nix_api_main.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_main.h',
@ -45,7 +47,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,6 +1,6 @@
# Public headers directory
include_dirs = [include_directories('../..')]
include_dirs = [ include_directories('../..') ]
headers = files(
'common-args.hh',

View file

@ -1,4 +1,6 @@
project('nix-main', 'cpp',
project(
'nix-main',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -16,8 +18,7 @@ subdir('nix-meson-build-support/deps-lists')
configdata = configuration_data()
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-store'),
@ -43,7 +44,7 @@ int main() {
configdata.set(
'HAVE_PUBSETBUF',
cxx.compiles(pubsetbuf_test).to_int(),
description: 'Optionally used for buffering on standard error'
description : 'Optionally used for buffering on standard error',
)
config_priv_h = configure_file(
@ -78,7 +79,7 @@ this_library = library(
config_priv_h,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-store-c', 'cpp',
project(
'nix-store-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -29,7 +31,7 @@ sources = files(
'nix_api_store.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_store.h',
@ -46,7 +48,7 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,6 +1,6 @@
# Public headers directory
include_dirs = [include_directories('../../..')]
include_dirs = [ include_directories('../../..') ]
headers = files(
'derived-path.hh',

View file

@ -1,4 +1,6 @@
project('nix-store-test-support', 'cpp',
project(
'nix-store-test-support',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -14,8 +16,7 @@ cxx = meson.get_compiler('cpp')
subdir('nix-meson-build-support/deps-lists')
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-test-support'),
@ -47,7 +48,7 @@ this_library = library(
include_directories : include_dirs,
# TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326
# is available. See also ../libutil/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-store-tests', 'cpp',
project(
'nix-store-tests',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -21,8 +23,7 @@ deps_private_maybe_subproject = [
dependency('nix-store-c'),
dependency('nix-store-test-support'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -80,7 +81,7 @@ sources = files(
'worker-protocol.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
@ -90,7 +91,7 @@ this_exe = executable(
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
# TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest
install : true,
)
@ -99,9 +100,9 @@ test(
meson.project_name(),
this_exe,
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'HOME': meson.current_build_dir() / 'test-home',
'NIX_REMOTE': meson.current_build_dir() / 'test-home' / 'store',
'_NIX_TEST_UNIT_DATA' : meson.current_source_dir() / 'data',
'HOME' : meson.current_build_dir() / 'test-home',
'NIX_REMOTE' : meson.current_build_dir() / 'test-home' / 'store',
},
protocol : 'gtest',
)
@ -120,11 +121,15 @@ if get_option('benchmarks')
'nix-store-benchmarks',
benchmark_sources,
config_priv_h,
dependencies : deps_private_subproject + deps_private + deps_other + [gbenchmark],
dependencies : deps_private_subproject + deps_private + deps_other + [
gbenchmark,
],
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
install : true,
cpp_args : ['-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"'],
cpp_args : [
'-DNIX_UNIT_TEST_DATA="' + meson.current_source_dir() + '/data"',
],
)
benchmark('nix-store-benchmarks', benchmark_exe)

View file

@ -9,12 +9,12 @@ config_pub_h = configure_file(
output : 'config.hh',
)
headers = [config_pub_h] + files(
headers = [ config_pub_h ] + files(
'binary-cache-store.hh',
'build-result.hh',
'build/derivation-goal.hh',
'build/derivation-building-goal.hh',
'build/derivation-building-misc.hh',
'build/derivation-goal.hh',
'build/derivation-trampoline-goal.hh',
'build/drv-output-substitution-goal.hh',
'build/goal.hh',
@ -27,8 +27,8 @@ headers = [config_pub_h] + files(
'common-ssh-store-config.hh',
'content-address.hh',
'daemon.hh',
'derivations.hh',
'derivation-options.hh',
'derivations.hh',
'derived-path-map.hh',
'derived-path.hh',
'downstream-placeholder.hh',

View file

@ -2,5 +2,4 @@ include_dirs += include_directories('../..')
headers += files(
'personality.hh',
# hack for trailing newline
)

View file

@ -1,6 +1,5 @@
sources += files(
'personality.cc',
# hack for trailing newline
)
subdir('include/nix/store')

View file

@ -1,4 +1,6 @@
project('nix-store', 'cpp',
project(
'nix-store',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -27,31 +29,34 @@ subdir('nix-meson-build-support/default-system-cpu')
configdata_pub.set_quoted(
'NIX_LOCAL_SYSTEM',
nix_system_cpu + '-' + host_machine.system(),
description :
'This is the system name Nix expects for local running instance of Nix.\n\n'
description : 'This is the system name Nix expects for local running instance of Nix.\n\n'
+ 'See the "system" setting for additional details',
)
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
]
subdir('nix-meson-build-support/subprojects')
run_command('ln', '-s',
run_command(
'ln',
'-s',
meson.project_build_root() / '__nothing_link_target',
meson.project_build_root() / '__nothing_symlink',
# native doesn't allow dangling symlinks, which the tests require
env : { 'MSYS' : 'winsymlinks:lnk' },
env : {'MSYS' : 'winsymlinks:lnk'},
check : true,
)
can_link_symlink = run_command('ln',
can_link_symlink = run_command(
'ln',
meson.project_build_root() / '__nothing_symlink',
meson.project_build_root() / '__nothing_hardlink',
check : false,
).returncode() == 0
run_command('rm', '-f',
run_command(
'rm',
'-f',
meson.project_build_root() / '__nothing_symlink',
meson.project_build_root() / '__nothing_hardlink',
check : true,
@ -84,20 +89,20 @@ configdata_pub.set(
if host_machine.system() == 'darwin'
sandbox = cxx.find_library('sandbox')
deps_other += [sandbox]
deps_other += [ sandbox ]
endif
if host_machine.system() == 'windows'
wsock32 = cxx.find_library('wsock32')
deps_other += [wsock32]
deps_other += [ wsock32 ]
endif
subdir('nix-meson-build-support/libatomic')
boost = dependency(
'boost',
modules : ['container', 'regex'],
include_type: 'system',
modules : [ 'container', 'regex' ],
include_type : 'system',
)
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we
# put in `deps_other`.
@ -112,9 +117,16 @@ seccomp_required = get_option('seccomp-sandboxing')
if not is_linux and seccomp_required.enabled()
warning('Force-enabling seccomp on non-Linux does not make sense')
endif
seccomp = dependency('libseccomp', 'seccomp', required : seccomp_required, version : '>=2.5.5')
seccomp = dependency(
'libseccomp',
'seccomp',
required : seccomp_required,
version : '>=2.5.5',
)
if is_linux and not seccomp.found()
warning('Sandbox security is reduced because libseccomp has not been found! Please provide libseccomp if it supports your CPU architecture.')
warning(
'Sandbox security is reduced because libseccomp has not been found! Please provide libseccomp if it supports your CPU architecture.',
)
endif
configdata_priv.set('HAVE_SECCOMP', seccomp.found().to_int())
deps_private += seccomp
@ -132,8 +144,8 @@ aws_s3 = dependency('aws-cpp-sdk-s3', required : false)
configdata_pub.set('NIX_WITH_S3_SUPPORT', aws_s3.found().to_int())
if aws_s3.found()
aws_s3 = declare_dependency(
include_directories: include_directories(aws_s3.get_variable('includedir')),
link_args: [
include_directories : include_directories(aws_s3.get_variable('includedir')),
link_args : [
'-L' + aws_s3.get_variable('libdir'),
'-laws-cpp-sdk-transfer',
'-laws-cpp-sdk-s3',
@ -159,7 +171,10 @@ endforeach
busybox = find_program(get_option('sandbox-shell'), required : false)
configdata_priv.set('HAVE_EMBEDDED_SANDBOX_SHELL', get_option('embedded-sandbox-shell').to_int())
configdata_priv.set(
'HAVE_EMBEDDED_SANDBOX_SHELL',
get_option('embedded-sandbox-shell').to_int(),
)
if get_option('embedded-sandbox-shell')
configdata_priv.set_quoted('SANDBOX_SHELL', '__embedded_sandbox_shell__')
@ -171,12 +186,7 @@ if get_option('embedded-sandbox-shell')
hexdump = find_program('hexdump', native : true)
embedded_sandbox_shell_gen = custom_target(
'embedded-sandbox-shell.gen.hh',
command : [
hexdump,
'-v',
'-e',
'1/1 "0x%x," "\n"'
],
command : [ hexdump, '-v', '-e', '1/1 "0x%x," "\n"' ],
input : busybox.full_path(),
output : 'embedded-sandbox-shell.gen.hh',
capture : true,
@ -228,21 +238,20 @@ endif
# Aside from prefix itself, each of these was made into an absolute path
# by joining it with prefix, unless it was already an absolute path
# (which is the default for store-dir, localstatedir, and log-dir).
configdata_priv.set_quoted('NIX_PREFIX', prefix)
configdata_priv.set_quoted('NIX_PREFIX', prefix)
configdata_priv.set_quoted('NIX_STORE_DIR', store_dir)
configdata_priv.set_quoted('NIX_DATA_DIR', datadir)
configdata_priv.set_quoted('NIX_DATA_DIR', datadir)
configdata_priv.set_quoted('NIX_STATE_DIR', localstatedir / 'nix')
configdata_priv.set_quoted('NIX_LOG_DIR', log_dir)
configdata_priv.set_quoted('NIX_CONF_DIR', sysconfdir / 'nix')
configdata_priv.set_quoted('NIX_MAN_DIR', mandir)
configdata_priv.set_quoted('NIX_LOG_DIR', log_dir)
configdata_priv.set_quoted('NIX_CONF_DIR', sysconfdir / 'nix')
configdata_priv.set_quoted('NIX_MAN_DIR', mandir)
lsof = find_program('lsof', required : false)
configdata_priv.set_quoted(
'LSOF',
lsof.found()
? lsof.full_path()
# Just look up on the PATH
: 'lsof',
lsof.found() ? lsof.full_path()
# Just look up on the PATH
: 'lsof',
)
config_priv_h = configure_file(
@ -255,8 +264,8 @@ subdir('nix-meson-build-support/common')
sources = files(
'binary-cache-store.cc',
'build-result.cc',
'build/derivation-goal.cc',
'build/derivation-building-goal.cc',
'build/derivation-goal.cc',
'build/derivation-trampoline-goal.cc',
'build/drv-output-substitution-goal.cc',
'build/entry-points.cc',
@ -270,8 +279,8 @@ sources = files(
'common-ssh-store-config.cc',
'content-address.cc',
'daemon.cc',
'derivations.cc',
'derivation-options.cc',
'derivations.cc',
'derived-path-map.cc',
'derived-path.cc',
'downstream-placeholder.cc',
@ -318,8 +327,8 @@ sources = files(
'ssh.cc',
'store-api.cc',
'store-dir-config.cc',
'store-registration.cc',
'store-reference.cc',
'store-registration.cc',
'uds-remote-store.cc',
'worker-protocol-connection.cc',
'worker-protocol.cc',
@ -347,10 +356,10 @@ this_library = library(
config_priv_h,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
install_headers(headers, subdir : 'nix/store', preserve_path : true)

View file

@ -1,21 +1,35 @@
# vim: filetype=meson
option('embedded-sandbox-shell', type : 'boolean', value : false,
option(
'embedded-sandbox-shell',
type : 'boolean',
value : false,
description : 'include the sandbox shell in the Nix binary',
)
option('seccomp-sandboxing', type : 'feature',
option(
'seccomp-sandboxing',
type : 'feature',
description : 'build support for seccomp sandboxing (recommended unless your arch doesn\'t support libseccomp, only relevant on Linux)',
)
option('sandbox-shell', type : 'string', value : 'busybox',
option(
'sandbox-shell',
type : 'string',
value : 'busybox',
description : 'path to a statically-linked shell to use as /bin/sh in sandboxes (usually busybox)',
)
option('store-dir', type : 'string', value : '/nix/store',
option(
'store-dir',
type : 'string',
value : '/nix/store',
description : 'path of the Nix store',
)
option('log-dir', type : 'string', value : '/nix/var/log/nix',
option(
'log-dir',
type : 'string',
value : '/nix/var/log/nix',
description : 'path to store logs in for Nix',
)

View file

@ -7,5 +7,4 @@ include_dirs += include_directories(
#'build',
)
headers += files(
)
headers += files()

View file

@ -1,4 +1,6 @@
project('nix-util-c', 'cpp',
project(
'nix-util-c',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -19,8 +21,7 @@ configdata = configuration_data()
deps_private_maybe_subproject = [
dependency('nix-util'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
configdata.set_quoted('PACKAGE_VERSION', meson.project_version())
@ -36,7 +37,7 @@ sources = files(
'nix_api_util.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
headers = files(
'nix_api_util.h',
@ -54,7 +55,7 @@ this_library = library(
config_priv_h,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,6 +1,6 @@
# Public headers directory
include_dirs = [include_directories('../../..')]
include_dirs = [ include_directories('../../..') ]
headers = files(
'characterization.hh',

View file

@ -1,4 +1,6 @@
project('nix-util-test-support', 'cpp',
project(
'nix-util-test-support',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -14,8 +16,7 @@ cxx = meson.get_compiler('cpp')
subdir('nix-meson-build-support/deps-lists')
deps_private_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = [
dependency('nix-util'),
dependency('nix-util-c'),
@ -44,7 +45,7 @@ this_library = library(
include_directories : include_dirs,
# TODO: Remove `-lrapidcheck` when https://github.com/emil-e/rapidcheck/pull/326
# is available. See also ../libutil/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
prelink : true, # For C++ static initializers
install : true,
)

View file

@ -1,4 +1,6 @@
project('nix-util-tests', 'cpp',
project(
'nix-util-tests',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -19,8 +21,7 @@ deps_private_maybe_subproject = [
dependency('nix-util-c'),
dependency('nix-util-test-support'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -76,7 +77,7 @@ sources = files(
'xml-writer.cc',
)
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
@ -86,7 +87,7 @@ this_exe = executable(
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
# TODO: -lrapidcheck, see ../libutil-support/build.meson
link_args: linker_export_flags + ['-lrapidcheck'],
link_args : linker_export_flags + [ '-lrapidcheck' ],
# get main from gtest
install : true,
)
@ -95,7 +96,7 @@ test(
meson.project_name(),
this_exe,
env : {
'_NIX_TEST_UNIT_DATA': meson.current_source_dir() / 'data',
'_NIX_TEST_UNIT_DATA' : meson.current_source_dir() / 'data',
},
protocol : 'gtest',
)

View file

@ -4,5 +4,4 @@ include_dirs += include_directories('../..')
headers += files(
'freebsd-jail.hh',
# hack for trailing newline
)

View file

@ -1,6 +1,5 @@
sources += files(
'freebsd-jail.cc',
# hack for trailing newline
)
subdir('include/nix/util')

View file

@ -5,5 +5,4 @@ include_dirs += include_directories('../..')
headers += files(
'cgroup.hh',
'linux-namespaces.hh',
# hack for trailing newline
)

View file

@ -1,7 +1,6 @@
sources += files(
'cgroup.cc',
'linux-namespaces.cc',
# hack for trailing newline
)
subdir('include/nix/util')

View file

@ -1,4 +1,6 @@
project('nix-util', 'cpp',
project(
'nix-util',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -16,10 +18,8 @@ subdir('nix-meson-build-support/deps-lists')
configdata = configuration_data()
deps_private_maybe_subproject = [
]
deps_public_maybe_subproject = [
]
deps_private_maybe_subproject = []
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
# Check for each of these functions, and create a define like `#define
@ -34,7 +34,7 @@ check_funcs = [
foreach funcspec : check_funcs
define_name = 'HAVE_' + funcspec[0].underscorify().to_upper()
define_value = cxx.has_function(funcspec[0]).to_int()
configdata.set(define_name, define_value, description: funcspec[1])
configdata.set(define_name, define_value, description : funcspec[1])
endforeach
subdir('nix-meson-build-support/libatomic')
@ -45,21 +45,21 @@ if host_machine.system() == 'windows'
elif host_machine.system() == 'sunos'
socket = cxx.find_library('socket')
network_service_library = cxx.find_library('nsl')
deps_other += [socket, network_service_library]
deps_other += [ socket, network_service_library ]
endif
blake3 = dependency(
'libblake3',
version: '>= 1.8.2',
version : '>= 1.8.2',
method : 'pkg-config',
)
deps_private += blake3
boost = dependency(
'boost',
modules : ['context', 'coroutine', 'iostreams', 'url'],
include_type: 'system',
version: '>=1.82.0'
modules : [ 'context', 'coroutine', 'iostreams', 'url' ],
include_type : 'system',
version : '>=1.82.0',
)
# boost is a public dependency, but not a pkg-config dependency unfortunately, so we
# put in `deps_other`.
@ -93,7 +93,12 @@ cpuid_required = get_option('cpuid')
if host_machine.cpu_family() != 'x86_64' and cpuid_required.enabled()
warning('Force-enabling seccomp on non-x86_64 does not make sense')
endif
cpuid = dependency('libcpuid', 'cpuid', version : '>= 0.7.0', required : cpuid_required)
cpuid = dependency(
'libcpuid',
'cpuid',
version : '>= 0.7.0',
required : cpuid_required,
)
configdata.set('HAVE_LIBCPUID', cpuid.found().to_int())
deps_private += cpuid
@ -109,7 +114,7 @@ config_priv_h = configure_file(
subdir('nix-meson-build-support/common')
sources = [config_priv_h] + files(
sources = [ config_priv_h ] + files(
'archive.cc',
'args.cc',
'base-n.cc',
@ -117,8 +122,8 @@ sources = [config_priv_h] + files(
'canon-path.cc',
'compression.cc',
'compute-levels.cc',
'configuration.cc',
'config-global.cc',
'configuration.cc',
'current-process.cc',
'english.cc',
'environment-variables.cc',
@ -137,8 +142,8 @@ sources = [config_priv_h] + files(
'logging.cc',
'memory-source-accessor.cc',
'mounted-source-accessor.cc',
'position.cc',
'pos-table.cc',
'position.cc',
'posix-source-accessor.cc',
'references.cc',
'serialise.cc',
@ -146,8 +151,8 @@ sources = [config_priv_h] + files(
'signature/signer.cc',
'source-accessor.cc',
'source-path.cc',
'subdir-source-accessor.cc',
'strings.cc',
'subdir-source-accessor.cc',
'suggestions.cc',
'tarfile.cc',
'tee-logger.cc',
@ -190,10 +195,10 @@ this_library = library(
sources,
dependencies : deps_public + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
prelink : true, # For C++ static initializers
install : true,
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
install_headers(headers, subdir : 'nix/util', preserve_path : true)
@ -202,7 +207,7 @@ libraries_private = []
if host_machine.system() == 'windows'
# `libraries_private` cannot contain ad-hoc dependencies (from
# `find_library), so we need to do this manually
libraries_private += ['-lws2_32']
libraries_private += [ '-lws2_32' ]
endif
subdir('nix-meson-build-support/export')

View file

@ -1,5 +1,7 @@
# vim: filetype=meson
option('cpuid', type : 'feature',
option(
'cpuid',
type : 'feature',
description : 'determine microarchitecture levels with libcpuid (only relevant on x86_64)',
)

View file

@ -5,7 +5,7 @@ configdata_unix = configuration_data()
configdata_unix.set(
'HAVE_DECL_AT_SYMLINK_NOFOLLOW',
cxx.has_header_symbol('fcntl.h', 'AT_SYMLINK_NOFOLLOW').to_int(),
description : 'Optionally used for changing the files and symlinks.'
description : 'Optionally used for changing the files and symlinks.',
)
# Check for each of these functions, and create a define like `#define
@ -39,7 +39,7 @@ check_funcs_unix = [
foreach funcspec : check_funcs_unix
define_name = 'HAVE_' + funcspec[0].underscorify().to_upper()
define_value = cxx.has_function(funcspec[0]).to_int()
configdata_unix.set(define_name, define_value, description: funcspec[1])
configdata_unix.set(define_name, define_value, description : funcspec[1])
endforeach
config_unix_priv_h = configure_file(

View file

@ -6,5 +6,4 @@ headers += files(
'signals-impl.hh',
'windows-async-pipe.hh',
'windows-error.hh',
# hack for trailing newline
)

View file

@ -1,4 +1,6 @@
project('nix', 'cpp',
project(
'nix',
'cpp',
version : files('.version'),
default_options : [
'cpp_std=c++2a',
@ -26,8 +28,7 @@ deps_private_maybe_subproject = [
dependency('nix-main'),
dependency('nix-cmd'),
]
deps_public_maybe_subproject = [
]
deps_public_maybe_subproject = []
subdir('nix-meson-build-support/subprojects')
subdir('nix-meson-build-support/export-all-symbols')
@ -57,10 +58,9 @@ config_priv_h = configure_file(
subdir('nix-meson-build-support/common')
subdir('nix-meson-build-support/generate-header')
nix_sources = [config_priv_h] + files(
nix_sources = [ config_priv_h ] + files(
'add-to-store.cc',
'app.cc',
'self-exe.cc',
'build.cc',
'bundle.cc',
'cat.cc',
@ -96,6 +96,7 @@ nix_sources = [config_priv_h] + files(
'repl.cc',
'run.cc',
'search.cc',
'self-exe.cc',
'sigs.cc',
'store-copy-log.cc',
'store-delete.cc',
@ -177,16 +178,16 @@ if host_machine.system() != 'windows'
]
endif
include_dirs = [include_directories('.')]
include_dirs = [ include_directories('.') ]
this_exe = executable(
meson.project_name(),
sources,
dependencies : deps_private_subproject + deps_private + deps_other,
include_directories : include_dirs,
link_args: linker_export_flags,
link_args : linker_export_flags,
install : true,
cpp_pch : do_pch ? ['pch/precompiled-headers.hh'] : []
cpp_pch : do_pch ? [ 'pch/precompiled-headers.hh' ] : [],
)
meson.override_find_program('nix', this_exe)
@ -217,15 +218,15 @@ foreach linkname : nix_symlinks
pointing_to : fs.name(this_exe),
install_dir : get_option('bindir'),
# The 'runtime' tag is what executables default to, which we want to emulate here.
install_tag : 'runtime'
install_tag : 'runtime',
)
custom_target(
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
output: linkname + executable_suffix,
command : [ 'ln', '-sf', fs.name(this_exe), '@OUTPUT@' ],
output : linkname + executable_suffix,
# native doesn't allow dangling symlinks, but the target executable often doesn't exist at this time
env : { 'MSYS' : 'winsymlinks:lnk' },
env : {'MSYS' : 'winsymlinks:lnk'},
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
build_by_default : true,
)
# TODO(Ericson3214): Doesn't yet work
#meson.override_find_program(linkname, t)
@ -233,19 +234,19 @@ endforeach
install_symlink(
'build-remote',
pointing_to : '..' / '..'/ get_option('bindir') / fs.name(this_exe),
pointing_to : '..' / '..' / get_option('bindir') / fs.name(this_exe),
install_dir : get_option('libexecdir') / fs.name(this_exe),
# The 'runtime' tag is what executables default to, which we want to emulate here.
install_tag : 'runtime'
install_tag : 'runtime',
)
custom_target(
command: ['ln', '-sf', fs.name(this_exe), '@OUTPUT@'],
output: 'build-remote' + executable_suffix,
command : [ 'ln', '-sf', fs.name(this_exe), '@OUTPUT@' ],
output : 'build-remote' + executable_suffix,
# native doesn't allow dangling symlinks, but the target executable often doesn't exist at this time
env : { 'MSYS' : 'winsymlinks:lnk' },
env : {'MSYS' : 'winsymlinks:lnk'},
# TODO(Ericson2314): Don't do this once we have the `meson.override_find_program` working)
build_by_default: true
build_by_default : true,
)
# TODO(Ericson3214): Doesn't yet work
#meson.override_find_program(linkname, t)

View file

@ -1,6 +1,9 @@
# vim: filetype=meson
# A relative path means it gets appended to prefix.
option('profile-dir', type : 'string', value : 'etc/profile.d',
option(
'profile-dir',
type : 'string',
value : 'etc/profile.d',
description : 'the path to install shell profile files',
)

View file

@ -34,7 +34,7 @@ nix_perl_store_cc = custom_target(
'Store.cc',
output : 'Store.cc',
input : nix_perl_store_xs,
command : [xsubpp, '@INPUT@', '-output', '@OUTPUT@'],
command : [ xsubpp, '@INPUT@', '-output', '@OUTPUT@' ],
)
# Build Nix::Store Library
@ -42,7 +42,7 @@ nix_perl_store_cc = custom_target(
nix_perl_store_lib = library(
'Store',
sources : nix_perl_store_cc,
name_prefix : '',
name_prefix : '',
prelink : true, # For C++ static initializers
install : true,
install_mode : 'rwxr-xr-x',
@ -56,5 +56,5 @@ nix_perl_store_lib = library(
install_data(
nix_perl_scripts,
install_mode : 'rw-r--r--',
install_dir : join_paths(nix_perl_install_dir,'Nix'),
install_dir : join_paths(nix_perl_install_dir, 'Nix'),
)

View file

@ -4,7 +4,7 @@
# init project
#============================================================================
project (
project(
'nix-perl',
'cpp',
version : files('.version'),
@ -65,7 +65,7 @@ yath = find_program('yath', required : false)
# Required Libraries
#-------------------------------------------------
bzip2_dep = dependency('bzip2', required: false)
bzip2_dep = dependency('bzip2', required : false)
if not bzip2_dep.found()
bzip2_dep = cpp.find_library('bz2')
if not bzip2_dep.found()
@ -87,15 +87,36 @@ nix_store_dep = dependency('nix-store')
# the perl bindings does not appear to be possible.
#-------------------------------------------------
perl_archname = run_command(
perl, '-e', 'use Config; print $Config{archname};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{archname};',
check : true,
).stdout()
perl_version = run_command(
perl, '-e', 'use Config; print $Config{version};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{version};',
check : true,
).stdout()
perl_archlibexp = run_command(
perl, '-e', 'use Config; print $Config{archlibexp};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{archlibexp};',
check : true,
).stdout()
perl_site_libdir = run_command(
perl, '-e', 'use Config; print $Config{installsitearch};', check: true).stdout()
perl,
'-e',
'use Config; print $Config{installsitearch};',
check : true,
).stdout()
nix_perl_install_dir = join_paths(
libdir, 'perl5', 'site_perl', perl_version, perl_archname)
libdir,
'perl5',
'site_perl',
perl_version,
perl_archname,
)
# print perl hints for logs
@ -110,10 +131,11 @@ message('Assumed Nix-Perl install dir: @0@'.format(nix_perl_install_dir))
#-------------------------------------------------
perl_check_dbi = run_command(
perl,
'-e', 'use DBI; use DBD::SQLite;',
'-e',
'use DBI; use DBD::SQLite;',
'-I@0@'.format(get_option('dbi_path')),
'-I@0@'.format(get_option('dbd_sqlite_path')),
check: true
check : true,
)
if perl_check_dbi.returncode() == 2
@ -128,10 +150,11 @@ endif
#-------------------------------------------------
perl_dep = declare_dependency(
dependencies : cpp.find_library(
'perl',
has_headers : [
join_paths(perl_archlibexp, 'CORE', 'perl.h'),
join_paths(perl_archlibexp, 'CORE', 'EXTERN.h')],
'perl',
has_headers : [
join_paths(perl_archlibexp, 'CORE', 'perl.h'),
join_paths(perl_archlibexp, 'CORE', 'EXTERN.h'),
],
dirs : [
join_paths(perl_archlibexp, 'CORE'),
],
@ -166,8 +189,8 @@ if get_option('tests').enabled()
test(
'nix-perl-test',
yath,
args : ['test'],
args : [ 'test' ],
workdir : meson.current_build_dir(),
depends : [nix_perl_store_lib],
depends : [ nix_perl_store_lib ],
)
endif

View file

@ -9,7 +9,8 @@ option(
'tests',
type : 'feature',
value : 'disabled',
description : 'run nix-perl tests')
description : 'run nix-perl tests',
)
# Location of Perl Modules
@ -18,10 +19,12 @@ option(
'dbi_path',
type : 'string',
value : '/usr',
description : 'path to perl::dbi')
description : 'path to perl::dbi',
)
option(
'dbd_sqlite_path',
type : 'string',
value : '/usr',
description : 'path to perl::dbd-SQLite')
description : 'path to perl::dbd-SQLite',
)

View file

@ -7,7 +7,6 @@
nix_perl_tests = files(
'init.t',
# hack for trailing newline
)