Files
lix/lix/libutil/meson.build
T
eldritch horrors 020ea8c8fc libutil: add async base header
currently this header only contains TRY_AWAIT, and it's public version
LIX_TRY_AWAIT. the former is for use in our cpp files only, the latter
may be used anywhere. we don't expose TRY_AWAIT unconditionally due to
it not being namespaced according to usual rules of macro naming, i.e.
exposing it may litter user macro namespaces unnecessarily. hiding our
internal version is achieved using a new define that's not set through
pkg-config or other means. (we could also add a private header that we
simply do not install, but that gets rather messy rather very quickly)

Change-Id: I372b1a414487dd03cfbfc620b3148a6c6e56ca3f
2025-01-23 17:21:23 +00:00

346 lines
8.4 KiB
Meson

libutil_sources = files(
'archive.cc',
'args.cc',
'canon-path.cc',
'cgroup.cc',
'compression.cc',
'compute-levels.cc',
'config.cc',
'current-process.cc',
'deprecated-features.cc',
'english.cc',
'environment-variables.cc',
'error.cc',
'escape-char.cc',
'escape-string.cc',
'exit.cc',
'experimental-features.cc',
'file-descriptor.cc',
'file-system.cc',
'fmt.cc',
'git.cc',
'hash.cc',
'hilite.cc',
'json-utils.cc',
'logging.cc',
'mount.cc',
'namespaces.cc',
'position.cc',
'print-elided.cc',
'processes.cc',
'references.cc',
'regex.cc',
'serialise.cc',
'shlex.cc',
'signals.cc',
'source-path.cc',
'strings.cc',
'suggestions.cc',
'tarfile.cc',
'terminal.cc',
'thread-name.cc',
'thread-pool.cc',
'unix-domain-socket.cc',
'url.cc',
'url-name.cc',
'users.cc',
'xml-writer.cc',
)
libutil_headers = files(
'apply-config-options.hh',
'abstract-setting-to-json.hh',
'ansicolor.hh',
'archive.hh',
'args/root.hh',
'args.hh',
'async-collect.hh',
'async.hh',
'async-semaphore.hh',
'backed-string-view.hh',
'box_ptr.hh',
'canon-path.hh',
'cgroup.hh',
'charptr-cast.hh',
'checked-arithmetic.hh',
'chunked-vector.hh',
'closure.hh',
'comparator.hh',
'compression.hh',
'compute-levels.hh',
'concepts.hh',
'config-impl.hh',
'config.hh',
'current-process.hh',
'deprecated-features.hh',
'deprecated-features-json.hh',
'english.hh',
'environment-variables.hh',
'error.hh',
'escape-char.hh',
'escape-string.hh',
'exit.hh',
'experimental-features.hh',
'experimental-features-json.hh',
'file-descriptor.hh',
'file-system.hh',
'finally.hh',
'fmt.hh',
'generator.hh',
'git.hh',
'hash.hh',
'hilite.hh',
'input-accessor.hh',
'json-impls.hh',
'json-utils.hh',
'logging.hh',
'logging-json.hh',
'lru-cache.hh',
'monitor-fd.hh',
'mount.hh',
'namespaces.hh',
'notifying-counter.hh',
'pool.hh',
'position.hh',
'print-elided.hh',
'processes.hh',
'ref.hh',
'references.hh',
'regex-combinators.hh',
'regex.hh',
'repair-flag.hh',
'result.hh',
'serialise.hh',
'shlex.hh',
'signals.hh',
'source-path.hh',
'split.hh',
'strings.hh',
'suggestions.hh',
'sync.hh',
'tarfile.hh',
'terminal.hh',
'thread-name.hh',
'thread-pool.hh',
'topo-sort.hh',
'types.hh',
'unix-domain-socket.hh',
'url-parts.hh',
'url-name.hh',
'url.hh',
'users.hh',
'variant-wrapper.hh',
'xml-writer.hh',
)
experimental_feature_definitions = files(
'experimental-features/auto-allocate-uids.md',
'experimental-features/ca-derivations.md',
'experimental-features/cgroups.md',
'experimental-features/daemon-trust-override.md',
'experimental-features/dynamic-derivations.md',
'experimental-features/fetch-closure.md',
'experimental-features/flakes.md',
'experimental-features/impure-derivations.md',
'experimental-features/nix-command.md',
'experimental-features/no-url-literals.md',
'experimental-features/parse-toml-timestamps.md',
'experimental-features/pipe-operator.md',
'experimental-features/read-only-local-store.md',
'experimental-features/recursive-nix.md',
'experimental-features/repl-automation.md',
'experimental-features/repl-flake.md',
)
deprecated_feature_definitions = files(
'deprecated-features/ancient-let.md',
'deprecated-features/rec-set-overrides.md',
'deprecated-features/url-literals.md',
'deprecated-features/shadow-internal-symbols.md',
)
experimental_features_gen = custom_target(
command : [
python.full_path(),
'@SOURCE_ROOT@/lix/code-generation/build_experimental_features.py',
'--header', '@OUTPUT0@',
'--impl-header', '@OUTPUT1@',
'--shortlist', '@OUTPUT2@',
'--descriptions', '@OUTPUT3@',
'@INPUT@',
],
input : experimental_feature_definitions,
output : [
'experimental-features.gen.inc',
'experimental-features-impl.gen.inc',
'experimental-features-shortlist.md',
'experimental-feature-descriptions.md',
],
install : true,
install_dir: [
includedir / 'lix/libutil',
false,
false,
false,
],
)
experimental_features_header = experimental_features_gen[0]
experimental_features_impl_header = experimental_features_gen[1]
experimental_features_shortlist_md = experimental_features_gen[2]
experimental_feature_descriptions_md = experimental_features_gen[3]
deprecated_features_gen = custom_target(
command : [
python.full_path(),
'@SOURCE_ROOT@/lix/code-generation/build_experimental_features.py',
'--deprecated',
'--header', '@OUTPUT0@',
'--impl-header', '@OUTPUT1@',
'--shortlist', '@OUTPUT2@',
'--descriptions', '@OUTPUT3@',
'@INPUT@',
],
input : deprecated_feature_definitions,
output : [
'deprecated-features.gen.inc',
'deprecated-features-impl.gen.inc',
'deprecated-features-shortlist.md',
'deprecated-feature-descriptions.md',
],
install : true,
install_dir: [
includedir / 'lix/libutil',
false,
false,
false
],
)
deprecated_features_header = deprecated_features_gen[0]
deprecated_features_impl_header = deprecated_features_gen[1]
deprecated_features_shortlist_md = deprecated_features_gen[2]
deprecated_feature_descriptions_md = deprecated_features_gen[3]
libutil_settings_headers = []
archive_setting_definitions = files(
'archive-settings/preallocate-contents.md',
'archive-settings/use-case-hack.md',
)
libutil_settings_headers += custom_target(
command : [
python.full_path(),
'@SOURCE_ROOT@/lix/code-generation/build_settings.py',
'--kernel', host_machine.system(),
'--header', '@OUTPUT@',
'--experimental-features', '@SOURCE_ROOT@/lix/libutil/experimental-features',
'@INPUT@',
],
input : archive_setting_definitions,
output : 'archive-settings.gen.inc',
)
feature_setting_definitions = files(
'feature-settings/deprecated-features.md',
'feature-settings/experimental-features.md',
)
libutil_settings_headers += custom_target(
command : [
python.full_path(),
'@SOURCE_ROOT@/lix/code-generation/build_settings.py',
'--kernel', host_machine.system(),
'--header', '@OUTPUT@',
'--experimental-features', '@SOURCE_ROOT@/lix/libutil/experimental-features',
'@INPUT@',
],
input : feature_setting_definitions,
output : 'feature-settings.gen.inc',
install : true,
install_dir : includedir / 'lix/libutil',
)
logging_setting_definitions = files(
'logging-settings/show-trace.md',
)
libutil_settings_headers += custom_target(
command : [
python.full_path(),
'@SOURCE_ROOT@/lix/code-generation/build_settings.py',
'--kernel', host_machine.system(),
'--header', '@OUTPUT@',
'--experimental-features', '@SOURCE_ROOT@/lix/libutil/experimental-features',
'@INPUT@',
],
input : logging_setting_definitions,
output : 'logging-settings.gen.inc',
install : true,
install_dir : includedir / 'lix/libutil',
)
libutil = library(
'lixutil',
libutil_sources,
experimental_features_header,
experimental_features_impl_header,
deprecated_features_header,
deprecated_features_impl_header,
libutil_settings_headers,
dependencies : [
aws_sdk,
aws_s3,
boehm,
boost,
cpuid,
seccomp,
libarchive,
brotli,
openssl,
nlohmann_json,
],
include_directories : [ '../..' ],
cpp_pch : cpp_pch,
implicit_include_directories : true,
install : true,
)
install_headers(libutil_headers, subdir : 'lix/libutil', preserve_path : true)
# 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(
input : 'lix-util.pc.in',
output : 'lix-util.pc',
install_dir : libdir / 'pkgconfig',
configuration : {
'prefix' : prefix,
'libdir' : libdir,
'includedir' : includedir,
'PACKAGE_VERSION' : meson.project_version(),
},
)
# Used by libstore and libfetchers.
liblixutil = declare_dependency(
include_directories : include_directories('../..'),
sources : [
experimental_features_header,
deprecated_features_header,
libutil_settings_headers,
],
link_with : libutil
)
# FIXME: remove when https://git.lix.systems/lix-project/lix/issues/359 is fixed.
if is_static
liblixutil_mstatic = declare_dependency(
include_directories : include_directories('../..'),
sources : [
experimental_features_header,
deprecated_features_header,
libutil_settings_headers,
],
link_whole : libutil,
)
else
liblixutil_mstatic = liblixutil
endif