Skip to content
Snippets Groups Projects
Commit 2cf65bf4 authored by Edward Z. Yang's avatar Edward Z. Yang
Browse files

Add libname install-dirs variable, use it by default. Fixes #2437.


Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>
parent 72440fde
No related merge requests found
......@@ -57,7 +57,7 @@ import System.FilePath ((</>), isPathSeparator, pathSeparator)
import System.FilePath (dropDrive)
import Distribution.Package
( PackageIdentifier, PackageKey, packageName, packageVersion )
( PackageIdentifier, PackageKey, packageName, packageVersion, packageKeyLibraryName )
import Distribution.System
( OS(..), buildOS, Platform(..) )
import Distribution.Compiler
......@@ -183,7 +183,7 @@ appendSubdirs append dirs = dirs {
-- users to be able to configure @--libdir=\/usr\/lib64@ for example but
-- because by default we want to support installing multiple versions of
-- packages and building the same package for multiple compilers we append the
-- libsubdir to get: @\/usr\/lib64\/$pkgkey\/$compiler@.
-- libsubdir to get: @\/usr\/lib64\/$libname\/$compiler@.
--
-- An additional complication is the need to support relocatable packages on
-- systems which support such things, like Windows.
......@@ -216,10 +216,10 @@ defaultInstallDirs comp userInstall _hasLibs = do
JHC -> "$compiler"
LHC -> "$compiler"
UHC -> "$pkgid"
_other -> "$abi" </> "$pkgkey",
_other -> "$abi" </> "$libname",
dynlibdir = "$libdir",
libexecdir = case buildOS of
Windows -> "$prefix" </> "$pkgkey"
Windows -> "$prefix" </> "$libname"
_other -> "$prefix" </> "libexec",
includedir = "$libdir" </> "$libsubdir" </> "include",
datadir = case buildOS of
......@@ -373,6 +373,7 @@ data PathTemplateVariable =
| PkgVerVar -- ^ The @$version@ package version path variable
| PkgIdVar -- ^ The @$pkgid@ package Id path variable, eg @foo-1.0@
| PkgKeyVar -- ^ The @$pkgkey@ package key path variable
| LibNameVar -- ^ The @$libname@ expanded package key path variable
| CompilerVar -- ^ The compiler name and version, eg @ghc-6.6.1@
| OSVar -- ^ The operating system name, eg @windows@ or @linux@
| ArchVar -- ^ The CPU architecture name, eg @i386@ or @x86_64@
......@@ -430,6 +431,7 @@ packageTemplateEnv pkgId pkg_key =
[(PkgNameVar, PathTemplate [Ordinary $ display (packageName pkgId)])
,(PkgVerVar, PathTemplate [Ordinary $ display (packageVersion pkgId)])
,(PkgKeyVar, PathTemplate [Ordinary $ display pkg_key])
,(LibNameVar, PathTemplate [Ordinary $ packageKeyLibraryName pkgId pkg_key])
,(PkgIdVar, PathTemplate [Ordinary $ display pkgId])
]
......@@ -479,6 +481,7 @@ installDirsTemplateEnv dirs =
instance Show PathTemplateVariable where
show PrefixVar = "prefix"
show PkgKeyVar = "pkgkey"
show LibNameVar = "libname"
show BindirVar = "bindir"
show LibdirVar = "libdir"
show LibsubdirVar = "libsubdir"
......@@ -516,6 +519,7 @@ instance Read PathTemplateVariable where
,("htmldir", HtmldirVar)
,("pkgid", PkgIdVar)
,("pkgkey", PkgKeyVar)
,("libname", LibNameVar)
,("pkg", PkgNameVar)
,("version", PkgVerVar)
,("compiler", CompilerVar)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment