aboutsummaryrefslogtreecommitdiff
path: root/package.nix
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-04-11 12:17:19 -0600
committerQyriad <qyriad@qyriad.me>2024-04-15 19:05:07 -0600
commitb81eec6ed56e5a5ad448359fc3d7755b68e59d0b (patch)
treeeb8655a9f1447ae3c5fe5ae73cae7c2b9340b3b2 /package.nix
parent99845e0e01eaa2120b10c22591c43c4305f5ba51 (diff)
build internal API docs with Meson
This commit adds the capability for building the Doxygen internal API docs in the Meson buildsystem, and also makes doing so the default for the internal-api-docs hydra job. Aside from the /nix-support directory, which differed only by the hash part of a store path, the outputs of hydraJobs.internal-api-docs before and after this commit were bit-for-bit identical on my machine. Change-Id: I98f0017891c25b06866c15f7652fe74f706ec8e1
Diffstat (limited to 'package.nix')
-rw-r--r--package.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/package.nix b/package.nix
index e1d3cfcd5..aab98c0ae 100644
--- a/package.nix
+++ b/package.nix
@@ -178,9 +178,15 @@ stdenv.mkDerivation (finalAttrs: {
dontBuild = false;
# FIXME(Qyriad): see if this is still needed once the migration to Meson is completed.
- mesonFlags = lib.optionals (buildWithMeson && stdenv.hostPlatform.isLinux) [
- "-Dsandbox-shell=${lib.getBin busybox-sandbox-shell}/bin/busybox"
- ];
+ mesonFlags =
+ lib.optionals (buildWithMeson && stdenv.hostPlatform.isLinux) [
+ "-Dsandbox-shell=${lib.getBin busybox-sandbox-shell}/bin/busybox"
+ ]
+ ++ lib.optional (finalAttrs.dontBuild) "-Denable-build=false"
+ # mesonConfigurePhase automatically passes -Dauto_features=enabled,
+ # so we must explicitly enable or disable features that we are not passing
+ # dependencies for.
+ ++ lib.singleton (lib.mesonEnable "internal-api-docs" internalApiDocs);
# We only include CMake so that Meson can locate toml11, which only ships CMake dependency metadata.
dontUseCmakeConfigure = true;
@@ -209,7 +215,7 @@ stdenv.mkDerivation (finalAttrs: {
]
++ lib.optional stdenv.hostPlatform.isLinux util-linuxMinimal
++ lib.optional (!officialRelease && buildUnreleasedNotes) build-release-notes
- ++ lib.optional internalApiDocs doxygen
+ ++ lib.optional (internalApiDocs || forDevShell) doxygen
++ lib.optionals buildWithMeson [
meson
ninja
@@ -236,6 +242,7 @@ stdenv.mkDerivation (finalAttrs: {
libseccomp
busybox-sandbox-shell
]
+ ++ lib.optional internalApiDocs rapidcheck
++ lib.optional stdenv.hostPlatform.isx86_64 libcpuid
# There have been issues building these dependencies
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) aws-sdk-cpp-nix
@@ -313,6 +320,13 @@ stdenv.mkDerivation (finalAttrs: {
installFlags = "sysconfdir=$(out)/etc";
+ # Make sure the internal API docs are already built, because mesonInstallPhase
+ # won't let us build them there. They would normally be built in buildPhase,
+ # but the internal API docs are conventionally built with doBuild = false.
+ preInstall = lib.optional (buildWithMeson && internalApiDocs) ''
+ meson ''${mesonBuildFlags:-} compile "$installTargets"
+ '';
+
postInstall =
lib.optionalString (!finalAttrs.dontBuild) ''
mkdir -p $doc/nix-support