Skip to content

Document environment variables that can be used to change Paths values. #3713

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions Cabal/Distribution/Simple/Build/PathsModule.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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\"
Expand Down
7 changes: 7 additions & 0 deletions Cabal/doc/developing-packages.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It may be useful to give a concrete example for some well-known package name as to how such a var looks like for demonstration purposes



### Accessing the package version ###

The aforementioned auto generated `Paths_`_pkgname_ module also
Expand Down