From f83916b5f726f1f6662639abf3f608fbffe6854e Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Tue, 7 Nov 2017 14:15:23 +0800 Subject: [PATCH 1/3] Look for install includes in buildpref as well When installing a lirbary, we should look for it's headers in it's 'build' preference first, then relative to the current path. --- Cabal/Distribution/Simple/Install.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Cabal/Distribution/Simple/Install.hs b/Cabal/Distribution/Simple/Install.hs index 31751f1b967..edf9ff99fb9 100644 --- a/Cabal/Distribution/Simple/Install.hs +++ b/Cabal/Distribution/Simple/Install.hs @@ -171,7 +171,7 @@ copyComponent verbosity pkg_descr lbi (CLib lib) clbi copydest = do -- install include files for all compilers - they may be needed to compile -- haskell files (using the CPP extension) - installIncludeFiles verbosity lib incPref + installIncludeFiles verbosity lib buildPref incPref case compilerFlavor (compiler lbi) of GHC -> GHC.installLib verbosity lbi libPref dynlibPref buildPref pkg_descr lib clbi @@ -247,11 +247,12 @@ installDataFiles verbosity pkg_descr destDataDir = -- | Install the files listed in install-includes for a library -- -installIncludeFiles :: Verbosity -> Library -> FilePath -> IO () -installIncludeFiles verbosity lib destIncludeDir = do +installIncludeFiles :: Verbosity -> Library -> FilePath -> FilePath -> IO () +installIncludeFiles verbosity lib buildPref destIncludeDir = do let relincdirs = "." : filter isRelative (includeDirs lbi) lbi = libBuildInfo lib - incs <- traverse (findInc relincdirs) (installIncludes lbi) + incdirs = relincdirs ++ [ buildPref dir | dir <- relincdirs ] + incs <- traverse (findInc incdirs) (installIncludes lbi) sequence_ [ do createDirectoryIfMissingVerbose verbosity True destDir installOrdinaryFile verbosity srcFile destFile From a7db062960fcf266f00c3810826707dfa6314ad5 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Tue, 7 Nov 2017 14:22:34 +0800 Subject: [PATCH 2/3] Adds changelog notice. --- Cabal/changelog | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Cabal/changelog b/Cabal/changelog index a9620acf9b8..bc685d5df9e 100644 --- a/Cabal/changelog +++ b/Cabal/changelog @@ -1,6 +1,8 @@ -*-change-log-*- 2.2.0.0 (current development version) + * `copyCompoment` and `installIncludeFiles` will look for include + headers in the build preference as well. * Added cxx-options and cxx-sources build info fields for seperate compilation of C++ source files (#3700) * Remove unused '--allow-newer'/'--allow-older' support (#4527) From 6788784e4da90d511b99953e14abd2f33cacebd3 Mon Sep 17 00:00:00 2001 From: Moritz Angermann Date: Wed, 8 Nov 2017 11:18:44 +0800 Subject: [PATCH 3/3] Change changelog msg. --- Cabal/changelog | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Cabal/changelog b/Cabal/changelog index bc685d5df9e..7247c7d4e11 100644 --- a/Cabal/changelog +++ b/Cabal/changelog @@ -1,8 +1,9 @@ -*-change-log-*- 2.2.0.0 (current development version) - * `copyCompoment` and `installIncludeFiles` will look for include - headers in the build preference as well. + * `copyCompomenti` and `installIncludeFiles` will look for include + headers in the build preference dir ('dist/build/...' by default) + as well. * Added cxx-options and cxx-sources build info fields for seperate compilation of C++ source files (#3700) * Remove unused '--allow-newer'/'--allow-older' support (#4527)