build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
parser_tab = custom_target(
|
|
|
|
input : 'parser.y',
|
|
|
|
output : [
|
|
|
|
'parser-tab.cc',
|
|
|
|
'parser-tab.hh',
|
|
|
|
],
|
|
|
|
command : [
|
|
|
|
'bison',
|
|
|
|
'-v',
|
|
|
|
'-o',
|
|
|
|
'@OUTPUT0@',
|
|
|
|
'@INPUT@',
|
|
|
|
'-d',
|
|
|
|
],
|
|
|
|
# NOTE(Qyriad): Meson doesn't support installing only part of a custom target, so we add
|
|
|
|
# an install script below which removes parser-tab.cc.
|
|
|
|
install : true,
|
2024-05-17 00:04:05 +00:00
|
|
|
install_dir : includedir / 'lix/libexpr',
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
lexer_tab = custom_target(
|
|
|
|
input : [
|
|
|
|
'lexer.l',
|
|
|
|
parser_tab,
|
|
|
|
],
|
|
|
|
output : [
|
|
|
|
'lexer-tab.cc',
|
|
|
|
'lexer-tab.hh',
|
|
|
|
],
|
|
|
|
command : [
|
|
|
|
'flex',
|
|
|
|
'--outfile',
|
|
|
|
'@OUTPUT0@',
|
|
|
|
'--header-file=' + '@OUTPUT1@',
|
|
|
|
'@INPUT0@',
|
|
|
|
],
|
|
|
|
# NOTE(Qyriad): Meson doesn't support installing only part of a custom target, so we add
|
|
|
|
# an install script below which removes lexer-tab.cc.
|
|
|
|
install : true,
|
2024-05-17 00:04:05 +00:00
|
|
|
install_dir : includedir / 'lix/libexpr',
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
# TODO(Qyriad): When the parser and lexer are rewritten this should be removed.
|
|
|
|
# NOTE(Qyriad): We do this this way instead of an inline bash or rm command
|
|
|
|
# due to subtleties in Meson. Check the comments in cleanup-install.bash for details.
|
|
|
|
meson.add_install_script(
|
|
|
|
bash,
|
|
|
|
meson.project_source_root() / 'meson/cleanup-install.bash',
|
|
|
|
'@0@'.format(includedir),
|
|
|
|
)
|
|
|
|
|
2024-03-29 01:37:14 +00:00
|
|
|
libexpr_generated_headers = [
|
|
|
|
gen_header.process('primops/derivation.nix', preserve_path_from : meson.current_source_dir()),
|
|
|
|
]
|
|
|
|
foreach header : [ 'imported-drv-to-derivation.nix', 'fetchurl.nix' ]
|
|
|
|
libexpr_generated_headers += custom_target(
|
|
|
|
command : [ 'bash', '-c', 'echo \'R"__NIX_STR(\' | cat - @INPUT@ && echo \')__NIX_STR"\'' ],
|
|
|
|
input : header,
|
|
|
|
output : '@PLAINNAME@.gen.hh',
|
|
|
|
capture : true,
|
|
|
|
install : true,
|
2024-05-17 00:04:05 +00:00
|
|
|
install_dir : includedir / 'lix/libexpr',
|
2024-03-29 01:37:14 +00:00
|
|
|
)
|
|
|
|
endforeach
|
|
|
|
subdir('flake')
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
|
|
|
|
libexpr_sources = files(
|
|
|
|
'attr-path.cc',
|
|
|
|
'attr-set.cc',
|
|
|
|
'eval-cache.cc',
|
|
|
|
'eval-error.cc',
|
|
|
|
'eval-settings.cc',
|
|
|
|
'eval.cc',
|
|
|
|
'function-trace.cc',
|
|
|
|
'get-drvs.cc',
|
|
|
|
'json-to-value.cc',
|
|
|
|
'nixexpr.cc',
|
|
|
|
'paths.cc',
|
|
|
|
'primops.cc',
|
|
|
|
'print-ambiguous.cc',
|
|
|
|
'print.cc',
|
|
|
|
'search-path.cc',
|
|
|
|
'value-to-json.cc',
|
|
|
|
'value-to-xml.cc',
|
|
|
|
'flake/config.cc',
|
|
|
|
'flake/flake.cc',
|
|
|
|
'flake/flakeref.cc',
|
|
|
|
'flake/lockfile.cc',
|
|
|
|
'primops/context.cc',
|
|
|
|
'primops/fetchClosure.cc',
|
|
|
|
'primops/fetchMercurial.cc',
|
|
|
|
'primops/fetchTree.cc',
|
|
|
|
'primops/fromTOML.cc',
|
|
|
|
'value/context.cc',
|
|
|
|
)
|
|
|
|
|
|
|
|
libexpr_headers = files(
|
|
|
|
'attr-path.hh',
|
|
|
|
'attr-set.hh',
|
|
|
|
'eval-cache.hh',
|
|
|
|
'eval-error.hh',
|
|
|
|
'eval-inline.hh',
|
|
|
|
'eval-settings.hh',
|
|
|
|
'eval.hh',
|
|
|
|
'flake/flake.hh',
|
|
|
|
'flake/flakeref.hh',
|
|
|
|
'flake/lockfile.hh',
|
|
|
|
'function-trace.hh',
|
|
|
|
'gc-small-vector.hh',
|
|
|
|
'get-drvs.hh',
|
|
|
|
'json-to-value.hh',
|
|
|
|
'nixexpr.hh',
|
|
|
|
'parser-state.hh',
|
|
|
|
'pos-idx.hh',
|
|
|
|
'pos-table.hh',
|
|
|
|
'primops.hh',
|
|
|
|
'print-ambiguous.hh',
|
|
|
|
'print-options.hh',
|
|
|
|
'print.hh',
|
|
|
|
'repl-exit-status.hh',
|
|
|
|
'search-path.hh',
|
|
|
|
'symbol-table.hh',
|
|
|
|
'value/context.hh',
|
|
|
|
'value-to-json.hh',
|
|
|
|
'value-to-xml.hh',
|
|
|
|
'value.hh',
|
|
|
|
)
|
|
|
|
|
|
|
|
libexpr = library(
|
2024-05-17 00:04:05 +00:00
|
|
|
'lixexpr',
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
libexpr_sources,
|
|
|
|
parser_tab,
|
|
|
|
lexer_tab,
|
2024-03-29 01:37:14 +00:00
|
|
|
libexpr_generated_headers,
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
dependencies : [
|
|
|
|
liblixutil,
|
|
|
|
liblixstore,
|
|
|
|
liblixfetchers,
|
|
|
|
boehm,
|
|
|
|
boost,
|
2024-03-27 02:36:17 +00:00
|
|
|
toml11,
|
2024-03-27 03:09:43 +00:00
|
|
|
nlohmann_json,
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
],
|
|
|
|
# for shared.hh
|
|
|
|
include_directories : [
|
|
|
|
'../libmain',
|
|
|
|
],
|
2024-05-30 20:44:01 +00:00
|
|
|
cpp_pch : ['../pch/precompiled-headers.hh'],
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
install : true,
|
|
|
|
# FIXME(Qyriad): is this right?
|
|
|
|
install_rpath : libdir,
|
|
|
|
)
|
|
|
|
|
|
|
|
install_headers(
|
|
|
|
libexpr_headers,
|
2024-05-17 00:04:05 +00:00
|
|
|
subdir : 'lix/libexpr',
|
build: optionally build and install with meson
This commit adds several meson.build, which successfully build and
install Lix executables, libraries, and headers. Meson does not yet
build docs, Perl bindings, or run tests, which will be added in
following commits. As such, this commit does not remove the existing
build system, or make it the default, and also as such, this commit has
several FIXMEs and TODOs as notes for what should be done before the
existing autoconf + make buildsystem can be removed and Meson made the
default. This commit does not modify any source files.
A Meson-enabled build is also added as a Hydra job, and to
`nix flake check`.
Change-Id: I667c8685b13b7bab91e281053f807a11616ae3d4
2024-03-21 19:41:23 +00:00
|
|
|
preserve_path : true,
|
|
|
|
)
|
|
|
|
|
|
|
|
liblixexpr = declare_dependency(
|
|
|
|
include_directories : include_directories('.'),
|
|
|
|
link_with : libexpr,
|
|
|
|
)
|
2024-03-28 23:42:44 +00:00
|
|
|
|
|
|
|
# FIXME: not using the pkg-config module because it creates way too many deps
|
|
|
|
# while meson migration is in progress, and we want to not include boost here
|
|
|
|
configure_file(
|
2024-05-17 00:04:05 +00:00
|
|
|
input : 'lix-expr.pc.in',
|
|
|
|
output : 'lix-expr.pc',
|
2024-03-28 23:42:44 +00:00
|
|
|
install_dir : libdir / 'pkgconfig',
|
|
|
|
configuration : {
|
|
|
|
'prefix' : prefix,
|
|
|
|
'libdir' : libdir,
|
|
|
|
'includedir' : includedir,
|
|
|
|
'PACKAGE_VERSION' : meson.project_version(),
|
|
|
|
},
|
|
|
|
)
|