diff options
Diffstat (limited to 'Setup.hs')
| -rw-r--r-- | Setup.hs | 25 |
1 files changed, 20 insertions, 5 deletions
@@ -14,26 +14,41 @@ main = do defaultMainWithHooks $ simpleUserHooks { preConf = \_ conf -> do - let path = fromJust (flagToMaybe $ configDistPref conf) + let buildPath = fromJust (flagToMaybe $ configDistPref conf) + + callCommand $ + printf "cd wlroots && meson setup %s -Dexamples=false --reconfigure" (wlrootsDir buildPath) + callCommand $ - printf "cd wlroots && meson setup %s -Dexamples=false --reconfigure" (wlrootsDir path) + printf "cmake -B %s -S harness" (harnessDir buildPath) + + lnF ("../" ++ harnessDir buildPath) "harness/build" + return emptyHookedBuildInfo, preBuild = \_ conf -> do let path = fromJust (flagToMaybe $ buildDistPref conf) + callCommand $ printf "cd wlroots && ninja -C %s" (wlrootsDir path) + + callCommand $ + printf "make -C %s" (harnessDir path) + + lnF (printf "%s/wtr_harness" (harnessDir path)) "wtr_harness" + return emptyHookedBuildInfo, postCopy = \a f pd _ -> do forM_ (flagToMaybe (copyDistPref f)) $ \copyDest -> do - let harnessFile = copyDest </> "build" </> "wtr_harness" </> "wtr_harness" - let pluginFile = copyDest </> "build" </> "wtr.so" </> "wtr.so" - lnF harnessFile "wtr_harness" + let pluginFile = copyDest </> "build" </> "wtr.so" </> "wtr.so" lnF pluginFile "wtr.so" } where wlrootsDir :: String -> String wlrootsDir = printf "../%s/build/wlroots" + harnessDir :: String -> String + harnessDir = printf "%s/build/wtr_harness" + lnF from to = do printf "%s -> %s\n" from to flip when (removeLink to) =<< doesFileExist to |