From 628174c992a5a740feb4dc119adf8dfb1f89f992 Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 1 Jan 2026 18:04:40 -0700 Subject: 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 --- Setup.hs | 69 ---------------------------------------------------------------- 1 file changed, 69 deletions(-) delete mode 100644 Setup.hs (limited to 'Setup.hs') 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) -- cgit