diff --git a/app/ghcup/Main.hs b/app/ghcup/Main.hs index 34d8995..cf8192b 100644 --- a/app/ghcup/Main.hs +++ b/app/ghcup/Main.hs @@ -1425,6 +1425,13 @@ Version: #{describe_result}|] prettyArch :: Architecture -> String prettyArch A_64 = "amd64" prettyArch A_32 = "i386" + prettyArch A_PowerPC = "PowerPC" + prettyArch A_PowerPC64 = "PowerPC64" + prettyArch A_Sparc = "Sparc" + prettyArch A_Sparc64 = "Sparc64" + prettyArch A_ARM = "ARM" + prettyArch A_ARM64 = "ARM64" + prettyPlatform :: PlatformResult -> String prettyPlatform PlatformResult { _platform = plat, _distroVersion = Just v' } = show plat <> ", " <> show v' diff --git a/lib/GHCup/Platform.hs b/lib/GHCup/Platform.hs index 3521717..0ef569c 100644 --- a/lib/GHCup/Platform.hs +++ b/lib/GHCup/Platform.hs @@ -48,10 +48,7 @@ import qualified Data.Text as T -- | Get the full platform request, consisting of architecture, distro, ... platformRequest :: (MonadLogger m, MonadCatch m, MonadIO m) => Excepts - '[ NoCompatiblePlatform - , NoCompatibleArch - , DistroNotFound - ] + '[NoCompatiblePlatform, NoCompatibleArch, DistroNotFound] m PlatformRequest platformRequest = do @@ -62,15 +59,21 @@ platformRequest = do getArchitecture :: Either NoCompatibleArch Architecture getArchitecture = case arch of - "x86_64" -> Right A_64 - "i386" -> Right A_32 - what -> Left (NoCompatibleArch what) - + "x86_64" -> Right A_64 + "i386" -> Right A_32 + "powerpc" -> Right A_PowerPC + "powerpc64" -> Right A_PowerPC64 + "powerpc64le" -> Right A_PowerPC64 + "sparc" -> Right A_Sparc + "sparc64" -> Right A_Sparc64 + "arm" -> Right A_ARM + "aarch64" -> Right A_ARM64 + what -> Left (NoCompatibleArch what) getPlatform :: (MonadLogger m, MonadCatch m, MonadIO m) => Excepts - '[NoCompatiblePlatform , DistroNotFound] + '[NoCompatiblePlatform, DistroNotFound] m PlatformResult getPlatform = do @@ -82,6 +85,7 @@ getPlatform = do ver <- ( either (const Nothing) Just . versioning + -- TODO: maybe do this somewhere else . getMajorVersion . decUTF8Safe ) diff --git a/lib/GHCup/Types.hs b/lib/GHCup/Types.hs index a411ea2..5fda585 100644 --- a/lib/GHCup/Types.hs +++ b/lib/GHCup/Types.hs @@ -90,6 +90,12 @@ data Tag = Latest data Architecture = A_64 | A_32 + | A_PowerPC + | A_PowerPC64 + | A_Sparc + | A_Sparc64 + | A_ARM + | A_ARM64 deriving (Eq, GHC.Generic, Ord, Show)