aboutsummaryrefslogtreecommitdiff
path: root/Setup.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2026-01-01 18:04:40 -0700
committerJosh Rahm <joshuarahm@gmail.com>2026-01-01 18:04:40 -0700
commit628174c992a5a740feb4dc119adf8dfb1f89f992 (patch)
tree683361b27cf4b6df2c5cc782d70de9bdf5fd38a8 /Setup.hs
parentbe1ef8cee5f68eb9afecca94071069a1ff82825e (diff)
downloadmontis-628174c992a5a740feb4dc119adf8dfb1f89f992.tar.gz
montis-628174c992a5a740feb4dc119adf8dfb1f89f992.tar.bz2
montis-628174c992a5a740feb4dc119adf8dfb1f89f992.zip
Have Meson orchestrate the whole build rather than stack.
As a part of this, I changed the file layout to: rt/ - the Montis runtime plug/ - the Montis plugin wlroots/ - wlroots
Diffstat (limited to 'Setup.hs')
-rw-r--r--Setup.hs69
1 files changed, 0 insertions, 69 deletions
diff --git a/Setup.hs b/Setup.hs
deleted file mode 100644
index e8a6b6b..0000000
--- a/Setup.hs
+++ /dev/null
@@ -1,69 +0,0 @@
-import Control.Exception
-import Control.Monad (forM_, when)
-import Data.Maybe (fromJust)
-import Distribution.Simple
-import Distribution.Simple.Setup
-import Distribution.Types.HookedBuildInfo
-import System.Directory
-import System.Environment (getArgs)
-import System.FilePath
-import System.Posix.Files
-import System.Process
-import Text.Printf
-
-main = do
- putStrLn "Running Setup.hs"
-
- defaultMainWithHooks $
- simpleUserHooks
- { preConf = \_ conf -> do
- let buildPath = fromJust (flagToMaybe $ configDistPref conf)
-
- callCommand $
- printf "cd wlroots && meson setup %s -Dexamples=false -Dbackends=x11,drm,libinput --reconfigure" (wlrootsDir buildPath)
-
- callCommand $
- 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 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
- ( do
- printf "Removing %s." to
- removeLink to
- )
- =<< doesExist to
- createSymbolicLink from to
-
- doesExist f = do
- b1 <- doesFileExist f
- b2 <- doesDirectoryExist f
- b3 <- catch (pathIsSymbolicLink f) (\(e :: SomeException) -> return False)
- return (b1 || b2 || b3)