From 4fd7a30a36cfd6e72a05b8f7bd4178e62d12f582 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 15 Feb 2008 13:42:24 +0000 Subject: [PATCH] Improve Lout package: improved directory layout, and documentation is now installed. svn path=/nixpkgs/trunk/; revision=10708 --- pkgs/tools/typesetting/lout/builder.sh | 32 +++++++++++++++++++++---- pkgs/tools/typesetting/lout/default.nix | 3 ++- pkgs/top-level/all-packages.nix | 2 +- 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/pkgs/tools/typesetting/lout/builder.sh b/pkgs/tools/typesetting/lout/builder.sh index 8f8febad125..28788fc5227 100755 --- a/pkgs/tools/typesetting/lout/builder.sh +++ b/pkgs/tools/typesetting/lout/builder.sh @@ -1,18 +1,42 @@ #!/bin/sh # Prepare a makefile specifying the appropriate output directories. +# +# Written by Ludovic Courtès . source "$stdenv/setup" || exit 1 nixMakefile="nix-makefile" +# Build and install documentation, PS and PDF. +installDoc () +{ + echo "building and installing documentation..." + for doc in design expert slides user + do + echo "building \`$doc' document..." + if [ ! -f "doc/$doc/outfile.ps" ] + then + ( PATH="$PWD:$PATH" ; \ + cd "doc/$doc" && lout -r4 -o outfile.ps all ) \ + || return 1 + fi + cp "doc/$doc/outfile.ps" "$out/doc/lout/$doc.ps" && \ + ps2pdf "doc/$doc/outfile.ps" "$out/doc/lout/$doc.pdf" + done + + return 0 +} + unpackPhase && \ cd lout-*.* && \ cat makefile | \ sed -e "s|^PREFIX[[:blank:]]*=.*\$|PREFIX = $out|g ; \ - s|^LOUTLIBDIR[[:blank:]]*=.*$|LOUTLIBDIR = \$(PREFIX)/include|g ; \ - s|^LOUTDOCDIR[[:blank:]]*=.*$|LOUTDOCDIR = \$(PREFIX)/doc|g ; \ + s|^LOUTLIBDIR[[:blank:]]*=.*$|LOUTLIBDIR = \$(PREFIX)/lib/lout|g ; \ + s|^LOUTDOCDIR[[:blank:]]*=.*$|LOUTDOCDIR = \$(PREFIX)/doc/lout|g ; \ s|^MANDIR[[:blank:]]*=.*$|MANDIR = \$(PREFIX)/man|g" \ > "$nixMakefile" && \ -mkdir -p "$out/bin" && \ -make -f "$nixMakefile" install +mkdir -p "$out/bin" && mkdir -p "$out/lib" \ +mkdir -p "$out/man" && mkdir -p "$out/doc/lout" && \ +make -f "$nixMakefile" install installman && \ +installDoc diff --git a/pkgs/tools/typesetting/lout/default.nix b/pkgs/tools/typesetting/lout/default.nix index 0758b7dfb7c..e36cc9ad303 100644 --- a/pkgs/tools/typesetting/lout/default.nix +++ b/pkgs/tools/typesetting/lout/default.nix @@ -1,4 +1,4 @@ -{stdenv, fetchurl}: +{stdenv, fetchurl, ghostscript}: stdenv.mkDerivation { name = "lout-3.36"; @@ -7,6 +7,7 @@ stdenv.mkDerivation { sha256 = "b689cbe12074be8817c90070b162593fc9cc51f2f8868701833ff599b24fd4ad"; }; + buildInputs = [ ghostscript ]; builder = ./builder.sh; meta = { diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index d3912d7a817..bdd577092ea 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -656,7 +656,7 @@ rec { }; lout = import ../tools/typesetting/lout { - inherit fetchurl stdenv; + inherit fetchurl stdenv ghostscript; }; lzma = import ../tools/compression/lzma {