diff options
author | Josh Rahm <rahm@google.com> | 2024-02-09 12:24:23 -0700 |
---|---|---|
committer | Josh Rahm <rahm@google.com> | 2024-02-09 12:24:23 -0700 |
commit | ebde8665851ca21ff00685eeaf5057ccec6eb05d (patch) | |
tree | bb5b38f048846d8196b5a12b270b2e87d6717d5e /Setup.hs | |
parent | dc9c17145c8774738d8b1c395d8796aabfcb828c (diff) | |
download | wetterhorn-ebde8665851ca21ff00685eeaf5057ccec6eb05d.tar.gz wetterhorn-ebde8665851ca21ff00685eeaf5057ccec6eb05d.tar.bz2 wetterhorn-ebde8665851ca21ff00685eeaf5057ccec6eb05d.zip |
Setup now builds wlroots in the .stack-work directory.
Diffstat (limited to 'Setup.hs')
-rw-r--r-- | Setup.hs | 19 |
1 files changed, 12 insertions, 7 deletions
@@ -8,18 +8,20 @@ import System.FilePath import System.Posix.Files (createSymbolicLink, removeLink) import System.Process import Text.Printf +import Data.Maybe (fromJust) main = do defaultMainWithHooks $ simpleUserHooks - { preConf = \_ _ -> do - callCommand "cd wlroots && meson setup build -Dexamples=false --reconfigure" + { preConf = \_ conf -> do + let path = fromJust (flagToMaybe $ configDistPref conf) + callCommand $ + printf "cd wlroots && meson setup %s -Dexamples=false --reconfigure" (wlrootsDir path) return emptyHookedBuildInfo, - preBuild = \_ _ -> do - callCommand "cd wlroots && ninja -C build" + preBuild = \_ conf -> do + let path = fromJust (flagToMaybe $ buildDistPref conf) + callCommand $ printf "cd wlroots && ninja -C %s" (wlrootsDir path) return emptyHookedBuildInfo, - cleanHook = \_ _ _ _ -> do - callCommand "cd wlroots && ninja -C build clean", postCopy = \a f pd _ -> do forM_ (flagToMaybe (copyDistPref f)) $ \copyDest -> do let harnessFile = copyDest </> "build" </> "wtr_harness" </> "wtr_harness" @@ -29,7 +31,10 @@ main = do lnF pluginFile "wtr.so" } where + wlrootsDir :: String -> String + wlrootsDir = printf "../%s/build/wlroots" + lnF from to = do - printf "%s -> %s" from to + printf "%s -> %s\n" from to flip when (removeLink to) =<< doesFileExist to createSymbolicLink from to |