forked from lix-project/lix
package: migrate internal-api-docs
Change-Id: I344d73a412c2c6e4bb2eb14bd4859056324f1ba7
This commit is contained in:
parent
4ad3446311
commit
b072c069b7
41
flake.nix
41
flake.nix
|
@ -421,31 +421,26 @@
|
||||||
dockerImage = lib.genAttrs linux64BitSystems (system: self.packages.${system}.dockerImage);
|
dockerImage = lib.genAttrs linux64BitSystems (system: self.packages.${system}.dockerImage);
|
||||||
|
|
||||||
# API docs for Nix's unstable internal C++ interfaces.
|
# API docs for Nix's unstable internal C++ interfaces.
|
||||||
internal-api-docs =
|
internal-api-docs = let
|
||||||
with nixpkgsFor.x86_64-linux.native;
|
nixpkgs = nixpkgsFor.x86_64-linux.native;
|
||||||
with commonDeps { inherit pkgs; };
|
inherit (nixpkgs) pkgs;
|
||||||
|
comDeps = commonDeps { inherit pkgs; };
|
||||||
|
|
||||||
stdenv.mkDerivation {
|
nix = nixpkgs.pkgs.callPackage ./package.nix {
|
||||||
pname = "nix-internal-api-docs";
|
inherit versionSuffix fileset officialRelease buildUnreleasedNotes;
|
||||||
inherit version;
|
inherit (comDeps) changelog-d;
|
||||||
|
internalApiDocs = true;
|
||||||
src = nixSrc;
|
boehmgc = comDeps.boehmgc-nix;
|
||||||
|
busybox-sandbox-shell = comDeps.sh;
|
||||||
configureFlags = testConfigureFlags ++ internalApiDocsConfigureFlags;
|
|
||||||
|
|
||||||
nativeBuildInputs = nativeBuildDeps;
|
|
||||||
buildInputs = buildDeps ++ propagatedDeps
|
|
||||||
++ awsDeps ++ checkDeps ++ internalApiDocsDeps;
|
|
||||||
|
|
||||||
dontBuild = true;
|
|
||||||
|
|
||||||
installTargets = [ "internal-api-html" ];
|
|
||||||
|
|
||||||
postInstall = ''
|
|
||||||
mkdir -p $out/nix-support
|
|
||||||
echo "doc internal-api-docs $out/share/doc/nix/internal-api/html" >> $out/nix-support/hydra-build-products
|
|
||||||
'';
|
|
||||||
};
|
};
|
||||||
|
in
|
||||||
|
nix.overrideAttrs (prev: {
|
||||||
|
# This Hydra job is just for the internal API docs.
|
||||||
|
# We don't need the build artifacts here.
|
||||||
|
dontBuild = true;
|
||||||
|
doCheck = false;
|
||||||
|
doInstallCheck = false;
|
||||||
|
});
|
||||||
|
|
||||||
# System tests.
|
# System tests.
|
||||||
tests = import ./tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
tests = import ./tests/nixos { inherit lib nixpkgs nixpkgsFor; } // {
|
||||||
|
|
37
package.nix
37
package.nix
|
@ -13,6 +13,7 @@
|
||||||
brotli,
|
brotli,
|
||||||
bzip2,
|
bzip2,
|
||||||
curl,
|
curl,
|
||||||
|
doxygen,
|
||||||
editline,
|
editline,
|
||||||
fileset,
|
fileset,
|
||||||
flex,
|
flex,
|
||||||
|
@ -42,6 +43,7 @@
|
||||||
officialRelease ? true,
|
officialRelease ? true,
|
||||||
# Set to true to build the release notes for the next release.
|
# Set to true to build the release notes for the next release.
|
||||||
buildUnreleasedNotes ? false,
|
buildUnreleasedNotes ? false,
|
||||||
|
internalApiDocs ? false,
|
||||||
|
|
||||||
# Not a real argument, just the only way to approximate let-binding some
|
# Not a real argument, just the only way to approximate let-binding some
|
||||||
# stuff for argument defaults.
|
# stuff for argument defaults.
|
||||||
|
@ -62,6 +64,13 @@
|
||||||
"RAPIDCHECK_HEADERS=${lib.getDev rapidcheck}/extras/gtest/include"
|
"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
|
# .gitignore has already been processed, so any changes in it are irrelevant
|
||||||
# at this point. It is not represented verbatim for test purposes because
|
# at this point. It is not represented verbatim for test purposes because
|
||||||
# that would interfere with repo semantics.
|
# that would interfere with repo semantics.
|
||||||
|
@ -98,7 +107,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
topLevelBuildFiles
|
topLevelBuildFiles
|
||||||
functionalTestFiles
|
functionalTestFiles
|
||||||
./unit-test-data
|
./unit-test-data
|
||||||
] ++ lib.optionals (!finalAttrs.dontBuild) [
|
] ++ lib.optionals (!finalAttrs.dontBuild || internalApiDocs) [
|
||||||
./boehmgc-coroutine-sp-fallback.diff
|
./boehmgc-coroutine-sp-fallback.diff
|
||||||
./doc
|
./doc
|
||||||
./misc
|
./misc
|
||||||
|
@ -132,7 +141,9 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
mercurial
|
mercurial
|
||||||
jq
|
jq
|
||||||
] ++ lib.optional stdenv.hostPlatform.isLinux util-linuxMinimal
|
] ++ lib.optional stdenv.hostPlatform.isLinux util-linuxMinimal
|
||||||
++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d;
|
++ lib.optional (!officialRelease && buildUnreleasedNotes) changelog-d
|
||||||
|
++ lib.optional internalApiDocs doxygen
|
||||||
|
;
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
curl
|
curl
|
||||||
|
@ -153,6 +164,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
++ lib.optional (stdenv.hostPlatform == stdenv.buildPlatform) aws-sdk-cpp-nix
|
++ 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.
|
# 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.doCheck) finalAttrs.passthru._checkInputs
|
||||||
|
++ lib.optionals (finalAttrs.dontBuild) maybePropagatedInputs
|
||||||
;
|
;
|
||||||
|
|
||||||
passthru._checkInputs = [
|
passthru._checkInputs = [
|
||||||
|
@ -163,10 +175,7 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
# FIXME(Qyriad): remove at the end of refactoring.
|
# FIXME(Qyriad): remove at the end of refactoring.
|
||||||
checkInputs = finalAttrs.passthru._checkInputs;
|
checkInputs = finalAttrs.passthru._checkInputs;
|
||||||
|
|
||||||
propagatedBuildInputs = [
|
propagatedBuildInputs = lib.optionals (!finalAttrs.dontBuild) maybePropagatedInputs;
|
||||||
boehmgc
|
|
||||||
nlohmann_json
|
|
||||||
];
|
|
||||||
|
|
||||||
disallowedReferences = [
|
disallowedReferences = [
|
||||||
boost
|
boost
|
||||||
|
@ -198,10 +207,13 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
] ++ [ "--sysconfdir=/etc" ]
|
] ++ [ "--sysconfdir=/etc" ]
|
||||||
++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell"
|
++ lib.optional stdenv.hostPlatform.isStatic "--enable-embedded-sandbox-shell"
|
||||||
++ [ (lib.enableFeature finalAttrs.doCheck "tests") ]
|
++ [ (lib.enableFeature finalAttrs.doCheck "tests") ]
|
||||||
++ lib.optionals finalAttrs.doCheck testConfigureFlags
|
++ lib.optionals (finalAttrs.doCheck || internalApiDocs) testConfigureFlags
|
||||||
++ lib.optional (!canRunInstalled) "--disable-doc-gen"
|
++ lib.optional (!canRunInstalled) "--disable-doc-gen"
|
||||||
|
++ [ (lib.enableFeature internalApiDocs "internal-api-docs") ]
|
||||||
;
|
;
|
||||||
|
|
||||||
|
installTargets = lib.optional internalApiDocs "internal-api-html";
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
|
makeFlags = "profiledir=$(out)/etc/profile.d PRECOMPILE_HEADERS=1";
|
||||||
|
@ -210,19 +222,20 @@ in stdenv.mkDerivation (finalAttrs: {
|
||||||
|
|
||||||
installFlags = "sysconfdir=$(out)/etc";
|
installFlags = "sysconfdir=$(out)/etc";
|
||||||
|
|
||||||
postInstall = ''
|
postInstall = lib.optionalString (!finalAttrs.dontBuild) ''
|
||||||
mkdir -p $doc/nix-support
|
mkdir -p $doc/nix-support
|
||||||
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
|
echo "doc manual $doc/share/doc/nix/manual" >> $doc/nix-support/hydra-build-products
|
||||||
${lib.optionalString stdenv.hostPlatform.isStatic ''
|
'' + lib.optionalString stdenv.hostPlatform.isStatic ''
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
|
echo "file binary-dist $out/bin/nix" >> $out/nix-support/hydra-build-products
|
||||||
''}
|
'' + lib.optionalString stdenv.isDarwin ''
|
||||||
${lib.optionalString stdenv.isDarwin ''
|
|
||||||
install_name_tool \
|
install_name_tool \
|
||||||
-change ${boost}/lib/libboost_context.dylib \
|
-change ${boost}/lib/libboost_context.dylib \
|
||||||
$out/lib/libboost_context.dylib \
|
$out/lib/libboost_context.dylib \
|
||||||
$out/lib/libnixutil.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;
|
doInstallCheck = finalAttrs.doCheck;
|
||||||
|
|
Loading…
Reference in a new issue