0
0
Fork 0
mirror of https://github.com/NixOS/nixpkgs.git synced 2025-07-13 21:50:33 +03:00

Merge pull request #206775 from SuperSandro2000/runCommand-nativeBuildInputs

This commit is contained in:
Sandro 2022-12-25 21:42:05 +01:00 committed by GitHub
commit 5af3f865e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 46 additions and 33 deletions

View file

@ -93,15 +93,19 @@ let
in rec {
inherit optionsNix;
optionsAsciiDoc = pkgs.runCommand "options.adoc" {} ''
${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \
optionsAsciiDoc = pkgs.runCommand "options.adoc" {
nativeBuildInputs = [ pkgs.python3Minimal ];
} ''
python ${./generateDoc.py} \
--format asciidoc \
${optionsJSON}/share/doc/nixos/options.json \
> $out
'';
optionsCommonMark = pkgs.runCommand "options.md" {} ''
${pkgs.python3Minimal}/bin/python ${./generateDoc.py} \
optionsCommonMark = pkgs.runCommand "options.md" {
nativeBuildInputs = [ pkgs.python3Minimal ];
} ''
python ${./generateDoc.py} \
--format commonmark \
${optionsJSON}/share/doc/nixos/options.json \
> $out
@ -153,16 +157,20 @@ in rec {
# Convert options.json into an XML file.
# The actual generation of the xml file is done in nix purely for the convenience
# of not having to generate the xml some other way
optionsXML = pkgs.runCommand "options.xml" {} ''
optionsXML = pkgs.runCommand "options.xml" {
nativeBuildInputs = with pkgs; [ nix ];
} ''
export NIX_STORE_DIR=$TMPDIR/store
export NIX_STATE_DIR=$TMPDIR/state
${pkgs.nix}/bin/nix-instantiate \
nix-instantiate \
--eval --xml --strict ${./optionsJSONtoXML.nix} \
--argstr file ${optionsJSON}/share/doc/nixos/options.json \
> "$out"
'';
optionsDocBook = pkgs.runCommand "options-docbook.xml" {} ''
optionsDocBook = pkgs.runCommand "options-docbook.xml" {
nativeBuildInputs = with pkgs; [ libxslt.bin libxslt.bin python3Minimal ];
} ''
optionsXML=${optionsXML}
if grep /nixpkgs/nixos/modules $optionsXML; then
echo "The manual appears to depend on the location of Nixpkgs, which is bad"
@ -172,14 +180,14 @@ in rec {
exit 1
fi
${pkgs.python3Minimal}/bin/python ${./sortXML.py} $optionsXML sorted.xml
${pkgs.libxslt.bin}/bin/xsltproc \
python ${./sortXML.py} $optionsXML sorted.xml
xsltproc \
--stringparam documentType '${documentType}' \
--stringparam revision '${revision}' \
--stringparam variablelistId '${variablelistId}' \
--stringparam optionIdPrefix '${optionIdPrefix}' \
-o intermediate.xml ${./options-to-docbook.xsl} sorted.xml
${pkgs.libxslt.bin}/bin/xsltproc \
xsltproc \
-o "$out" ${./postprocess-option-descriptions.xsl} intermediate.xml
'';
}