Skip to content

Commit

Permalink
Merge #2589
Browse files Browse the repository at this point in the history
2589: Release docs pdf on hydra r=coot a=jbgi



Co-authored-by: Jean-Baptiste Giraudeau <jean-baptiste.giraudeau@iohk.io>
  • Loading branch information
iohk-bors[bot] and jbgi authored Sep 4, 2020
2 parents eb58177 + e8afe15 commit 65be742
Show file tree
Hide file tree
Showing 5 changed files with 65 additions and 5 deletions.
2 changes: 1 addition & 1 deletion default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ let
};

self = {
inherit haskellPackages;
inherit haskellPackages docs;

inherit (haskellPackages.ouroboros-network.identifier) version;

Expand Down
8 changes: 4 additions & 4 deletions docs/network-spec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ all: $(DOCNAME).pdf
# -interaction=nonstopmode keeps the pdflatex backend from stopping at a
# missing file reference and interactively asking you for an alternative.

$(DOCNAME).pdf: $(DOCNAME).tex messages.cddl
latexmk -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode" -use-make $(DOCNAME).tex
$(DOCNAME).pdf: $(DOCNAME).tex ../../ouroboros-network/test/messages.cddl
latexmk -bibtex -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode" -use-make $(DOCNAME).tex

watch: network.tex miniprotocols.tex messages.cddl
latexmk -pvc -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode" -use-make $(DOCNAME).tex
watch: network.tex miniprotocols.tex ../../ouroboros-network/test/messages.cddl
latexmk -bibtex -pvc -pdf -pdflatex="pdflatex -synctex=1 -interaction=nonstopmode" -use-make $(DOCNAME).tex

clean:
latexmk -CA
Expand Down
1 change: 1 addition & 0 deletions docs/shell.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
(import ../nix {}).docs
57 changes: 57 additions & 0 deletions nix/docs.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
{ pkgs }: with pkgs;
let
src = haskell-nix.haskellLib.cleanGit {
name = "ouroboros-network-docs-src";
src = ../.;
subDir = "docs";
};
message-cddl = ../ouroboros-network/test/messages.cddl;
in pkgs.runCommand "ouroboros-network-docs" {
nativeBuildInputs = [ imagemagick ];
buildInputs = [ (texlive.combine {
inherit (texlive)
cleveref
framed
scheme-small
collection-fontsrecommended
stmaryrd kpfonts geometry hyperref
todonotes
amsmath mathtools
colortbl polytable lazylist
fancyvrb
#graphicx
pstricks
wrapfig
# build tools
latexmk
;
})];
} ''
for d in network-design network-spec; do
mkdir -p docs/$d
ln -s ${src}/$d/* docs/$d/
done
mkdir -p ouroboros-network/test
cp ${message-cddl} ouroboros-network/test/messages.cddl
mkdir -p $out
(
cd docs/network-design
latexmk -pdf -pdflatex="pdflatex -interaction=nonstopmode"
cp -a *.pdf $out/
)
(
cd docs/network-spec
make all
cp -a *.pdf $out/
)
mkdir -p $out/nix-support
for pdf in $out/*.pdf; do
echo "file binary-dist $pdf" >> $out/nix-support/hydra-build-products
done
''
2 changes: 2 additions & 0 deletions nix/pkgs.nix
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ pkgs: _: with pkgs; {
buildPackages
;
};

docs = callPackages ./docs.nix {};
}

0 comments on commit 65be742

Please sign in to comment.