From 12aadf6547622311b97e1de45241767266d3c812 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Tue, 24 Nov 2015 12:50:19 -0500 Subject: [PATCH] Custom setup. --- Setup.hs | 25 ++++++++++++++++++++++++- semantic-diff.cabal | 2 +- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Setup.hs b/Setup.hs index 9a994af67..7dc96c327 100644 --- a/Setup.hs +++ b/Setup.hs @@ -1,2 +1,25 @@ +import Data.Maybe +import qualified Distribution.PackageDescription as PD import Distribution.Simple -main = defaultMain +import Distribution.Simple.LocalBuildInfo +import System.Directory + +main = defaultMainWithHooks simpleUserHooks { + confHook = semanticDiffConfHook +} + +semanticDiffConfHook (description, buildInfo) flags = do + localBuildInfo <- confHook simpleUserHooks (description, buildInfo) flags + let packageDescription = localPkgDescr localBuildInfo + library = fromJust $ PD.library packageDescription + libraryBuildInfo = PD.libBuildInfo library + dir <- getCurrentDirectory + return localBuildInfo { + localPkgDescr = packageDescription { + PD.library = Just $ library { + PD.libBuildInfo = libraryBuildInfo { + PD.extraLibDirs = (dir ++ "/prototype/External/tree-sitter/out/Release"):(dir ++ "/prototype/External/tree-sitter-c"):PD.extraLibDirs libraryBuildInfo + } + } + } + } diff --git a/semantic-diff.cabal b/semantic-diff.cabal index adcf074a6..5eb4f2c0b 100644 --- a/semantic-diff.cabal +++ b/semantic-diff.cabal @@ -7,7 +7,7 @@ author: Rob Rix, Josh Vera maintainer: rob.rix@github.com copyright: 2015 GitHub category: Web -build-type: Simple +build-type: Custom -- extra-source-files: cabal-version: >=1.10