34 lines
1013 B
Haskell
34 lines
1013 B
Haskell
{-# LANGUAGE DisambiguateRecordFields #-}
|
|
{-# LANGUAGE DuplicateRecordFields #-}
|
|
{-# LANGUAGE NoFieldSelectors #-}
|
|
|
|
module SetupHooks (setupHooks) where
|
|
|
|
import Distribution.Simple.SetupHooks
|
|
import Distribution.Utils.Path
|
|
import System.Directory
|
|
|
|
setupHooks :: SetupHooks
|
|
setupHooks =
|
|
noSetupHooks
|
|
{ configureHooks =
|
|
noConfigureHooks
|
|
{ preConfComponentHook = Just addRustLibDir
|
|
}
|
|
}
|
|
|
|
addRustLibDir :: PreConfComponentInputs -> IO PreConfComponentOutputs
|
|
addRustLibDir inputs = do
|
|
cwd <- getCurrentDirectory
|
|
pure
|
|
(noPreConfComponentOutputs inputs :: PreConfComponentOutputs)
|
|
{ componentDiff =
|
|
buildInfoComponentDiff
|
|
(componentName (component inputs))
|
|
emptyBuildInfo
|
|
{ extraLibDirs =
|
|
[ makeSymbolicPath $ cwd </> "rust" </> "target" </> "debug"
|
|
]
|
|
}
|
|
}
|