aboutsummaryrefslogtreecommitdiff
path: root/package.nix
diff options
context:
space:
mode:
authorQyriad <qyriad@qyriad.me>2024-03-08 21:09:11 -0700
committerQyriad <qyriad@qyriad.me>2024-03-11 04:26:35 -0600
commitb072c069b741d5939baf0350d53392197da3b2d7 (patch)
tree744ceb3324177b2398e8afb484341ebc9f9f2109 /package.nix
parent4ad3446311de5fc7a1f254dcda7634126d87435c (diff)
package: migrate internal-api-docs
Change-Id: I344d73a412c2c6e4bb2eb14bd4859056324f1ba7
Diffstat (limited to 'package.nix')
-rw-r--r--package.nix53
1 files changed, 33 insertions, 20 deletions
diff --git a/package.nix b/package.nix
index a6933b0ab..73e887d8d 100644
--- a/package.nix
+++ b/package.nix
@@ -13,6 +13,7 @@
brotli,
bzip2,
curl,
+ doxygen,
editline,
fileset,
flex,
@@ -42,6 +43,7 @@
officialRelease ? true,
# Set to true to build the release notes for the next release.
buildUnreleasedNotes ? false,
+ internalApiDocs ? false,
# Not a real argument, just the only way to approximate let-binding some
# stuff for argument defaults.
@@ -62,6 +64,13 @@
"RAPIDCHECK_HEADERS=${lib.getDev rapidcheck}/extras/gtest/include"
];
+ # The internal API docs need these for the build, but if we're not building
+ # Nix itself, then these don't need to be propagated.
+ maybePropagatedInputs = [
+ boehmgc
+ nlohmann_json
+ ];
+
# .gitignore has already been processed, so any changes in it are irrelevant
# at this point. It is not represented verbatim for test purposes because
# that would interfere with repo semantics.
@@ -98,7 +107,7 @@ in stdenv.mkDerivation (finalAttrs: {
topLevelBuildFiles
functionalTestFiles
./unit-test-data
- ] ++ lib.optionals (!finalAttrs.dontBuild) [
+ ] ++ lib.optionals (!finalAttrs.dontBuild || internalApiDocs) [
./boehmgc-coroutine-sp-fallback.diff
./doc
./misc
@@ -132,7 +141,9 @@ in stdenv.mkDerivation (finalAttrs: {
mercurial
jq
] ++ lib.optional stdenv.hostPlatform.isLinux util-linuxMinimal
- ++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d;
+ ++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d
+ ++ lib.optional internalApiDocs doxygen
+ ;
buildInputs = [
curl
@@ -153,6 +164,7 @@ in stdenv.mkDerivation (finalAttrs: {
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) aws-sdk-cpp-nix
# FIXME(Qyriad): This is how the flake.nix version does it, but this is cursed.
++ lib.optionals (finalAttrs.doCheck) finalAttrs.passthru._checkInputs
+ ++ lib.optionals (finalAttrs.dontBuild) maybePropagatedInputs
;
passthru._checkInputs = [
@@ -163,10 +175,7 @@ in stdenv.mkDerivation (finalAttrs: {
# FIXME(Qyriad): remove at the end of refactoring.
checkInputs = finalAttrs.passthru._checkInputs;
- propagatedBuildInputs = [
- boehmgc
- nlohmann_json
- ];
+ propagatedBuildInputs = lib.optionals (!finalAttrs.dontBuild) maybePropagatedInputs;
disallowedReferences = [
boost
@@ -198,10 +207,13 @@ in stdenv.mkDerivation (finalAttrs: {
] ++ [ "--sysconfdir=/etc" ]
++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell"
++ [ (lib.enableFeature finalAttrs.doCheck "tests") ]
- ++ lib.optionals finalAttrs.doCheck testConfigureFlags
+ ++ lib.optionals (finalAttrs.doCheck || internalApiDocs) testConfigureFlags
++ lib.optional (!canRunInstalled) "--disable-doc-gen"
+ ++ [ (lib.enableFeature internalApiDocs "internal-api-docs") ]
;
+ installTargets = lib.optional internalApiDocs "internal-api-html";
+
enableParallelBuilding = true;
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
@@ -210,19 +222,20 @@ in stdenv.mkDerivation (finalAttrs: {
installFlags = "sysconfdir=$(out)/etc";
- postInstall = ''
- mkdir -p $doc/nix-support
- echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
- ${lib.optionalString stdenv.hostPlatform.isStatic ''
- mkdir -p $out/nix-support
- echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
- ''}
- ${lib.optionalString stdenv.isDarwin ''
- install_name_tool \
- -change ${boost}/lib/libboost_context.dylib \
- $out/lib/libboost_context.dylib \
- $out/lib/libnixutil.dylib
- ''}
+ postInstall = lib.optionalString (!finalAttrs.dontBuild) ''
+ mkdir -p $doc/nix-support
+ echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
+ '' + lib.optionalString stdenv.hostPlatform.isStatic ''
+ mkdir -p $out/nix-support
+ echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
+ '' + lib.optionalString stdenv.isDarwin ''
+ install_name_tool \
+ -change ${boost}/lib/libboost_context.dylib \
+ $out/lib/libboost_context.dylib \
+ $out/lib/libnixutil.dylib
+ '' + lib.optionalString internalApiDocs ''
+ mkdir -p $out/nix-support
+ echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> "$out/nix-support/hydra-build-products"
'';
doInstallCheck = finalAttrs.doCheck;