aboutsummaryrefslogtreecommitdiff
path: root/package.nix
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-04-17 21:48:25 +0000
committerGerrit Code Review <gerrit@lix>2024-04-17 21:48:25 +0000
commitcf0744ceed3b70114ea7b832ae0d02b72d2abfe5 (patch)
treefbc826574b7dc531469adec302269da20b9815da /package.nix
parent6d79aa3d70a65b9eba2982325a8b6d149cbef453 (diff)
parentb81eec6ed56e5a5ad448359fc3d7755b68e59d0b (diff)
Merge "build internal API docs with Meson" into main
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