Commit 85d53975 authored by Edward Z. Yang's avatar Edward Z. Yang

Make GHC install libraries to e.g. xhtml-3000.2.1-0ACfOp3hebWD9jGWE4v4Gh.

Summary:
Previously, we'd install them to something like
xhtml_0ACfOp3hebWD9jGWE4v4G which was fairly ugly; this
commit changes the default install path to contain the full
package name and version, as well as the package key.

Needs a Cabal submodule update for the commit for install paths support
"Add libname install-dirs variable, use it by default. Fixes #2437".
It also contains some miscellaneous fixes for Cabal HEAD.
Signed-off-by: default avatarEdward Z. Yang <ezyang@cs.stanford.edu>

Test Plan: validate

Reviewers: austin

Subscribers: bgamari, thomie

Trac Issues: #10479

Differential Revision: https://phabricator.haskell.org/D922
parent f2ffdc6e
......@@ -908,7 +908,7 @@ install_packages: rts/dist/package.conf.install
$(call INSTALL_DIR,"$(DESTDIR)$(topdir)/rts")
$(call installLibsTo, $(RTS_INSTALL_LIBS), "$(DESTDIR)$(topdir)/rts")
$(foreach p, $(INSTALL_DYNLIBS), \
$(call installLibsTo, $(wildcard $p/dist-install/build/*.so $p/dist-install/build/*.dll $p/dist-install/build/*.dylib), "$(DESTDIR)$(topdir)/$($p_dist-install_PACKAGE_KEY)"))
$(call installLibsTo, $(wildcard $p/dist-install/build/*.so $p/dist-install/build/*.dll $p/dist-install/build/*.dylib), "$(DESTDIR)$(topdir)/$($p_dist-install_LIB_NAME)"))
$(foreach p, $(INSTALL_PACKAGES), \
$(call make-command, \
"$(ghc-cabal_INPLACE)" copy \
......
Subproject commit bda1ce6b757cdaca93f2eba4e1906a4658719537
Subproject commit 9e9e4370bbca6af032794225fe5638124acf2d85
......@@ -21,6 +21,9 @@ flag include-ghc-prim
Description: Include GHC.Prim in exposed-modules
default: False
custom-setup
setup-depends: base >= 4 && < 5, Cabal >= 1.23
Library
default-language: Haskell2010
other-extensions:
......
......@@ -186,11 +186,11 @@ ifneq "$4" "0"
ifeq "$$(TargetElf)" "YES"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
$$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
$$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'$$$$ORIGIN/../$$d') -optl-Wl,-zorigin
else ifeq "$$(TargetOS_CPP)" "darwin"
$1_$2_$3_GHC_LD_OPTS += \
-fno-use-rpaths \
$$(foreach d,$$($1_$2_TRANSITIVE_DEP_KEYS),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
$$(foreach d,$$($1_$2_TRANSITIVE_DEP_LIB_NAMES),-optl-Wl$$(comma)-rpath -optl-Wl$$(comma)'@loader_path/../$$d')
endif
endif
endif
......
......@@ -118,6 +118,7 @@ doCheck directory
[] -> return ()
errs -> mapM_ print errs >> exitWith (ExitFailure 1)
where isFailure (PackageDistSuspicious {}) = False
isFailure (PackageDistSuspiciousWarn {}) = False
isFailure _ = True
runHsColour :: FilePath -> FilePath -> [String] -> IO ()
......@@ -256,7 +257,7 @@ updateInstallDirTemplates relocatableBuild myPrefix myLibdir myDocdir idts
if relocatableBuild
then "$topdir"
else myLibdir,
libsubdir = toPathTemplate "$pkgkey",
libsubdir = toPathTemplate "$libname",
docdir = toPathTemplate $
if relocatableBuild
then "$topdir/../doc/html/libraries/$pkgid"
......@@ -414,6 +415,12 @@ generate directory distdir dll0Modules config_args
| packageKeySupported comp
= map (display . Installed.packageKey) dep_pkgs
| otherwise = transitiveDeps
transitiveDepLibNames
| packageKeySupported comp
= map (\p -> packageKeyLibraryName
(Installed.sourcePackageId p)
(Installed.packageKey p)) dep_pkgs
| otherwise = transitiveDeps
transitiveDepNames = map (display . packageName) transitive_dep_ids
libraryDirs = forDeps Installed.libraryDirs
......@@ -444,6 +451,7 @@ generate directory distdir dll0Modules config_args
variablePrefix ++ "_DEP_NAMES = " ++ unwords depNames,
variablePrefix ++ "_TRANSITIVE_DEPS = " ++ unwords transitiveDeps,
variablePrefix ++ "_TRANSITIVE_DEP_KEYS = " ++ unwords transitiveDepKeys,
variablePrefix ++ "_TRANSITIVE_DEP_LIB_NAMES = " ++ unwords transitiveDepLibNames,
variablePrefix ++ "_TRANSITIVE_DEP_NAMES = " ++ unwords transitiveDepNames,
variablePrefix ++ "_INCLUDE_DIRS = " ++ unwords (includeDirs bi),
variablePrefix ++ "_INCLUDES = " ++ unwords (includes bi),
......
......@@ -19,7 +19,7 @@ import Distribution.ModuleName (ModuleName)
import Distribution.InstalledPackageInfo as Cabal
import Distribution.Compat.ReadP hiding (get)
import Distribution.ParseUtils
import Distribution.Package hiding (depends, installedPackageId)
import Distribution.Package hiding (installedPackageId)
import Distribution.Text
import Distribution.Version
import Distribution.Simple.Utils (fromUTF8, toUTF8)
......
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