Commit d4a7ecf4 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

Obey DESTDIR when installing library docs

parent 9b8b293b
......@@ -298,15 +298,17 @@ endif
.PHONY: install install-docs install.library.%
DESTlibraryhtmldir = $(DESTDIR)$(libraryhtmldir)/html
install: $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR))
ifeq "$(HADDOCK_DOCS)" "YES"
$(INSTALL_DIR) $(libraryhtmldir)/html
$(INSTALL_DATA) index.html doc-index.html $(libraryhtmldir)/html
$(INSTALL_SCRIPT) gen_contents_index $(libraryhtmldir)/html
$(INSTALL_DIR) $(DESTlibraryhtmldir)
$(INSTALL_DATA) index.html doc-index.html $(DESTlibraryhtmldir)
$(INSTALL_SCRIPT) gen_contents_index $(DESTlibraryhtmldir)
# Hacks:
$(INSTALL_DATA) $(libraryhtmldir)/html/base/*.css $(libraryhtmldir)/html
$(INSTALL_DATA) $(libraryhtmldir)/html/base/*.js $(libraryhtmldir)/html
$(INSTALL_DATA) $(libraryhtmldir)/html/base/*.gif $(libraryhtmldir)/html
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.css $(DESTlibraryhtmldir)
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.js $(DESTlibraryhtmldir)
$(INSTALL_DATA) $(DESTlibraryhtmldir)/base/*.gif $(DESTlibraryhtmldir)
endif
# Cabal doesn't let us ask to install docs only, so do nothing here
......@@ -320,7 +322,7 @@ $(foreach SUBDIR,$(SUBDIRS),install.library.$(SUBDIR)): \
install.library.%: installPackage/installPackage ifBuildable/ifBuildable
if ifBuildable/ifBuildable $*; then \
cd $* && \
../installPackage/installPackage $(DESTDIR)$(prefix) $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace $(DESTDIR)$(libdir)/package.conf; \
../installPackage/installPackage $(DESTDIR) $(prefix) $(FPTOOLS_TOP_ABS)/$(GHC_PKG_DIR_REL)/ghc-pkg-inplace $(DESTDIR)$(libdir)/package.conf; \
fi
.PHONY: binary-dist binary-dist.library.%
......
......@@ -11,7 +11,7 @@ import System.Environment
main :: IO ()
main = do args <- getArgs
case args of
pref : ghcpkg : ghcpkgconf : args' ->
destdir : pref : ghcpkg : ghcpkgconf : args' ->
let verbosity = case args' of
[] -> normal
['-':'v':v] ->
......@@ -20,14 +20,14 @@ main = do args <- getArgs
_ -> Just v
in flagToVerbosity m
_ -> error ("Bad arguments: " ++ show args)
in doit pref ghcpkg ghcpkgconf verbosity
in doit destdir pref ghcpkg ghcpkgconf verbosity
_ ->
error "Missing arguments"
doit :: FilePath -> FilePath -> FilePath -> Verbosity -> IO ()
doit pref ghcpkg ghcpkgconf verbosity =
doit :: FilePath -> FilePath -> FilePath -> FilePath -> Verbosity -> IO ()
doit destdir pref ghcpkg ghcpkgconf verbosity =
do let userHooks = simpleUserHooks
copyFlags = (emptyCopyFlags NoCopyDest) {
copyFlags = (emptyCopyFlags (CopyTo destdir)) {
copyVerbose = verbosity
}
registerFlags = emptyRegisterFlags {
......
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