1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00
nix/meson.build
Jason Yundt c78676a1de Sometimes build nix-manual when cross compiling
Before this change, if you were cross compiling Nix, then the nix-manual
subproject would never get built. In some situations, it makes sense to
not build the nix-manual subproject when cross compiling. For example,
if the build system is x86_64 and the host system is riscv64, then it
makes sense to not build the manual. Building the manual requires
executing certain build artifacts, and you can’t run x86_64 executables
on riscv64 systems.

That being said, there are some situations where it does make sense to
build the nix-manual subproject when cross compiling. For example, if
the build system is x86_64 and the host system is i686, then it doesn’t
make sense to not build the manual. You can run i686 executables on
x86_64 systems just fine.

This change makes it so that the nix-manual subproject will sometimes
get built when cross compiling. Specifically, the nix-manual subproject
will get built as long as the doc-gen option is enabled and the build
system is capable of running host binaries.

---

The main motivation behind this change is to fix this Nixpkgs issue [1].
Building pkgs.nixStatic counts as cross compiling Nix, and
pkgs.nixStatic is supposed to produce a man output. Building
pkgs.nixStatic currently fails because it isn’t actually producing a man
output. That issue will go away once this commit gets backported to Nix
2.28.x.

[1]: <https://github.com/NixOS/nixpkgs/issues/426410>

(cherry picked from commit 5e407e6abb)
2025-07-26 22:29:20 +00:00

56 lines
1.2 KiB
Meson

# This is just a stub project to include all the others as subprojects
# for development shell purposes
project('nix-dev-shell', 'cpp',
version : files('.version'),
subproject_dir : 'src',
default_options : [
'localstatedir=/nix/var',
]
)
# Internal Libraries
subproject('libutil')
subproject('libstore')
subproject('libfetchers')
subproject('libexpr')
subproject('libflake')
subproject('libmain')
subproject('libcmd')
# Executables
subproject('nix')
# Docs
if get_option('doc-gen')
subproject('internal-api-docs')
subproject('external-api-docs')
if meson.can_run_host_binaries()
subproject('nix-manual')
endif
endif
# External C wrapper libraries
subproject('libutil-c')
subproject('libstore-c')
subproject('libexpr-c')
subproject('libflake-c')
subproject('libmain-c')
# Language Bindings
if get_option('bindings') and not meson.is_cross_build()
subproject('perl')
endif
# Testing
if get_option('unit-tests')
subproject('libutil-test-support')
subproject('libutil-tests')
subproject('libstore-test-support')
subproject('libstore-tests')
subproject('libfetchers-tests')
subproject('libexpr-test-support')
subproject('libexpr-tests')
subproject('libflake-tests')
endif
subproject('nix-functional-tests')