drop hooks in favour of using bundled libraries properly
script addition is hacky, but I know no other way to get most of the build path, in arch/version-independent way we'll use a custom setup or whatever eventually (_eventually_ hooks...) anyway
This commit is contained in:
parent
ffc59a418b
commit
beb9e14542
@ -1,33 +0,0 @@
|
|||||||
{-# 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"
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -6,14 +6,6 @@ author: Patrick Aldis
|
|||||||
maintainer:
|
maintainer:
|
||||||
george.thomas@obsidian.systems
|
george.thomas@obsidian.systems
|
||||||
patrick.aldis@obsidian.systems
|
patrick.aldis@obsidian.systems
|
||||||
build-type: Hooks
|
|
||||||
|
|
||||||
custom-setup
|
|
||||||
setup-depends:
|
|
||||||
base,
|
|
||||||
Cabal-hooks,
|
|
||||||
Cabal-syntax,
|
|
||||||
directory,
|
|
||||||
|
|
||||||
common common
|
common common
|
||||||
default-language: GHC2024
|
default-language: GHC2024
|
||||||
|
|||||||
@ -59,3 +59,6 @@ echo " Patched header at $HEADER"
|
|||||||
|
|
||||||
echo "=== Done ==="
|
echo "=== Done ==="
|
||||||
echo "Run 'cabal run' to test."
|
echo "Run 'cabal run' to test."
|
||||||
|
|
||||||
|
# place static lib in position for bundling with Cabal
|
||||||
|
cp rust/target/debug/libgarnet_rs.a $(cabal list-bin . | sed -e 's=x/garnet/build/garnet/garnet=build=g')
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user