diff --git a/Cabal-syntax/src/Distribution/System.hs b/Cabal-syntax/src/Distribution/System.hs index 5142bf523b1..730bb6d685e 100644 --- a/Cabal-syntax/src/Distribution/System.hs +++ b/Cabal-syntax/src/Distribution/System.hs @@ -112,6 +112,7 @@ data OS | Android -- mobile OSs | Ghcjs | Wasi + | Haiku | OtherOS String deriving (Eq, Generic, Ord, Show, Read, Typeable, Data) @@ -138,6 +139,7 @@ knownOSs = , Android , Ghcjs , Wasi + , Haiku ] osAliases :: ClassificationStrictness -> OS -> [String] diff --git a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs index 37d38f2bac4..a396dea860c 100644 --- a/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs +++ b/Cabal-tests/tests/UnitTests/Distribution/Utils/Structured.hs @@ -27,9 +27,9 @@ tests = testGroup "Distribution.Utils.Structured" -- The difference is in encoding of newtypes #if MIN_VERSION_base(4,7,0) , testCase "GenericPackageDescription" $ - md5Check (Proxy :: Proxy GenericPackageDescription) 0x8d8f340f10a58b8d8a87bf42213dac89 + md5Check (Proxy :: Proxy GenericPackageDescription) 0xc7d1064aaf2c9bcf92c3d7f23e6d7e94 , testCase "LocalBuildInfo" $ - md5Check (Proxy :: Proxy LocalBuildInfo) 0xbb22c3258d3092f31e992bc093d09170 + md5Check (Proxy :: Proxy LocalBuildInfo) 0x0324f420f9fb98417098127a414cc7c0 #endif ] diff --git a/Cabal/src/Distribution/Simple/GHC.hs b/Cabal/src/Distribution/Simple/GHC.hs index 892526e399f..8949b24c9cf 100644 --- a/Cabal/src/Distribution/Simple/GHC.hs +++ b/Cabal/src/Distribution/Simple/GHC.hs @@ -2258,6 +2258,7 @@ getRPaths lbi clbi | supportRPaths hostOS = do supportRPaths Ghcjs = False supportRPaths Wasi = False supportRPaths Hurd = False + supportRPaths Haiku = False supportRPaths (OtherOS _) = False -- Do _not_ add a default case so that we get a warning here when a new OS -- is added. diff --git a/Cabal/src/Distribution/Simple/GHCJS.hs b/Cabal/src/Distribution/Simple/GHCJS.hs index 8515635de54..6c9bf34f0eb 100644 --- a/Cabal/src/Distribution/Simple/GHCJS.hs +++ b/Cabal/src/Distribution/Simple/GHCJS.hs @@ -1794,6 +1794,7 @@ getRPaths lbi clbi | supportRPaths hostOS = do supportRPaths Ghcjs = False supportRPaths Wasi = False supportRPaths Hurd = False + supportRPaths Haiku = False supportRPaths (OtherOS _) = False -- Do _not_ add a default case so that we get a warning here when a new OS -- is added. diff --git a/Cabal/src/Distribution/Simple/InstallDirs.hs b/Cabal/src/Distribution/Simple/InstallDirs.hs index c77ee8a99b2..eead40c597b 100644 --- a/Cabal/src/Distribution/Simple/InstallDirs.hs +++ b/Cabal/src/Distribution/Simple/InstallDirs.hs @@ -204,6 +204,7 @@ defaultInstallDirs' False comp userInstall _hasLibs = do Windows -> do windowsProgramFilesDir <- getWindowsProgramFilesDir return (windowsProgramFilesDir "Haskell") + Haiku -> return "/boot/system/non-packaged" _ -> return "/usr/local" installLibDir <- case buildOS of @@ -226,17 +227,27 @@ defaultInstallDirs' False comp userInstall _hasLibs = do , flibdir = "$libdir" , libexecdir = case buildOS of Windows -> "$prefix" "$libname" + Haiku -> "$libdir" _other -> "$prefix" "libexec" - , includedir = "$libdir" "$libsubdir" "include" + , includedir = case buildOS of + Haiku -> "$prefix" "develop" "headers" + _other -> "$libdir" "$libsubdir" "include" , datadir = case buildOS of Windows -> "$prefix" + Haiku -> "$prefix" "data" _other -> "$prefix" "share" , datasubdir = "$abi" "$pkgid" - , docdir = "$datadir" "doc" "$abi" "$pkgid" - , mandir = "$datadir" "man" + , docdir = case buildOS of + Haiku -> "$prefix" "documentation" + _other -> "$datadir" "doc" "$abi" "$pkgid" + , mandir = case buildOS of + Haiku -> "$docdir" "man" + _other -> "$datadir" "man" , htmldir = "$docdir" "html" , haddockdir = "$htmldir" - , sysconfdir = "$prefix" "etc" + , sysconfdir = case buildOS of + Haiku -> "boot" "system" "settings" + _other -> "$prefix" "etc" } -- --------------------------------------------------------------------------- diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 5531140629f..6321a63b03b 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -848,6 +848,7 @@ platformDefines lbi = Ghcjs -> ["ghcjs"] Wasi -> ["wasi"] Hurd -> ["hurd"] + Haiku -> ["haiku"] OtherOS _ -> [] archStr = case hostArch of I386 -> ["i386"] diff --git a/changelog.d/pr-9006 b/changelog.d/pr-9006 new file mode 100644 index 00000000000..905a962e646 --- /dev/null +++ b/changelog.d/pr-9006 @@ -0,0 +1,10 @@ +synopsis: Add Haiku as a known platform +packages: Cabal +prs: #9006 + +description: { + +- Cabal: Distribution now recognises Haiku as a valid platform, + and also implements Haiku's unique directory layout. + +}