Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/Main.hs
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ main = do
glogRule
yamlCppRule
leveldbRule
marisaSourceRule
hostMarisaRule
marisaRule
librimeRule
Expand Down
17 changes: 12 additions & 5 deletions src/Rules/Marisa.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
module Rules.Marisa
( marisaRule,
hostMarisaRule,
marisaSourceRule,
)
where

Expand All @@ -18,13 +19,20 @@ data MarisaTrie = MarisaTrie

type instance RuleResult MarisaTrie = ()

marisaSourceRule :: Rules ()
marisaSourceRule = do
"marisa-source" ~> do
src <- liftIO $ canonicalizePath "marisa-trie"
cmd_ (Cwd src) "git checkout ."
cmd_ (Cwd src) "git apply ../patches/marisa-tire.patch"

hostMarisaRule :: Rules ()
hostMarisaRule = do
"host-marisa" ~> do
need ["marisa-source"]
marisaSrc <- liftIO $ canonicalizePath "marisa-trie"
let buildDir = outputDir </> "marisa-build-host"
let hostPrefix = outputDir </> "host"
cmd_ (Cwd marisaSrc) "git checkout ."
cmd_
"cmake"
"-B" buildDir
Expand All @@ -41,9 +49,8 @@ marisaRule = do
useCMake $
(cmakeBuilder "marisa")
{ source = const $ pure "marisa-trie",
preBuild = BuildAction $ \_ src -> do
cmd_ (Cwd src) "git checkout ."
cmd_ (Cwd src) "git apply ../patches/marisa-tire.patch",
cmakeFlags = const ["-DBUILD_SHARED_LIBS=OFF"]
}
"marisa" ~> buildWithAndroidEnv buildMarisa MarisaTrie
"marisa" ~> do
need ["marisa-source"]
buildWithAndroidEnv buildMarisa MarisaTrie