From 8c9361e4ba6e2257f2bd9d354a56005318477ed6 Mon Sep 17 00:00:00 2001 From: Daniel Gröber Date: Tue, 30 Jul 2019 02:16:19 +0200 Subject: Support cabal-file not being in pkgdir with cabal-v1 --- src/CabalHelper/Compiletime/Types.hs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/CabalHelper/Compiletime/Types.hs b/src/CabalHelper/Compiletime/Types.hs index ec24f2d..f9900bb 100644 --- a/src/CabalHelper/Compiletime/Types.hs +++ b/src/CabalHelper/Compiletime/Types.hs @@ -66,7 +66,7 @@ data ProjLoc (pt :: ProjType) where -- ending in @.cabal@ existing in the directory. More than one such files -- existing is a user error. Note: For this project type the concepts of -- project and package coincide. - ProjLocV1CabalFile :: { plCabalFile :: !FilePath } -> ProjLoc 'V1 + ProjLocV1CabalFile :: { plCabalFile :: !FilePath, plPackageDir :: !FilePath } -> ProjLoc 'V1 -- | A @cabal v1-build@ project directory. Same as 'ProjLocV1CabalFile' but -- will search for the cabal file for you. If more than one @.cabal@ file @@ -86,8 +86,8 @@ data ProjLoc (pt :: ProjType) where deriving instance Show (ProjLoc pt) plV1Dir :: ProjLoc 'V1 -> FilePath -plV1Dir (ProjLocV1CabalFile cabal_file) = takeDirectory cabal_file -plV1Dir (ProjLocV1Dir pkgdir) = pkgdir +plV1Dir ProjLocV1CabalFile {plPackageDir} = plPackageDir +plV1Dir ProjLocV1Dir {plPackageDir} = plPackageDir data DistDir (pt :: ProjType) where -- | Build directory for cabal /old-build/ aka. /v1-build/ aka. just -- cgit v1.2.3