mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-25 15:26:17 +02:00
C API: fix documentation build
This commit is contained in:
parent
41f1669dea
commit
55601963b3
3 changed files with 22 additions and 7 deletions
|
@ -1,19 +1,19 @@
|
||||||
.PHONY: external-api-html
|
.PHONY: external-api-html
|
||||||
|
|
||||||
ifeq ($(internal_api_docs), yes)
|
ifeq ($(external_api_docs), yes)
|
||||||
|
|
||||||
$(docdir)/external-api/html/index.html $(docdir)/external-api/latex: $(d)/doxygen.cfg
|
$(docdir)/external-api/html/index.html $(docdir)/external-api/latex: $(d)/doxygen.cfg
|
||||||
mkdir -p $(docdir)/external-api
|
mkdir -p $(docdir)/external-api
|
||||||
{ cat $< ; echo "OUTPUT_DIRECTORY=$(docdir)/external-api" ; } | doxygen -
|
{ cat $< ; echo "OUTPUT_DIRECTORY=$(docdir)/external-api" ; } | doxygen -
|
||||||
|
|
||||||
# Generate the HTML API docs for Nix's unstable internal interfaces.
|
# Generate the HTML API docs for Nix's unstable external interfaces.
|
||||||
external-api-html: $(docdir)/external-api/html/index.html
|
external-api-html: $(docdir)/external-api/html/index.html
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
# Make a nicer error message
|
# Make a nicer error message
|
||||||
external-api-html:
|
external-api-html:
|
||||||
@echo "Internal API docs are disabled. Configure with '--enable-external-api-docs', or avoid calling 'make external-api-html'."
|
@echo "External API docs are disabled. Configure with '--enable-external-api-docs', or avoid calling 'make external-api-html'."
|
||||||
@exit 1
|
@exit 1
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -285,6 +285,13 @@
|
||||||
enableInternalAPIDocs = true;
|
enableInternalAPIDocs = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# API docs for Nix's C bindings.
|
||||||
|
external-api-docs = nixpkgsFor.x86_64-linux.native.callPackage ./package.nix {
|
||||||
|
inherit fileset;
|
||||||
|
doBuild = false;
|
||||||
|
enableExternalAPIDocs = true;
|
||||||
|
};
|
||||||
|
|
||||||
# System tests.
|
# System tests.
|
||||||
tests = import ./tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
tests = import ./tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
||||||
|
|
||||||
|
|
16
package.nix
16
package.nix
|
@ -5,6 +5,7 @@
|
||||||
, autoreconfHook
|
, autoreconfHook
|
||||||
, aws-sdk-cpp
|
, aws-sdk-cpp
|
||||||
, boehmgc
|
, boehmgc
|
||||||
|
, buildPackages
|
||||||
, nlohmann_json
|
, nlohmann_json
|
||||||
, bison
|
, bison
|
||||||
, boost
|
, boost
|
||||||
|
@ -91,9 +92,10 @@
|
||||||
# - readline
|
# - readline
|
||||||
, readlineFlavor ? if stdenv.hostPlatform.isWindows then "readline" else "editline"
|
, readlineFlavor ? if stdenv.hostPlatform.isWindows then "readline" else "editline"
|
||||||
|
|
||||||
# Whether to build the internal API docs, can be done separately from
|
# Whether to build the internal/external API docs, can be done separately from
|
||||||
# everything else.
|
# everything else.
|
||||||
, enableInternalAPIDocs ? false
|
, enableInternalAPIDocs ? false
|
||||||
|
, enableExternalAPIDocs ? false
|
||||||
|
|
||||||
# Whether to install unit tests. This is useful when cross compiling
|
# Whether to install unit tests. This is useful when cross compiling
|
||||||
# since we cannot run them natively during the build, but can do so
|
# since we cannot run them natively during the build, but can do so
|
||||||
|
@ -199,7 +201,7 @@ in {
|
||||||
++ lib.optional doBuild "dev"
|
++ lib.optional doBuild "dev"
|
||||||
# If we are doing just build or just docs, the one thing will use
|
# 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.
|
# "out". We only need additional outputs if we are doing both.
|
||||||
++ lib.optional (doBuild && (enableManual || enableInternalAPIDocs)) "doc"
|
++ lib.optional (doBuild && (enableManual || enableInternalAPIDocs || enableExternalAPIDocs)) "doc"
|
||||||
++ lib.optional installUnitTests "check";
|
++ lib.optional installUnitTests "check";
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
|
@ -221,7 +223,7 @@ in {
|
||||||
] ++ lib.optionals (doInstallCheck || enableManual) [
|
] ++ lib.optionals (doInstallCheck || enableManual) [
|
||||||
jq # Also for custom mdBook preprocessor.
|
jq # Also for custom mdBook preprocessor.
|
||||||
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
] ++ lib.optional stdenv.hostPlatform.isLinux util-linux
|
||||||
++ lib.optional enableInternalAPIDocs doxygen
|
++ lib.optional (enableInternalAPIDocs || enableExternalAPIDocs) doxygen
|
||||||
;
|
;
|
||||||
|
|
||||||
buildInputs = lib.optionals doBuild [
|
buildInputs = lib.optionals doBuild [
|
||||||
|
@ -285,6 +287,7 @@ in {
|
||||||
(lib.enableFeature buildUnitTests "unit-tests")
|
(lib.enableFeature buildUnitTests "unit-tests")
|
||||||
(lib.enableFeature doInstallCheck "functional-tests")
|
(lib.enableFeature doInstallCheck "functional-tests")
|
||||||
(lib.enableFeature enableInternalAPIDocs "internal-api-docs")
|
(lib.enableFeature enableInternalAPIDocs "internal-api-docs")
|
||||||
|
(lib.enableFeature enableExternalAPIDocs "external-api-docs")
|
||||||
(lib.enableFeature enableManual "doc-gen")
|
(lib.enableFeature enableManual "doc-gen")
|
||||||
(lib.enableFeature enableGC "gc")
|
(lib.enableFeature enableGC "gc")
|
||||||
(lib.enableFeature enableMarkdown "markdown")
|
(lib.enableFeature enableMarkdown "markdown")
|
||||||
|
@ -309,7 +312,8 @@ in {
|
||||||
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
|
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
|
||||||
|
|
||||||
installTargets = lib.optional doBuild "install"
|
installTargets = lib.optional doBuild "install"
|
||||||
++ lib.optional enableInternalAPIDocs "internal-api-html";
|
++ lib.optional enableInternalAPIDocs "internal-api-html"
|
||||||
|
++ lib.optional enableExternalAPIDocs "external-api-html";
|
||||||
|
|
||||||
installFlags = "sysconfdir=$(out)/etc";
|
installFlags = "sysconfdir=$(out)/etc";
|
||||||
|
|
||||||
|
@ -336,6 +340,10 @@ in {
|
||||||
'' + lib.optionalString enableInternalAPIDocs ''
|
'' + lib.optionalString enableInternalAPIDocs ''
|
||||||
mkdir -p ''${!outputDoc}/nix-support
|
mkdir -p ''${!outputDoc}/nix-support
|
||||||
echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> ''${!outputDoc}/nix-support/hydra-build-products
|
echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> ''${!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.
|
# So the check output gets links for DLLs in the out output.
|
||||||
|
|
Loading…
Reference in a new issue