Commit d4a7ecf4 authored by Ian Lynagh's avatar Ian Lynagh

Obey DESTDIR when installing library docs

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