Description
I've been following the documentation for the Paths_pkgname and data-files mechanism and managed to get a simple example going.
However, I don't quite understand the documentation for prefix-independence:
On Windows it is possible to obtain the pathname of the running program.
Does that mean that prefix-independence is only for Windows? Perhaps it should be explicitly stated.
The executable can find its auxiliary files by finding its own path and knowing the location of the other files relative to $bindir. Prefix-independence is particularly useful: it means the user can choose the install location (i.e. the value of $prefix) at install-time
Here by "installing", do we mean something like copying the executable to another location, maybe across machines?
If the executable finds the other files relative to $bindir
, why is $prefix
needed at all?
In order to achieve this, we require that for an executable on Windows, all of $bindir, $libdir, $dynlibdir, $datadir and $libexecdir begin with $prefix.
Is this the default, or do I have to do tweak something in order to achieve it? Does "beginning with $prefix" mean "beginning with the literal text '$prefix'" or "beginning with the value of $prefix"?
System information
- Cabal 3.6.2.0
Activity