1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 02:21:16 +02:00

Port C API docs to Meson (#10936)

* Port C API docs to Meson

* don't cross-compile the docs
This commit is contained in:
Valentin Gagarin 2024-06-19 22:43:54 +02:00 committed by GitHub
parent 0c6029669d
commit 1c131ec2b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 131 additions and 68 deletions

View file

@ -20,7 +20,6 @@
, git
, gtest
, jq
, doxygen
, libarchive
, libcpuid
, libgit2
@ -53,8 +52,7 @@
, versionSuffix ? ""
, officialRelease ? false
# Whether to build Nix. Useful to skip for tasks like (a) just
# generating API docs or (b) testing existing pre-built versions of Nix
# Whether to build Nix. Useful to skip for tasks like testing existing pre-built versions of Nix
, doBuild ? true
# Run the unit tests as part of the build. See `installUnitTests` for an
@ -93,10 +91,6 @@
# - readline
, readlineFlavor ? if stdenv.hostPlatform.isWindows then "readline" else "editline"
# Whether to build the external API docs, can be done separately from
# everything else.
, enableExternalAPIDocs ? forDevShell
# Whether to install unit tests. This is useful when cross compiling
# since we cannot run them natively during the build, but can do so
# later.
@ -184,13 +178,6 @@ in {
./scripts/local.mk
] ++ lib.optionals buildUnitTests [
./doc/manual
] ++ lib.optionals enableExternalAPIDocs [
./doc/external-api
] ++ lib.optionals enableExternalAPIDocs [
# Source might not be compiled, but still must be available
# for Doxygen to gather comments.
(fileset.difference ./src ./src/perl)
./tests/unit
] ++ lib.optionals buildUnitTests [
./tests/unit
] ++ lib.optionals doInstallCheck [
@ -204,7 +191,7 @@ in {
++ lib.optional doBuild "dev"
# If we are doing just build or just docs, the one thing will use
# "out". We only need additional outputs if we are doing both.
++ lib.optional (doBuild && (enableManual || enableExternalAPIDocs)) "doc"
++ lib.optional (doBuild && enableManual) "doc"
++ lib.optional installUnitTests "check"
++ lib.optional doCheck "testresults"
;
@ -228,7 +215,6 @@ in {
] ++ lib.optionals (doInstallCheck || enableManual) [
jq # Also for custom mdBook preprocessor.
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
++ lib.optional enableExternalAPIDocs doxygen
;
buildInputs = lib.optionals doBuild [
@ -291,7 +277,6 @@ in {
(lib.enableFeature doBuild "build")
(lib.enableFeature buildUnitTests "unit-tests")
(lib.enableFeature doInstallCheck "functional-tests")
(lib.enableFeature enableExternalAPIDocs "external-api-docs")
(lib.enableFeature enableManual "doc-gen")
(lib.enableFeature enableGC "gc")
(lib.enableFeature enableMarkdown "markdown")
@ -319,8 +304,7 @@ in {
mkdir $testresults
'';
installTargets = lib.optional doBuild "install"
++ lib.optional enableExternalAPIDocs "external-api-html";
installTargets = lib.optional doBuild "install";
installFlags = "sysconfdir=$(out)/etc";
@ -344,9 +328,6 @@ in {
) + lib.optionalString enableManual ''
mkdir -p ''${!outputDoc}/nix-support
echo "doc manual ''${!outputDoc}/share/doc/nix/manual" >> ''${!outputDoc}/nix-support/hydra-build-products
'' + lib.optionalString enableExternalAPIDocs ''
mkdir -p ''${!outputDoc}/nix-support
echo "doc external-api-docs $out/share/doc/nix/external-api/html" >> ''${!outputDoc}/nix-support/hydra-build-products
'';
# So the check output gets links for DLLs in the out output.