From 95863b258bde3ec11d9688e35454e523571ac17d Mon Sep 17 00:00:00 2001 From: Qyriad Date: Sat, 10 Aug 2024 10:59:58 -0600 Subject: =?UTF-8?q?build:=20build=20lix-doc=20with=20Meson!=20=F0=9F=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit lix-doc is now built with Meson, with lix-doc's dependencies built as Meson subprojects, either fetched on demand with .wrap files, or fetched in advance by Nix with importCargoLock. It even builds statically. Fixes #256. Co-authored-by: Lunaphied Co-authored-by: Jade Lovelace Change-Id: I3a4731ff13278e7117e0316bc0d7169e85f5eb0c --- meson.build | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'meson.build') diff --git a/meson.build b/meson.build index cf1b877f9..4711e0087 100644 --- a/meson.build +++ b/meson.build @@ -30,6 +30,14 @@ # FIXME: This hack should be removed when https://git.lix.systems/lix-project/lix/issues/359 # is fixed. # +# lix-doc is built with Meson in lix-doc/meson.build, and linked into libcmd in +# src/libcmd/meson.build. When building outside the Nix sandbox, Meson will use the .wrap +# files in subprojects/ to download and extract the dependency crates into subprojects/. +# When building inside the Nix sandbox, Lix's derivation in package.nix uses a +# fixed-output derivation to fetch those crates in advance instead, and then symlinks +# them into subprojects/ with the same names that Meson uses when downloading them +# itself -- perfect for --wrap-mode=nodownload, which mesonConfigurePhase uses. +# # Unit tests are setup in tests/unit/meson.build, under the test suite "check". # # Functional tests are a bit more complicated. Generally they're defined in @@ -38,10 +46,11 @@ # be placed in specific directories' meson.build files to create the right directory tree # in the build directory. -project('lix', 'cpp', +project('lix', 'cpp', 'rust', version : run_command('bash', '-c', 'echo -n $(jq -r .version < ./version.json)$VERSION_SUFFIX', check : true).stdout().strip(), default_options : [ 'cpp_std=c++2a', + 'rust_std=2021', # TODO(Qyriad): increase the warning level 'warning_level=1', 'debug=true', @@ -322,13 +331,6 @@ pegtl = dependency( nlohmann_json = dependency('nlohmann_json', required : true, include_type : 'system') -# lix-doc is a Rust project provided via buildInputs and unfortunately doesn't have any way to be detected. -# Just declare it manually to resolve this. -# -# FIXME: build this with meson in the future after we drop Make (with which we -# *absolutely* are not going to make it work) -lix_doc = declare_dependency(link_args : [ '-llix_doc' ]) - if is_freebsd libprocstat = declare_dependency(link_args : [ '-lprocstat' ]) endif @@ -552,6 +554,7 @@ if is_darwin ) endif +subdir('lix-doc') subdir('src') subdir('scripts') subdir('misc') -- cgit v1.2.3