diff --git a/.travis.yml b/.travis.yml index 11c6fd0f..6e882cc1 100644 --- a/.travis.yml +++ b/.travis.yml @@ -7,6 +7,7 @@ jobs: env: TARGET=linux-exe - env: TARGET=windows-exe - env: TARGET=static-exe + - env: TARGET=book - stage: Package env: TARGET=release-zip diff --git a/book/conf.py b/book/conf.py index 29cf49e0..f71edb57 100644 --- a/book/conf.py +++ b/book/conf.py @@ -12,11 +12,11 @@ # General information about the project. project = u'Das tttool-Buch' -copyright = u'2017, Joachim Breitner' +copyright = u'2019, Joachim Breitner' author = u'Joachim Breitner' -version = u'1.7.0' -release = u'1.7.0' +version = u'1.8.1' +release = version language = 'de' diff --git a/nix/default.nix b/nix/default.nix index ec12d5ee..2592c82f 100644 --- a/nix/default.nix +++ b/nix/default.nix @@ -64,27 +64,79 @@ in rec { contrib = ../contrib; + book = + let + sphinx-env = pkgs.python.withPackages(ps: [ + ps.sphinx + ps.recommonmark + ]); + tex = pkgs.texlive.combine { + inherit (pkgs.texlive) + scheme-basic latexmk cmap collection-fontsrecommended + fncychap titlesec tabulary varwidth framed fancyvrb float parskip + wrapfig upquote capt-of needspace; + }; + in + pkgs.stdenv.mkDerivation { + name = "tttool-book"; + + buildInputs = [ sphinx-env tex ]; + + src = builtins.path { + path = ../book; + name = "book"; + filter = path: type: + baseNameOf path != "_build" && + baseNameOf path != ".gitignore"; + }; + + buildPhase = '' + source ${pkgs.stdenv}/setup + make html + make latexpdf + rm -f _build/html/.buildinfo + rm -rf _build/html/_sources + ''; + + installPhase = '' + mkdir -p $out/ + mv _build/html $out/book.html + mv _build/latex/tttool.pdf $out/book.pdf + ''; + }; + release = pkgs.stdenv.mkDerivation { name = "tttool-release"; - buildInputs = [ static-exe ]; + buildInputs = [ pkgs.perl ]; builder = pkgs.writeScript "create-tttool-release.sh" '' source ${pkgs.stdenv}/setup + # check version + version=$(${static-exe}/bin/tttool --help|perl -ne 'print $1 if /tttool-(.*) -- The swiss army knife/') + doc_version=$(perl -ne "print \$1 if /VERSION: '(.*)'/" ${book}/book.html/_static/documentation_options.js) + + if [ "$version" != "$doc_version" ] + then + echo "Mismatch between tttool version \"$version\" and book version \"$doc_version\"" + exit 1 + fi + mkdir -p $out/ cp -vsr ${static-files}/* $out - cp -v ${static-exe}/bin/tttool $out/ - cp -v ${windows-exe}/bin/tttool.exe $out/ + cp -vs ${static-exe}/bin/tttool $out/ + cp -vs ${windows-exe}/bin/tttool.exe $out/ mkdir -p $out/contrib - cp -vr ${contrib}/* $out/contrib/ + cp -vsr ${contrib}/* $out/contrib/ + cp -vsr ${book}/* $out ''; }; release-zip = pkgs.stdenv.mkDerivation { name = "tttool-release.zip"; - buildInputs = [ release pkgs.perl pkgs.zip ]; + buildInputs = [ pkgs.perl pkgs.zip ]; builder = pkgs.writeScript "zip-tttool-release.sh" '' source ${pkgs.stdenv}/setup