Commit 7f4b8d9b authored by Ian Lynagh's avatar Ian Lynagh

Put docs into versioned directory names; fixes trac #3532

You can now have multiple versions of a package installed, and
gen_contents_index will do the right thing.
parent ebaa8c99
...@@ -817,6 +817,8 @@ ifneq "$(INSTALL_LIBRARY_DOCS)" "" ...@@ -817,6 +817,8 @@ ifneq "$(INSTALL_LIBRARY_DOCS)" ""
for i in $(INSTALL_LIBRARY_DOCS); do \ for i in $(INSTALL_LIBRARY_DOCS); do \
$(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \ $(INSTALL_DOC) $(INSTALL_OPTS) $$i "$(DESTDIR)$(docdir)/html/libraries/"; \
done done
$(INSTALL_DATA) $(INSTALL_OPTS) libraries/prologue.txt "$(DESTDIR)$(docdir)/html/libraries/"
$(INSTALL_SCRIPT) $(INSTALL_OPTS) libraries/gen_contents_index "$(DESTDIR)$(docdir)/html/libraries/"
endif endif
ifneq "$(INSTALL_HTML_DOC_DIRS)" "" ifneq "$(INSTALL_HTML_DOC_DIRS)" ""
for i in $(INSTALL_HTML_DOC_DIRS); do \ for i in $(INSTALL_HTML_DOC_DIRS); do \
......
...@@ -3,28 +3,35 @@ ...@@ -3,28 +3,35 @@
set -e set -e
HADDOCK_ARGS= HADDOCK_ARGS=
NAMES=
case $* in case $* in
--inplace) --inplace)
HADDOCK=../inplace/bin/haddock HADDOCK=../inplace/bin/haddock
HADDOCK_FILES=`ls -1 */dist-install/doc/html/*/*.haddock | sort` HADDOCK_FILES1=`ls -1 */dist-install/doc/html/*/*.haddock | sort`
HADDOCK_FILES="$HADDOCK_FILES `ls -1 dph/*/dist-install/doc/html/*/*.haddock | sort`" HADDOCK_FILES2=`ls -1 dph/*/dist-install/doc/html/*/*.haddock | sort`
HADDOCK_FILES="$HADDOCK_FILES1 $HADDOCK_FILES2"
for HADDOCK_FILE in $HADDOCK_FILES
do
LIBPATH=`echo "$HADDOCK_FILE" | sed 's#/dist-install.*##'`
NAME=`echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##'`
VERSION=`grep -i '^version:' $LIBPATH/$NAME.cabal | sed 's/.*[ \t]//'`
HADDOCK_ARG="--read-interface=${NAME}-${VERSION},$HADDOCK_FILE"
HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
done
;; ;;
*) *)
HADDOCK=../../../../bin/haddock HADDOCK=../../../../../bin/haddock
# We don't want the GHC API to swamp the index # We don't want the GHC API to swamp the index
HADDOCK_FILES=`ls -1 */*.haddock | grep -v "ghc/" | sort` HADDOCK_FILES=`ls -1 */*.haddock | grep -v '/ghc\.haddock' | sort`
for HADDOCK_FILE in $HADDOCK_FILES
do
NAME_VERSION=`echo "$HADDOCK_FILE" | sed 's#/.*##'`
HADDOCK_ARG="--read-interface=${NAME_VERSION},$HADDOCK_FILE"
HADDOCK_ARGS="$HADDOCK_ARGS $HADDOCK_ARG"
done
;; ;;
esac esac
for HADDOCK_FILE in $HADDOCK_FILES
do
NAME=` echo "$HADDOCK_FILE" | sed 's#.*/##' | sed 's#\.haddock$##' `
HADDOCK_ARGS="$HADDOCK_ARGS --read-interface=$NAME,$HADDOCK_FILE"
NAMES="$NAMES $NAME"
done
# Now create the combined contents and index pages # Now create the combined contents and index pages
$HADDOCK --gen-index --gen-contents -o . \ $HADDOCK --gen-index --gen-contents -o . \
-t "Haskell Hierarchical Libraries" \ -t "Haskell Hierarchical Libraries" \
......
...@@ -198,8 +198,8 @@ doInstall ghc ghcpkg strip topdir directory distDir ...@@ -198,8 +198,8 @@ doInstall ghc ghcpkg strip topdir directory distDir
libsubdir = toPathTemplate "$pkgid", libsubdir = toPathTemplate "$pkgid",
docdir = toPathTemplate $ docdir = toPathTemplate $
if relocatableBuild if relocatableBuild
then "$topdir/$pkg" then "$topdir/$pkgid"
else (myDocdir </> "$pkg"), else (myDocdir </> "$pkgid"),
htmldir = toPathTemplate "$docdir" htmldir = toPathTemplate "$docdir"
} }
progs = withPrograms lbi progs = withPrograms lbi
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment