From f0d9c465407b798af67a1ffd6c2a6b84b06c09dd Mon Sep 17 00:00:00 2001 From: "Edward Z. Yang" Date: Mon, 22 Aug 2016 16:20:44 -0700 Subject: [PATCH] Document environment variables that can be used to change Paths values. See also #462. Signed-off-by: Edward Z. Yang --- Cabal/Distribution/Simple/Build/PathsModule.hs | 3 +++ Cabal/doc/developing-packages.markdown | 7 +++++++ 2 files changed, 10 insertions(+) diff --git a/Cabal/Distribution/Simple/Build/PathsModule.hs b/Cabal/Distribution/Simple/Build/PathsModule.hs index 3149eecb64e..e190f7a5c93 100644 --- a/Cabal/Distribution/Simple/Build/PathsModule.hs +++ b/Cabal/Distribution/Simple/Build/PathsModule.hs @@ -242,6 +242,9 @@ generate pkg_descr lbi clbi = -- | Generates the name of the environment variable controlling the path -- component of interest. +-- +-- Note: The format of these strings is part of Cabal's public API; +-- changing this function constitutes a *backwards-compatibility* break. pkgPathEnvVar :: PackageDescription -> String -- ^ path component; one of \"bindir\", \"libdir\", -- \"datadir\", \"libexecdir\", or \"sysconfdir\" diff --git a/Cabal/doc/developing-packages.markdown b/Cabal/doc/developing-packages.markdown index 64cc60dadfb..0e1d60de367 100644 --- a/Cabal/doc/developing-packages.markdown +++ b/Cabal/doc/developing-packages.markdown @@ -2071,6 +2071,13 @@ getLibexecDir :: IO FilePath getSysconfDir :: IO FilePath ~~~~~~~~~~~~~~~ +The actual location of all these directories can be individually +overridden at runtime using environment variables of the form +`pkg_name_var`, where `pkg_name` is the name of the package with +all hyphens converted into underscores, and `var` is either +`bindir`, `libdir`, `datadir`, `libexedir` or `sysconfdir`. + + ### Accessing the package version ### The aforementioned auto generated `Paths_`_pkgname_ module also