diff --git a/.gitignore b/.gitignore index 16314abf76..13c0765d0e 100644 --- a/.gitignore +++ b/.gitignore @@ -7,7 +7,6 @@ test Build/SysConfig Build/Version Build/InstallDesktopFile -Build/EvilSplicer Build/Standalone Build/OSXMkLibs Build/LinuxMkLibs diff --git a/Annex/Environment.hs b/Annex/Environment.hs index 6fdac1e498..68d617e224 100644 --- a/Annex/Environment.hs +++ b/Annex/Environment.hs @@ -5,8 +5,6 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Annex.Environment where import Annex.Common @@ -37,14 +35,8 @@ checkEnvironmentIO = whenM (isNothing <$> myUserGecos) $ do ensureEnv "GIT_AUTHOR_NAME" username ensureEnv "GIT_COMMITTER_NAME" username where -#ifndef __ANDROID__ -- existing environment is not overwritten ensureEnv var val = setEnv var val False -#else - -- Environment setting is broken on Android, so this is dealt with - -- in runshell instead. - ensureEnv _ _ = noop -#endif {- Runs an action that commits to the repository, and if it fails, - sets user.email and user.name to a dummy value and tries the action again. -} diff --git a/Annex/GitOverlay.hs b/Annex/GitOverlay.hs index d809e0b23a..25021b7740 100644 --- a/Annex/GitOverlay.hs +++ b/Annex/GitOverlay.hs @@ -14,6 +14,7 @@ import Git import Git.Types import Git.Index import Git.Env +import Utility.Env import qualified Annex import qualified Annex.Queue @@ -27,8 +28,8 @@ withIndexFile f a = do a where -- This is an optimisation. Since withIndexFile is run repeatedly, - -- and addGitEnv uses the slow copyGitEnv when gitEnv is Nothing, - -- we cache the copied environment the first time, and reuse it in + -- and addGitEnv uses the slow getEnvironment when gitEnv is Nothing, + -- we cache the environment the first time, and reuse it in -- subsequent calls. -- -- (This could be done at another level; eg when creating the @@ -40,7 +41,7 @@ withIndexFile f a = do Nothing -> do e <- Annex.withState $ \s -> case Annex.cachedgitenv s of Nothing -> do - e <- copyGitEnv + e <- getEnvironment return (s { Annex.cachedgitenv = Just e }, e) Just e -> return (s, e) m (g { gitEnv = Just e }) diff --git a/Annex/Hook.hs b/Annex/Hook.hs index 450ed261b3..efcc5de836 100644 --- a/Annex/Hook.hs +++ b/Annex/Hook.hs @@ -40,7 +40,7 @@ postUpdateAnnexHook = Git.Hook "post-update-annex" "" [] mkHookScript :: String -> String mkHookScript s = unlines - [ shebang_local + [ shebang , "# automatically configured by git-annex" , s ] diff --git a/Annex/NumCopies.hs b/Annex/NumCopies.hs index 60d918cae5..bd448ddbda 100644 --- a/Annex/NumCopies.hs +++ b/Annex/NumCopies.hs @@ -5,7 +5,7 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP, ScopedTypeVariables, DeriveDataTypeable #-} +{-# LANGUAGE ScopedTypeVariables, DeriveDataTypeable #-} module Annex.NumCopies ( module Types.NumCopies, @@ -165,9 +165,7 @@ verifyEnoughCopiesToDrop nolocmsg key removallock need skip preverified tocheck cont v `catchNonAsync` (throw . DropException) a `M.catches` [ M.Handler (\ (e :: AsyncException) -> throwM e) -#if MIN_VERSION_base(4,7,0) , M.Handler (\ (e :: SomeAsyncException) -> throwM e) -#endif , M.Handler (\ (DropException e') -> throwM e') , M.Handler (\ (_e :: SomeException) -> fallback) ] diff --git a/Assistant/Install.hs b/Assistant/Install.hs index 9b39de233e..7e72887dc2 100644 --- a/Assistant/Install.hs +++ b/Assistant/Install.hs @@ -80,7 +80,7 @@ ensureInstalled = ifM (isJust <$> getEnv "GIT_ANNEX_PACKAGE_INSTALL") let rungitannexshell var = runshell $ "git-annex-shell -c \"" ++ var ++ "\"" installWrapper (sshdir "git-annex-shell") $ unlines - [ shebang_local + [ shebang , "set -e" , "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" , rungitannexshell "$SSH_ORIGINAL_COMMAND" @@ -89,7 +89,7 @@ ensureInstalled = ifM (isJust <$> getEnv "GIT_ANNEX_PACKAGE_INSTALL") , "fi" ] installWrapper (sshdir "git-annex-wrapper") $ unlines - [ shebang_local + [ shebang , "set -e" , runshell "\"$@\"" ] @@ -124,7 +124,7 @@ installFileManagerHooks program = unlessM osAndroid $ do where genNautilusScript scriptdir action = installscript (scriptdir scriptname action) $ unlines - [ shebang_local + [ shebang , autoaddedcomment , "exec " ++ program ++ " " ++ action ++ " --notify-start --notify-finish -- \"$@\"" ] diff --git a/Assistant/Pairing.hs b/Assistant/Pairing.hs index 34c5aab1f6..d105e6c51c 100644 --- a/Assistant/Pairing.hs +++ b/Assistant/Pairing.hs @@ -5,8 +5,6 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Assistant.Pairing where import Annex.Common @@ -84,11 +82,7 @@ data PairingInProgress = PairingInProgress data AddrClass = IPv4AddrClass | IPv6AddrClass data SomeAddr = IPv4Addr HostAddress -{- My Android build of the Network library does not currently have IPV6 - - support. -} -#ifndef __ANDROID__ | IPv6Addr HostAddress6 -#endif deriving (Ord, Eq, Read, Show) {- This contains the whole secret, just lightly obfuscated to make it not diff --git a/Assistant/Ssh.hs b/Assistant/Ssh.hs index 8528446160..429a824947 100644 --- a/Assistant/Ssh.hs +++ b/Assistant/Ssh.hs @@ -189,7 +189,7 @@ addAuthorizedKeysCommand gitannexshellonly dir pubkey = intercalate "&&" echoval v = "echo " ++ shellEscape v wrapper = "~/.ssh/git-annex-shell" script = - [ shebang_portable + [ shebang , "set -e" , "if [ \"x$SSH_ORIGINAL_COMMAND\" != \"x\" ]; then" , runshell "$SSH_ORIGINAL_COMMAND" diff --git a/Assistant/Threads/WebApp.hs b/Assistant/Threads/WebApp.hs index dfb631bc6f..cf2f1724a2 100644 --- a/Assistant/Threads/WebApp.hs +++ b/Assistant/Threads/WebApp.hs @@ -7,7 +7,6 @@ {-# LANGUAGE TemplateHaskell, MultiParamTypeClasses #-} {-# LANGUAGE ViewPatterns, OverloadedStrings #-} -{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-orphans #-} module Assistant.Threads.WebApp where @@ -69,11 +68,6 @@ webAppThread assistantdata urlrenderer noannex cannotrun postfirstrun listenhost then pure listenhost else getAnnex $ annexListen <$> Annex.getGitConfig tlssettings <- getAnnex getTlsSettings -#ifdef __ANDROID__ - when (isJust listenhost') $ - -- See Utility.WebApp - giveup "Sorry, --listen is not currently supported on Android" -#endif webapp <- WebApp <$> pure assistantdata <*> genAuthToken 128 diff --git a/Assistant/WebApp/Configurators/Local.hs b/Assistant/WebApp/Configurators/Local.hs index e4bfbfebee..f1134dca62 100644 --- a/Assistant/WebApp/Configurators/Local.hs +++ b/Assistant/WebApp/Configurators/Local.hs @@ -165,13 +165,8 @@ postFirstRepositoryR :: Handler Html postFirstRepositoryR = page "Getting started" (Just Configuration) $ do unlessM (liftIO $ inPath "git") $ giveup "You need to install git in order to use git-annex!" -#ifdef __ANDROID__ - androidspecial <- liftIO $ doesDirectoryExist "/sdcard/DCIM" - let path = "/sdcard/annex" -#else androidspecial <- liftIO osAndroid path <- liftIO . defaultRepositoryPath =<< liftH inFirstRun -#endif ((res, form), enctype) <- liftH $ runFormPostNoToken $ newRepositoryForm path case res of FormSuccess (RepositoryPath p) -> liftH $ @@ -180,12 +175,8 @@ postFirstRepositoryR = page "Getting started" (Just Configuration) $ do getAndroidCameraRepositoryR :: Handler () getAndroidCameraRepositoryR = do -#ifdef __ANDROID__ - let dcim = "/sdcard/DCIM" -#else home <- liftIO myHomeDir let dcim = home "storage" "dcim" -#endif startFullAssistant dcim SourceGroup $ Just addignore where addignore = do @@ -392,10 +383,6 @@ driveList = mapM (genRemovableDrive . mnt_dir) =<< filter sane <$> getMounts | dir == "/tmp" = False | dir == "/run/shm" = False | dir == "/run/lock" = False -#ifdef __ANDROID__ - | dir == "/mnt/sdcard" = False - | dir == "/sdcard" = False -#endif | otherwise = True #endif diff --git a/Assistant/WebApp/Configurators/Ssh.hs b/Assistant/WebApp/Configurators/Ssh.hs index 52e8247aa1..8bf92e550f 100644 --- a/Assistant/WebApp/Configurators/Ssh.hs +++ b/Assistant/WebApp/Configurators/Ssh.hs @@ -116,7 +116,6 @@ sshInputAForm hostnamefield d = normalize <$> gen bad_username textField bad_username = "bad user name" :: Text -#ifndef __ANDROID__ bad_hostname = "cannot resolve host name" :: Text check_hostname = checkM (liftIO . checkdns) hostnamefield @@ -131,10 +130,6 @@ sshInputAForm hostnamefield d = normalize <$> gen | otherwise -> Right $ T.pack fullname Just [] -> Right t Nothing -> Left bad_hostname -#else - -- getAddrInfo currently broken on Android - check_hostname = hostnamefield -- unchecked -#endif -- The directory is implicitly in home, so remove any leading ~/ normalize i = i { inputDirectory = normalizedir <$> inputDirectory i } diff --git a/Assistant/WebApp/Configurators/Upgrade.hs b/Assistant/WebApp/Configurators/Upgrade.hs index 3ef361c432..1fa0087129 100644 --- a/Assistant/WebApp/Configurators/Upgrade.hs +++ b/Assistant/WebApp/Configurators/Upgrade.hs @@ -5,7 +5,7 @@ - Licensed under the GNU AGPL version 3 or higher. -} -{-# LANGUAGE CPP, QuasiQuotes, TemplateHaskell, OverloadedStrings #-} +{-# LANGUAGE QuasiQuotes, TemplateHaskell, OverloadedStrings #-} module Assistant.WebApp.Configurators.Upgrade where @@ -15,22 +15,11 @@ import Assistant.Upgrade import Assistant.Restart import Config -{- On Android, just point the user at the apk file to download. - - Installation will be handled by selecting the downloaded file. - - - - Otherwise, start the upgrade process, which will run fully - - noninteractively. - - -} +{- Start the upgrade process. -} getConfigStartUpgradeR :: GitAnnexDistribution -> Handler Html getConfigStartUpgradeR d = do -#ifdef ANDROID_SPLICES - let url = distributionUrl d - page "Upgrade" (Just Configuration) $ - $(widgetFile "configurators/upgrade/android") -#else liftAssistant $ startDistributionDownload d redirect DashboardR -#endif {- Finish upgrade by starting the new assistant in the same repository this - one is running in, and redirecting to it. -} diff --git a/Assistant/WebApp/Page.hs b/Assistant/WebApp/Page.hs index 0e5f4fae3e..07a33ea7fe 100644 --- a/Assistant/WebApp/Page.hs +++ b/Assistant/WebApp/Page.hs @@ -5,7 +5,7 @@ - Licensed under the GNU AGPL version 3 or higher. -} -{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings, RankNTypes, CPP #-} +{-# LANGUAGE TypeFamilies, QuasiQuotes, MultiParamTypeClasses, TemplateHaskell, OverloadedStrings, RankNTypes #-} module Assistant.WebApp.Page where @@ -71,12 +71,5 @@ customPage' with_longpolling navbaritem content = do where navdetails i = (navBarName i, navBarRoute i, Just i == navbaritem) -hasFileBrowser :: Bool -#ifdef ANDROID_SPLICES -hasFileBrowser = False -#else -hasFileBrowser = True -#endif - controlMenu :: Widget controlMenu = $(widgetFile "controlmenu") diff --git a/Build/EvilSplicer.hs b/Build/EvilSplicer.hs deleted file mode 100644 index e07034c5b0..0000000000 --- a/Build/EvilSplicer.hs +++ /dev/null @@ -1,738 +0,0 @@ -{- Expands template haskell splices - - - - You should probably just use http://hackage.haskell.org/package/zeroth - - instead. I wish I had known about it before writing this. - - - - First, the code must be built with a ghc that supports TH, - - and the splices dumped to a log. For example: - - cabal build --ghc-options=-ddump-splices 2>&1 | tee log - - - - Along with the log, a headers file may also be provided, containing - - additional imports needed by the template haskell code. - - - - This program will parse the log, and expand all splices therein, - - writing files to the specified destdir (which can be "." to modify - - the source tree directly). They can then be built a second - - time, with a ghc that does not support TH. - - - - Note that template haskell code may refer to symbols that are not - - exported by the library that defines the TH code. In this case, - - the library has to be modifed to export those symbols. - - - - There can also be other problems with the generated code; it may - - need modifications to compile. - - - - - - Copyright 2013 Joey Hess - - - - Licensed under the GNU GPL version 3 or higher. - -} - -module Main where - -import Text.Parsec -import Text.Parsec.String -import Control.Applicative ((<$>)) -import Data.Either -import Data.List hiding (find) -import Data.Char -import System.Environment -import System.FilePath -import System.IO -import Control.Monad -import Prelude hiding (log) - -import Utility.Monad -import Utility.Misc -import Utility.Exception hiding (try) -import Utility.Path -import Utility.FileSystemEncoding -import Utility.Directory -import Utility.Split - -data Coord = Coord - { coordLine :: Int - , coordColumn :: Int - } - deriving (Read, Show) - -offsetCoord :: Coord -> Coord -> Coord -offsetCoord a b = Coord - (coordLine a - coordLine b) - (coordColumn a - coordColumn b) - -data SpliceType = SpliceExpression | SpliceDeclaration - deriving (Read, Show, Eq) - -data Splice = Splice - { splicedFile :: FilePath - , spliceStart :: Coord - , spliceEnd :: Coord - , splicedExpression :: String - , splicedCode :: String - , spliceType :: SpliceType - } - deriving (Read, Show) - -isExpressionSplice :: Splice -> Bool -isExpressionSplice s = spliceType s == SpliceExpression - -number :: Parser Int -number = read <$> many1 digit - -{- A pair of Coords is written in one of three ways: - - "95:21-73", "1:1", or "(92,25)-(94,2)" - -} -coordsParser :: Parser (Coord, Coord) -coordsParser = (try singleline <|> try weird <|> multiline) "Coords" - where - singleline = do - line <- number - void $ char ':' - startcol <- number - void $ char '-' - endcol <- number - return $ (Coord line startcol, Coord line endcol) - - weird = do - line <- number - void $ char ':' - col <- number - return $ (Coord line col, Coord line col) - - multiline = do - start <- fromparens - void $ char '-' - end <- fromparens - return $ (start, end) - - fromparens = between (char '(') (char ')') $ do - line <- number - void $ char ',' - col <- number - return $ Coord line col - -indent :: Parser String -indent = many1 $ char ' ' - -restOfLine :: Parser String -restOfLine = newline `after` many (noneOf "\n") - -indentedLine :: Parser String -indentedLine = indent >> restOfLine - -spliceParser :: Parser Splice -spliceParser = do - file <- many1 (noneOf ":\n") - void $ char ':' - (start, end) <- coordsParser - void $ string ": Splicing " - splicetype <- tosplicetype - <$> (string "expression" <|> string "declarations") - void newline - - getthline <- expressionextractor - expression <- unlines <$> many1 getthline - - void indent - void $ string "======>" - void newline - - getcodeline <- expressionextractor - realcoords <- try (Right <$> getrealcoords file) <|> (Left <$> getcodeline) - codelines <- many getcodeline - return $ case realcoords of - Left firstcodeline -> - Splice file start end expression - (unlines $ firstcodeline:codelines) - splicetype - Right (realstart, realend) -> - Splice file realstart realend expression - (unlines codelines) - splicetype - where - tosplicetype "declarations" = SpliceDeclaration - tosplicetype "expression" = SpliceExpression - tosplicetype s = error $ "unknown splice type: " ++ s - - {- All lines of the indented expression start with the same - - indent, which is stripped. Any other indentation is preserved. -} - expressionextractor = do - i <- lookAhead indent - return $ try $ do - void $ string i - restOfLine - - {- When splicing declarations, GHC will output a splice - - at 1:1, and then inside the splice code block, - - the first line will give the actual coordinates of the - - line that was spliced. -} - getrealcoords file = do - void indent - void $ string file - void $ char ':' - char '\n' `after` coordsParser - -{- Extracts the splices, ignoring the rest of the compiler output. -} -splicesExtractor :: Parser [Splice] -splicesExtractor = rights <$> many extract - where - extract = try (Right <$> spliceParser) <|> (Left <$> compilerJunkLine) - compilerJunkLine = restOfLine - -{- Modifies the source file, expanding the splices, which all must - - have the same splicedFile. Writes the new file to the destdir. - - - - Each splice's Coords refer to the original position in the file, - - and not to its position after any previous splices may have inserted - - or removed lines. - - - - To deal with this complication, the file is broken into logical lines - - (which can contain any String, including a multiline or empty string). - - Each splice is assumed to be on its own block of lines; two - - splices on the same line is not currently supported. - - This means that a splice can modify the logical lines within its block - - as it likes, without interfering with the Coords of other splices. - - - - As well as expanding splices, this can add a block of imports to the - - file. These are put right before the first line in the file that - - starts with "import " - -} -applySplices :: FilePath -> Maybe String -> [Splice] -> IO () -applySplices _ _ [] = noop -applySplices destdir imports splices@(first:_) = do - let f = splicedFile first - let dest = (destdir f) - lls <- map (++ "\n") . lines <$> readFileStrict f - createDirectoryIfMissing True (parentDir dest) - let newcontent = concat $ addimports $ expand lls splices - oldcontent <- catchMaybeIO $ readFileStrict dest - when (oldcontent /= Just newcontent) $ do - putStrLn $ "splicing " ++ f - withFile dest WriteMode $ \h -> do - hPutStr h newcontent - hClose h - where - expand lls [] = lls - expand lls (s:rest) - | isExpressionSplice s = expand (expandExpressionSplice s lls) rest - | otherwise = expand (expandDeclarationSplice s lls) rest - - addimports lls = case imports of - Nothing -> lls - Just v -> - let (start, end) = break ("import " `isPrefixOf`) lls - in if null end - then start - else concat - [ start - , [v] - , end - ] - -{- Declaration splices are expanded to replace their whole line. -} -expandDeclarationSplice :: Splice -> [String] -> [String] -expandDeclarationSplice s lls = concat [before, [splice], end] - where - cs = spliceStart s - ce = spliceEnd s - - (before, rest) = splitAt (coordLine cs - 1) lls - (_oldlines, end) = splitAt (1 + coordLine (offsetCoord ce cs)) rest - splice = mangleCode $ splicedCode s - -{- Expression splices are expanded within their line. -} -expandExpressionSplice :: Splice -> [String] -> [String] -expandExpressionSplice sp lls = concat [before, spliced:padding, end] - where - cs = spliceStart sp - ce = spliceEnd sp - - (before, rest) = splitAt (coordLine cs - 1) lls - (oldlines, end) = splitAt (1 + coordLine (offsetCoord ce cs)) rest - (splicestart, padding, spliceend) = case map expandtabs oldlines of - ss:r - | null r -> (ss, [], ss) - | otherwise -> (ss, take (length r) (repeat []), last r) - _ -> ([], [], []) - spliced = concat - [ joinsplice $ deqqstart $ take (coordColumn cs - 1) splicestart - , addindent (findindent splicestart) (mangleCode $ splicedCode sp) - , deqqend $ drop (coordColumn ce) spliceend - ] - - {- coordinates assume tabs are expanded to 8 spaces -} - expandtabs = replace "\t" (take 8 $ repeat ' ') - - {- splicing leaves $() quasiquote behind; remove it -} - deqqstart s = case reverse s of - ('(':'$':restq) -> reverse restq - _ -> s - deqqend (')':s) = s - deqqend s = s - - {- Prepare the code that comes just before the splice so - - the splice will combine with it appropriately. -} - joinsplice s - -- all indentation? Skip it, we'll use the splice's indentation - | all isSpace s = "" - -- function definition needs no preparation - -- ie: foo = $(splice) - | "=" `isSuffixOf` s' = s - -- nor does lambda definition or case expression - | "->" `isSuffixOf` s' = s - -- nor does a let .. in declaration - | "in" `isSuffixOf` s' = s - -- already have a $ to set off the splice - -- ie: foo $ $(splice) - | "$" `isSuffixOf` s' = s - -- need to add a $ to set off the splice - -- ie: bar $(splice) - | otherwise = s ++ " $ " - where - s' = filter (not . isSpace) s - - findindent = length . takeWhile isSpace - addindent n = unlines . map (i ++) . lines - where - i = take n $ repeat ' ' - -{- Tweaks code output by GHC in splices to actually build. Yipes. -} -mangleCode :: String -> String -mangleCode = flip_colon - . persist_dequalify_hack - . let_do - . remove_unnecessary_type_signatures - . lambdaparenhackyesod - . lambdaparenhackpersistent - . lambdaparens - . declaration_parens - . case_layout - . case_layout_multiline - . yesod_url_render_hack - . text_builder_hack - . nested_instances - . boxed_fileembed - . collapse_multiline_strings - . remove_package_version - . emptylambda - where - {- Lambdas are often output without parens around them. - - This breaks when the lambda is immediately applied to a - - parameter. - - - - For example: - - - - renderRoute (StaticR sub_a1nUH) - - = \ (a_a1nUI, b_a1nUJ) - - -> (((pack "static") : a_a1nUI), - - b_a1nUJ) - - (renderRoute sub_a1nUH) - - - - There are sometimes many lines of lambda code that need to be - - parenthesised. Approach: find the "->" and scan down the - - column to the first non-whitespace. This is assumed - - to be the expression after the lambda. - - - - Runs recursively on the body of the lambda, to handle nested - - lambdas. - -} - lambdaparens = parsecAndReplace $ do - -- skip lambdas inside tuples or parens - prefix <- noneOf "(, \n" - preindent <- many1 $ oneOf " \n" - void $ string "\\ " - lambdaparams <- restofline - continuedlambdaparams <- many $ try $ do - indent1 <- many1 $ char ' ' - p <- satisfy isLetter - aram <- many $ satisfy isAlphaNum <|> oneOf "_" - void newline - return $ indent1 ++ p:aram ++ "\n" - indent1 <- many1 $ char ' ' - void $ string "-> " - firstline <- restofline - lambdalines <- many $ try $ do - void $ string indent1 - void $ char ' ' - l <- restofline - return $ indent1 ++ " " ++ l - return $ concat - [ prefix:preindent - , "(\\ " ++ lambdaparams ++ "\n" - , concat continuedlambdaparams - , indent1 ++ "-> " - , lambdaparens $ intercalate "\n" (firstline:lambdalines) - , ")\n" - ] - - {- Hack to add missing parens in a specific case in yesod - - static route code. - - - - StaticR - - yesod_dispatch_env_a4iDV - - (\ p_a4iE2 r_a4iE3 - - -> r_a4iE3 - - {Network.Wai.pathInfo = p_a4iE2} - - xrest_a4iDT req_a4iDW)) } - - - - Need to add another paren around the lambda, and close it - - before its parameters. lambdaparens misses this one because - - there is already one paren present. - - - - Note that the { } may be on the same line, or wrapped to next. - - - - FIXME: This is a hack. lambdaparens could just always add a - - layer of parens even when a lambda seems to be in parent. - -} - lambdaparenhackyesod = parsecAndReplace $ do - indent1 <- many1 $ char ' ' - staticr <- string "StaticR" - void newline - void $ string indent1 - yesod_dispatch_env <- restofline - void $ string indent1 - lambdaprefix <- string "(\\ " - l1 <- restofline - void $ string indent1 - lambdaarrow <- string " ->" - l2 <- restofline - l3 <- if '{' `elem` l2 && '}' `elem` l2 - then return "" - else do - void $ string indent1 - restofline - return $ unlines - [ indent1 ++ staticr - , indent1 ++ yesod_dispatch_env - , indent1 ++ "(" ++ lambdaprefix ++ l1 - , indent1 ++ lambdaarrow ++ l2 ++ l3 ++ ")" - ] - - {- Hack to reorder misplaced paren in persistent code. - - - - = ((Right Fscked) - - (\ persistValue_a36iM - - -> case fromPersistValue persistValue_a36iM of { - - Right r_a36iN -> Right r_a36iN - - Left err_a36iO - - -> (Left - - $ ((("field " `Data.Monoid.mappend` (packPTH "key")) - - `Data.Monoid.mappend` ": ") - - `Data.Monoid.mappend` err_a36iO)) } - - x_a36iL)) - - - - Fixed by adding another level of params around the lambda - - (lambdaparams should be generalized to cover this case). - -} - lambdaparenhackpersistent = parsecAndReplace $ do - indent1 <- many1 $ char ' ' - start <- do - s1 <- string "(\\ " - s2 <- string "persistValue_" - s3 <- restofline - return $ s1 ++ s2 ++ s3 - void $ string indent1 - indent2 <- many1 $ char ' ' - void $ string "-> " - l1 <- restofline - lambdalines <- many $ try $ do - void $ string $ indent1 ++ indent2 ++ " " - l <- restofline - return $ indent1 ++ indent2 ++ " " ++ l - return $ concat - [ indent1 ++ "(" ++ start ++ "\n" - , indent1 ++ indent2 ++ "-> " ++ l1 ++ "\n" - , intercalate "\n" lambdalines - , ")\n" - ] - - restofline = manyTill (noneOf "\n") newline - - {- For some reason, GHC sometimes doesn't like the multiline - - strings it creates. It seems to get hung up on \{ at the - - start of a new line sometimes, wanting it to not be escaped. - - - - To work around what is likely a GHC bug, just collapse - - multiline strings. -} - collapse_multiline_strings = parsecAndReplace $ do - void $ string "\\\n" - void $ many1 $ oneOf " \t" - void $ string "\\" - return "\\n" - - {- GHC outputs splices using explicit braces rather than layout. - - For a case expression, it does something weird: - - - - case foo of { - - xxx -> blah - - yyy -> blah }; - - - - This is not legal Haskell; the statements in the case must be - - separated by ';' - - - - To fix, we could just put a semicolon at the start of every line - - containing " -> " ... Except that lambdas also contain that. - - But we can get around that: GHC outputs lambdas like this: - - - - \ foo - - -> bar - - - - Or like this: - - - - \ foo -> bar - - - - So, we can put the semicolon at the start of every line - - containing " -> " unless there's a "\ " first, or it's - - all whitespace up until it. - -} - case_layout = skipfree $ parsecAndReplace $ do - void newline - indent1 <- many1 $ char ' ' - prefix <- manyTill (noneOf "\n") (try (string "-> ")) - if length prefix > 20 - then unexpected "too long a prefix" - else if "\\ " `isInfixOf` prefix - then unexpected "lambda expression" - else if null prefix - then unexpected "second line of lambda" - else return $ "\n" ++ indent1 ++ "; " ++ prefix ++ " -> " - {- Sometimes cases themselves span multiple lines: - - - - Nothing - - -> foo - - - - -- This is not yet handled! - - ComplexConstructor var var - - var var - - -> foo - -} - case_layout_multiline = skipfree $ parsecAndReplace $ do - void newline - indent1 <- many1 $ char ' ' - firstline <- restofline - - void $ string indent1 - indent2 <- many1 $ char ' ' - void $ string "-> " - if "\\ " `isInfixOf` firstline - then unexpected "lambda expression" - else return $ "\n" ++ indent1 ++ "; " ++ firstline ++ "\n" - ++ indent1 ++ indent2 ++ "-> " - - {- Type definitions for free monads triggers the case_* hacks, avoid. -} - skipfree f s - | "MonadFree" `isInfixOf` s = s - | otherwise = f s - - {- (foo, \ -> bar) is not valid haskell, GHC. - - Change to (foo, bar) - - - - (Does this ever happen outside a tuple? Only saw - - it inside them.. - -} - emptylambda = replace ", \\ -> " ", " - - {- GHC may output this: - - - - instance RenderRoute WebApp where - - data instance Route WebApp - - ^^^^^^^^ - - The marked word should not be there. - - - - FIXME: This is a yesod and persistent-specific hack, - - it should look for the outer instance. - -} - nested_instances = replace " data instance Route" " data Route" - . replace " data instance Unique" " data Unique" - . replace " data instance EntityField" " data EntityField" - . replace " type instance PersistEntityBackend" " type PersistEntityBackend" - - {- GHC does not properly parenthesise generated data type - - declarations. -} - declaration_parens = replace "StaticR Route Static" "StaticR (Route Static)" - - {- A type signature is sometimes given for an entire lambda, - - which is not properly parenthesized or laid out. This is a - - hack to remove one specific case where this happens and the - - signature is easily inferred, so is just removed. - -} - remove_unnecessary_type_signatures = parsecAndReplace $ do - void $ string " ::" - void newline - void $ many1 $ char ' ' - void $ string "Text.Css.Block Text.Css.Resolved" - void newline - return "" - - {- GHC may add full package and version qualifications for - - symbols from unimported modules. We don't want these. - - - - Examples: - - "blaze-html-0.4.3.1:Text.Blaze.Internal.preEscapedText" - - "ghc-prim:GHC.Types.:" - -} - remove_package_version = parsecAndReplace $ - mangleSymbol <$> qualifiedSymbol - - mangleSymbol "GHC.Types." = "" - mangleSymbol "GHC.Tuple." = "" - mangleSymbol s = s - - qualifiedSymbol :: Parser String - qualifiedSymbol = do - s <- hstoken - void $ char ':' - if length s < 5 - then unexpected "too short to be a namespace" - else do - t <- hstoken - case t of - (c:r) | isUpper c && "." `isInfixOf` r -> return t - _ -> unexpected "not a module qualified symbol" - - hstoken :: Parser String - hstoken = do - t <- satisfy isLetter - oken <- many $ satisfy isAlphaNum <|> oneOf "-.'" - return $ t:oken - - {- This works when it's "GHC.Types.:", but we strip - - that above, so have to fix up after it here. - - The ; is added by case_layout. -} - flip_colon = replace "; : _ " "; _ : " - - {- TH for persistent has some qualified symbols in places - - that are not allowed. -} - persist_dequalify_hack = replace "Database.Persist.TH.++" "`Data.Text.append`" - . replace "Database.Persist.Sql.Class.sqlType" "sqlType" - . replace "Database.Persist.Class.PersistField.toPersistValue" "toPersistValue" - . replace "Database.Persist.Class.PersistField.fromPersistValue" "fromPersistValue" - - {- Sometimes generates invalid bracketed code with a let - - expression: - - - - foo = do { let x = foo; - - use foo } - - - - Fix by converting the "let x = " to "x <- return $" - -} - let_do = parsecAndReplace $ do - void $ string "= do { let " - x <- many $ noneOf "=\r\n" - _ <- many1 $ oneOf " \t\r\n" - void $ string "= " - return $ "= do { " ++ x ++ " <- return $ " - -{- Embedded files use unsafe packing, which is problematic - - for several reasons, including that GHC sometimes omits trailing - - newlines in the file content, which leads to the wrong byte - - count. Also, GHC sometimes outputs unicode characters, which - - are not legal in unboxed strings. - - - - Avoid problems by converting: - - GHC.IO.unsafePerformIO - - (Data.ByteString.Unsafe.unsafePackAddressLen - - lllll - - "blabblah"#)), - - to: - - Data.ByteString.Char8.pack "blabblah"), - - - - Note that the string is often multiline. This only works if - - collapse_multiline_strings has run first. - -} -boxed_fileembed :: String -> String -boxed_fileembed = parsecAndReplace $ do - i <- indent - void $ string "GHC.IO.unsafePerformIO" - void newline - void indent - void $ string "(Data.ByteString.Unsafe.unsafePackAddressLen" - void newline - void indent - void number - void newline - void indent - void $ char '"' - s <- restOfLine - let s' = take (length s - 5) s - if "\"#))," `isSuffixOf` s - then return (i ++ "Data.ByteString.Char8.pack \"" ++ s' ++ "\"),\n") - else fail "not an unboxed string" - -{- This works around a problem in the expanded template haskell for Yesod - - type-safe url rendering. - - - - It generates code like this: - - - - (toHtml - - (\ u_a2ehE -> urender_a2ehD u_a2ehE [] - - (CloseAlert aid))))); - - - - Where urender_a2ehD is the function returned by getUrlRenderParams. - - But, that function that only takes 2 params, not 3. - - And toHtml doesn't take a parameter at all! - - - - So, this modifes the code, to look like this: - - - - (toHtml - - (flip urender_a2ehD [] - - (CloseAlert aid))))); - - - - FIXME: Investigate and fix this properly. - -} -yesod_url_render_hack :: String -> String -yesod_url_render_hack = parsecAndReplace $ do - void $ string "(toHtml" - void whitespace - void $ string "(\\" - void whitespace - wtf <- hstoken - void whitespace - void $ string "->" - void whitespace - renderer <- hstoken - void whitespace - void $ string wtf - void whitespace - return $ "(toHtml (flip " ++ renderer ++ " " - where - whitespace :: Parser String - whitespace = many $ oneOf " \t\r\n" - - hstoken :: Parser String - hstoken = many1 $ satisfy isAlphaNum <|> oneOf "_" - -{- Use exported symbol. -} -text_builder_hack :: String -> String -text_builder_hack = replace "Data.Text.Lazy.Builder.Internal.fromText" "Data.Text.Lazy.Builder.fromText" - -{- Given a Parser that finds strings it wants to modify, - - and returns the modified string, does a mass - - find and replace throughout the input string. - - Rather slow, but crazy powerful. -} -parsecAndReplace :: Parser String -> String -> String -parsecAndReplace p s = case parse find "" s of - Left _e -> s - Right l -> concatMap (either return id) l - where - find :: Parser [Either Char String] - find = many $ try (Right <$> p) <|> (Left <$> anyChar) - -main :: IO () -main = do - useFileSystemEncoding - go =<< getArgs - where - go (destdir:log:header:[]) = run destdir log (Just header) - go (destdir:log:[]) = run destdir log Nothing - go _ = error "usage: EvilSplicer destdir logfile [headerfile]" - - run destdir log mheader = do - r <- parseFromFile splicesExtractor log - case r of - Left e -> error $ show e - Right splices -> do - let groups = groupBy (\a b -> splicedFile a == splicedFile b) splices - imports <- maybe (return Nothing) (catchMaybeIO . readFile) mheader - mapM_ (applySplices destdir imports) groups diff --git a/BuildFlags.hs b/BuildFlags.hs index e750506e6e..5fdc4df914 100644 --- a/BuildFlags.hs +++ b/BuildFlags.hs @@ -62,11 +62,6 @@ buildFlags = filter (not . null) #ifdef WITH_DESKTOP_NOTIFY , "DesktopNotify" #endif -#ifdef WITH_CONCURRENTOUTPUT - , "ConcurrentOutput" -#else -#warning Building without ConcurrentOutput -#endif #ifdef WITH_TORRENTPARSER , "TorrentParser" #endif diff --git a/CHANGELOG b/CHANGELOG index 78e077db89..fbffe3e8e0 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,12 @@ +git-annex (6.20181012) UNRELEASED; urgency=medium + + * Removed the old Android app. + * Removed support for building with very old ghc < 8.0.1, + and with yesod < 1.4.3, and without concurrent-output, + which were onyl being used for the Android cross build. + + -- Joey Hess Sat, 13 Oct 2018 00:52:02 -0400 + git-annex (6.20181011) upstream; urgency=medium * sync: Warn when a remote's export is not updated to the current diff --git a/COPYRIGHT b/COPYRIGHT index 3c1c93da90..0e11d74c83 100644 --- a/COPYRIGHT +++ b/COPYRIGHT @@ -33,7 +33,7 @@ Files: Utility/* Copyright: 2012-2018 Joey Hess License: BSD-2-clause -Files: doc/logo* */favicon.ico standalone/osx/git-annex.app/Contents/Resources/git-annex.icns standalone/android/icons/* +Files: doc/logo* */favicon.ico standalone/osx/git-annex.app/Contents/Resources/git-annex.icns Copyright: 2007 Henrik Nyh 2010 Joey Hess 2013 John Lawrence diff --git a/CmdLine/Action.hs b/CmdLine/Action.hs index 2abf902053..2b0b7de419 100644 --- a/CmdLine/Action.hs +++ b/CmdLine/Action.hs @@ -24,10 +24,7 @@ import Control.Concurrent.STM import Control.Exception (throwIO) import Data.Either import qualified Data.Map.Strict as M - -#ifdef WITH_CONCURRENTOUTPUT import qualified System.Console.Regions as Regions -#endif {- Runs a command, starting with the check stage, and then - the seek stage. Finishes by running the continutation, and @@ -169,7 +166,6 @@ callCommandActionQuiet = start {- Do concurrent output when that has been requested. -} allowConcurrentOutput :: Annex a -> Annex a -#ifdef WITH_CONCURRENTOUTPUT allowConcurrentOutput a = do fromcmdline <- Annex.getState Annex.concurrency fromgitcfg <- annexJobs <$> Annex.getGitConfig @@ -197,9 +193,6 @@ allowConcurrentOutput a = do setconcurrentoutputenabled False setconcurrentoutputenabled b = Annex.changeState $ \s -> s { Annex.output = (Annex.output s) { concurrentOutputEnabled = b } } -#else -allowConcurrentOutput = id -#endif {- Ensures that only one thread processes a key at a time. - Other threads will block until it's done. -} diff --git a/Command/Fix.hs b/Command/Fix.hs index 4439616761..eae27727cd 100644 --- a/Command/Fix.hs +++ b/Command/Fix.hs @@ -18,7 +18,7 @@ import Annex.Content import Annex.Perms import qualified Annex.Queue import qualified Database.Keys -#if ! defined(mingw32_HOST_OS) && ! defined(__ANDROID__) +#if ! defined(mingw32_HOST_OS) import Utility.Touch #endif @@ -91,7 +91,7 @@ makeHardLink file key = do fixSymlink :: FilePath -> FilePath -> CommandPerform fixSymlink file link = do liftIO $ do -#if ! defined(mingw32_HOST_OS) && ! defined(__ANDROID__) +#if ! defined(mingw32_HOST_OS) -- preserve mtime of symlink mtime <- catchMaybeIO $ TimeSpec . modificationTime <$> getSymbolicLinkStatus file @@ -99,7 +99,7 @@ fixSymlink file link = do createDirectoryIfMissing True (parentDir file) removeFile file createSymbolicLink link file -#if ! defined(mingw32_HOST_OS) && ! defined(__ANDROID__) +#if ! defined(mingw32_HOST_OS) maybe noop (\t -> touch file t False) mtime #endif next $ cleanupSymlink file diff --git a/Command/Info.hs b/Command/Info.hs index 2fcd602a61..1fcf9b9d94 100644 --- a/Command/Info.hs +++ b/Command/Info.hs @@ -13,9 +13,7 @@ import "mtl" Control.Monad.State.Strict import qualified Data.Map.Strict as M import qualified Data.Vector as V import Data.Ord -#if MIN_VERSION_base(4,9,0) import qualified Data.Semigroup as Sem -#endif import Prelude import Command @@ -60,26 +58,18 @@ data KeyData = KeyData , backendsKeys :: M.Map KeyVariety Integer } -appendKeyData :: KeyData -> KeyData -> KeyData -appendKeyData a b = KeyData - { countKeys = countKeys a + countKeys b - , sizeKeys = sizeKeys a + sizeKeys b - , unknownSizeKeys = unknownSizeKeys a + unknownSizeKeys b - , backendsKeys = backendsKeys a <> backendsKeys b - } - -#if MIN_VERSION_base(4,9,0) instance Sem.Semigroup KeyData where - (<>) = appendKeyData -#endif + a <> b = KeyData + { countKeys = countKeys a + countKeys b + , sizeKeys = sizeKeys a + sizeKeys b + , unknownSizeKeys = unknownSizeKeys a + unknownSizeKeys b + , backendsKeys = backendsKeys a <> backendsKeys b + } instance Monoid KeyData where mempty = KeyData 0 0 0 M.empty -#if MIN_VERSION_base(4,11,0) -#elif MIN_VERSION_base(4,9,0) +#if ! MIN_VERSION_base(4,11,0) mappend = (Sem.<>) -#else - mappend = appendKeyData #endif data NumCopiesStats = NumCopiesStats diff --git a/Command/WebApp.hs b/Command/WebApp.hs index c380c312e7..fc5b8805a6 100644 --- a/Command/WebApp.hs +++ b/Command/WebApp.hs @@ -19,9 +19,6 @@ import Assistant.Install import Annex.Environment import Utility.WebApp import Utility.Daemon (checkDaemon) -#ifdef __ANDROID__ -import Utility.Env -#endif import Utility.UserInfo import Annex.Init import qualified Git @@ -188,18 +185,7 @@ firstRun o = do Annex.eval state $ startDaemon True True Nothing Nothing (listenAddress o) $ Just $ sendurlback v - sendurlback v _origout _origerr url _htmlshim = do - recordUrl url - putMVar v url - -recordUrl :: String -> IO () -#ifdef __ANDROID__ -{- The Android app has a menu item that opens the url recorded - - in this file. -} -recordUrl url = writeFile "/sdcard/git-annex.home/.git-annex-url" url -#else -recordUrl _ = noop -#endif + sendurlback v _origout _origerr url _htmlshim = putMVar v url openBrowser :: Maybe FilePath -> FilePath -> String -> Maybe Handle -> Maybe Handle -> IO () openBrowser mcmd htmlshim realurl outh errh = do @@ -207,7 +193,6 @@ openBrowser mcmd htmlshim realurl outh errh = do openBrowser' mcmd htmlshim' realurl outh errh openBrowser' :: Maybe FilePath -> FilePath -> String -> Maybe Handle -> Maybe Handle -> IO () -#ifndef __ANDROID__ openBrowser' mcmd htmlshim realurl outh errh = ifM osAndroid {- Android does not support file:// urls well, but neither @@ -216,20 +201,6 @@ openBrowser' mcmd htmlshim realurl outh errh = ( runbrowser realurl , runbrowser (fileUrl htmlshim) ) -#else -openBrowser' mcmd htmlshim realurl outh errh = do - recordUrl realurl - {- Android's `am` command does not work reliably across the - - wide range of Android devices. Intead, FIFO should be set to - - the filename of a fifo that we can write the URL to. -} - v <- getEnv "FIFO" - case v of - Nothing -> runbrowser realurl - Just f -> void $ forkIO $ do - fd <- openFd f WriteOnly Nothing defaultFileFlags - void $ fdWrite fd realurl - closeFd fd -#endif where runbrowser url = do let p = case mcmd of diff --git a/Git/Env.hs b/Git/Env.hs index 7e5a2b242e..d29ef9e3c3 100644 --- a/Git/Env.hs +++ b/Git/Env.hs @@ -5,8 +5,6 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Git.Env where import Common @@ -18,28 +16,11 @@ import Utility.Env - does not have any gitEnv yet. -} adjustGitEnv :: Repo -> ([(String, String)] -> [(String, String)]) -> IO Repo adjustGitEnv g adj = do - e <- maybe copyGitEnv return (gitEnv g) + e <- maybe getEnvironment return (gitEnv g) let e' = adj e return $ g { gitEnv = Just e' } where -{- Copies the current environment, so it can be adjusted when running a git - - command. -} -copyGitEnv :: IO [(String, String)] -copyGitEnv = do -#ifdef __ANDROID__ - {- This should not be necessary on Android, but there is some - - weird getEnvironment breakage. See - - https://github.com/neurocyte/ghc-android/issues/7 - - Use getEnv to get some key environment variables that - - git expects to have. -} - let keyenv = words "USER PATH GIT_EXEC_PATH HOSTNAME HOME" - let getEnvPair k = maybe Nothing (\v -> Just (k, v)) <$> getEnv k - catMaybes <$> forM keyenv getEnvPair -#else - getEnvironment -#endif - addGitEnv :: Repo -> String -> String -> IO Repo addGitEnv g var val = adjustGitEnv g (addEntry var val) diff --git a/Git/Fsck.hs b/Git/Fsck.hs index 3092ff2c67..a6d3c9b3bc 100644 --- a/Git/Fsck.hs +++ b/Git/Fsck.hs @@ -26,9 +26,7 @@ import qualified Git.Version import qualified Data.Set as S import Control.Concurrent.Async -#if MIN_VERSION_base(4,9,0) import qualified Data.Semigroup as Sem -#endif import Prelude data FsckResults @@ -58,18 +56,13 @@ appendFsckOutput AllDuplicateEntriesWarning AllDuplicateEntriesWarning = AllDupl appendFsckOutput AllDuplicateEntriesWarning NoFsckOutput = AllDuplicateEntriesWarning appendFsckOutput NoFsckOutput AllDuplicateEntriesWarning = AllDuplicateEntriesWarning -#if MIN_VERSION_base(4,9,0) instance Sem.Semigroup FsckOutput where (<>) = appendFsckOutput -#endif instance Monoid FsckOutput where mempty = NoFsckOutput -#if MIN_VERSION_base(4,11,0) -#elif MIN_VERSION_base(4,9,0) +#if ! MIN_VERSION_base(4,11,0) mappend = (Sem.<>) -#else - mappend = appendFsckOutput #endif {- Runs fsck to find some of the broken objects in the repository. diff --git a/Makefile b/Makefile index 4f741623ff..149309f593 100644 --- a/Makefile +++ b/Makefile @@ -109,7 +109,7 @@ clean: if [ "$(BUILDER)" != ./Setup ] && [ "$(BUILDER)" != cabal ]; then $(BUILDER) clean; fi rm -rf tmp dist git-annex $(mans) configure *.tix .hpc \ doc/.ikiwiki html dist tags Build/SysConfig Build/Version \ - Setup Build/InstallDesktopFile Build/EvilSplicer \ + Setup Build/InstallDesktopFile \ Build/Standalone Build/OSXMkLibs Build/LinuxMkLibs \ Build/DistributionUpdate Build/BuildVersion Build/MakeMans \ git-annex-shell git-union-merge .tasty-rerun-log @@ -118,8 +118,6 @@ clean: Build/InstallDesktopFile: Build/InstallDesktopFile.hs $(GHC) --make $@ -Wall -fno-warn-tabs -Build/EvilSplicer: Build/EvilSplicer.hs - $(GHC) --make $@ -Wall -fno-warn-tabs Build/Standalone: Build/Standalone.hs tmp/configure-stamp $(GHC) --make $@ -Wall -fno-warn-tabs Build/OSXMkLibs: Build/OSXMkLibs.hs @@ -234,47 +232,6 @@ osxapp: hdiutil create -format UDBZ -size 640m -srcfolder tmp/build-dmg \ -volname git-annex -o tmp/git-annex.dmg -ANDROID_FLAGS?= -# Cross compile for Android. -# Uses https://github.com/neurocyte/ghc-android -android: Build/EvilSplicer - echo "Running native build, to get TH splices.." - if [ ! -e dist/setup/setup ]; then $(BUILDER) configure -O0 $(ANDROID_FLAGS) -fAndroidSplice; fi - mkdir -p tmp - if ! $(BUILDER) build --ghc-options=-ddump-splices 2> tmp/dump-splices; then tail tmp/dump-splices >&2; exit 1; fi - echo "Setting up Android build tree.." - ./Build/EvilSplicer tmp/splices tmp/dump-splices standalone/no-th/evilsplicer-headers.hs - rsync -az --exclude tmp --exclude dist . tmp/androidtree -# Copy the files with expanded splices to the source tree, but -# only if the existing source file is not newer. (So, if a file -# used to have TH splices but they were removed, it will be newer, -# and not overwritten.) - cp -uR tmp/splices/* tmp/androidtree || true -# Some additional dependencies needed by the expanded splices. - sed -i 's/^ Build-Depends: */ Build-Depends: yesod-core, yesod-routes, shakespeare, blaze-markup, file-embed, wai-app-static, wai, unordered-containers, /' tmp/androidtree/git-annex.cabal -# Avoid warnings due to sometimes unused imports added for the splices. - sed -i 's/GHC-Options: \(.*\)-Wall/GHC-Options: \1-Wall -fno-warn-unused-imports /i' tmp/androidtree/git-annex.cabal - sed -i 's/Extensions: /Extensions: MagicHash /i' tmp/androidtree/git-annex.cabal -# Cabal cannot cross compile with custom build type, so workaround. - sed -i 's/Build-type: Custom/Build-type: Simple/' tmp/androidtree/git-annex.cabal -# Build just once, but link repeatedly, for different versions of Android. - mkdir -p tmp/androidtree/dist/build/git-annex/4.0 tmp/androidtree/dist/build/git-annex/4.3 tmp/androidtree/dist/build/git-annex/5.0 - if [ ! -e tmp/androidtree/dist/setup-config ]; then \ - cd tmp/androidtree && CROSS_COMPILE=Android $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \ - fi - PATH=$(shell standalone/android/toolchainpath 4) cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \ - && mv dist/build/git-annex/git-annex dist/build/git-annex/4.0/git-annex - PATH=$(shell standalone/android/toolchainpath 4) cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \ - --ghc-options=-optl-z --ghc-options=-optlnocopyreloc \ - && mv dist/build/git-annex/git-annex dist/build/git-annex/4.3/git-annex - PATH=$(shell standalone/android/toolchainpath 5) cd tmp/androidtree && $$HOME/.ghc/$(shell cat standalone/android/abiversion)/arm-linux-androideabi/bin/cabal build \ - --ghc-options=-optl-z --ghc-options=-optlnocopyreloc --ghc-options=-optl-fPIE --ghc-options=-optl-pie --ghc-options=-optc-fPIE --ghc-options=-optc-pie \ - && mv dist/build/git-annex/git-annex dist/build/git-annex/5.0/git-annex - -androidapp: - $(MAKE) android - $(MAKE) -C standalone/android - # Bypass cabal, and only run the main ghc --make command for a # faster development build. fast: dist/cabalbuild diff --git a/Messages/Concurrent.hs b/Messages/Concurrent.hs index 8d69d6bbc5..7580edd2ea 100644 --- a/Messages/Concurrent.hs +++ b/Messages/Concurrent.hs @@ -14,7 +14,6 @@ import Types import Types.Messages import qualified Annex -#ifdef WITH_CONCURRENTOUTPUT import Common import qualified System.Console.Concurrent as Console import qualified System.Console.Regions as Regions @@ -23,7 +22,6 @@ import qualified Data.Text as T #ifndef mingw32_HOST_OS import GHC.IO.Encoding #endif -#endif {- Outputs a message in a concurrency safe way. - @@ -33,15 +31,10 @@ import GHC.IO.Encoding - instead. -} concurrentMessage :: MessageState -> Bool -> String -> Annex () -> Annex () -#ifdef WITH_CONCURRENTOUTPUT concurrentMessage s iserror msg fallback | concurrentOutputEnabled s = go =<< consoleRegion <$> Annex.getState Annex.output -#else -concurrentMessage _s _iserror _msg fallback -#endif | otherwise = fallback -#ifdef WITH_CONCURRENTOUTPUT where go Nothing | iserror = liftIO $ Console.errorConcurrent msg @@ -58,7 +51,6 @@ concurrentMessage _s _iserror _msg fallback rl <- takeTMVar Regions.regionList putTMVar Regions.regionList (if r `elem` rl then rl else r:rl) -#endif {- Runs an action in its own dedicated region of the console. - @@ -70,7 +62,6 @@ concurrentMessage _s _iserror _msg fallback - complete. -} inOwnConsoleRegion :: MessageState -> Annex a -> Annex a -#ifdef WITH_CONCURRENTOUTPUT inOwnConsoleRegion s a | concurrentOutputEnabled s = do r <- mkregion @@ -85,11 +76,7 @@ inOwnConsoleRegion s a Right ret -> do rmregion r return ret -#else -inOwnConsoleRegion _s a -#endif | otherwise = a -#ifdef WITH_CONCURRENTOUTPUT where -- The region is allocated here, but not displayed until -- a message is added to it. This avoids unnecessary screen @@ -108,10 +95,8 @@ inOwnConsoleRegion _s a unless (T.null t) $ Console.bufferOutputSTM h t Regions.closeConsoleRegion r -#endif {- The progress region is displayed inline with the current console region. -} -#ifdef WITH_CONCURRENTOUTPUT withProgressRegion :: (Regions.ConsoleRegion -> Annex a) -> Annex a withProgressRegion a = do parent <- consoleRegion <$> Annex.getState Annex.output @@ -119,14 +104,12 @@ withProgressRegion a = do instance Regions.LiftRegion Annex where liftRegion = liftIO . atomically -#endif {- The concurrent-output library uses Text, which bypasses the normal use - of the fileSystemEncoding to roundtrip invalid characters, when in a - non-unicode locale. Work around that problem by avoiding using - concurrent output when not in a unicode locale. -} concurrentOutputSupported :: IO Bool -#ifdef WITH_CONCURRENTOUTPUT #ifndef mingw32_HOST_OS concurrentOutputSupported = do enc <- getLocaleEncoding @@ -134,9 +117,6 @@ concurrentOutputSupported = do #else concurrentOutputSupported = return True -- Windows is always unicode #endif -#else -concurrentOutputSupported = return False -#endif {- Hide any currently displayed console regions while running the action, - so that the action can use the console itself. @@ -144,7 +124,6 @@ concurrentOutputSupported = return False - the regions will not be hidden, but the action still runs, garbling the - display. -} hideRegionsWhile :: Annex a -> Annex a -#ifdef WITH_CONCURRENTOUTPUT #if MIN_VERSION_concurrent_output(1,9,0) hideRegionsWhile a = bracketIO setup cleanup go where @@ -156,6 +135,3 @@ hideRegionsWhile a = bracketIO setup cleanup go #else hideRegionsWhile = id #endif -#else -hideRegionsWhile = id -#endif diff --git a/Messages/Progress.hs b/Messages/Progress.hs index bd43dbfc4b..49df6d34cc 100644 --- a/Messages/Progress.hs +++ b/Messages/Progress.hs @@ -5,8 +5,6 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Messages.Progress where import Common @@ -16,12 +14,10 @@ import Types import Types.Messages import Types.Key import qualified Messages.JSON as JSON - -#ifdef WITH_CONCURRENTOUTPUT import Messages.Concurrent + import qualified System.Console.Regions as Regions import qualified System.Console.Concurrent as Console -#endif {- Shows a progress meter while performing a transfer of a key. - The action is passed the meter and a callback to use to update the meter. @@ -45,7 +41,6 @@ metered othermeter key getsrcfile a = withMessageState $ \st -> liftIO $ clearMeterHandle meter stdout return r go msize (MessageState { outputType = NormalOutput, concurrentOutputEnabled = True }) = -#if WITH_CONCURRENTOUTPUT withProgressRegion $ \r -> do meter <- liftIO $ mkMeter msize $ \_ msize' old new -> let s = bandwidthMeter msize' old new @@ -53,9 +48,6 @@ metered othermeter key getsrcfile a = withMessageState $ \st -> m <- liftIO $ rateLimitMeterUpdate 0.2 meter $ updateMeter meter a meter (combinemeter m) -#else - nometer -#endif go msize (MessageState { outputType = JSONOutput jsonoptions }) | jsonProgress jsonoptions = do buf <- withMessageState $ return . jsonBuffer @@ -133,7 +125,6 @@ mkStderrRelayer = do mkStderrEmitter :: Annex (String -> IO ()) mkStderrEmitter = withMessageState go where -#ifdef WITH_CONCURRENTOUTPUT - go s | concurrentOutputEnabled s = return Console.errorConcurrent -#endif - go _ = return (hPutStrLn stderr) + go s + | concurrentOutputEnabled s = return Console.errorConcurrent + | otherwise = return (hPutStrLn stderr) diff --git a/Types/DesktopNotify.hs b/Types/DesktopNotify.hs index ce7e4c4a3e..59facb33b4 100644 --- a/Types/DesktopNotify.hs +++ b/Types/DesktopNotify.hs @@ -10,9 +10,7 @@ module Types.DesktopNotify where import Data.Monoid -#if MIN_VERSION_base(4,9,0) import qualified Data.Semigroup as Sem -#endif import Prelude data DesktopNotify = DesktopNotify @@ -21,22 +19,14 @@ data DesktopNotify = DesktopNotify } deriving (Show) -appendDesktopNotify :: DesktopNotify -> DesktopNotify -> DesktopNotify -appendDesktopNotify (DesktopNotify s1 f1) (DesktopNotify s2 f2) = - DesktopNotify (s1 || s2) (f1 || f2) - -#if MIN_VERSION_base(4,9,0) instance Sem.Semigroup DesktopNotify where - (<>) = appendDesktopNotify -#endif + (DesktopNotify s1 f1) <> (DesktopNotify s2 f2) = + DesktopNotify (s1 || s2) (f1 || f2) instance Monoid DesktopNotify where mempty = DesktopNotify False False -#if MIN_VERSION_base(4,11,0) -#elif MIN_VERSION_base(4,9,0) +#if ! MIN_VERSION_base(4,11,0) mappend = (Sem.<>) -#else - mappend = appendDesktopNotify #endif mkNotifyStart :: DesktopNotify diff --git a/Types/Difference.hs b/Types/Difference.hs index 0f7100c0c0..b804b68998 100644 --- a/Types/Difference.hs +++ b/Types/Difference.hs @@ -26,9 +26,7 @@ import qualified Git.Config import Data.Maybe import Data.Monoid import qualified Data.Set as S -#if MIN_VERSION_base(4,9,0) import qualified Data.Semigroup as Sem -#endif import Prelude -- Describes differences from the v5 repository format. @@ -80,18 +78,13 @@ appendDifferences a@(Differences {}) b@(Differences {}) = a } appendDifferences _ _ = UnknownDifferences -#if MIN_VERSION_base(4,9,0) instance Sem.Semigroup Differences where (<>) = appendDifferences -#endif instance Monoid Differences where mempty = Differences False False False -#if MIN_VERSION_base(4,11,0) -#elif MIN_VERSION_base(4,9,0) +#if ! MIN_VERSION_base(4,11,0) mappend = (Sem.<>) -#else - mappend = appendDifferences #endif readDifferences :: String -> Differences diff --git a/Types/Messages.hs b/Types/Messages.hs index 8ca60651f6..609587a433 100644 --- a/Types/Messages.hs +++ b/Types/Messages.hs @@ -5,16 +5,12 @@ - Licensed under the GNU GPL version 3 or higher. -} -{-# LANGUAGE CPP #-} - module Types.Messages where import qualified Utility.Aeson as Aeson import Control.Concurrent -#ifdef WITH_CONCURRENTOUTPUT import System.Console.Regions (ConsoleRegion) -#endif data OutputType = NormalOutput | QuietOutput | JSONOutput JSONOptions deriving (Show) @@ -40,10 +36,8 @@ data MessageState = MessageState , concurrentOutputEnabled :: Bool , sideActionBlock :: SideActionBlock , implicitMessages :: Bool -#ifdef WITH_CONCURRENTOUTPUT , consoleRegion :: Maybe ConsoleRegion , consoleRegionErrFlag :: Bool -#endif , jsonBuffer :: Maybe Aeson.Object , promptLock :: MVar () -- left full when not prompting } @@ -56,10 +50,8 @@ newMessageState = do , concurrentOutputEnabled = False , sideActionBlock = NoBlock , implicitMessages = True -#ifdef WITH_CONCURRENTOUTPUT , consoleRegion = Nothing , consoleRegionErrFlag = False -#endif , jsonBuffer = Nothing , promptLock = promptlock } diff --git a/Types/Test.hs b/Types/Test.hs index 5a9a9e075c..aa593cd2d7 100644 --- a/Types/Test.hs +++ b/Types/Test.hs @@ -11,9 +11,7 @@ module Types.Test where import Test.Tasty.Options import Data.Monoid -#if MIN_VERSION_base(4,9,0) import qualified Data.Semigroup as Sem -#endif import Prelude import Types.Command @@ -25,25 +23,17 @@ data TestOptions = TestOptions , internalData :: CmdParams } -appendTestOptions :: TestOptions -> TestOptions -> TestOptions -appendTestOptions a b = TestOptions - (tastyOptionSet a <> tastyOptionSet b) - (keepFailuresOption a || keepFailuresOption b) - (fakeSsh a || fakeSsh b) - (internalData a <> internalData b) - -#if MIN_VERSION_base(4,9,0) instance Sem.Semigroup TestOptions where - (<>) = appendTestOptions -#endif + a <> b = TestOptions + (tastyOptionSet a <> tastyOptionSet b) + (keepFailuresOption a || keepFailuresOption b) + (fakeSsh a || fakeSsh b) + (internalData a <> internalData b) instance Monoid TestOptions where mempty = TestOptions mempty False False mempty -#if MIN_VERSION_base(4,11,0) -#elif MIN_VERSION_base(4,9,0) +#if ! MIN_VERSION_base(4,11,0) mappend = (Sem.<>) -#else - mappend = appendTestOptions #endif type TestRunner = TestOptions -> IO () diff --git a/Utility/Batch.hs b/Utility/Batch.hs index d96f9d3f37..0c6d9da755 100644 --- a/Utility/Batch.hs +++ b/Utility/Batch.hs @@ -11,7 +11,7 @@ module Utility.Batch where import Common -#if defined(linux_HOST_OS) || defined(__ANDROID__) +#if defined(linux_HOST_OS) import Control.Concurrent.Async import System.Posix.Process #endif @@ -29,7 +29,7 @@ import qualified Control.Exception as E - systems, the action is simply ran. -} batch :: IO a -> IO a -#if defined(linux_HOST_OS) || defined(__ANDROID__) +#if defined(linux_HOST_OS) batch a = wait =<< batchthread where batchthread = asyncBound $ do @@ -51,11 +51,7 @@ getBatchCommandMaker = do #ifndef mingw32_HOST_OS nicers <- filterM (inPath . fst) [ ("nice", []) -#ifndef __ANDROID__ - -- Android's ionice does not allow specifying a command, - -- so don't use it. , ("ionice", ["-c3"]) -#endif , ("nocache", []) ] return $ \(command, params) -> diff --git a/Utility/CopyFile.hs b/Utility/CopyFile.hs index 4ad85b7db1..4f3c9f4286 100644 --- a/Utility/CopyFile.hs +++ b/Utility/CopyFile.hs @@ -5,8 +5,6 @@ - License: BSD-2-clause -} -{-# LANGUAGE CPP #-} - module Utility.CopyFile ( copyFileExternal, createLinkOrCopy, @@ -32,7 +30,6 @@ copyFileExternal meta src dest = do removeFile dest boolSystem "cp" $ params ++ [File src, File dest] where -#ifndef __ANDROID__ params = map snd $ filter fst [ (BuildInfo.cp_reflink_auto, Param "--reflink=auto") , (allmeta && BuildInfo.cp_a, Param "-a") @@ -41,9 +38,6 @@ copyFileExternal meta src dest = do , (not allmeta && BuildInfo.cp_preserve_timestamps , Param "--preserve=timestamps") ] -#else - params = if allmeta then [] else [] -#endif allmeta = meta == CopyAllMetaData {- Create a hard link if the filesystem allows it, and fall back to copying diff --git a/Utility/DiskFree.hs b/Utility/DiskFree.hs index be4e823558..39e266162d 100644 --- a/Utility/DiskFree.hs +++ b/Utility/DiskFree.hs @@ -13,8 +13,6 @@ module Utility.DiskFree ( getDiskSize ) where -#ifndef __ANDROID__ - import System.DiskSpace import Utility.Applicative import Utility.Exception @@ -24,15 +22,3 @@ getDiskFree = catchMaybeIO . getAvailSpace getDiskSize :: FilePath -> IO (Maybe Integer) getDiskSize = fmap diskTotal <$$> catchMaybeIO . getDiskUsage - -#else - -#warning Building without disk free space checking support - -getDiskFree :: FilePath -> IO (Maybe Integer) -getDiskFree _ = return Nothing - -getDiskSize :: FilePath -> IO (Maybe Integer) -getDiskSize _ = return Nothing - -#endif diff --git a/Utility/Exception.hs b/Utility/Exception.hs index 67c2e85d81..bcadb78988 100644 --- a/Utility/Exception.hs +++ b/Utility/Exception.hs @@ -5,7 +5,7 @@ - License: BSD-2-clause -} -{-# LANGUAGE CPP, ScopedTypeVariables #-} +{-# LANGUAGE ScopedTypeVariables #-} {-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.Exception ( @@ -29,11 +29,7 @@ module Utility.Exception ( import Control.Monad.Catch as X hiding (Handler) import qualified Control.Monad.Catch as M import Control.Exception (IOException, AsyncException) -#ifdef MIN_VERSION_GLASGOW_HASKELL -#if MIN_VERSION_GLASGOW_HASKELL(7,10,0,0) import Control.Exception (SomeAsyncException) -#endif -#endif import Control.Monad import Control.Monad.IO.Class (liftIO, MonadIO) import System.IO.Error (isDoesNotExistError, ioeGetErrorType) @@ -46,15 +42,7 @@ import Utility.Data - where there's a problem that the user is excpected to see in some - circumstances. -} giveup :: [Char] -> a -#ifdef MIN_VERSION_base -#if MIN_VERSION_base(4,9,0) giveup = errorWithoutStackTrace -#else -giveup = error -#endif -#else -giveup = error -#endif {- Catches IO errors and returns a Bool -} catchBoolIO :: MonadCatch m => m Bool -> m Bool @@ -95,11 +83,7 @@ bracketIO setup cleanup = bracket (liftIO setup) (liftIO . cleanup) catchNonAsync :: MonadCatch m => m a -> (SomeException -> m a) -> m a catchNonAsync a onerr = a `catches` [ M.Handler (\ (e :: AsyncException) -> throwM e) -#ifdef MIN_VERSION_GLASGOW_HASKELL -#if MIN_VERSION_GLASGOW_HASKELL(7,10,0,0) , M.Handler (\ (e :: SomeAsyncException) -> throwM e) -#endif -#endif , M.Handler (\ (e :: SomeException) -> onerr e) ] diff --git a/Utility/Lsof.hs b/Utility/Lsof.hs index 7cab8d98a7..90b22cc7bc 100644 --- a/Utility/Lsof.hs +++ b/Utility/Lsof.hs @@ -5,8 +5,6 @@ - License: BSD-2-clause -} -{-# LANGUAGE CPP #-} - module Utility.Lsof where import Common @@ -54,13 +52,6 @@ query opts = type LsofParser = String -> [(FilePath, LsofOpenMode, ProcessInfo)] -parse :: LsofParser -#ifdef __ANDROID__ -parse = parseDefault -#else -parse = parseFormatted -#endif - {- Parsing null-delimited output like: - - pPID\0cCMDLINE\0 @@ -71,8 +62,8 @@ parse = parseFormatted - Where each new process block is started by a pid, and a process can - have multiple files open. -} -parseFormatted :: LsofParser -parseFormatted s = bundle $ go [] $ lines s +parse :: LsofParser +parse s = bundle $ go [] $ lines s where bundle = concatMap (\(fs, p) -> map (\(f, m) -> (f, m, p)) fs) @@ -110,14 +101,3 @@ parseFormatted s = bundle $ go [] $ lines s splitnull = splitc '\0' parsefail = error $ "failed to parse lsof output: " ++ show s - -{- Parses lsof's default output format. -} -parseDefault :: LsofParser -parseDefault = mapMaybe parseline . drop 1 . lines - where - parseline l = case words l of - (command : spid : _user : _fd : _type : _device : _size : _node : rest) -> - case readish spid of - Nothing -> Nothing - Just pid -> Just (unwords rest, OpenUnknown, ProcessInfo pid command) - _ -> Nothing diff --git a/Utility/Mounts.hs b/Utility/Mounts.hs index 47b24b1639..449b75dc5d 100644 --- a/Utility/Mounts.hs +++ b/Utility/Mounts.hs @@ -5,7 +5,6 @@ - License: BSD-2-clause -} -{-# LANGUAGE CPP #-} {-# OPTIONS_GHC -fno-warn-tabs #-} module Utility.Mounts (getMounts, Mntent(..)) where @@ -16,11 +15,7 @@ import System.MountPoints (Mntent(..)) import Utility.Exception getMounts :: IO [Mntent] -#ifndef __ANDROID__ getMounts = System.MountPoints.getMounts -- That will crash when the linux build is running on Android, -- so fall back to this. `catchNonAsync` const System.MountPoints.getProcMounts -#else -getMounts = System.MountPoints.getProcMounts -#endif diff --git a/Utility/Shell.hs b/Utility/Shell.hs index c64ca75b91..2f7cd3cb10 100644 --- a/Utility/Shell.hs +++ b/Utility/Shell.hs @@ -20,21 +20,11 @@ import Utility.PartialPrelude import System.FilePath #endif -shellPath_portable :: FilePath -shellPath_portable = "/bin/sh" +shellPath :: FilePath +shellPath = "/bin/sh" -shellPath_local :: FilePath -#ifndef __ANDROID__ -shellPath_local = shellPath_portable -#else -shellPath_local = "/system/bin/sh" -#endif - -shebang_portable :: String -shebang_portable = "#!" ++ shellPath_portable - -shebang_local :: String -shebang_local = "#!" ++ shellPath_local +shebang :: String +shebang = "#!" ++ shellPath -- | On Windows, shebang is not handled by the kernel, so to support -- shell scripts etc, have to look at the program being run and diff --git a/Utility/ThreadScheduler.hs b/Utility/ThreadScheduler.hs index da05e99669..5b46c92e3d 100644 --- a/Utility/ThreadScheduler.hs +++ b/Utility/ThreadScheduler.hs @@ -18,10 +18,8 @@ import System.Posix.IO #endif #ifndef mingw32_HOST_OS import System.Posix.Signals -#ifndef __ANDROID__ import System.Posix.Terminal #endif -#endif newtype Seconds = Seconds { fromSeconds :: Int } deriving (Eq, Ord, Show) @@ -63,10 +61,8 @@ waitForTermination = do let check sig = void $ installHandler sig (CatchOnce $ putMVar lock ()) Nothing check softwareTermination -#ifndef __ANDROID__ whenM (queryTerminal stdInput) $ check keyboardSignal -#endif takeMVar lock #endif diff --git a/Utility/Touch.hs b/Utility/Touch.hs index 62acea02ae..086160f564 100644 --- a/Utility/Touch.hs +++ b/Utility/Touch.hs @@ -13,7 +13,7 @@ module Utility.Touch ( touch ) where -#if ! defined(mingw32_HOST_OS) && ! defined(__ANDROID__) +#if ! defined(mingw32_HOST_OS) #if MIN_VERSION_unix(2,7,0) diff --git a/Utility/UserInfo.hs b/Utility/UserInfo.hs index a98576d488..17ce8db5a6 100644 --- a/Utility/UserInfo.hs +++ b/Utility/UserInfo.hs @@ -47,8 +47,8 @@ myUserName = myVal env userName #endif myUserGecos :: IO (Maybe String) --- userGecos crashes on Android and is not available on Windows. -#if defined(__ANDROID__) || defined(mingw32_HOST_OS) +-- userGecos is not available on Windows. +#if defined(mingw32_HOST_OS) myUserGecos = return Nothing #else myUserGecos = eitherToMaybe <$> myVal [] userGecos diff --git a/Utility/WebApp.hs b/Utility/WebApp.hs index 6fc154329d..5856bd756c 100644 --- a/Utility/WebApp.hs +++ b/Utility/WebApp.hs @@ -30,9 +30,6 @@ import Blaze.ByteString.Builder.Char.Utf8 (fromText) import Blaze.ByteString.Builder (Builder) import Control.Arrow ((***)) import Control.Concurrent -#ifdef __ANDROID__ -import Data.Endian -#endif localhost :: HostName localhost = "localhost" @@ -42,11 +39,6 @@ browserProc :: String -> CreateProcess #ifdef darwin_HOST_OS browserProc url = proc "open" [url] #else -#ifdef __ANDROID__ --- Warning: The `am` command does not work very reliably on Android. -browserProc url = proc "am" - ["start", "-a", "android.intent.action.VIEW", "-d", url] -#else #ifdef mingw32_HOST_OS -- Warning: On Windows, no quoting or escaping of the url seems possible, -- so spaces in it will cause problems. One approach is to make the url @@ -57,7 +49,6 @@ browserProc url = proc "cmd" ["/c start " ++ url] browserProc url = proc "xdg-open" [url] #endif #endif -#endif {- Binds to a socket on localhost, or possibly a different specified - hostname or address, and runs a webapp on it. @@ -69,19 +60,11 @@ runWebApp :: Maybe TLSSettings -> Maybe HostName -> Wai.Application -> (SockAddr runWebApp tlssettings h app observer = withSocketsDo $ do sock <- getSocket h void $ forkIO $ go webAppSettings sock app - sockaddr <- fixSockAddr <$> getSocketName sock + sockaddr <- getSocketName sock observer sockaddr where go = (maybe runSettingsSocket (\ts -> runTLSSocket ts) tlssettings) -fixSockAddr :: SockAddr -> SockAddr -#ifdef __ANDROID__ -{- On Android, the port is currently incorrectly returned in network - - byte order, which is wrong on little endian systems. -} -fixSockAddr (SockAddrInet (PortNum port) addr) = SockAddrInet (PortNum $ swapEndian port) addr -#endif -fixSockAddr addr = addr - -- disable buggy sloworis attack prevention code webAppSettings :: Settings webAppSettings = setTimeout halfhour defaultSettings diff --git a/Utility/Yesod.hs b/Utility/Yesod.hs index 5e85f3147e..c39ca8783a 100644 --- a/Utility/Yesod.hs +++ b/Utility/Yesod.hs @@ -1,7 +1,6 @@ {- Yesod stuff, that's typically found in the scaffolded site. - - - Also a bit of a compatability layer to make it easier to support yesod - - 1.1-1.4 in the same code base. + - Also a bit of a compatability layer for older versions of yesod. - - Copyright 2012-2014 Joey Hess - @@ -13,28 +12,18 @@ module Utility.Yesod ( module Y , liftH -#ifndef __NO_TH__ , widgetFile , hamletTemplate -#endif -#if ! MIN_VERSION_yesod_core(1,2,20) - , withUrlRenderer -#endif ) where import Yesod as Y import Yesod.Form.Bootstrap3 as Y hiding (bfs) -#ifndef __NO_TH__ import Yesod.Default.Util import Language.Haskell.TH.Syntax (Q, Exp) import Data.Default (def) import Text.Hamlet hiding (Html) -#endif -#if ! MIN_VERSION_yesod(1,4,0) import Data.Text (Text) -#endif -#ifndef __NO_TH__ widgetFile :: String -> Q Exp widgetFile = widgetFileNoReload $ def { wfsHamletSettings = defaultHamletSettings @@ -44,7 +33,6 @@ widgetFile = widgetFileNoReload $ def hamletTemplate :: FilePath -> FilePath hamletTemplate f = globFile "hamlet" f -#endif {- Lift Handler to Widget -} #if MIN_VERSION_yesod_core(1,6,0) @@ -53,8 +41,3 @@ liftH :: HandlerFor site a -> WidgetFor site a liftH :: Monad m => HandlerT site m a -> WidgetT site m a #endif liftH = handlerToWidget - -#if ! MIN_VERSION_yesod_core(1,2,20) -withUrlRenderer :: MonadHandler m => ((Route (HandlerSite m) -> [(Text, Text)] -> Text) -> output) -> m output -withUrlRenderer = giveUrlRenderer -#endif diff --git a/git-annex.cabal b/git-annex.cabal index 379af8a8e9..7b9f04eac6 100644 --- a/git-annex.cabal +++ b/git-annex.cabal @@ -218,7 +218,6 @@ Extra-Source-Files: templates/configurators/ssh/add.hamlet templates/configurators/ssh/setupmodal.hamlet templates/configurators/ssh/confirm.hamlet - templates/configurators/upgrade/android.hamlet templates/configurators/enableia.hamlet templates/configurators/fsck.hamlet templates/configurators/addrepository/archive.hamlet @@ -270,23 +269,12 @@ Flag Pairing Flag Production Description: Enable production build (slower build; faster binary) -Flag Android - Description: Cross building for Android - Default: False - -Flag AndroidSplice - Description: Building to get TH splices for Android - Default: False - Flag TorrentParser Description: Use haskell torrent library to parse torrent files Flag MagicMime Description: Use libmagic to determine file MIME types -Flag ConcurrentOutput - Description: Use concurrent-output library - Flag Benchmark Description: Enable benchmarking Default: False @@ -299,18 +287,18 @@ source-repository head location: git://git-annex.branchable.com/ custom-setup - Setup-Depends: base (>= 4.6), hslogger, split, unix-compat, process, + Setup-Depends: base (>= 4.9), hslogger, split, unix-compat, process, filepath, exceptions, bytestring, directory, IfElse, data-default, utf8-string, transformers, Cabal Executable git-annex Main-Is: git-annex.hs Build-Depends: - base (>= 4.6 && < 5.0), + base (>= 4.9 && < 5.0), network (>= 2.6.3.0), network-uri (>= 2.6), optparse-applicative (>= 0.11.0), - containers (>= 0.5.0.0), + containers (>= 0.5.7.1), exceptions (>= 0.6), stm (>= 2.3), mtl (>= 2), @@ -324,6 +312,7 @@ Executable git-annex SafeSemaphore, async, directory (>= 1.2), + disk-free-space, filepath, IfElse, hslogger, @@ -365,6 +354,7 @@ Executable git-annex memory, split, attoparsec, + concurrent-output (>= 1.6), QuickCheck (>= 2.1), tasty (>= 0.7), tasty-hunit, @@ -501,7 +491,7 @@ Executable git-annex Utility.Mounts Utility.OSX - if os(linux) || flag(Android) + if os(linux) Build-Depends: hinotify CPP-Options: -DWITH_INOTIFY Other-Modules: Utility.DirWatcher.INotify @@ -529,30 +519,21 @@ Executable git-annex CPP-Options: -DWITH_DBUS -DWITH_DESKTOP_NOTIFY -DWITH_DBUS_NOTIFICATIONS Other-Modules: Utility.DBus - if flag(Android) - Build-Depends: data-endian - CPP-Options: -D__ANDROID__ -DANDROID_SPLICES -D__NO_TH__ - else - Build-Depends: disk-free-space - - if flag(AndroidSplice) - CPP-Options: -DANDROID_SPLICES - if flag(Webapp) Build-Depends: - yesod (>= 1.2.6), - yesod-static (>= 1.2.4), - yesod-form (>= 1.3.15), - yesod-core (>= 1.2.19), - path-pieces (>= 0.1.4), - warp (>= 3.0.0.5), - warp-tls (>= 1.4), + yesod (>= 1.4.3), + yesod-static (>= 1.5.1), + yesod-form (>= 1.4.8), + yesod-core (>= 1.4.25), + path-pieces (>= 0.2.1), + warp (>= 3.2.8), + warp-tls (>= 3.2.2), wai, wai-extra, blaze-builder, clientsession, template-haskell, - shakespeare (>= 2.0.0) + shakespeare (>= 2.0.11) CPP-Options: -DWITH_WEBAPP Other-Modules: Command.WebApp @@ -605,10 +586,6 @@ Executable git-annex Build-Depends: magic CPP-Options: -DWITH_MAGICMIME - if flag(ConcurrentOutput) - Build-Depends: concurrent-output (>= 1.6) - CPP-Options: -DWITH_CONCURRENTOUTPUT - if flag(Benchmark) Build-Depends: criterion, deepseq CPP-Options: -DWITH_BENCHMARK diff --git a/stack.yaml b/stack.yaml index d135280fd6..d1374b7178 100644 --- a/stack.yaml +++ b/stack.yaml @@ -1,6 +1,5 @@ flags: git-annex: - concurrentoutput: true production: true assistant: true pairing: true @@ -10,8 +9,6 @@ flags: webapp: true magicmime: false dbus: false - android: false - androidsplice: false packages: - '.' extra-deps: diff --git a/standalone/android/.gitignore b/standalone/android/.gitignore deleted file mode 100644 index e8792ba9fd..0000000000 --- a/standalone/android/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -build-utils -start diff --git a/standalone/android/Makefile b/standalone/android/Makefile deleted file mode 100644 index 6f49b495f6..0000000000 --- a/standalone/android/Makefile +++ /dev/null @@ -1,84 +0,0 @@ -# Cross-compiles utilities needed for git-annex on Android, -# and builds the Android app. - -build: - ./buildapk 4 - ./buildapk 5 - -# Targets below are used by buildapk, which sets -# GIT_ANNEX_ANDROID_SOURCETREE - -source: $(GIT_ANNEX_ANDROID_SOURCETREE) - -$(GIT_ANNEX_ANDROID_SOURCETREE): - mkdir -p $(GIT_ANNEX_ANDROID_SOURCETREE) - git clone git://git.debian.org/git/d-i/busybox $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox - git clone git://git.kernel.org/pub/scm/git/git.git $(GIT_ANNEX_ANDROID_SOURCETREE)/git - git clone git://git.samba.org/rsync.git $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync - git clone git://git.gnupg.org/gnupg.git $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg - git clone git://git.openssl.org/openssl $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl - git clone git://github.com/CyanogenMod/android_external_openssh.git $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh - git clone git://github.com/jackpal/Android-Terminal-Emulator.git $(GIT_ANNEX_ANDROID_SOURCETREE)/term - -$(GIT_ANNEX_ANDROID_SOURCETREE)/openssl/build-stamp: - # This is a version which the openssh below can build with. - # Newer versions changed something to do with BIGNUM. - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && git reset --hard 616f71e486d693991b594439c884ec624b32c2d4 - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && CC=$$(which cc) ./Configure android - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssl && $(MAKE) - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/build-stamp: openssh.patch openssh.config.h - # This is a known-good version that the patch works with. - # TODO: Upgrade - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && git reset --hard 0a8617ed5af2f0248d0e9648e26b224e16ada742 - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && ./configure --host=arm-linux-androideabi --with-ssl-dir=../openssl --without-openssl-header-check - cat openssh.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && patch -p1) - cp openssh.config.h $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh/config.h - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && sed -i -e 's/getrrsetbyname.o //' openbsd-compat/Makefile - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && sed -i -e 's/auth-passwd.o //' Makefile - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/openssh && $(MAKE) ssh ssh-keygen - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/build-stamp: busybox_config - cp busybox_config $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox/.config - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && git reset --hard a758e3e1e04e7705f5d37b2f27be654cd0e7282c - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && yes '' | $(MAKE) oldconfig - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/busybox && $(MAKE) - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/git/build-stamp: git.patch - # This is a known-good version that the patch works with. - cat git.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/git && git reset --hard d9c691a759d62cef53a6cc11864a2ef4b0829244 && git am) - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/git && $(MAKE) install NO_OPENSSL=1 NO_GETTEXT=1 NO_GECOS_IN_PWENT=1 NO_GETPASS=1 NO_NSEC=1 NO_MKDTEMP=1 NO_PTHREADS=1 NO_PERL=1 NO_CURL=1 NO_EXPAT=1 NO_TCLTK=1 NO_ICONV=1 HAVE_CLOCK_GETTIME= HAVE_GETDELIM= prefix= DESTDIR=installed-tree - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/build-stamp: rsync.patch - # This is a known-good version that the patch works with. - cat rsync.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && git reset --hard eec26089b1c7bdbb260674480ffe6ece257bca63 && git am) - cp /usr/share/misc/config.sub /usr/share/misc/config.guess $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync/ - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && ./configure --host=arm-linux-androideabi --disable-locale --disable-iconv-open --disable-iconv --disable-acl-support --disable-xattr-support - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/rsync && $(MAKE) - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg/build-stamp: - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && git checkout gnupg-1.4.15 - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && ./autogen.sh - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg && ./configure --host=arm-linux-androideabi --disable-gnupg-iconv --disable-card-support --disable-agent-support --disable-photo-viewers --disable-keyserver-helpers --disable-nls - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/gnupg; $(MAKE) || true # expected failure in doc build - touch $@ - -$(GIT_ANNEX_ANDROID_SOURCETREE)/term/build-stamp: term.patch icons - # This is a known-good version that the patch works with. - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && git reset --hard 3d34b3c42295c215b62e70f3ee696dd664ba08ce - cat term.patch | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && patch -p1) - (cd icons && tar c .) | (cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term/res && tar x) - # This renaming has a purpose. It makes the path to the app's - # /data directory shorter, which makes ssh connection caching - # sockets placed there have more space for their filenames. - # Also, it avoids overlap with the Android Terminal Emulator - # app, if it's also installed. - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && find -name .git -prune -o -type f -print0 | xargs -0 perl -pi -e 's/jackpal/ga/g' - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && perl -pi -e 's/Terminal Emulator/Git Annex/g' res/*/strings.xml - cd $(GIT_ANNEX_ANDROID_SOURCETREE)/term && echo y | tools/update.sh || true - touch $@ diff --git a/standalone/android/abiversion b/standalone/android/abiversion deleted file mode 100644 index 4cc4c14cdb..0000000000 --- a/standalone/android/abiversion +++ /dev/null @@ -1 +0,0 @@ -android-14/arm-linux-androideabi-4.8 diff --git a/standalone/android/buildapk b/standalone/android/buildapk deleted file mode 100755 index 310949c089..0000000000 --- a/standalone/android/buildapk +++ /dev/null @@ -1,112 +0,0 @@ -#!/bin/sh -# -# Cross-compiles utilities needed for git-annex on Android, -# and builds the Android app. - -set -e - -androidversion=$1 -if [ -z "$androidversion" ]; then - echo "need android version (4 or 5) as parameter" >&2 - exit 1 -fi - -VER="$(perl -e '$_=<>;print m/\((.*?)\)/'<../../CHANGELOG)" - -PATH=$(./toolchainpath "$androidversion") -export PATH - -# Paths to the Android SDK and NDK. -export ANDROID_SDK_ROOT="$HOME/.android/adt-bundle-linux-x86/sdk" -export ANDROID_NDK_ROOT="$HOME/.android/android-ndk" - -GIT_ANNEX_ANDROID_SOURCETREE="$HOME/.android/git-annex-sourcetree" -export GIT_ANNEX_ANDROID_SOURCETREE -if [ ! -e "$GIT_ANNEX_ANDROID_SOURCETREE" ]; then - make source -fi -src="$GIT_ANNEX_ANDROID_SOURCETREE-$androidversion" -if [ ! -e "$src" ] ; then - cp -a "$GIT_ANNEX_ANDROID_SOURCETREE" "$src" -fi -GIT_ANNEX_ANDROID_SOURCETREE="$src" -export GIT_ANNEX_ANDROID_SOURCETREE - -gittree="$GIT_ANNEX_ANDROID_SOURCETREE/git/installed-tree" - -make "$GIT_ANNEX_ANDROID_SOURCETREE/openssl/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/busybox/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/rsync/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/gnupg/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/git/build-stamp" -make "$GIT_ANNEX_ANDROID_SOURCETREE/term/build-stamp" - -perl -i -pe 's/(android:versionName=)"[^"]+"/$1"'"$VER"'"/' \ - "$GIT_ANNEX_ANDROID_SOURCETREE/term/AndroidManifest.xml" - -# Debug build because it does not need signing keys. -(cd "$GIT_ANNEX_ANDROID_SOURCETREE/term" && tools/build-debug) - -# Install executables as pseudo-libraries so they will be -# unpacked from the .apk. -mkdir -p "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/busybox/busybox" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.busybox.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/ssh" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.ssh.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/openssh/ssh-keygen" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.ssh-keygen.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/rsync/rsync" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.rsync.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/gnupg/g10/gpg" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.gpg.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git-shell" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-shell.so" -cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git-upload-pack" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-upload-pack.so" -arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note "$GIT_ANNEX_ANDROID_SOURCETREE"/term/libs/armeabi/* -cp runshell "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.runshell.so" -cc start.c -o "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.start.so" - -# remove git stuff we don't need to save space -rm -rf $gittree/bin/git-cvsserver \ - $gittree/libexec/git-core/git-daemon \ - $gittree/libexec/git-core/git-show-index \ - $gittree/libexec/git-core/mergetools \ - $gittree/libexec/git-core/git-credential-* \ - $gittree/libexec/git-core/git-cvsserver \ - $gittree/libexec/git-core/git-cvsimport \ - $gittree/libexec/git-core/git-fast-import \ - $gittree/libexec/git-core/git-http-backend \ - $gittree/libexec/git-core/git-imap-send \ - $gittree/libexec/git-core/git-instaweb \ - $gittree/libexec/git-core/git-p4 \ - $gittree/libexec/git-core/git-remote-test* \ - $gittree/libexec/git-core/git-submodule \ - $gittree/libexec/git-core/git-svn \ - $gittree/libexec/git-core/git-web--browse - -# Most of git is in one multicall binary, but a few important -# commands are still shell scripts. Those are put into -# a tarball, along with a list of all the links that should be -# set up. -(cd $gittree && mkdir -p links) -(cd $gittree && find -samefile bin/git -not -wholename ./bin/git > links/git) -(cd $gittree && find -samefile bin/git-shell -not -wholename ./bin/git-shell > links/git-shell) -(cd $gittree && find -samefile bin/git-upload-pack -not -wholename ./bin/git-upload-pack > links/git-upload-pack) -(cd $gittree && find -type f -not -samefile bin/git -not -samefile bin/git-shell -not -samefile bin/git-upload-pack | tar czf ../git.tar.gz -T -) -(cp "$GIT_ANNEX_ANDROID_SOURCETREE/git/git.tar.gz" "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git.tar.gz.so") - -git rev-parse HEAD > "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.version.so" -cp ../trustedkeys.gpg "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.trustedkeys.so" - -genapk () { - mkdir -p ../../tmp/$1; \ - cp ../../tmp/androidtree/dist/build/git-annex/$1/git-annex "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-annex.so" - arm-linux-androideabi-strip --strip-unneeded --remove-section=.comment --remove-section=.note "$GIT_ANNEX_ANDROID_SOURCETREE/term/libs/armeabi/lib.git-annex.so" - (cd "$GIT_ANNEX_ANDROID_SOURCETREE/term" && ant debug) - cp "$GIT_ANNEX_ANDROID_SOURCETREE/term/bin/Term-debug.apk" ../../tmp/$1/git-annex.apk -} - -if [ "$androidversion" = 4 ]; then - for v in 4.0 4.3; do - genapk $v - done -else - genapk 5.0 -fi diff --git a/standalone/android/buildchroot b/standalone/android/buildchroot deleted file mode 100755 index e64bdd03d7..0000000000 --- a/standalone/android/buildchroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -set -e -if [ "$(whoami)" != root ]; then - echo "Must run this as root!" >&2 - exit 1 -fi - -debootstrap --arch=i386 jessie debian-stable-android -cp $0-inchroot debian-stable-android/tmp -cp $0-inchroot-asuser debian-stable-android/tmp -cp $(dirname $0)/abiversion debian-stable-android/tmp - -# Don't use these vars in the chroot. -unset TMP -unset TEMP -unset TMPDIR -unset TEMPDIR - -chroot debian-stable-android "tmp/$(basename $0)-inchroot" - -echo -echo -echo "debian-stable-android is set up, with a user builder" -echo "your next step is probably to check out git-annex in this chroot" -echo "and run standalone/android/install-haskell-packages" -echo -echo diff --git a/standalone/android/buildchroot-inchroot b/standalone/android/buildchroot-inchroot deleted file mode 100755 index 69653b7585..0000000000 --- a/standalone/android/buildchroot-inchroot +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh -# Runs inside the chroot set up by buildchroot -set -e -set -x -if [ "$(whoami)" != root ]; then - echo "Must run this as root!" >&2 - exit 1 -fi - -# java needs this mounted to work -mount -t proc proc /proc || true - -echo "deb-src http://ftp.us.debian.org/debian jessie main" >> /etc/apt/sources.list -apt-get update -apt-get -y install build-essential ghc git libncurses5-dev cabal-install -apt-get -y install happy alex -apt-get -y install llvm-3.4 -apt-get -y install ca-certificates curl file m4 autoconf zlib1g-dev -apt-get -y install libgnutls28-dev libxml2-dev libgsasl7-dev pkg-config c2hs -apt-get -y install ant default-jdk rsync wget gnupg lsof -apt-get -y install gettext unzip python -apt-get -y install locales automake -echo en_US.UTF-8 UTF-8 >> /etc/locale.gen -locale-gen -apt-get clean -useradd builder --create-home || true -su builder -c $0-asuser diff --git a/standalone/android/buildchroot-inchroot-asuser b/standalone/android/buildchroot-inchroot-asuser deleted file mode 100755 index a7bea231a8..0000000000 --- a/standalone/android/buildchroot-inchroot-asuser +++ /dev/null @@ -1,40 +0,0 @@ -#!/bin/sh -# Runs inside the chroot set up by buildchroot, as the user it creates -set -e -set -x - -# Put in /tmp by buildchroot, but when bootstrapping with propellor, -# this is run inside a checked out git-annex tree. -if [ -e /tmp/abiversion ]; then - ABIVERSION=$(cat /tmp/abiversion) -else - ABIVERSION=$(cat standalone/android/abiversion) -fi - -cd -rm -rf .ghc .cabal .android -mkdir -p .android -cd .android -git clone https://github.com/joeyh/ghc-android -cd ghc-android -git checkout jessie-ghc-snapshot -./build - -# This saves 2 gb, and the same sources are in build-*/ghc -rm -rf stage0 - -# Set up android SDK where the git-annex android Makefile -# expects to find it. -cd .. -ln -s ghc-android/android-ndk-* android-ndk -wget http://dl.google.com/android/adt/adt-bundle-linux-x86-20130917.zip -unzip adt*.zip -rm adt*.zip -mv adt-bundle-linux-x86-* adt-bundle-linux-x86 -rm -rf adt-bundle-linux-x86/eclipse - -# The git-annex android Makefile needs this cc symlink. -ln -s arm-linux-androideabi-gcc $HOME/.ghc/$ABIVERSION/bin/cc - -git config --global user.email androidbuilder@example.com -git config --global user.name androidbuilder diff --git a/standalone/android/busybox_config b/standalone/android/busybox_config deleted file mode 100644 index 28ea880d98..0000000000 --- a/standalone/android/busybox_config +++ /dev/null @@ -1,997 +0,0 @@ -# Run "make android2_defconfig", then "make". -# -# Tested with the standalone toolchain from ndk r6: -# android-ndk-r6/build/tools/make-standalone-toolchain.sh --platform=android-8 -# -CONFIG_HAVE_DOT_CONFIG=y - -# -# Busybox Settings -# - -# -# General Configuration -# -# CONFIG_DESKTOP is not set -# CONFIG_EXTRA_COMPAT is not set -# CONFIG_INCLUDE_SUSv2 is not set -# CONFIG_USE_PORTABLE_CODE is not set -CONFIG_PLATFORM_LINUX=y -CONFIG_FEATURE_BUFFERS_USE_MALLOC=y -# CONFIG_FEATURE_BUFFERS_GO_ON_STACK is not set -# CONFIG_FEATURE_BUFFERS_GO_IN_BSS is not set -# CONFIG_SHOW_USAGE is not set -# CONFIG_FEATURE_VERBOSE_USAGE is not set -# CONFIG_FEATURE_COMPRESS_USAGE is not set -CONFIG_FEATURE_INSTALLER=y -# CONFIG_INSTALL_NO_USR is not set -# CONFIG_LOCALE_SUPPORT is not set -# CONFIG_UNICODE_SUPPORT is not set -# CONFIG_UNICODE_USING_LOCALE is not set -# CONFIG_FEATURE_CHECK_UNICODE_IN_ENV is not set -CONFIG_SUBST_WCHAR=0 -CONFIG_LAST_SUPPORTED_WCHAR=0 -# CONFIG_UNICODE_COMBINING_WCHARS is not set -# CONFIG_UNICODE_WIDE_WCHARS is not set -# CONFIG_UNICODE_BIDI_SUPPORT is not set -# CONFIG_UNICODE_NEUTRAL_TABLE is not set -# CONFIG_UNICODE_PRESERVE_BROKEN is not set -# CONFIG_LONG_OPTS is not set -# CONFIG_FEATURE_DEVPTS is not set -# CONFIG_FEATURE_CLEAN_UP is not set -# CONFIG_FEATURE_UTMP is not set -# CONFIG_FEATURE_WTMP is not set -# CONFIG_FEATURE_PIDFILE is not set -# CONFIG_FEATURE_SUID is not set -# CONFIG_FEATURE_SUID_CONFIG is not set -# CONFIG_FEATURE_SUID_CONFIG_QUIET is not set -# CONFIG_SELINUX is not set -# CONFIG_FEATURE_PREFER_APPLETS is not set -CONFIG_BUSYBOX_EXEC_PATH="/proc/self/exe" -CONFIG_FEATURE_SYSLOG=y -# CONFIG_FEATURE_HAVE_RPC is not set - -# -# Build Options -# -# CONFIG_STATIC is not set -# CONFIG_PIE is not set -# CONFIG_NOMMU is not set -# CONFIG_BUILD_LIBBUSYBOX is not set -# CONFIG_FEATURE_INDIVIDUAL is not set -# CONFIG_FEATURE_SHARED_BUSYBOX is not set -# CONFIG_LFS is not set -CONFIG_CROSS_COMPILER_PREFIX="arm-linux-androideabi-" -CONFIG_EXTRA_CFLAGS="" - -# -# Debugging Options -# -# CONFIG_DEBUG is not set -# CONFIG_DEBUG_PESSIMIZE is not set -# CONFIG_WERROR is not set -CONFIG_NO_DEBUG_LIB=y -# CONFIG_DMALLOC is not set -# CONFIG_EFENCE is not set - -# -# Installation Options ("make install" behavior) -# -CONFIG_INSTALL_APPLET_SYMLINKS=y -# CONFIG_INSTALL_APPLET_HARDLINKS is not set -# CONFIG_INSTALL_APPLET_SCRIPT_WRAPPERS is not set -# CONFIG_INSTALL_APPLET_DONT is not set -# CONFIG_INSTALL_SH_APPLET_SYMLINK is not set -# CONFIG_INSTALL_SH_APPLET_HARDLINK is not set -# CONFIG_INSTALL_SH_APPLET_SCRIPT_WRAPPER is not set -CONFIG_PREFIX="./_install" - -# -# Busybox Library Tuning -# -# CONFIG_FEATURE_SYSTEMD is not set -# CONFIG_FEATURE_RTMINMAX is not set -CONFIG_PASSWORD_MINLEN=6 -CONFIG_MD5_SMALL=1 -# CONFIG_FEATURE_FAST_TOP is not set -# CONFIG_FEATURE_ETC_NETWORKS is not set -CONFIG_FEATURE_USE_TERMIOS=y -# CONFIG_FEATURE_EDITING is not set -CONFIG_FEATURE_EDITING_MAX_LEN=0 -# CONFIG_FEATURE_EDITING_VI is not set -CONFIG_FEATURE_EDITING_HISTORY=0 -# CONFIG_FEATURE_EDITING_SAVEHISTORY is not set -# CONFIG_FEATURE_TAB_COMPLETION is not set -# CONFIG_FEATURE_USERNAME_COMPLETION is not set -# CONFIG_FEATURE_EDITING_FANCY_PROMPT is not set -# CONFIG_FEATURE_EDITING_ASK_TERMINAL is not set -# CONFIG_FEATURE_NON_POSIX_CP is not set -# CONFIG_FEATURE_VERBOSE_CP_MESSAGE is not set -CONFIG_FEATURE_COPYBUF_KB=4 -# CONFIG_FEATURE_SKIP_ROOTFS is not set -# CONFIG_MONOTONIC_SYSCALL is not set -# CONFIG_IOCTL_HEX2STR_ERROR is not set -# CONFIG_FEATURE_HWIB is not set - -# -# Applets -# - -# -# Archival Utilities -# -CONFIG_FEATURE_SEAMLESS_XZ=y -CONFIG_FEATURE_SEAMLESS_LZMA=y -CONFIG_FEATURE_SEAMLESS_BZ2=y -CONFIG_FEATURE_SEAMLESS_GZ=y -CONFIG_FEATURE_SEAMLESS_Z=y -CONFIG_AR=y -CONFIG_FEATURE_AR_LONG_FILENAMES=y -CONFIG_FEATURE_AR_CREATE=y -CONFIG_BUNZIP2=y -CONFIG_BZIP2=y -CONFIG_CPIO=y -CONFIG_FEATURE_CPIO_O=y -CONFIG_FEATURE_CPIO_P=y -CONFIG_DPKG=y -CONFIG_DPKG_DEB=y -# CONFIG_FEATURE_DPKG_DEB_EXTRACT_ONLY is not set -CONFIG_GUNZIP=y -CONFIG_GZIP=y -# CONFIG_FEATURE_GZIP_LONG_OPTIONS is not set -CONFIG_LZOP=y -CONFIG_LZOP_COMPR_HIGH=y -CONFIG_RPM2CPIO=y -CONFIG_RPM=y -CONFIG_TAR=y -CONFIG_FEATURE_TAR_CREATE=y -CONFIG_FEATURE_TAR_AUTODETECT=y -CONFIG_FEATURE_TAR_FROM=y -CONFIG_FEATURE_TAR_OLDGNU_COMPATIBILITY=y -CONFIG_FEATURE_TAR_OLDSUN_COMPATIBILITY=y -CONFIG_FEATURE_TAR_GNU_EXTENSIONS=y -# CONFIG_FEATURE_TAR_LONG_OPTIONS is not set -# CONFIG_FEATURE_TAR_TO_COMMAND is not set -CONFIG_FEATURE_TAR_UNAME_GNAME=y -CONFIG_FEATURE_TAR_NOPRESERVE_TIME=y -# CONFIG_FEATURE_TAR_SELINUX is not set -CONFIG_UNCOMPRESS=y -CONFIG_UNLZMA=y -CONFIG_FEATURE_LZMA_FAST=y -CONFIG_LZMA=y -CONFIG_UNXZ=y -CONFIG_XZ=y -CONFIG_UNZIP=y - -# -# Coreutils -# -CONFIG_BASENAME=y -CONFIG_CAT=y -# CONFIG_DATE is not set -# CONFIG_FEATURE_DATE_ISOFMT is not set -# CONFIG_FEATURE_DATE_NANO is not set -# CONFIG_FEATURE_DATE_COMPAT is not set -# CONFIG_ID is not set -# CONFIG_GROUPS is not set -CONFIG_TEST=y -CONFIG_FEATURE_TEST_64=y -CONFIG_TOUCH=y -CONFIG_TR=y -CONFIG_FEATURE_TR_CLASSES=y -CONFIG_FEATURE_TR_EQUIV=y -CONFIG_BASE64=y -CONFIG_CAL=y -CONFIG_CATV=y -CONFIG_CHGRP=y -CONFIG_CHMOD=y -CONFIG_CHOWN=y -# CONFIG_FEATURE_CHOWN_LONG_OPTIONS is not set -CONFIG_CHROOT=y -CONFIG_CKSUM=y -CONFIG_COMM=y -CONFIG_CP=y -# CONFIG_FEATURE_CP_LONG_OPTIONS is not set -CONFIG_CUT=y -CONFIG_DD=y -CONFIG_FEATURE_DD_SIGNAL_HANDLING=y -CONFIG_FEATURE_DD_THIRD_STATUS_LINE=y -CONFIG_FEATURE_DD_IBS_OBS=y -# CONFIG_DF is not set -# CONFIG_FEATURE_DF_FANCY is not set -CONFIG_DIRNAME=y -CONFIG_DOS2UNIX=y -CONFIG_UNIX2DOS=y -CONFIG_DU=y -CONFIG_FEATURE_DU_DEFAULT_BLOCKSIZE_1K=y -CONFIG_ECHO=y -CONFIG_FEATURE_FANCY_ECHO=y -# CONFIG_ENV is not set -# CONFIG_FEATURE_ENV_LONG_OPTIONS is not set -CONFIG_EXPAND=y -# CONFIG_FEATURE_EXPAND_LONG_OPTIONS is not set -# CONFIG_EXPR is not set -# CONFIG_EXPR_MATH_SUPPORT_64 is not set -CONFIG_FALSE=y -CONFIG_FOLD=y -# CONFIG_FSYNC is not set -CONFIG_HEAD=y -CONFIG_FEATURE_FANCY_HEAD=y -# CONFIG_HOSTID is not set -CONFIG_INSTALL=y -# CONFIG_FEATURE_INSTALL_LONG_OPTIONS is not set -CONFIG_LN=y -# CONFIG_LOGNAME is not set -CONFIG_LS=y -CONFIG_FEATURE_LS_FILETYPES=y -CONFIG_FEATURE_LS_FOLLOWLINKS=y -CONFIG_FEATURE_LS_RECURSIVE=y -CONFIG_FEATURE_LS_SORTFILES=y -CONFIG_FEATURE_LS_TIMESTAMPS=y -CONFIG_FEATURE_LS_USERNAME=y -# CONFIG_FEATURE_LS_COLOR is not set -# CONFIG_FEATURE_LS_COLOR_IS_DEFAULT is not set -CONFIG_MD5SUM=y -CONFIG_MKDIR=y -# CONFIG_FEATURE_MKDIR_LONG_OPTIONS is not set -CONFIG_MKFIFO=y -CONFIG_MKNOD=y -CONFIG_MV=y -# CONFIG_FEATURE_MV_LONG_OPTIONS is not set -CONFIG_NICE=y -CONFIG_NOHUP=y -CONFIG_OD=y -CONFIG_PRINTENV=y -CONFIG_PRINTF=y -CONFIG_PWD=y -CONFIG_READLINK=y -CONFIG_FEATURE_READLINK_FOLLOW=y -CONFIG_REALPATH=y -CONFIG_RM=y -CONFIG_RMDIR=y -# CONFIG_FEATURE_RMDIR_LONG_OPTIONS is not set -CONFIG_SEQ=y -CONFIG_SHA1SUM=y -CONFIG_SHA256SUM=y -CONFIG_SHA512SUM=y -CONFIG_SLEEP=y -CONFIG_FEATURE_FANCY_SLEEP=y -CONFIG_FEATURE_FLOAT_SLEEP=y -CONFIG_SORT=y -CONFIG_FEATURE_SORT_BIG=y -CONFIG_SPLIT=y -CONFIG_FEATURE_SPLIT_FANCY=y -# CONFIG_STAT is not set -# CONFIG_FEATURE_STAT_FORMAT is not set -CONFIG_STTY=y -CONFIG_SUM=y -CONFIG_SYNC=y -CONFIG_TAC=y -CONFIG_TAIL=y -CONFIG_FEATURE_FANCY_TAIL=y -CONFIG_TEE=y -CONFIG_FEATURE_TEE_USE_BLOCK_IO=y -CONFIG_TRUE=y -# CONFIG_TTY is not set -CONFIG_UNAME=y -CONFIG_UNEXPAND=y -# CONFIG_FEATURE_UNEXPAND_LONG_OPTIONS is not set -CONFIG_UNIQ=y -# CONFIG_USLEEP is not set -CONFIG_UUDECODE=y -CONFIG_UUENCODE=y -CONFIG_WC=y -CONFIG_FEATURE_WC_LARGE=y -# CONFIG_WHO is not set -CONFIG_WHOAMI=y -CONFIG_YES=y - -# -# Common options for cp and mv -# -CONFIG_FEATURE_PRESERVE_HARDLINKS=y - -# -# Common options for ls, more and telnet -# -CONFIG_FEATURE_AUTOWIDTH=y - -# -# Common options for df, du, ls -# -CONFIG_FEATURE_HUMAN_READABLE=y - -# -# Common options for md5sum, sha1sum, sha256sum, sha512sum -# -CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y - -# -# Console Utilities -# -CONFIG_CHVT=y -CONFIG_FGCONSOLE=y -CONFIG_CLEAR=y -CONFIG_DEALLOCVT=y -CONFIG_DUMPKMAP=y -# CONFIG_KBD_MODE is not set -# CONFIG_LOADFONT is not set -CONFIG_LOADKMAP=y -CONFIG_OPENVT=y -CONFIG_RESET=y -CONFIG_RESIZE=y -CONFIG_FEATURE_RESIZE_PRINT=y -CONFIG_SETCONSOLE=y -# CONFIG_FEATURE_SETCONSOLE_LONG_OPTIONS is not set -# CONFIG_SETFONT is not set -# CONFIG_FEATURE_SETFONT_TEXTUAL_MAP is not set -CONFIG_DEFAULT_SETFONT_DIR="" -CONFIG_SETKEYCODES=y -CONFIG_SETLOGCONS=y -CONFIG_SHOWKEY=y -# CONFIG_FEATURE_LOADFONT_PSF2 is not set -# CONFIG_FEATURE_LOADFONT_RAW is not set - -# -# Debian Utilities -# -CONFIG_MKTEMP=y -CONFIG_PIPE_PROGRESS=y -CONFIG_RUN_PARTS=y -# CONFIG_FEATURE_RUN_PARTS_LONG_OPTIONS is not set -CONFIG_FEATURE_RUN_PARTS_FANCY=y -CONFIG_START_STOP_DAEMON=y -CONFIG_FEATURE_START_STOP_DAEMON_FANCY=y -# CONFIG_FEATURE_START_STOP_DAEMON_LONG_OPTIONS is not set -CONFIG_WHICH=y - -# -# Editors -# -CONFIG_PATCH=y -CONFIG_VI=y -CONFIG_FEATURE_VI_MAX_LEN=0 -# CONFIG_FEATURE_VI_8BIT is not set -# CONFIG_FEATURE_VI_COLON is not set -# CONFIG_FEATURE_VI_YANKMARK is not set -CONFIG_FEATURE_VI_SEARCH=y -# CONFIG_FEATURE_VI_REGEX_SEARCH is not set -CONFIG_FEATURE_VI_USE_SIGNALS=y -# CONFIG_FEATURE_VI_DOT_CMD is not set -# CONFIG_FEATURE_VI_READONLY is not set -# CONFIG_FEATURE_VI_SETOPTS is not set -# CONFIG_FEATURE_VI_SET is not set -CONFIG_FEATURE_VI_WIN_RESIZE=y -# CONFIG_FEATURE_VI_ASK_TERMINAL is not set -# CONFIG_FEATURE_VI_OPTIMIZE_CURSOR is not set -# CONFIG_AWK is not set -# CONFIG_FEATURE_AWK_LIBM is not set -CONFIG_CMP=y -CONFIG_DIFF=y -# CONFIG_FEATURE_DIFF_LONG_OPTIONS is not set -CONFIG_FEATURE_DIFF_DIR=y -# CONFIG_ED is not set -CONFIG_SED=y -# CONFIG_FEATURE_ALLOW_EXEC is not set - -# -# Finding Utilities -# -CONFIG_FIND=y -CONFIG_FEATURE_FIND_PRINT0=y -CONFIG_FEATURE_FIND_MTIME=y -# CONFIG_FEATURE_FIND_MMIN is not set -CONFIG_FEATURE_FIND_PERM=y -CONFIG_FEATURE_FIND_TYPE=y -# CONFIG_FEATURE_FIND_XDEV is not set -# CONFIG_FEATURE_FIND_MAXDEPTH is not set -# CONFIG_FEATURE_FIND_NEWER is not set -# CONFIG_FEATURE_FIND_INUM is not set -# CONFIG_FEATURE_FIND_EXEC is not set -# CONFIG_FEATURE_FIND_USER is not set -# CONFIG_FEATURE_FIND_GROUP is not set -# CONFIG_FEATURE_FIND_NOT is not set -# CONFIG_FEATURE_FIND_DEPTH is not set -# CONFIG_FEATURE_FIND_PAREN is not set -# CONFIG_FEATURE_FIND_SIZE is not set -# CONFIG_FEATURE_FIND_PRUNE is not set -# CONFIG_FEATURE_FIND_DELETE is not set -# CONFIG_FEATURE_FIND_PATH is not set -# CONFIG_FEATURE_FIND_REGEX is not set -# CONFIG_FEATURE_FIND_CONTEXT is not set -# CONFIG_FEATURE_FIND_LINKS is not set -CONFIG_GREP=y -# CONFIG_FEATURE_GREP_EGREP_ALIAS is not set -# CONFIG_FEATURE_GREP_FGREP_ALIAS is not set -# CONFIG_FEATURE_GREP_CONTEXT is not set -CONFIG_XARGS=y -CONFIG_FEATURE_XARGS_SUPPORT_CONFIRMATION=y -CONFIG_FEATURE_XARGS_SUPPORT_QUOTES=y -CONFIG_FEATURE_XARGS_SUPPORT_TERMOPT=y -CONFIG_FEATURE_XARGS_SUPPORT_ZERO_TERM=y - -# -# Init Utilities -# -# CONFIG_BOOTCHARTD is not set -# CONFIG_FEATURE_BOOTCHARTD_BLOATED_HEADER is not set -# CONFIG_FEATURE_BOOTCHARTD_CONFIG_FILE is not set -# CONFIG_HALT is not set -# CONFIG_FEATURE_CALL_TELINIT is not set -# CONFIG_TELINIT_PATH="" -# CONFIG_INIT is not set -# CONFIG_FEATURE_USE_INITTAB is not set -# CONFIG_FEATURE_KILL_REMOVED is not set -# CONFIG_FEATURE_KILL_DELAY=0 -# CONFIG_FEATURE_INIT_SCTTY is not set -# CONFIG_FEATURE_INIT_SYSLOG is not set -# CONFIG_FEATURE_EXTRA_QUIET is not set -# CONFIG_FEATURE_INIT_COREDUMPS is not set -# CONFIG_FEATURE_INITRD is not set -# CONFIG_INIT_TERMINAL_TYPE="linux" -# CONFIG_MESG is not set -# CONFIG_FEATURE_MESG_ENABLE_ONLY_GROUP=y - -# -# Login/Password Management Utilities -# -# CONFIG_ADD_SHELL is not set -# CONFIG_REMOVE_SHELL is not set -# CONFIG_FEATURE_SHADOWPASSWDS is not set -# CONFIG_USE_BB_PWD_GRP is not set -# CONFIG_USE_BB_SHADOW is not set -# CONFIG_USE_BB_CRYPT is not set -# CONFIG_USE_BB_CRYPT_SHA is not set -# CONFIG_ADDUSER is not set -# CONFIG_FEATURE_ADDUSER_LONG_OPTIONS is not set -# CONFIG_FEATURE_CHECK_NAMES is not set -CONFIG_FIRST_SYSTEM_ID=0 -CONFIG_LAST_SYSTEM_ID=0 -# CONFIG_ADDGROUP is not set -# CONFIG_FEATURE_ADDGROUP_LONG_OPTIONS is not set -# CONFIG_FEATURE_ADDUSER_TO_GROUP is not set -# CONFIG_DELUSER is not set -# CONFIG_DELGROUP is not set -# CONFIG_FEATURE_DEL_USER_FROM_GROUP is not set -# CONFIG_GETTY is not set -# CONFIG_LOGIN is not set -# CONFIG_PAM is not set -# CONFIG_LOGIN_SCRIPTS is not set -# CONFIG_FEATURE_NOLOGIN is not set -# CONFIG_FEATURE_SECURETTY is not set -# CONFIG_PASSWD is not set -# CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set -# CONFIG_CRYPTPW is not set -# CONFIG_CHPASSWD is not set -# CONFIG_SU is not set -# CONFIG_FEATURE_SU_SYSLOG is not set -# CONFIG_FEATURE_SU_CHECKS_SHELLS is not set -# CONFIG_SULOGIN is not set -# CONFIG_VLOCK is not set - -# -# Linux Ext2 FS Progs -# -CONFIG_CHATTR=y -# CONFIG_FSCK is not set -CONFIG_LSATTR=y -CONFIG_TUNE2FS=y - -# -# Linux Module Utilities -# -# CONFIG_MODINFO is not set -# CONFIG_MODPROBE_SMALL is not set -# CONFIG_FEATURE_MODPROBE_SMALL_OPTIONS_ON_CMDLINE=y -# CONFIG_FEATURE_MODPROBE_SMALL_CHECK_ALREADY_LOADED=y -# CONFIG_INSMOD is not set -# CONFIG_RMMOD is not set -# CONFIG_LSMOD is not set -# CONFIG_FEATURE_LSMOD_PRETTY_2_6_OUTPUT is not set -# CONFIG_MODPROBE is not set -# CONFIG_FEATURE_MODPROBE_BLACKLIST is not set -# CONFIG_DEPMOD is not set - -# -# Options common to multiple modutils -# -# CONFIG_FEATURE_2_4_MODULES is not set -# CONFIG_FEATURE_INSMOD_TRY_MMAP is not set -# CONFIG_FEATURE_INSMOD_VERSION_CHECKING is not set -# CONFIG_FEATURE_INSMOD_KSYMOOPS_SYMBOLS is not set -# CONFIG_FEATURE_INSMOD_LOADINKMEM is not set -# CONFIG_FEATURE_INSMOD_LOAD_MAP is not set -# CONFIG_FEATURE_INSMOD_LOAD_MAP_FULL is not set -# CONFIG_FEATURE_CHECK_TAINTED_MODULE is not set -# CONFIG_FEATURE_MODUTILS_ALIAS is not set -# CONFIG_FEATURE_MODUTILS_SYMBOLS is not set -# CONFIG_DEFAULT_MODULES_DIR="/lib/modules" -# CONFIG_DEFAULT_DEPMOD_FILE="modules.dep" - -# -# Linux System Utilities -# -CONFIG_BLOCKDEV=y -CONFIG_REV=y -# CONFIG_ACPID is not set -# CONFIG_FEATURE_ACPID_COMPAT is not set -CONFIG_BLKID=y -# CONFIG_FEATURE_BLKID_TYPE is not set -CONFIG_DMESG=y -CONFIG_FEATURE_DMESG_PRETTY=y -CONFIG_FBSET=y -CONFIG_FEATURE_FBSET_FANCY=y -CONFIG_FEATURE_FBSET_READMODE=y -CONFIG_FDFLUSH=y -CONFIG_FDFORMAT=y -CONFIG_FDISK=y -CONFIG_FDISK_SUPPORT_LARGE_DISKS=y -CONFIG_FEATURE_FDISK_WRITABLE=y -# CONFIG_FEATURE_AIX_LABEL is not set -# CONFIG_FEATURE_SGI_LABEL is not set -# CONFIG_FEATURE_SUN_LABEL is not set -# CONFIG_FEATURE_OSF_LABEL is not set -# CONFIG_FEATURE_GPT_LABEL is not set -CONFIG_FEATURE_FDISK_ADVANCED=y -CONFIG_FINDFS=y -CONFIG_FLOCK=y -CONFIG_FREERAMDISK=y -# CONFIG_FSCK_MINIX is not set -# CONFIG_MKFS_EXT2 is not set -# CONFIG_MKFS_MINIX is not set -# CONFIG_FEATURE_MINIX2 is not set -# CONFIG_MKFS_REISER is not set -# CONFIG_MKFS_VFAT is not set -CONFIG_GETOPT=y -CONFIG_FEATURE_GETOPT_LONG=y -CONFIG_HEXDUMP=y -CONFIG_FEATURE_HEXDUMP_REVERSE=y -CONFIG_HD=y -# CONFIG_HWCLOCK is not set -# CONFIG_FEATURE_HWCLOCK_LONG_OPTIONS is not set -# CONFIG_FEATURE_HWCLOCK_ADJTIME_FHS is not set -# CONFIG_IPCRM is not set -# CONFIG_IPCS is not set -CONFIG_LOSETUP=y -CONFIG_LSPCI=y -CONFIG_LSUSB=y -# CONFIG_MDEV is not set -# CONFIG_FEATURE_MDEV_CONF is not set -# CONFIG_FEATURE_MDEV_RENAME is not set -# CONFIG_FEATURE_MDEV_RENAME_REGEXP is not set -# CONFIG_FEATURE_MDEV_EXEC is not set -# CONFIG_FEATURE_MDEV_LOAD_FIRMWARE is not set -CONFIG_MKSWAP=y -CONFIG_FEATURE_MKSWAP_UUID=y -CONFIG_MORE=y -# CONFIG_MOUNT is not set -# CONFIG_FEATURE_MOUNT_FAKE is not set -# CONFIG_FEATURE_MOUNT_VERBOSE is not set -# CONFIG_FEATURE_MOUNT_HELPERS is not set -# CONFIG_FEATURE_MOUNT_LABEL is not set -# CONFIG_FEATURE_MOUNT_NFS is not set -# CONFIG_FEATURE_MOUNT_CIFS is not set -# CONFIG_FEATURE_MOUNT_FLAGS is not set -# CONFIG_FEATURE_MOUNT_FSTAB is not set -# CONFIG_PIVOT_ROOT is not set -# CONFIG_RDATE is not set -CONFIG_RDEV=y -CONFIG_READPROFILE=y -CONFIG_RTCWAKE=y -CONFIG_SCRIPT=y -CONFIG_SCRIPTREPLAY=y -# CONFIG_SETARCH is not set -# CONFIG_SWAPONOFF is not set -# CONFIG_FEATURE_SWAPON_PRI is not set -# CONFIG_SWITCH_ROOT is not set -# CONFIG_UMOUNT is not set -# CONFIG_FEATURE_UMOUNT_ALL is not set -# CONFIG_FEATURE_MOUNT_LOOP is not set -# CONFIG_FEATURE_MOUNT_LOOP_CREATE is not set -# CONFIG_FEATURE_MTAB_SUPPORT is not set -CONFIG_VOLUMEID=y - -# -# Filesystem/Volume identification -# -CONFIG_FEATURE_VOLUMEID_EXT=y -CONFIG_FEATURE_VOLUMEID_BTRFS=y -CONFIG_FEATURE_VOLUMEID_REISERFS=y -CONFIG_FEATURE_VOLUMEID_FAT=y -CONFIG_FEATURE_VOLUMEID_HFS=y -CONFIG_FEATURE_VOLUMEID_JFS=y -CONFIG_FEATURE_VOLUMEID_XFS=y -CONFIG_FEATURE_VOLUMEID_NTFS=y -CONFIG_FEATURE_VOLUMEID_ISO9660=y -CONFIG_FEATURE_VOLUMEID_UDF=y -CONFIG_FEATURE_VOLUMEID_LUKS=y -CONFIG_FEATURE_VOLUMEID_LINUXSWAP=y -CONFIG_FEATURE_VOLUMEID_CRAMFS=y -CONFIG_FEATURE_VOLUMEID_ROMFS=y -CONFIG_FEATURE_VOLUMEID_SYSV=y -CONFIG_FEATURE_VOLUMEID_OCFS2=y -CONFIG_FEATURE_VOLUMEID_LINUXRAID=y - -# -# Miscellaneous Utilities -# -# CONFIG_CONSPY is not set -# CONFIG_NANDWRITE is not set -CONFIG_NANDDUMP=y -CONFIG_SETSERIAL=y -# CONFIG_UBIATTACH is not set -# CONFIG_UBIDETACH is not set -# CONFIG_UBIMKVOL is not set -# CONFIG_UBIRMVOL is not set -# CONFIG_UBIRSVOL is not set -# CONFIG_UBIUPDATEVOL is not set -# CONFIG_ADJTIMEX is not set -# CONFIG_BBCONFIG is not set -# CONFIG_FEATURE_COMPRESS_BBCONFIG is not set -CONFIG_BEEP=y -CONFIG_FEATURE_BEEP_FREQ=4000 -CONFIG_FEATURE_BEEP_LENGTH_MS=30 -CONFIG_CHAT=y -CONFIG_FEATURE_CHAT_NOFAIL=y -# CONFIG_FEATURE_CHAT_TTY_HIFI is not set -CONFIG_FEATURE_CHAT_IMPLICIT_CR=y -CONFIG_FEATURE_CHAT_SWALLOW_OPTS=y -CONFIG_FEATURE_CHAT_SEND_ESCAPES=y -CONFIG_FEATURE_CHAT_VAR_ABORT_LEN=y -CONFIG_FEATURE_CHAT_CLR_ABORT=y -CONFIG_CHRT=y -# CONFIG_CROND is not set -# CONFIG_FEATURE_CROND_D is not set -# CONFIG_FEATURE_CROND_CALL_SENDMAIL is not set -CONFIG_FEATURE_CROND_DIR="" -# CONFIG_CRONTAB is not set -CONFIG_DC=y -CONFIG_FEATURE_DC_LIBM=y -# CONFIG_DEVFSD is not set -# CONFIG_DEVFSD_MODLOAD is not set -# CONFIG_DEVFSD_FG_NP is not set -# CONFIG_DEVFSD_VERBOSE is not set -# CONFIG_FEATURE_DEVFS is not set -CONFIG_DEVMEM=y -# CONFIG_EJECT is not set -# CONFIG_FEATURE_EJECT_SCSI is not set -CONFIG_FBSPLASH=y -CONFIG_FLASHCP=y -CONFIG_FLASH_LOCK=y -CONFIG_FLASH_UNLOCK=y -# CONFIG_FLASH_ERASEALL is not set -# CONFIG_IONICE is not set -CONFIG_INOTIFYD=y -# CONFIG_LAST is not set -# CONFIG_FEATURE_LAST_SMALL is not set -# CONFIG_FEATURE_LAST_FANCY is not set -# CONFIG_LESS is not set -CONFIG_FEATURE_LESS_MAXLINES=0 -# CONFIG_FEATURE_LESS_BRACKETS is not set -# CONFIG_FEATURE_LESS_FLAGS is not set -# CONFIG_FEATURE_LESS_MARKS is not set -# CONFIG_FEATURE_LESS_REGEXP is not set -# CONFIG_FEATURE_LESS_WINCH is not set -# CONFIG_FEATURE_LESS_DASHCMD is not set -# CONFIG_FEATURE_LESS_LINENUMS is not set -CONFIG_HDPARM=y -CONFIG_FEATURE_HDPARM_GET_IDENTITY=y -CONFIG_FEATURE_HDPARM_HDIO_SCAN_HWIF=y -CONFIG_FEATURE_HDPARM_HDIO_UNREGISTER_HWIF=y -CONFIG_FEATURE_HDPARM_HDIO_DRIVE_RESET=y -CONFIG_FEATURE_HDPARM_HDIO_TRISTATE_HWIF=y -CONFIG_FEATURE_HDPARM_HDIO_GETSET_DMA=y -CONFIG_MAKEDEVS=y -# CONFIG_FEATURE_MAKEDEVS_LEAF is not set -CONFIG_FEATURE_MAKEDEVS_TABLE=y -CONFIG_MAN=y -# CONFIG_MICROCOM is not set -# CONFIG_MOUNTPOINT is not set -# CONFIG_MT is not set -CONFIG_RAIDAUTORUN=y -# CONFIG_READAHEAD is not set -# CONFIG_RFKILL is not set -# CONFIG_RUNLEVEL is not set -CONFIG_RX=y -CONFIG_SETSID=y -CONFIG_STRINGS=y -# CONFIG_TASKSET is not set -# CONFIG_FEATURE_TASKSET_FANCY is not set -CONFIG_TIME=y -CONFIG_TIMEOUT=y -CONFIG_TTYSIZE=y -CONFIG_VOLNAME=y -# CONFIG_WALL is not set -# CONFIG_WATCHDOG is not set - -# -# Networking Utilities -# -# CONFIG_NAMEIF is not set -# CONFIG_FEATURE_NAMEIF_EXTENDED is not set -CONFIG_NBDCLIENT=y -CONFIG_NC=y -CONFIG_NC_SERVER=y -CONFIG_NC_EXTRA=y -# CONFIG_NC_110_COMPAT is not set -# CONFIG_PING is not set -# CONFIG_PING6 is not set -# CONFIG_FEATURE_FANCY_PING is not set -CONFIG_WHOIS=y -# CONFIG_FEATURE_IPV6 is not set -# CONFIG_FEATURE_UNIX_LOCAL is not set -# CONFIG_FEATURE_PREFER_IPV4_ADDRESS is not set -# CONFIG_VERBOSE_RESOLUTION_ERRORS is not set -CONFIG_ARP=y -# CONFIG_ARPING is not set -# CONFIG_BRCTL is not set -# CONFIG_FEATURE_BRCTL_FANCY is not set -# CONFIG_FEATURE_BRCTL_SHOW is not set -CONFIG_DNSD=y -# CONFIG_ETHER_WAKE is not set -CONFIG_FAKEIDENTD=y -CONFIG_FTPD=y -CONFIG_FEATURE_FTP_WRITE=y -CONFIG_FEATURE_FTPD_ACCEPT_BROKEN_LIST=y -CONFIG_FTPGET=y -CONFIG_FTPPUT=y -# CONFIG_FEATURE_FTPGETPUT_LONG_OPTIONS is not set -# CONFIG_HOSTNAME is not set -CONFIG_HTTPD=y -CONFIG_FEATURE_HTTPD_RANGES=y -CONFIG_FEATURE_HTTPD_USE_SENDFILE=y -CONFIG_FEATURE_HTTPD_SETUID=y -CONFIG_FEATURE_HTTPD_BASIC_AUTH=y -# CONFIG_FEATURE_HTTPD_AUTH_MD5 is not set -CONFIG_FEATURE_HTTPD_CGI=y -CONFIG_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR=y -CONFIG_FEATURE_HTTPD_SET_REMOTE_PORT_TO_ENV=y -CONFIG_FEATURE_HTTPD_ENCODE_URL_STR=y -CONFIG_FEATURE_HTTPD_ERROR_PAGES=y -CONFIG_FEATURE_HTTPD_PROXY=y -CONFIG_FEATURE_HTTPD_GZIP=y -CONFIG_IFCONFIG=y -CONFIG_FEATURE_IFCONFIG_STATUS=y -# CONFIG_FEATURE_IFCONFIG_SLIP is not set -CONFIG_FEATURE_IFCONFIG_MEMSTART_IOADDR_IRQ=y -CONFIG_FEATURE_IFCONFIG_HW=y -CONFIG_FEATURE_IFCONFIG_BROADCAST_PLUS=y -# CONFIG_IFENSLAVE is not set -# CONFIG_IFPLUGD is not set -CONFIG_IFUPDOWN=y -CONFIG_IFUPDOWN_IFSTATE_PATH="/var/run/ifstate" -CONFIG_FEATURE_IFUPDOWN_IP=y -CONFIG_FEATURE_IFUPDOWN_IP_BUILTIN=y -# CONFIG_FEATURE_IFUPDOWN_IFCONFIG_BUILTIN is not set -CONFIG_FEATURE_IFUPDOWN_IPV4=y -# CONFIG_FEATURE_IFUPDOWN_IPV6 is not set -CONFIG_FEATURE_IFUPDOWN_MAPPING=y -# CONFIG_FEATURE_IFUPDOWN_EXTERNAL_DHCP is not set -# CONFIG_INETD is not set -# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_ECHO is not set -# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DISCARD is not set -# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_TIME is not set -# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_DAYTIME is not set -# CONFIG_FEATURE_INETD_SUPPORT_BUILTIN_CHARGEN is not set -# CONFIG_FEATURE_INETD_RPC is not set -CONFIG_IP=y -CONFIG_FEATURE_IP_ADDRESS=y -CONFIG_FEATURE_IP_LINK=y -CONFIG_FEATURE_IP_ROUTE=y -CONFIG_FEATURE_IP_TUNNEL=y -CONFIG_FEATURE_IP_RULE=y -CONFIG_FEATURE_IP_SHORT_FORMS=y -# CONFIG_FEATURE_IP_RARE_PROTOCOLS is not set -CONFIG_IPADDR=y -CONFIG_IPLINK=y -CONFIG_IPROUTE=y -CONFIG_IPTUNNEL=y -CONFIG_IPRULE=y -CONFIG_IPCALC=y -CONFIG_FEATURE_IPCALC_FANCY=y -# CONFIG_FEATURE_IPCALC_LONG_OPTIONS is not set -CONFIG_NETSTAT=y -CONFIG_FEATURE_NETSTAT_WIDE=y -CONFIG_FEATURE_NETSTAT_PRG=y -# CONFIG_NSLOOKUP is not set -# CONFIG_NTPD is not set -# CONFIG_FEATURE_NTPD_SERVER is not set -CONFIG_PSCAN=y -CONFIG_ROUTE=y -# CONFIG_SLATTACH is not set -CONFIG_TCPSVD=y -# CONFIG_TELNET is not set -# CONFIG_FEATURE_TELNET_TTYPE is not set -# CONFIG_FEATURE_TELNET_AUTOLOGIN is not set -# CONFIG_TELNETD is not set -# CONFIG_FEATURE_TELNETD_STANDALONE is not set -# CONFIG_FEATURE_TELNETD_INETD_WAIT is not set -# CONFIG_TFTP is not set -# CONFIG_TFTPD is not set -# CONFIG_FEATURE_TFTP_GET is not set -# CONFIG_FEATURE_TFTP_PUT is not set -# CONFIG_FEATURE_TFTP_BLOCKSIZE is not set -# CONFIG_FEATURE_TFTP_PROGRESS_BAR is not set -# CONFIG_TFTP_DEBUG is not set -# CONFIG_TRACEROUTE is not set -# CONFIG_TRACEROUTE6 is not set -# CONFIG_FEATURE_TRACEROUTE_VERBOSE is not set -# CONFIG_FEATURE_TRACEROUTE_SOURCE_ROUTE is not set -# CONFIG_FEATURE_TRACEROUTE_USE_ICMP is not set -CONFIG_TUNCTL=y -CONFIG_FEATURE_TUNCTL_UG=y -# CONFIG_UDHCPD is not set -# CONFIG_DHCPRELAY is not set -# CONFIG_DUMPLEASES is not set -# CONFIG_FEATURE_UDHCPD_WRITE_LEASES_EARLY is not set -# CONFIG_FEATURE_UDHCPD_BASE_IP_ON_MAC is not set -CONFIG_DHCPD_LEASES_FILE="" -CONFIG_UDHCPC=y -CONFIG_FEATURE_UDHCPC_ARPING=y -# CONFIG_FEATURE_UDHCP_PORT is not set -CONFIG_UDHCP_DEBUG=9 -CONFIG_FEATURE_UDHCP_RFC3397=y -CONFIG_FEATURE_UDHCP_8021Q=y -CONFIG_UDHCPC_DEFAULT_SCRIPT="/usr/share/udhcpc/default.script" -CONFIG_UDHCPC_SLACK_FOR_BUGGY_SERVERS=80 -CONFIG_IFUPDOWN_UDHCPC_CMD_OPTIONS="-R -n" -# CONFIG_UDPSVD is not set -# CONFIG_VCONFIG is not set -CONFIG_WGET=y -CONFIG_FEATURE_WGET_STATUSBAR=y -CONFIG_FEATURE_WGET_AUTHENTICATION=y -# CONFIG_FEATURE_WGET_LONG_OPTIONS is not set -CONFIG_FEATURE_WGET_TIMEOUT=y -# CONFIG_ZCIP is not set - -# -# Print Utilities -# -CONFIG_LPD=y -CONFIG_LPR=y -CONFIG_LPQ=y - -# -# Mail Utilities -# -CONFIG_MAKEMIME=y -CONFIG_FEATURE_MIME_CHARSET="us-ascii" -CONFIG_POPMAILDIR=y -CONFIG_FEATURE_POPMAILDIR_DELIVERY=y -CONFIG_REFORMIME=y -CONFIG_FEATURE_REFORMIME_COMPAT=y -CONFIG_SENDMAIL=y - -# -# Process Utilities -# -CONFIG_IOSTAT=y -CONFIG_MPSTAT=y -CONFIG_NMETER=y -CONFIG_PMAP=y -# CONFIG_POWERTOP is not set -CONFIG_PSTREE=y -CONFIG_PWDX=y -CONFIG_SMEMCAP=y -# CONFIG_FREE is not set -CONFIG_FUSER=y -# CONFIG_KILL is not set -# CONFIG_KILLALL is not set -# CONFIG_KILLALL5 is not set -# CONFIG_PGREP is not set -CONFIG_PIDOF=y -CONFIG_FEATURE_PIDOF_SINGLE=y -CONFIG_FEATURE_PIDOF_OMIT=y -# CONFIG_PKILL is not set -# CONFIG_PS is not set -# CONFIG_FEATURE_PS_WIDE is not set -# CONFIG_FEATURE_PS_TIME is not set -# CONFIG_FEATURE_PS_ADDITIONAL_COLUMNS is not set -# CONFIG_FEATURE_PS_UNUSUAL_SYSTEMS is not set -CONFIG_RENICE=y -CONFIG_BB_SYSCTL=y -CONFIG_TOP=y -CONFIG_FEATURE_TOP_CPU_USAGE_PERCENTAGE=y -CONFIG_FEATURE_TOP_CPU_GLOBAL_PERCENTS=y -CONFIG_FEATURE_TOP_SMP_CPU=y -CONFIG_FEATURE_TOP_DECIMALS=y -CONFIG_FEATURE_TOP_SMP_PROCESS=y -CONFIG_FEATURE_TOPMEM=y -CONFIG_FEATURE_SHOW_THREADS=y -# CONFIG_UPTIME is not set -CONFIG_WATCH=y - -# -# Runit Utilities -# -CONFIG_RUNSV=y -CONFIG_RUNSVDIR=y -# CONFIG_FEATURE_RUNSVDIR_LOG is not set -CONFIG_SV=y -CONFIG_SV_DEFAULT_SERVICE_DIR="/var/service" -CONFIG_SVLOGD=y -CONFIG_CHPST=y -CONFIG_SETUIDGID=y -CONFIG_ENVUIDGID=y -CONFIG_ENVDIR=y -CONFIG_SOFTLIMIT=y -# CONFIG_CHCON is not set -# CONFIG_FEATURE_CHCON_LONG_OPTIONS is not set -# CONFIG_GETENFORCE is not set -# CONFIG_GETSEBOOL is not set -# CONFIG_LOAD_POLICY is not set -# CONFIG_MATCHPATHCON is not set -# CONFIG_RESTORECON is not set -# CONFIG_RUNCON is not set -# CONFIG_FEATURE_RUNCON_LONG_OPTIONS is not set -# CONFIG_SELINUXENABLED is not set -# CONFIG_SETENFORCE is not set -# CONFIG_SETFILES is not set -# CONFIG_FEATURE_SETFILES_CHECK_OPTION is not set -# CONFIG_SETSEBOOL is not set -# CONFIG_SESTATUS is not set - -# -# Shells -# -CONFIG_ASH=y -# CONFIG_ASH_BASH_COMPAT is not set -# CONFIG_ASH_IDLE_TIMEOUT is not set -CONFIG_ASH_JOB_CONTROL=y -# CONFIG_ASH_ALIAS is not set -CONFIG_ASH_GETOPTS=y -# CONFIG_ASH_BUILTIN_ECHO is not set -# CONFIG_ASH_BUILTIN_PRINTF is not set -# CONFIG_ASH_BUILTIN_TEST is not set -# CONFIG_ASH_CMDCMD is not set -# CONFIG_ASH_MAIL is not set -# CONFIG_ASH_OPTIMIZE_FOR_SIZE is not set -# CONFIG_ASH_RANDOM_SUPPORT is not set -# CONFIG_ASH_EXPAND_PRMT is not set -CONFIG_CTTYHACK=y -# CONFIG_HUSH is not set -# CONFIG_HUSH_BASH_COMPAT is not set -# CONFIG_HUSH_BRACE_EXPANSION is not set -# CONFIG_HUSH_HELP is not set -# CONFIG_HUSH_INTERACTIVE is not set -# CONFIG_HUSH_SAVEHISTORY is not set -# CONFIG_HUSH_JOB is not set -# CONFIG_HUSH_TICK is not set -# CONFIG_HUSH_IF is not set -# CONFIG_HUSH_LOOPS is not set -# CONFIG_HUSH_CASE is not set -# CONFIG_HUSH_FUNCTIONS is not set -# CONFIG_HUSH_LOCAL is not set -# CONFIG_HUSH_RANDOM_SUPPORT is not set -# CONFIG_HUSH_EXPORT_N is not set -# CONFIG_HUSH_MODE_X is not set -# CONFIG_MSH is not set -CONFIG_FEATURE_SH_IS_ASH=y -# CONFIG_FEATURE_SH_IS_HUSH is not set -# CONFIG_FEATURE_SH_IS_NONE is not set -# CONFIG_FEATURE_BASH_IS_ASH is not set -# CONFIG_FEATURE_BASH_IS_HUSH is not set -CONFIG_FEATURE_BASH_IS_NONE=y -# CONFIG_SH_MATH_SUPPORT is not set -# CONFIG_SH_MATH_SUPPORT_64 is not set -# CONFIG_FEATURE_SH_EXTRA_QUIET is not set -CONFIG_FEATURE_SH_STANDALONE=y -# CONFIG_FEATURE_SH_NOFORK is not set -# CONFIG_FEATURE_SH_HISTFILESIZE is not set - -# -# System Logging Utilities -# -# CONFIG_SYSLOGD is not set -# CONFIG_FEATURE_ROTATE_LOGFILE is not set -# CONFIG_FEATURE_REMOTE_LOG is not set -# CONFIG_FEATURE_SYSLOGD_DUP is not set -# CONFIG_FEATURE_SYSLOGD_CFG is not set -CONFIG_FEATURE_SYSLOGD_READ_BUFFER_SIZE=0 -# CONFIG_FEATURE_IPC_SYSLOG is not set -CONFIG_FEATURE_IPC_SYSLOG_BUFFER_SIZE=0 -# CONFIG_LOGREAD is not set -# CONFIG_FEATURE_LOGREAD_REDUCED_LOCKING is not set -CONFIG_KLOGD=y -CONFIG_FEATURE_KLOGD_KLOGCTL=y -# CONFIG_LOGGER is not set diff --git a/standalone/android/cabal.config b/standalone/android/cabal.config deleted file mode 100644 index 1313b1c2e4..0000000000 --- a/standalone/android/cabal.config +++ /dev/null @@ -1,209 +0,0 @@ -constraints: unix installed, - blaze-html ==0.8.1.3, - blaze-markup ==0.7.0.3, - basement ==0.0.7, - memory ==0.14.9, - connection ==0.2.8, - aws ==0.13.0, - lifted-base ==0.2.3.6, - Crypto ==4.2.5.1, - binary ==0.7.6.1, - DAV ==1.0.3, - HTTP ==4000.2.17, - HUnit ==1.2.5.2, - IfElse ==0.85, - MissingH ==1.2.1.0, - directory ==1.2.2.0, - MonadRandom ==0.1.13, - QuickCheck ==2.7.6, - SafeSemaphore ==0.10.1, - aeson ==0.7.0.6, - ansi-wl-pprint ==0.6.7.1, - appar ==0.1.4, - asn1-encoding ==0.9.5, - asn1-parse ==0.9.4, - asn1-types ==0.3.2, - async ==2.0.1.5, - attoparsec ==0.11.3.4, - attoparsec-conduit ==1.1.0, - authenticate ==1.3.2.10, - base-unicode-symbols ==0.2.2.4, - base16-bytestring ==0.1.1.6, - base64-bytestring ==1.0.0.1, - bifunctors ==4.1.1.1, - bloomfilter ==2.0.0.0, - byteable ==0.1.1, - byteorder ==1.0.4, - case-insensitive ==1.2.0.1, - cereal ==0.4.0.1, - cipher-aes ==0.2.8, - cipher-des ==0.0.6, - cipher-rc4 ==0.1.4, - clientsession ==0.9.0.3, - comonad ==4.2, - conduit ==1.1.6, - conduit-extra ==1.1.3, - contravariant ==0.6.1.1, - cookie ==0.4.1.2, - cprng-aes ==0.5.2, - crypto-api ==0.13.2, - crypto-cipher-types ==0.0.9, - crypto-numbers ==0.2.3, - crypto-pubkey ==0.2.4, - crypto-pubkey-types ==0.4.2.3, - crypto-random ==0.0.7, - cryptohash ==0.11.6, - cryptohash-conduit ==0.1.1, - css-text ==0.1.2.1, - data-default ==0.5.3, - data-default-class ==0.0.1, - data-default-instances-base ==0.0.1, - data-default-instances-containers ==0.0.1, - data-default-instances-dlist ==0.0.1, - data-default-instances-old-locale ==0.0.1, - sandi ==0.3.0.1, - dbus ==0.10.8, - distributive ==0.4.4, - dlist ==0.7.0.1, - dns ==1.3.0, - edit-distance ==0.2.1.2, - either ==4.3, - email-validate ==1.0.0, - entropy ==0.2.1, - errors ==1.4.7, - exceptions ==0.6.1, - failure ==0.2.0.3, - fast-logger ==2.1.5, - fdo-notify ==0.3.1, - feed ==0.3.9.2, - file-embed ==0.0.6, - fingertree ==0.1.0.0, - free ==4.9, - gnuidn ==0.2, - gnutls ==0.1.4, - gsasl ==0.3.5, - hS3 ==0.5.7, - hashable ==1.2.1.0, - hinotify ==0.3.5, - hjsmin ==0.1.4.7, - hslogger ==1.2.10, - http-client ==0.4.31.1, - http-client-tls ==0.2.4.1, - http-conduit ==2.1.9, - http-date ==0.0.6.1, - http-types ==0.9.1, - blaze-builder ==0.3.3.2, - hxt ==9.3.1.4, - hxt-charproperties ==9.1.1.1, - hxt-regex-xmlschema ==9.0.4, - hxt-unicode ==9.0.2.2, - idna ==0.2, - iproute ==1.3.1, - json ==0.5, - keys ==3.10.1, - language-javascript ==0.5.13, - lens ==4.4.0.2, - libxml-sax ==0.7.5, - mime-mail ==0.4.1.2, - mime-types ==0.1.0.4, - mmorph ==1.0.3, - monad-control ==0.3.2.2, - monad-logger ==0.3.6.1, - monad-loops ==0.4.2.1, - monads-tf ==0.1.0.2, - mtl ==2.1.2, - nats ==0.1.2, - network ==2.6.3.1 - network-conduit ==1.1.0, - network-info ==0.2.0.5, - network-multicast ==0.0.10, - network-uri ==2.6.0.1, - optparse-applicative ==0.11.0.2, - parallel ==3.2.0.4, - path-pieces ==0.1.4, - pem ==0.2.2, - persistent ==1.3.3, - persistent-template ==1.3.2.2, - pointed ==4.0, - prelude-extras ==0.4, - profunctors ==4.0.4, - publicsuffixlist ==0.1, - punycode ==2.0, - random ==1.0.1.1, - ranges ==0.2.4, - reducers ==3.10.2.1, - reflection ==1.2.0.1, - regex-base ==0.93.2, - regex-compat ==0.95.1, - regex-posix ==0.95.2, - regex-tdfa ==1.2.0, - resource-pool ==0.2.1.1, - resourcet ==1.1.2.3, - safe ==0.3.8, - securemem ==0.1.3, - semigroupoids ==4.2, - semigroups ==0.15.3, - shakespeare ==2.0.5, - silently ==1.2.4.1, - simple-sendfile ==0.2.14, - skein ==1.0.9, - socks ==0.5.5, - split ==0.2.2, - stm ==2.4.2, - stm-chans ==3.0.0.2, - streaming-commons ==0.1.4.1, - stringprep ==0.1.5, - stringsearch ==0.3.6.5, - syb ==0.4.0, - system-fileio ==0.3.14, - system-filepath ==0.4.12, - tagged ==0.7.2, - tagsoup ==0.13.1, - tagstream-conduit ==0.5.5.1, - text ==1.1.1.0, - text-icu ==0.6.3.7, - tf-random ==0.5, - tls ==1.3.8, - transformers ==0.3.0.0, - transformers-base ==0.4.1, - transformers-compat ==0.3.3.3, - unbounded-delays ==0.1.0.8, - unix-compat ==0.4.1.3, - unix-time ==0.2.2, - unordered-containers ==0.2.5.0, - utf8-string ==0.3.7, - uuid ==1.3.3, - vault ==0.3.0.3, - vector ==0.10.0.1, - void ==0.6.1, - wai ==3.0.1.1, - wai-app-static ==3.0.0.1, - wai-extra ==3.0.1.2, - wai-logger ==2.1.1, - warp ==3.0.8, - warp-tls ==3.0.4.2, - word8 ==0.1.1, - x509 ==1.6.5, - x509-store ==1.6.3, - x509-system ==1.6.6, - x509-validation ==1.6.8, - xml ==1.3.13, - xml-conduit ==1.2.1, - xml-hamlet ==0.4.0.9, - xml-types ==0.3.4, - xss-sanitize ==0.3.5.2, - yaml ==0.8.9.3, - yesod ==1.2.6.1, - yesod-auth ==1.3.4.6, - yesod-core ==1.2.20.1, - yesod-default ==1.2.0, - yesod-form ==1.3.16, - yesod-persistent ==1.2.3.1, - yesod-routes ==1.2.0.7, - yesod-static ==1.2.4, - zlib ==0.5.4.1, - bytestring installed, - process ==1.2.3.0, - scientific ==0.3.3.1, - clock ==0.4.6.0, - cryptonite ==0.15 diff --git a/standalone/android/clean-haskell-packages b/standalone/android/clean-haskell-packages deleted file mode 100755 index b8c6132d6b..0000000000 --- a/standalone/android/clean-haskell-packages +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh -# Removes all currently installed cross-compiled haskell packages -# except those part of ghc. -# Useful if the build failed. -rm -f $(grep -l $HOME/.ghc/$(cat abiversion)/.cabal/lib/ $HOME/.ghc/android-14/arm-linux-androideabi-4.8/lib/*-ghc-*/package.conf.d/*.conf) -$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin/ghc-pkg recache diff --git a/standalone/android/dropbear.patch b/standalone/android/dropbear.patch deleted file mode 100644 index 84c7dfb6d6..0000000000 --- a/standalone/android/dropbear.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 014dadb02fd984828a6232534c47dba8e2f7818a Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 13 Feb 2013 15:29:52 -0400 -Subject: [PATCH] android patch for dropbear - -* Disable HOME override -* Use urandom to avoid blocking on every ssh connection. -* Enable use of netbsd_getpass.c ---- - cli-auth.c | 1 + - cli-main.c | 2 -- - options.h | 2 +- - 3 files changed, 2 insertions(+), 3 deletions(-) - -diff --git a/cli-auth.c b/cli-auth.c -index 4c17a21..91dfdf8 100644 ---- a/cli-auth.c -+++ b/cli-auth.c -@@ -31,6 +31,7 @@ - #include "ssh.h" - #include "packet.h" - #include "runopts.h" -+#include "netbsd_getpass.c" - - void cli_authinitialise() { - -diff --git a/cli-main.c b/cli-main.c -index 106006b..68cf023 100644 ---- a/cli-main.c -+++ b/cli-main.c -@@ -47,8 +47,6 @@ int main(int argc, char ** argv) { - _dropbear_exit = cli_dropbear_exit; - _dropbear_log = cli_dropbear_log; - -- putenv("HOME=/data/local"); -- - disallow_core(); - - cli_getopts(argc, argv); -diff --git a/options.h b/options.h -index 7625151..48e404d 100644 ---- a/options.h -+++ b/options.h -@@ -159,7 +159,7 @@ etc) slower (perhaps by 50%). Recommended for most small systems. */ - * however significantly reduce the security of your ssh connections - * if the PRNG state becomes guessable - make sure you know what you are - * doing if you change this. */ --#define DROPBEAR_RANDOM_DEV "/dev/random" -+#define DROPBEAR_RANDOM_DEV "/dev/urandom" - - /* prngd must be manually set up to produce output */ - /*#define DROPBEAR_PRNGD_SOCKET "/var/run/dropbear-rng"*/ --- -1.7.10.4 - diff --git a/standalone/android/git.patch b/standalone/android/git.patch deleted file mode 100644 index ec81aaaeb4..0000000000 --- a/standalone/android/git.patch +++ /dev/null @@ -1,47 +0,0 @@ -From e0fffe80a8815e64dbc1d690c79bf006651c7642 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 13 Aug 2014 13:50:56 -0400 -Subject: [PATCH] avoid using of chmod on android when changing config - -This breaks on Android's /sdcard, which has a variety of FUSE -implentations, all total shite. ---- - config.c | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/config.c b/config.c -index 9ba40bc..a350638 100644 ---- a/config.c -+++ b/config.c -@@ -2124,12 +2124,14 @@ int git_config_set_multivar_in_file_gently(const char *config_filename, - close(in_fd); - in_fd = -1; - -+ /* not on android - if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) { - error("chmod on %s failed: %s", - get_lock_file_path(lock), strerror(errno)); - ret = CONFIG_NO_WRITE; - goto out_free; - } -+ */ - - if (store.seen == 0) - store.seen = 1; -@@ -2329,11 +2331,13 @@ int git_config_rename_section_in_file(const char *config_filename, - - fstat(fileno(config_file), &st); - -+ /* not on android - if (chmod(get_lock_file_path(lock), st.st_mode & 07777) < 0) { - ret = error("chmod on %s failed: %s", - get_lock_file_path(lock), strerror(errno)); - goto out; - } -+ */ - - while (fgets(buf, sizeof(buf), config_file)) { - int i; --- -2.1.4 - diff --git a/standalone/android/haskell-patches/basement_fix-build-on-android.patch b/standalone/android/haskell-patches/basement_fix-build-on-android.patch deleted file mode 100644 index 948473bc2e..0000000000 --- a/standalone/android/haskell-patches/basement_fix-build-on-android.patch +++ /dev/null @@ -1,41 +0,0 @@ -From cc0c373b69f93057cbdcb634a461e10ec019d87a Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Wed, 20 Jun 2018 00:29:11 +0100 -Subject: [PATCH] fix build on android - ---- - Basement/Terminal.hs | 2 -- - basement.cabal | 1 - - 2 files changed, 3 deletions(-) - -diff --git a/Basement/Terminal.hs b/Basement/Terminal.hs -index 8136e52..cca9606 100644 ---- a/Basement/Terminal.hs -+++ b/Basement/Terminal.hs -@@ -1,11 +1,9 @@ - {-# LANGUAGE CPP #-} - module Basement.Terminal - ( initialize -- , getDimensions - ) where - - import Basement.Compat.Base --import Basement.Terminal.Size (getDimensions) - #ifdef mingw32_HOST_OS - import System.IO (hSetEncoding, utf8, hPutStrLn, stderr, stdin, stdout) - import System.Win32.Console (setConsoleCP, setConsoleOutputCP, getConsoleCP, getConsoleOutputCP) -diff --git a/basement.cabal b/basement.cabal -index af50291..0824c94 100644 ---- a/basement.cabal -+++ b/basement.cabal -@@ -135,7 +135,6 @@ library - Basement.String.Encoding.ASCII7 - Basement.String.Encoding.ISO_8859_1 - -- Basement.Terminal.Size - - - build-depends: base >= 4.7 && < 5 --- -2.1.4 - diff --git a/standalone/android/haskell-patches/certificate_1.3.7-0001-support-Android-cert-store.patch b/standalone/android/haskell-patches/certificate_1.3.7-0001-support-Android-cert-store.patch deleted file mode 100644 index 5f772bfdfe..0000000000 --- a/standalone/android/haskell-patches/certificate_1.3.7-0001-support-Android-cert-store.patch +++ /dev/null @@ -1,37 +0,0 @@ -From 3779c75175e895f94b21341ebd6361e9d6af54fd Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Thu, 9 May 2013 12:36:23 -0400 -Subject: [PATCH] support Android cert store - -Android puts it in a different place and has only hashed files. -See https://github.com/vincenthz/hs-certificate/issues/19 ---- - System/Certificate/X509/Unix.hs | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/System/Certificate/X509/Unix.hs b/System/Certificate/X509/Unix.hs -index 8463465..74e9503 100644 ---- a/System/Certificate/X509/Unix.hs -+++ b/System/Certificate/X509/Unix.hs -@@ -35,7 +35,8 @@ import qualified Control.Exception as E - import Data.Char - - defaultSystemPath :: FilePath --defaultSystemPath = "/etc/ssl/certs/" -+defaultSystemPath = "/system/etc/security/cacerts/" -+--defaultSystemPath = "/etc/ssl/certs/" - - envPathOverride :: String - envPathOverride = "SYSTEM_CERTIFICATE_PATH" -@@ -47,7 +48,7 @@ listDirectoryCerts path = (map (path ) . filter isCert <$> getDirectoryConten - && isDigit (s !! 9) - && (s !! 8) == '.' - && all isHexDigit (take 8 s) -- isCert x = (not $ isPrefixOf "." x) && (not $ isHashedFile x) -+ isCert x = (not $ isPrefixOf "." x) - - getSystemCertificateStore :: IO CertificateStore - getSystemCertificateStore = makeCertificateStore . concat <$> (getSystemPath >>= listDirectoryCerts >>= mapM readCertificates) --- -1.8.2.rc3 - diff --git a/standalone/android/haskell-patches/clock_hack-for-android.patch b/standalone/android/haskell-patches/clock_hack-for-android.patch deleted file mode 100644 index d2c39ff539..0000000000 --- a/standalone/android/haskell-patches/clock_hack-for-android.patch +++ /dev/null @@ -1,76 +0,0 @@ -From 5be3bdfc5ec83eaa5defd42e99f73a685123bea0 Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Fri, 22 May 2015 18:35:43 +0000 -Subject: [PATCH] hack for android - ---- - System/Clock.hsc | 32 ++------------------------------ - 1 file changed, 2 insertions(+), 30 deletions(-) - -diff --git a/System/Clock.hsc b/System/Clock.hsc -index b6a4968..92bcf8b 100644 ---- a/System/Clock.hsc -+++ b/System/Clock.hsc -@@ -35,8 +35,6 @@ import GHC.Generics (Generic) - # endif - #endif - --#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) -- - -- | Clock types. A clock may be system-wide (that is, visible to all processes) - -- or per-process (measuring time that is meaningful only within a process). - -- All implementations shall support CLOCK_REALTIME. -@@ -119,7 +117,7 @@ getTime ThreadCPUTime = allocaAndPeek hs_clock_win32_gettime_threadtime - #elif defined(__MACH__) - getTime clk = allocaAndPeek $ hs_clock_darwin_gettime $ clockToConst clk - #else --getTime clk = allocaAndPeek $ clock_gettime $ clockToConst clk -+getTime clk = error "getTime clk not implemented" - #endif - - #if defined(_WIN32) -@@ -130,7 +128,7 @@ getRes ThreadCPUTime = allocaAndPeek hs_clock_win32_getres_threadtime - #elif defined(__MACH__) - getRes clk = allocaAndPeek $ hs_clock_darwin_getres $ clockToConst clk - #else --getRes clk = allocaAndPeek $ clock_getres $ clockToConst clk -+getRes clk = error "getRes clk not implemented" - #endif - - -- | TimeSpec structure -@@ -139,32 +137,6 @@ data TimeSpec = TimeSpec - , nsec :: {-# UNPACK #-} !Int64 -- ^ nanoseconds - } deriving (Eq, Generic, Read, Show, Typeable) - --#if defined(_WIN32) --instance Storable TimeSpec where -- sizeOf _ = sizeOf (undefined :: Int64) * 2 -- alignment _ = alignment (undefined :: Int64) -- poke ptr ts = do -- pokeByteOff ptr 0 (sec ts) -- pokeByteOff ptr (sizeOf (undefined :: Int64)) (nsec ts) -- peek ptr = do -- TimeSpec -- <$> peekByteOff ptr 0 -- <*> peekByteOff ptr (sizeOf (undefined :: Int64)) --#else --instance Storable TimeSpec where -- sizeOf _ = #{size struct timespec} -- alignment _ = #{alignment struct timespec} -- poke ptr ts = do -- let xs :: #{type time_t} = fromIntegral $ sec ts -- xn :: #{type long} = fromIntegral $ nsec ts -- #{poke struct timespec, tv_sec} ptr (xs) -- #{poke struct timespec, tv_nsec} ptr (xn) -- peek ptr = do -- xs :: #{type time_t} <- #{peek struct timespec, tv_sec} ptr -- xn :: #{type long} <- #{peek struct timespec, tv_nsec} ptr -- return $ TimeSpec (fromIntegral xs) (fromIntegral xn) --#endif -- - normalize :: TimeSpec -> TimeSpec - normalize (TimeSpec xs xn) = - let (q, r) = xn `divMod` (10^9) --- -2.1.4 - diff --git a/standalone/android/haskell-patches/comonad_cross-build.patch b/standalone/android/haskell-patches/comonad_cross-build.patch deleted file mode 100644 index ee8ae42681..0000000000 --- a/standalone/android/haskell-patches/comonad_cross-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 589c6a87ec62e35942c9a86ea8d91b443c80da99 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Fri, 18 Oct 2013 23:07:02 +0000 -Subject: [PATCH] cross build - ---- - comonad.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/comonad.cabal b/comonad.cabal -index 5d34b13..756ed92 100644 ---- a/comonad.cabal -+++ b/comonad.cabal -@@ -13,7 +13,7 @@ copyright: Copyright (C) 2008-2013 Edward A. Kmett, - Copyright (C) 2004-2008 Dave Menendez - synopsis: Comonads - description: Comonads --build-type: Custom -+build-type: Simple - extra-source-files: - .ghci - .gitignore --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/crypto-numbers_build-fix.patch b/standalone/android/haskell-patches/crypto-numbers_build-fix.patch deleted file mode 100644 index 5c0693a312..0000000000 --- a/standalone/android/haskell-patches/crypto-numbers_build-fix.patch +++ /dev/null @@ -1,227 +0,0 @@ -From 0cfdb30120976290068f4bcbebbf236b960afbb6 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 26 Dec 2013 20:01:30 -0400 -Subject: [PATCH] hack to build - ---- - Crypto/Number/Basic.hs | 14 -------------- - Crypto/Number/ModArithmetic.hs | 29 ----------------------------- - Crypto/Number/Prime.hs | 18 ------------------ - crypto-numbers.cabal | 2 +- - 4 files changed, 1 insertion(+), 62 deletions(-) - -diff --git a/Crypto/Number/Basic.hs b/Crypto/Number/Basic.hs -index 65c14b3..eaee853 100644 ---- a/Crypto/Number/Basic.hs -+++ b/Crypto/Number/Basic.hs -@@ -20,11 +20,7 @@ module Crypto.Number.Basic - , areEven - ) where - --#if MIN_VERSION_integer_gmp(0,5,1) --import GHC.Integer.GMP.Internals --#else - import Data.Bits --#endif - - -- | sqrti returns two integer (l,b) so that l <= sqrt i <= b - -- the implementation is quite naive, use an approximation for the first number -@@ -63,25 +59,16 @@ sqrti i - -- gcde 'a' 'b' find (x,y,gcd(a,b)) where ax + by = d - -- - gcde :: Integer -> Integer -> (Integer, Integer, Integer) --#if MIN_VERSION_integer_gmp(0,5,1) --gcde a b = (s, t, g) -- where (# g, s #) = gcdExtInteger a b -- t = (g - s * a) `div` b --#else - gcde a b = if d < 0 then (-x,-y,-d) else (x,y,d) where - (d, x, y) = f (a,1,0) (b,0,1) - f t (0, _, _) = t - f (a', sa, ta) t@(b', sb, tb) = - let (q, r) = a' `divMod` b' in - f t (r, sa - (q * sb), ta - (q * tb)) --#endif - - -- | get the extended GCD of two integer using the extended binary algorithm (HAC 14.61) - -- get (x,y,d) where d = gcd(a,b) and x,y satisfying ax + by = d - gcde_binary :: Integer -> Integer -> (Integer, Integer, Integer) --#if MIN_VERSION_integer_gmp(0,5,1) --gcde_binary = gcde --#else - gcde_binary a' b' - | b' == 0 = (1,0,a') - | a' >= b' = compute a' b' -@@ -105,7 +92,6 @@ gcde_binary a' b' - in if u2 >= v2 - then loop g x y (u2 - v2) v2 (a2 - c2) (b2 - d2) c2 d2 - else loop g x y u2 (v2 - u2) a2 b2 (c2 - a2) (d2 - b2) --#endif - - -- | check if a list of integer are all even - areEven :: [Integer] -> Bool -diff --git a/Crypto/Number/ModArithmetic.hs b/Crypto/Number/ModArithmetic.hs -index 942c12f..f8cfc32 100644 ---- a/Crypto/Number/ModArithmetic.hs -+++ b/Crypto/Number/ModArithmetic.hs -@@ -29,12 +29,8 @@ module Crypto.Number.ModArithmetic - import Control.Exception (throw, Exception) - import Data.Typeable - --#if MIN_VERSION_integer_gmp(0,5,1) --import GHC.Integer.GMP.Internals --#else - import Crypto.Number.Basic (gcde_binary) - import Data.Bits --#endif - - -- | Raised when two numbers are supposed to be coprimes but are not. - data CoprimesAssertionError = CoprimesAssertionError -@@ -55,13 +51,7 @@ expSafe :: Integer -- ^ base - -> Integer -- ^ exponant - -> Integer -- ^ modulo - -> Integer -- ^ result --#if MIN_VERSION_integer_gmp(0,5,1) --expSafe b e m -- | odd m = powModSecInteger b e m -- | otherwise = powModInteger b e m --#else - expSafe = exponentiation --#endif - - -- | Compute the modular exponentiation of base^exponant using - -- the fastest algorithm without any consideration for -@@ -74,11 +64,7 @@ expFast :: Integer -- ^ base - -> Integer -- ^ modulo - -> Integer -- ^ result - expFast = --#if MIN_VERSION_integer_gmp(0,5,1) -- powModInteger --#else - exponentiation --#endif - - -- note on exponentiation: 0^0 is treated as 1 for mimicking the standard library; - -- the mathematic debate is still open on whether or not this is true, but pratically -@@ -87,22 +73,15 @@ expFast = - -- | exponentiation_rtl_binary computes modular exponentiation as b^e mod m - -- using the right-to-left binary exponentiation algorithm (HAC 14.79) - exponentiation_rtl_binary :: Integer -> Integer -> Integer -> Integer --#if MIN_VERSION_integer_gmp(0,5,1) --exponentiation_rtl_binary = expSafe --#else - exponentiation_rtl_binary 0 0 m = 1 `mod` m - exponentiation_rtl_binary b e m = loop e b 1 - where sq x = (x * x) `mod` m - loop !0 _ !a = a `mod` m - loop !i !s !a = loop (i `shiftR` 1) (sq s) (if odd i then a * s else a) --#endif - - -- | exponentiation computes modular exponentiation as b^e mod m - -- using repetitive squaring. - exponentiation :: Integer -> Integer -> Integer -> Integer --#if MIN_VERSION_integer_gmp(0,5,1) --exponentiation = expSafe --#else - exponentiation b e m - | b == 1 = b - | e == 0 = 1 -@@ -110,7 +89,6 @@ exponentiation b e m - | even e = let p = (exponentiation b (e `div` 2) m) `mod` m - in (p^(2::Integer)) `mod` m - | otherwise = (b * exponentiation b (e-1) m) `mod` m --#endif - - --{-# DEPRECATED exponantiation_rtl_binary "typo in API name it's called exponentiation_rtl_binary #-} - exponantiation_rtl_binary :: Integer -> Integer -> Integer -> Integer -@@ -122,17 +100,10 @@ exponantiation = exponentiation - - -- | inverse computes the modular inverse as in g^(-1) mod m - inverse :: Integer -> Integer -> Maybe Integer --#if MIN_VERSION_integer_gmp(0,5,1) --inverse g m -- | r == 0 = Nothing -- | otherwise = Just r -- where r = recipModInteger g m --#else - inverse g m - | d > 1 = Nothing - | otherwise = Just (x `mod` m) - where (x,_,d) = gcde_binary g m --#endif - - -- | Compute the modular inverse of 2 coprime numbers. - -- This is equivalent to inverse except that the result -diff --git a/Crypto/Number/Prime.hs b/Crypto/Number/Prime.hs -index 0cea9da..458c94d 100644 ---- a/Crypto/Number/Prime.hs -+++ b/Crypto/Number/Prime.hs -@@ -3,9 +3,7 @@ - #ifndef MIN_VERSION_integer_gmp - #define MIN_VERSION_integer_gmp(a,b,c) 0 - #endif --#if MIN_VERSION_integer_gmp(0,5,1) - {-# LANGUAGE MagicHash #-} --#endif - -- | - -- Module : Crypto.Number.Prime - -- License : BSD-style -@@ -30,12 +28,7 @@ import Crypto.Number.Generate - import Crypto.Number.Basic (sqrti, gcde_binary) - import Crypto.Number.ModArithmetic (exponantiation) - --#if MIN_VERSION_integer_gmp(0,5,1) --import GHC.Integer.GMP.Internals --import GHC.Base --#else - import Data.Bits --#endif - - -- | returns if the number is probably prime. - -- first a list of small primes are implicitely tested for divisibility, -@@ -78,21 +71,11 @@ findPrimeFromWith rng prop !n - -- | find a prime from a starting point with no specific property. - findPrimeFrom :: CPRG g => g -> Integer -> (Integer, g) - findPrimeFrom rng n = --#if MIN_VERSION_integer_gmp(0,5,1) -- (nextPrimeInteger n, rng) --#else - findPrimeFromWith rng (\g _ -> (True, g)) n --#endif - - -- | Miller Rabin algorithm return if the number is probably prime or composite. - -- the tries parameter is the number of recursion, that determines the accuracy of the test. - primalityTestMillerRabin :: CPRG g => g -> Int -> Integer -> (Bool, g) --#if MIN_VERSION_integer_gmp(0,5,1) --primalityTestMillerRabin rng (I# tries) !n = -- case testPrimeInteger n tries of -- 0# -> (False, rng) -- _ -> (True, rng) --#else - primalityTestMillerRabin rng tries !n - | n <= 3 = error "Miller-Rabin requires tested value to be > 3" - | even n = (False, rng) -@@ -129,7 +112,6 @@ primalityTestMillerRabin rng tries !n - | x2 == 1 = False - | x2 /= nm1 = loop' ws ((x2*x2) `mod` n) (r+1) - | otherwise = loop ws --#endif - - {- - n < z -> witness to test -diff --git a/crypto-numbers.cabal b/crypto-numbers.cabal -index 9610e34..6669d78 100644 ---- a/crypto-numbers.cabal -+++ b/crypto-numbers.cabal -@@ -15,7 +15,7 @@ Extra-Source-Files: Tests/*.hs - - Flag integer-gmp - Description: Are we using integer-gmp? -- Default: True -+ Default: False - - Library - Build-Depends: base >= 4 && < 5 --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/distributive_0.4.4_0001-fixes-for-cross-build.patch b/standalone/android/haskell-patches/distributive_0.4.4_0001-fixes-for-cross-build.patch deleted file mode 100644 index 4229d644d8..0000000000 --- a/standalone/android/haskell-patches/distributive_0.4.4_0001-fixes-for-cross-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 86eca0993e1716b4db14570836efbe838626892f Mon Sep 17 00:00:00 2001 -From: dummy -Date: Sun, 25 May 2014 09:11:15 +0200 -Subject: [PATCH] cross build - ---- - distributive.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/distributive.cabal b/distributive.cabal -index 9be5133..3e72c65 100644 ---- a/distributive.cabal -+++ b/distributive.cabal -@@ -12,7 +12,7 @@ bug-reports: http://github.com/ekmett/distributive/issues - copyright: Copyright (C) 2011-2014 Edward A. Kmett - synopsis: Distributive functors -- Dual to Traversable - description: Distributive functors -- Dual to Traversable --build-type: Custom -+build-type: Simple - extra-source-files: - .ghci - .travis.yml --- -2.0.0.rc2 - diff --git a/standalone/android/haskell-patches/dns_use-android-net.dns1-command-instead-of-resolv.conf.patch b/standalone/android/haskell-patches/dns_use-android-net.dns1-command-instead-of-resolv.conf.patch deleted file mode 100644 index 962a642075..0000000000 --- a/standalone/android/haskell-patches/dns_use-android-net.dns1-command-instead-of-resolv.conf.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 087f1ae5e17f0e6d7c9f6b4092a5bb5bb6f5bf60 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 16 Oct 2014 02:59:11 +0000 -Subject: [PATCH] port - ---- - Network/DNS/Resolver.hs | 13 ++++++++----- - dns.cabal | 1 + - 2 files changed, 9 insertions(+), 5 deletions(-) - -diff --git a/Network/DNS/Resolver.hs b/Network/DNS/Resolver.hs -index 5721e03..c4400d1 100644 ---- a/Network/DNS/Resolver.hs -+++ b/Network/DNS/Resolver.hs -@@ -19,7 +19,7 @@ module Network.DNS.Resolver ( - ) where - - import Control.Applicative ((<$>), (<*>), pure) --import Control.Exception (bracket) -+import Control.Exception (bracket, catch, IOException) - import qualified Data.ByteString.Char8 as BS - import Data.Char (isSpace) - import Data.List (isPrefixOf) -@@ -32,6 +32,7 @@ import Network.Socket (AddrInfoFlag(..), AddrInfo(..), defaultHints, getAddrInfo - import Prelude hiding (lookup) - import System.Random (getStdRandom, randomR) - import System.Timeout (timeout) -+import System.Process - - #if mingw32_HOST_OS == 1 - import Network.Socket (send) -@@ -130,10 +131,12 @@ makeResolvSeed conf = ResolvSeed <$> addr - where - addr = case resolvInfo conf of - RCHostName numhost -> makeAddrInfo numhost -- RCFilePath file -> toAddr <$> readFile file >>= makeAddrInfo -- toAddr cs = let l:_ = filter ("nameserver" `isPrefixOf`) $ lines cs -- in extract l -- extract = reverse . dropWhile isSpace . reverse . dropWhile isSpace . drop 11 -+ RCFilePath file -> do -+ -- Android has no /etc/resolv.conf; use getprop command. -+ ls <- catch (lines <$> readProcess "getprop" ["net.dns1"] []) (const (return []) :: IOException -> IO [String]) -+ makeAddrInfo $ case ls of -+ [] -> "8.8.8.8" -- google public dns as a fallback only -+ (l:_) -> l - - makeAddrInfo :: HostName -> IO AddrInfo - makeAddrInfo addr = do -diff --git a/dns.cabal b/dns.cabal -index ceaf5f4..cd15e61 100644 ---- a/dns.cabal -+++ b/dns.cabal -@@ -37,6 +37,7 @@ Library - , network >= 2.3 - , random - , resourcet -+ , process - else - Build-Depends: base >= 4 && < 5 - , attoparsec --- -2.1.1 - diff --git a/standalone/android/haskell-patches/gsasl_0.3.5-0001-link-with-libgsasl.patch b/standalone/android/haskell-patches/gsasl_0.3.5-0001-link-with-libgsasl.patch deleted file mode 100644 index 42206a1cf7..0000000000 --- a/standalone/android/haskell-patches/gsasl_0.3.5-0001-link-with-libgsasl.patch +++ /dev/null @@ -1,25 +0,0 @@ -From df0f41f92d003f7d59ef927737ffec3a9bd61827 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Tue, 7 May 2013 18:41:01 -0400 -Subject: [PATCH] avoid cabal hell - ---- - gsasl.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gsasl.cabal b/gsasl.cabal -index d991873..c5c2b19 100644 ---- a/gsasl.cabal -+++ b/gsasl.cabal -@@ -31,7 +31,7 @@ library - build-depends: - base >= 4.0 && < 5.0 - , transformers >= 0.2 -- , bytestring >= 0.9 -+ , bytestring >= 0.10.3.0 - - pkgconfig-depends: libgsasl >= 1.1 - --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/iproute_1.2.11_0001-build-without-IPv6-stuff.patch b/standalone/android/haskell-patches/iproute_1.2.11_0001-build-without-IPv6-stuff.patch deleted file mode 100644 index bb9caec770..0000000000 --- a/standalone/android/haskell-patches/iproute_1.2.11_0001-build-without-IPv6-stuff.patch +++ /dev/null @@ -1,47 +0,0 @@ -From 7beec2e707d59f9573aa2dc7c57bd2a62f16b480 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 15 May 2013 19:06:03 -0400 -Subject: [PATCH] build without IPv6 stuff - ---- - Data/IP.hs | 2 +- - Data/IP/Addr.hs | 3 +++ - 2 files changed, 4 insertions(+), 1 deletion(-) - -diff --git a/Data/IP.hs b/Data/IP.hs -index cffef93..ea486c9 100644 ---- a/Data/IP.hs -+++ b/Data/IP.hs -@@ -6,7 +6,7 @@ module Data.IP ( - -- ** IP data - IP (..) - , IPv4, toIPv4, fromIPv4, fromHostAddress, toHostAddress -- , IPv6, toIPv6, fromIPv6, fromHostAddress6, toHostAddress6 -+ , IPv6, toIPv6, fromIPv6 -- , fromHostAddress6, toHostAddress6 - -- ** IP range data - , IPRange (..) - , AddrRange (addr, mask, mlen) -diff --git a/Data/IP/Addr.hs b/Data/IP/Addr.hs -index faaf0c7..5b556fb 100644 ---- a/Data/IP/Addr.hs -+++ b/Data/IP/Addr.hs -@@ -312,6 +312,7 @@ toHostAddress (IP4 addr4) - | byteOrder == LittleEndian = fixByteOrder addr4 - | otherwise = addr4 - -+{- - -- | The 'fromHostAddress6' function converts 'HostAddress6' to 'IPv6'. - fromHostAddress6 :: HostAddress6 -> IPv6 - fromHostAddress6 = IP6 -@@ -320,6 +321,8 @@ fromHostAddress6 = IP6 - toHostAddress6 :: IPv6 -> HostAddress6 - toHostAddress6 (IP6 addr6) = addr6 - -+-} -+ - fixByteOrder :: Word32 -> Word32 - fixByteOrder s = d1 .|. d2 .|. d3 .|. d4 - where --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/language-javascript_fix-build-with-new-ghc.patch b/standalone/android/haskell-patches/language-javascript_fix-build-with-new-ghc.patch deleted file mode 100644 index 6182cba442..0000000000 --- a/standalone/android/haskell-patches/language-javascript_fix-build-with-new-ghc.patch +++ /dev/null @@ -1,25 +0,0 @@ -From cb5252db1a0d515da69d9167a8b2facd839940b2 Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Mon, 11 Nov 2013 02:29:06 +0000 -Subject: [PATCH] fix build with new ghc - ---- - src/Language/JavaScript/Parser/Lexer.hs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/Language/JavaScript/Parser/Lexer.hs b/src/Language/JavaScript/Parser/Lexer.hs -index 79fa9c5..fa96e29 100644 ---- a/src/Language/JavaScript/Parser/Lexer.hs -+++ b/src/Language/JavaScript/Parser/Lexer.hs -@@ -712,7 +712,7 @@ alex_scan_tkn user orig_input len input s last_acc = - (offset) = (base +# ord_c) - (check) = alexIndexInt16OffAddr alex_check offset - -- (new_s) = if (offset >=# 0#) && (check ==# ord_c) -+ (new_s) = if (tagToEnum# (offset >=# 0#)) && (tagToEnum# (check ==# ord_c)) - then alexIndexInt16OffAddr alex_table offset - else alexIndexInt16OffAddr alex_deflt s - in --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/network_android-port-fixes.patch b/standalone/android/haskell-patches/network_android-port-fixes.patch deleted file mode 100644 index 784eec13a9..0000000000 --- a/standalone/android/haskell-patches/network_android-port-fixes.patch +++ /dev/null @@ -1,341 +0,0 @@ -From 834a0d3bfe56b969a65eff834604442cde8798f7 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Wed, 20 Jun 2018 05:06:41 +0100 -Subject: [PATCH] android port fixes - -Build note: Ensure a hsc2hs in PATH is modified to pass -x to the real -one, to enable cross-compiling. ---- - Network/BSD.hsc | 84 ------------------------------------------- - Network/Socket.hsc | 16 ++++----- - Network/Socket/ByteString.hsc | 2 +- - Network/Socket/Internal.hsc | 2 +- - Network/Socket/Types.hsc | 14 +++----- - cbits/HsNet.c | 18 ++++++++++ - configure | 1 + - include/HsNetworkConfig.h | 4 +-- - 8 files changed, 36 insertions(+), 105 deletions(-) - -diff --git a/Network/BSD.hsc b/Network/BSD.hsc -index 67f2fcd..4c86af5 100644 ---- a/Network/BSD.hsc -+++ b/Network/BSD.hsc -@@ -28,12 +28,8 @@ module Network.BSD - , hostAddress - - #if defined(HAVE_GETHOSTENT) && !defined(mingw32_HOST_OS) -- , getHostEntries -- - -- ** Low level functionality -- , setHostEntry - , getHostEntry -- , endHostEntry - #endif - - -- * Service names -@@ -61,14 +57,6 @@ module Network.BSD - , getProtocolNumber - , defaultProtocol - --#if !defined(mingw32_HOST_OS) -- , getProtocolEntries -- -- ** Low level functionality -- , setProtocolEntry -- , getProtocolEntry -- , endProtocolEntry --#endif -- - -- * Port numbers - , PortNumber - -@@ -80,11 +68,6 @@ module Network.BSD - #if !defined(mingw32_HOST_OS) - , getNetworkByName - , getNetworkByAddr -- , getNetworkEntries -- -- ** Low level functionality -- , setNetworkEntry -- , getNetworkEntry -- , endNetworkEntry - #endif - - #if defined(HAVE_IF_NAMETOINDEX) -@@ -298,30 +281,6 @@ getProtocolNumber proto = do - (ProtocolEntry _ _ num) <- getProtocolByName proto - return num - --#if !defined(mingw32_HOST_OS) --getProtocolEntry :: IO ProtocolEntry -- Next Protocol Entry from DB --getProtocolEntry = withLock $ do -- ent <- throwNoSuchThingIfNull "getProtocolEntry" "no such protocol entry" -- $ c_getprotoent -- peek ent -- --foreign import ccall unsafe "getprotoent" c_getprotoent :: IO (Ptr ProtocolEntry) -- --setProtocolEntry :: Bool -> IO () -- Keep DB Open ? --setProtocolEntry flg = withLock $ c_setprotoent (fromBool flg) -- --foreign import ccall unsafe "setprotoent" c_setprotoent :: CInt -> IO () -- --endProtocolEntry :: IO () --endProtocolEntry = withLock $ c_endprotoent -- --foreign import ccall unsafe "endprotoent" c_endprotoent :: IO () -- --getProtocolEntries :: Bool -> IO [ProtocolEntry] --getProtocolEntries stayOpen = withLock $ do -- setProtocolEntry stayOpen -- getEntries (getProtocolEntry) (endProtocolEntry) --#endif - - -- --------------------------------------------------------------------------- - -- Host lookups -@@ -405,21 +364,6 @@ getHostEntry = withLock $ do - >>= peek - - foreign import ccall unsafe "gethostent" c_gethostent :: IO (Ptr HostEntry) -- --setHostEntry :: Bool -> IO () --setHostEntry flg = withLock $ c_sethostent (fromBool flg) -- --foreign import ccall unsafe "sethostent" c_sethostent :: CInt -> IO () -- --endHostEntry :: IO () --endHostEntry = withLock $ c_endhostent -- --foreign import ccall unsafe "endhostent" c_endhostent :: IO () -- --getHostEntries :: Bool -> IO [HostEntry] --getHostEntries stayOpen = do -- setHostEntry stayOpen -- getEntries (getHostEntry) (endHostEntry) - #endif - - -- --------------------------------------------------------------------------- -@@ -482,34 +426,6 @@ getNetworkByAddr addr family = withLock $ do - - foreign import ccall unsafe "getnetbyaddr" - c_getnetbyaddr :: NetworkAddr -> CInt -> IO (Ptr NetworkEntry) -- --getNetworkEntry :: IO NetworkEntry --getNetworkEntry = withLock $ do -- throwNoSuchThingIfNull "getNetworkEntry" "no more network entries" -- $ c_getnetent -- >>= peek -- --foreign import ccall unsafe "getnetent" c_getnetent :: IO (Ptr NetworkEntry) -- ---- | Open the network name database. The parameter specifies ---- whether a connection is maintained open between various ---- networkEntry calls --setNetworkEntry :: Bool -> IO () --setNetworkEntry flg = withLock $ c_setnetent (fromBool flg) -- --foreign import ccall unsafe "setnetent" c_setnetent :: CInt -> IO () -- ---- | Close the connection to the network name database. --endNetworkEntry :: IO () --endNetworkEntry = withLock $ c_endnetent -- --foreign import ccall unsafe "endnetent" c_endnetent :: IO () -- ---- | Get the list of network entries. --getNetworkEntries :: Bool -> IO [NetworkEntry] --getNetworkEntries stayOpen = do -- setNetworkEntry stayOpen -- getEntries (getNetworkEntry) (endNetworkEntry) - #endif - - -- --------------------------------------------------------------------------- -diff --git a/Network/Socket.hsc b/Network/Socket.hsc -index 8b2e6fe..b02b80d 100644 ---- a/Network/Socket.hsc -+++ b/Network/Socket.hsc -@@ -59,7 +59,7 @@ module Network.Socket - , HostName - , ServiceName - --#if defined(IPV6_SOCKET_SUPPORT) -+#if defined(IPV6_SOCKET_SUPPORT) || 1 - , AddrInfo(..) - - , AddrInfoFlag(..) -@@ -143,7 +143,7 @@ module Network.Socket - -- * Special constants - , aNY_PORT - , iNADDR_ANY --#if defined(IPV6_SOCKET_SUPPORT) -+#if defined(IPV6_SOCKET_SUPPORTNO) - , iN6ADDR_ANY - #endif - , sOMAXCONN -@@ -521,7 +521,7 @@ accept sock@(MkSocket s family stype protocol status) = do - return new_sock - #else - with (fromIntegral sz) $ \ ptr_len -> do --# ifdef HAVE_ACCEPT4 -+#if 0 - new_sock <- throwSocketErrorIfMinus1RetryMayBlock "accept" - (threadWaitRead (fromIntegral s)) - (c_accept4 s sockaddr ptr_len (#const SOCK_NONBLOCK)) -@@ -903,7 +903,7 @@ packSocketOption so = - Just MaxSegment -> Just ((#const IPPROTO_TCP), (#const TCP_MAXSEG)) - #endif - #ifdef TCP_NODELAY -- Just NoDelay -> Just ((#const IPPROTO_TCP), (#const TCP_NODELAY)) -+ Just NoDelay -> Nothing -- Just ((#const IPPROTO_TCP), (#const TCP_NODELAY)) - #endif - #ifdef TCP_USER_TIMEOUT - Just UserTimeout -> Just ((#const IPPROTO_TCP), (#const TCP_USER_TIMEOUT)) -@@ -1036,9 +1036,9 @@ iNADDR_ANY :: HostAddress - iNADDR_ANY = htonl (#const INADDR_ANY) - - -- | Converts the from host byte order to network byte order. --foreign import CALLCONV unsafe "htonl" htonl :: Word32 -> Word32 -+foreign import CALLCONV unsafe "my_htonl" htonl :: Word32 -> Word32 - -- | Converts the from network byte order to host byte order. --foreign import CALLCONV unsafe "ntohl" ntohl :: Word32 -> Word32 -+foreign import CALLCONV unsafe "my_ntohl" ntohl :: Word32 -> Word32 - - #if defined(IPV6_SOCKET_SUPPORT) - -- | The IPv6 wild card address. -@@ -1206,7 +1206,7 @@ unpackBits ((k,v):xs) r - ----------------------------------------------------------------------------- - -- Address and service lookups - --#if defined(IPV6_SOCKET_SUPPORT) -+#if defined(IPV6_SOCKET_SUPPORT) || 1 - - -- | Flags that control the querying behaviour of 'getAddrInfo'. - -- For more information, see -@@ -1568,7 +1568,7 @@ foreign import CALLCONV unsafe "bind" - c_bind :: CInt -> Ptr SockAddr -> CInt{-CSockLen???-} -> IO CInt - foreign import CALLCONV SAFE_ON_WIN "connect" - c_connect :: CInt -> Ptr SockAddr -> CInt{-CSockLen???-} -> IO CInt --#ifdef HAVE_ACCEPT4 -+#if 0 - foreign import CALLCONV unsafe "accept4" - c_accept4 :: CInt -> Ptr SockAddr -> Ptr CInt{-CSockLen???-} -> CInt -> IO CInt - #else -diff --git a/Network/Socket/ByteString.hsc b/Network/Socket/ByteString.hsc -index 93e29c9..a736932 100644 ---- a/Network/Socket/ByteString.hsc -+++ b/Network/Socket/ByteString.hsc -@@ -177,7 +177,7 @@ sendMany sock@(MkSocket fd _ _ _ _) cs = do - liftM fromIntegral . withIOVec cs $ \(iovsPtr, iovsLen) -> - throwSocketErrorWaitWrite sock "writev" $ - c_writev (fromIntegral fd) iovsPtr -- (fromIntegral (min iovsLen (#const IOV_MAX))) -+ (fromIntegral (min iovsLen (0x0026))) - #else - sendMany sock = sendAll sock . B.concat - #endif -diff --git a/Network/Socket/Internal.hsc b/Network/Socket/Internal.hsc -index c8bf4f6..2463bd7 100644 ---- a/Network/Socket/Internal.hsc -+++ b/Network/Socket/Internal.hsc -@@ -24,7 +24,7 @@ module Network.Socket.Internal - ( - -- * Socket addresses - HostAddress --#if defined(IPV6_SOCKET_SUPPORT) -+#if defined(IPV6_SOCKET_SUPPORTNO) - , HostAddress6 - , FlowInfo - , ScopeID -diff --git a/Network/Socket/Types.hsc b/Network/Socket/Types.hsc -index b42c98d..e5bb9fe 100644 ---- a/Network/Socket/Types.hsc -+++ b/Network/Socket/Types.hsc -@@ -758,10 +758,10 @@ intToPortNumber v = PortNum (htons (fromIntegral v)) - portNumberToInt :: PortNumber -> Int - portNumberToInt (PortNum po) = fromIntegral (ntohs po) - --foreign import CALLCONV unsafe "ntohs" ntohs :: Word16 -> Word16 --foreign import CALLCONV unsafe "htons" htons :: Word16 -> Word16 --foreign import CALLCONV unsafe "ntohl" ntohl :: Word32 -> Word32 --foreign import CALLCONV unsafe "htonl" htonl :: Word32 -> Word32 -+foreign import CALLCONV unsafe "my_ntohs" ntohs :: Word16 -> Word16 -+foreign import CALLCONV unsafe "my_htons" htons :: Word16 -> Word16 -+foreign import CALLCONV unsafe "my_ntohl" ntohl :: Word32 -> Word32 -+foreign import CALLCONV unsafe "my_htonl" htonl :: Word32 -> Word32 - - instance Enum PortNumber where - toEnum = intToPortNumber -@@ -1071,13 +1071,9 @@ poke32 p i0 a = do - -- | Private newtype proxy for the Storable instance. To avoid orphan instances. - newtype In6Addr = In6Addr HostAddress6 - --#if __GLASGOW_HASKELL__ < 800 --#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) --#endif -- - instance Storable In6Addr where - sizeOf _ = #const sizeof(struct in6_addr) -- alignment _ = #alignment struct in6_addr -+ alignment _ = 64 - - peek p = do - a <- peek32 p 0 -diff --git a/cbits/HsNet.c b/cbits/HsNet.c -index 86b55dc..6225c32 100644 ---- a/cbits/HsNet.c -+++ b/cbits/HsNet.c -@@ -6,3 +6,21 @@ - - #define INLINE - #include "HsNet.h" -+ -+#include -+uint16_t my_htons(uint16_t v) -+{ -+ htons(v); -+} -+uint32_t my_htonl(uint32_t v) -+{ -+ htonl(v); -+} -+uint16_t my_ntohs(uint16_t v) -+{ -+ ntohs(v); -+} -+uint32_t my_ntohl(uint32_t v) -+{ -+ ntohl(v); -+} -diff --git a/configure b/configure -index 9e82879..24ef3ce 100755 ---- a/configure -+++ b/configure -@@ -1,4 +1,5 @@ - #! /bin/sh -+set -- --host=arm-linux-androideabi - # Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.69 for Haskell network package 2.3.0.14. - # -diff --git a/include/HsNetworkConfig.h b/include/HsNetworkConfig.h -index 383f6e2..62b8852 100644 ---- a/include/HsNetworkConfig.h -+++ b/include/HsNetworkConfig.h -@@ -2,7 +2,7 @@ - /* include/HsNetworkConfig.h.in. Generated from configure.ac by autoheader. */ - - /* Define to 1 if you have the `accept4' function. */ --#define HAVE_ACCEPT4 1 -+/* #undef HAVE_ACCEPT4 */ - - /* Define to 1 if you have the header file. */ - #define HAVE_ARPA_INET_H 1 -@@ -73,7 +73,7 @@ - #define HAVE_LIMITS_H 1 - - /* Define to 1 if you have the header file. */ --#define HAVE_LINUX_CAN_H 1 -+/* #undef HAVE_LINUX_CAN_H */ - - /* Define to 1 if you have a Linux sendfile(2) implementation. */ - #define HAVE_LINUX_SENDFILE 1 --- -2.1.4 - diff --git a/standalone/android/haskell-patches/primitive_0.5.3.0_0001-disable-i386-opt-stuff-to-allow-cross-compilation.patch b/standalone/android/haskell-patches/primitive_0.5.3.0_0001-disable-i386-opt-stuff-to-allow-cross-compilation.patch deleted file mode 100644 index efee692b51..0000000000 --- a/standalone/android/haskell-patches/primitive_0.5.3.0_0001-disable-i386-opt-stuff-to-allow-cross-compilation.patch +++ /dev/null @@ -1,25 +0,0 @@ -From ff2d1519fb294a123636ac6bd80e50741922c856 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Sun, 25 May 2014 09:41:13 +0200 -Subject: [PATCH] disable i386 opt stuff to allow cross-compilation - ---- - primitive.cabal | 2 -- - 1 file changed, 2 deletions(-) - -diff --git a/primitive.cabal b/primitive.cabal -index 9651dfd..b655e8d 100644 ---- a/primitive.cabal -+++ b/primitive.cabal -@@ -47,8 +47,6 @@ Library - cc-options: -O3 -fomit-frame-pointer -Wall - if !os(solaris) - cc-options: -ftree-vectorize -- if arch(i386) || arch(x86_64) -- cc-options: -msse2 - - source-repository head - type: git --- -2.0.0.rc2 - diff --git a/standalone/android/haskell-patches/socks_0.4.2_0001-remove-IPv6-stuff.patch b/standalone/android/haskell-patches/socks_0.4.2_0001-remove-IPv6-stuff.patch deleted file mode 100644 index c9723f3f76..0000000000 --- a/standalone/android/haskell-patches/socks_0.4.2_0001-remove-IPv6-stuff.patch +++ /dev/null @@ -1,135 +0,0 @@ -From e1a2f80f6bec25921ab645a0aaf1c6422a8917ab Mon Sep 17 00:00:00 2001 -From: dummy -Date: Mon, 11 Nov 2013 01:06:58 +0000 -Subject: [PATCH] fix - ---- - Network/Socks5/Command.hs | 8 +------- - Network/Socks5/Conf.hs | 1 - - Network/Socks5/Lowlevel.hs | 1 - - Network/Socks5/Types.hs | 18 +----------------- - Network/Socks5/Wire.hs | 2 -- - 5 files changed, 2 insertions(+), 28 deletions(-) - -diff --git a/Network/Socks5/Command.hs b/Network/Socks5/Command.hs -index db95fbd..fdba5ec 100644 ---- a/Network/Socks5/Command.hs -+++ b/Network/Socks5/Command.hs -@@ -13,7 +13,6 @@ module Network.Socks5.Command - , Connect(..) - , Command(..) - , connectIPV4 -- , connectIPV6 - , connectDomainName - -- * lowlevel interface - , rpc -@@ -29,7 +28,7 @@ import qualified Data.ByteString as B - import qualified Data.ByteString.Char8 as BC - import Data.Serialize - --import Network.Socket (Socket, PortNumber, HostAddress, HostAddress6) -+import Network.Socket (Socket, PortNumber, HostAddress) - import Network.Socket.ByteString - - import Network.Socks5.Types -@@ -65,11 +64,6 @@ connectIPV4 socket hostaddr port = onReply <$> rpc_ socket (Connect $ SocksAddre - where onReply (SocksAddrIPV4 h, p) = (h, p) - onReply _ = error "ipv4 requested, got something different" - --connectIPV6 :: Socket -> HostAddress6 -> PortNumber -> IO (HostAddress6, PortNumber) --connectIPV6 socket hostaddr6 port = onReply <$> rpc_ socket (Connect $ SocksAddress (SocksAddrIPV6 hostaddr6) port) -- where onReply (SocksAddrIPV6 h, p) = (h, p) -- onReply _ = error "ipv6 requested, got something different" -- - -- TODO: FQDN should only be ascii, maybe putting a "fqdn" data type - -- in front to make sure and make the BC.pack safe. - connectDomainName :: Socket -> String -> PortNumber -> IO (SocksHostAddress, PortNumber) -diff --git a/Network/Socks5/Conf.hs b/Network/Socks5/Conf.hs -index c29ff7b..007d382 100644 ---- a/Network/Socks5/Conf.hs -+++ b/Network/Socks5/Conf.hs -@@ -47,5 +47,4 @@ defaultSocksConfFromSockAddr sockaddr = SocksConf server SocksVer5 - where server = SocksAddress haddr port - (haddr,port) = case sockaddr of - SockAddrInet p h -> (SocksAddrIPV4 h, p) -- SockAddrInet6 p _ h _ -> (SocksAddrIPV6 h, p) - _ -> error "unsupported unix sockaddr type" -diff --git a/Network/Socks5/Lowlevel.hs b/Network/Socks5/Lowlevel.hs -index c10d9b9..2c3d59c 100644 ---- a/Network/Socks5/Lowlevel.hs -+++ b/Network/Socks5/Lowlevel.hs -@@ -17,7 +17,6 @@ resolveToSockAddr :: SocksAddress -> IO SockAddr - resolveToSockAddr (SocksAddress sockHostAddr port) = - case sockHostAddr of - SocksAddrIPV4 ha -> return $ SockAddrInet port ha -- SocksAddrIPV6 ha6 -> return $ SockAddrInet6 port 0 ha6 0 - SocksAddrDomainName bs -> do he <- getHostByName (BC.unpack bs) - return $ SockAddrInet port (hostAddress he) - -diff --git a/Network/Socks5/Types.hs b/Network/Socks5/Types.hs -index 7fbec25..17c7c83 100644 ---- a/Network/Socks5/Types.hs -+++ b/Network/Socks5/Types.hs -@@ -19,7 +19,7 @@ module Network.Socks5.Types - import Data.ByteString (ByteString) - import Data.Word - import Data.Data --import Network.Socket (HostAddress, HostAddress6, PortNumber) -+import Network.Socket (HostAddress, PortNumber) - import Control.Exception - import qualified Data.ByteString.Char8 as BC - import Numeric (showHex) -@@ -53,12 +53,10 @@ data SocksMethod = - data SocksHostAddress = - SocksAddrIPV4 !HostAddress - | SocksAddrDomainName !ByteString -- | SocksAddrIPV6 !HostAddress6 - deriving (Eq,Ord) - - instance Show SocksHostAddress where - show (SocksAddrIPV4 ha) = "SocksAddrIPV4(" ++ showHostAddress ha ++ ")" -- show (SocksAddrIPV6 ha6) = "SocksAddrIPV6(" ++ showHostAddress6 ha6 ++ ")" - show (SocksAddrDomainName dn) = "SocksAddrDomainName(" ++ BC.unpack dn ++ ")" - - -- | Converts a HostAddress to a String in dot-decimal notation -@@ -69,20 +67,6 @@ showHostAddress num = concat [show q1, ".", show q2, ".", show q3, ".", show q4] - (num''',q3) = num'' `quotRem` 256 - (_,q4) = num''' `quotRem` 256 - ---- | Converts a IPv6 HostAddress6 to standard hex notation --showHostAddress6 :: HostAddress6 -> String --showHostAddress6 (a,b,c,d) = -- (concat . intersperse ":" . map (flip showHex "")) -- [p1,p2,p3,p4,p5,p6,p7,p8] -- where (a',p2) = a `quotRem` 65536 -- (_,p1) = a' `quotRem` 65536 -- (b',p4) = b `quotRem` 65536 -- (_,p3) = b' `quotRem` 65536 -- (c',p6) = c `quotRem` 65536 -- (_,p5) = c' `quotRem` 65536 -- (d',p8) = d `quotRem` 65536 -- (_,p7) = d' `quotRem` 65536 -- - -- | Describe a Socket address on the SOCKS protocol - data SocksAddress = SocksAddress !SocksHostAddress !PortNumber - deriving (Show,Eq,Ord) -diff --git a/Network/Socks5/Wire.hs b/Network/Socks5/Wire.hs -index 10bd262..a30f32e 100644 ---- a/Network/Socks5/Wire.hs -+++ b/Network/Socks5/Wire.hs -@@ -46,12 +46,10 @@ data SocksResponse = SocksResponse - - getAddr 1 = SocksAddrIPV4 <$> getWord32host - getAddr 3 = SocksAddrDomainName <$> (getWord8 >>= getByteString . fromIntegral) --getAddr 4 = SocksAddrIPV6 <$> (liftM4 (,,,) getWord32host getWord32host getWord32host getWord32host) - getAddr n = error ("cannot get unknown socket address type: " ++ show n) - - putAddr (SocksAddrIPV4 h) = putWord8 1 >> putWord32host h - putAddr (SocksAddrDomainName b) = putWord8 3 >> putWord8 (fromIntegral $ B.length b) >> putByteString b --putAddr (SocksAddrIPV6 (a,b,c,d)) = putWord8 4 >> mapM_ putWord32host [a,b,c,d] - - getSocksRequest 5 = do - cmd <- toEnum . fromIntegral <$> getWord8 --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/stm-chans_cross-build.patch b/standalone/android/haskell-patches/stm-chans_cross-build.patch deleted file mode 100644 index f0964d693e..0000000000 --- a/standalone/android/haskell-patches/stm-chans_cross-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -From c1b166ad1dbed80f7eed7b9c1b2dc5c668eeb8fc Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Fri, 18 Oct 2013 23:28:56 +0000 -Subject: [PATCH] cross build - ---- - stm-chans.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/stm-chans.cabal b/stm-chans.cabal -index 89d4780..2119a74 100644 ---- a/stm-chans.cabal -+++ b/stm-chans.cabal -@@ -6,7 +6,7 @@ - -- and source-repository:. - Cabal-Version: >= 1.6 - -- We need a custom build in order to define __HADDOCK__ --Build-Type: Custom -+Build-Type: Simple - - Name: stm-chans - Version: 3.0.0 --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/system-filepath_cross-build.patch b/standalone/android/haskell-patches/system-filepath_cross-build.patch deleted file mode 100644 index c9f9304a48..0000000000 --- a/standalone/android/haskell-patches/system-filepath_cross-build.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0e728d5b049224394908d793c73902a8c981e636 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Mon, 26 May 2014 01:04:40 +0000 -Subject: [PATCH] fix cross build - ---- - system-filepath.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/system-filepath.cabal b/system-filepath.cabal -index d6aa726..f4e5e0f 100644 ---- a/system-filepath.cabal -+++ b/system-filepath.cabal -@@ -6,7 +6,7 @@ license-file: license.txt - author: John Millikin - maintainer: John Millikin - copyright: John Millikin 2010-2012 --build-type: Custom -+build-type: Simple - cabal-version: >= 1.8 - category: System - stability: experimental --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/unbounded-delays_crossbuild.patch b/standalone/android/haskell-patches/unbounded-delays_crossbuild.patch deleted file mode 100644 index dd0a7fca90..0000000000 --- a/standalone/android/haskell-patches/unbounded-delays_crossbuild.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 0ad071f80ee72e7b8ca5b0b70dfae5bbf8677969 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 12 Mar 2014 12:18:17 -0400 -Subject: [PATCH] cross build - ---- - unbounded-delays.cabal | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/unbounded-delays.cabal b/unbounded-delays.cabal -index 76d0a50..0f27569 100644 ---- a/unbounded-delays.cabal -+++ b/unbounded-delays.cabal -@@ -1,7 +1,7 @@ - name: unbounded-delays - version: 0.1.0.6 - cabal-version: >= 1.6 --build-type: Custom -+build-type: Simple - author: Bas van Dijk - Roel van Dijk - maintainer: Bas van Dijk --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch b/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch deleted file mode 100644 index 16c4f92a21..0000000000 --- a/standalone/android/haskell-patches/unix-time_hack-for-Bionic.patch +++ /dev/null @@ -1,56 +0,0 @@ -From db9eb179885874af342bb2c3adef7185496ba1f1 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Wed, 15 Oct 2014 16:37:32 +0000 -Subject: [PATCH] hack for bionic - ---- - Data/UnixTime/Types.hsc | 12 ------------ - cbits/conv.c | 2 +- - 2 files changed, 1 insertion(+), 13 deletions(-) - -diff --git a/Data/UnixTime/Types.hsc b/Data/UnixTime/Types.hsc -index d30f39b..ec7ca4c 100644 ---- a/Data/UnixTime/Types.hsc -+++ b/Data/UnixTime/Types.hsc -@@ -9,8 +9,6 @@ import Foreign.Storable - - #include - --#let alignment t = "%lu", (unsigned long)offsetof(struct {char x__; t (y__); }, y__) -- - -- | - -- Data structure for Unix time. - data UnixTime = UnixTime { -@@ -20,16 +18,6 @@ data UnixTime = UnixTime { - , utMicroSeconds :: {-# UNPACK #-} !Int32 - } deriving (Eq,Ord,Show) - --instance Storable UnixTime where -- sizeOf _ = (#size struct timeval) -- alignment _ = (#alignment struct timeval) -- peek ptr = UnixTime -- <$> (#peek struct timeval, tv_sec) ptr -- <*> (#peek struct timeval, tv_usec) ptr -- poke ptr ut = do -- (#poke struct timeval, tv_sec) ptr (utSeconds ut) -- (#poke struct timeval, tv_usec) ptr (utMicroSeconds ut) -- - -- | - -- Format of the strptime()/strftime() style. - type Format = ByteString -diff --git a/cbits/conv.c b/cbits/conv.c -index ec31fef..b7bc0f9 100644 ---- a/cbits/conv.c -+++ b/cbits/conv.c -@@ -96,7 +96,7 @@ time_t c_parse_unix_time_gmt(char *fmt, char *src) { - #else - strptime(src, fmt, &dst); - #endif -- return timegm(&dst); -+ return NULL; /* timegm(&dst); (not in Bionic) */ - } - - size_t c_format_unix_time(char *fmt, time_t src, char* dst, int siz) { --- -2.1.1 - diff --git a/standalone/android/haskell-patches/uuid_build-without-v1-uuid-which-needs-network-info.patch b/standalone/android/haskell-patches/uuid_build-without-v1-uuid-which-needs-network-info.patch deleted file mode 100644 index 12cb2a922c..0000000000 --- a/standalone/android/haskell-patches/uuid_build-without-v1-uuid-which-needs-network-info.patch +++ /dev/null @@ -1,79 +0,0 @@ -From 87283f9b6f992a7f0e36c7b1bafc288bf2bf106a Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Mon, 11 Nov 2013 02:46:27 +0000 -Subject: [PATCH] build without v1 uuid which needs network-ino - ---- - Data/UUID/Util.hs | 11 ----------- - Data/UUID/V1.hs | 2 -- - uuid.cabal | 2 -- - 3 files changed, 15 deletions(-) - -diff --git a/Data/UUID/Util.hs b/Data/UUID/Util.hs -index 581391a..399e508 100644 ---- a/Data/UUID/Util.hs -+++ b/Data/UUID/Util.hs -@@ -3,7 +3,6 @@ module Data.UUID.Util ( - UnpackedUUID(..) - , unpack, pack - , version -- , extractMac - , extractTime - , setTime - ) where -@@ -13,7 +12,6 @@ import Data.Word - import Data.Word.Util - import Data.Bits - import Data.UUID.Internal --import Network.Info - import Data.Int (Int64) - - version :: UUID -> Int -@@ -43,12 +41,3 @@ extractTime uuid = - timeAndVersionToTime :: Word16 -> Word16 - timeAndVersionToTime tv = tv .&. 0x0FFF - --extractMac :: UUID -> Maybe MAC --extractMac uuid = -- if version uuid == 1 -- then Just $ -- MAC (node_0 unpacked) (node_1 unpacked) (node_2 unpacked) (node_3 unpacked) (node_4 unpacked) (node_5 unpacked) -- else Nothing -- where -- unpacked = unpack uuid -- -diff --git a/Data/UUID/V1.hs b/Data/UUID/V1.hs -index 067e729..ca4c235 100644 ---- a/Data/UUID/V1.hs -+++ b/Data/UUID/V1.hs -@@ -37,8 +37,6 @@ import System.IO.Unsafe - - import qualified System.Random as R - --import Network.Info -- - import Data.UUID.Builder - import Data.UUID.Internal - -diff --git a/uuid.cabal b/uuid.cabal -index 0a53059..57b1b86 100644 ---- a/uuid.cabal -+++ b/uuid.cabal -@@ -32,14 +32,12 @@ Library - cryptohash >= 0.7 && < 0.12, - deepseq == 1.3.*, - hashable (>= 1.1.1.0 && < 1.2.0) || (>= 1.2.1 && < 1.3), -- network-info == 0.2.*, - random >= 1.0.1 && < 1.1, - time >= 1.1 && < 1.5 - - Exposed-Modules: - Data.UUID - Data.UUID.Util -- Data.UUID.V1 - Data.UUID.V3 - Data.UUID.V4 - Data.UUID.V5 --- -1.7.10.4 - diff --git a/standalone/android/haskell-patches/warp_remove-ipv6-stuff.patch b/standalone/android/haskell-patches/warp_remove-ipv6-stuff.patch deleted file mode 100644 index cc5368f6b4..0000000000 --- a/standalone/android/haskell-patches/warp_remove-ipv6-stuff.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 2f1d2eddde94d339d91d7b018dc90542b7625fd3 Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Wed, 20 Jun 2018 14:41:04 +0100 -Subject: [PATCH] remove ipv6 stuff - ---- - Network/Wai/Handler/Warp/Run.hs | 9 +-------- - 1 file changed, 1 insertion(+), 8 deletions(-) - -diff --git a/Network/Wai/Handler/Warp/Run.hs b/Network/Wai/Handler/Warp/Run.hs -index 116b24e..5c7cbcb 100644 ---- a/Network/Wai/Handler/Warp/Run.hs -+++ b/Network/Wai/Handler/Warp/Run.hs -@@ -14,7 +14,7 @@ import Control.Monad (when, unless, void) - import Data.ByteString (ByteString) - import qualified Data.ByteString as S - import Data.Char (chr) --import Data.IP (toHostAddress, toHostAddress6) -+import Data.IP (toHostAddress) - import Data.IORef (IORef, newIORef, readIORef, writeIORef) - import Data.Streaming.Network (bindPortTCP) - import Network (sClose, Socket) -@@ -305,13 +305,6 @@ serveConnection conn ii origAddr transport settings app = do - [a] -> Just (SockAddrInet (readInt clientPort) - (toHostAddress a)) - _ -> Nothing -- ["PROXY","TCP6",clientAddr,_,clientPort,_] -> -- case [x | (x, t) <- reads (decodeAscii clientAddr), null t] of -- [a] -> Just (SockAddrInet6 (readInt clientPort) -- 0 -- (toHostAddress6 a) -- 0) -- _ -> Nothing - ("PROXY":"UNKNOWN":_) -> - Just origAddr - _ -> --- -2.1.4 - diff --git a/standalone/android/haskell-patches/x509-store_support-Android-cert-store.patch b/standalone/android/haskell-patches/x509-store_support-Android-cert-store.patch deleted file mode 100644 index 1683f49745..0000000000 --- a/standalone/android/haskell-patches/x509-store_support-Android-cert-store.patch +++ /dev/null @@ -1,28 +0,0 @@ -From 717945172c2f3ff95cce9db2d075122bccfc9a1a Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Wed, 20 Jun 2018 02:01:30 +0100 -Subject: [PATCH] support Android cert store - -Android has only hashsed cert files. -See https://github.com/vincenthz/hs-certificate/issues/19 ---- - Data/X509/CertificateStore.hs | 2 +- - 2 files changed, 1 insertion(+), 1 deletion(-) - delete mode 100644 Data/X509/.CertificateStore.hs.swp - -diff --git a/Data/X509/CertificateStore.hs b/Data/X509/CertificateStore.hs -index 07449a2..74b8bde 100644 ---- a/Data/X509/CertificateStore.hs -+++ b/Data/X509/CertificateStore.hs -@@ -106,7 +106,7 @@ listDirectoryCerts path = - && isDigit (s !! 9) - && (s !! 8) == '.' - && all isHexDigit (take 8 s) -- isCert x = (not $ isPrefixOf "." x) && (not $ isHashedFile x) -+ isCert x = (not $ isPrefixOf "." x) - - getDirContents = E.catch (map (path ) . filter isCert <$> getDirectoryContents path) emptyPaths - where emptyPaths :: E.IOException -> IO [FilePath] --- -2.1.4 - diff --git a/standalone/android/haskell-patches/xss-sanitize_deps.patch b/standalone/android/haskell-patches/xss-sanitize_deps.patch deleted file mode 100644 index 0f0cfd9256..0000000000 --- a/standalone/android/haskell-patches/xss-sanitize_deps.patch +++ /dev/null @@ -1,24 +0,0 @@ -From 41eb8ab50125eb6ccf260c5510407483f1d78dd4 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Wed, 20 Jun 2018 14:52:52 +0100 -Subject: [PATCH] deps - ---- - xss-sanitize.cabal | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/xss-sanitize.cabal b/xss-sanitize.cabal -index 727dc95..2de4270 100644 ---- a/xss-sanitize.cabal -+++ b/xss-sanitize.cabal -@@ -19,6 +19,7 @@ library - , tagsoup >= 0.12.2 && < 1 - , utf8-string >= 0.3 && < 1 - , network >= 2 && < 3 -+ , network-uri - , css-text >= 0.1.1 && < 0.2 - , text >= 0.11 && < 2 - , attoparsec >= 0.10.0.3 && < 1 --- -2.1.4 - diff --git a/standalone/android/haskell-patches/zlib_0.5.4.0_0001-hack-to-build-on-Android.patch b/standalone/android/haskell-patches/zlib_0.5.4.0_0001-hack-to-build-on-Android.patch deleted file mode 100644 index a899fb8920..0000000000 --- a/standalone/android/haskell-patches/zlib_0.5.4.0_0001-hack-to-build-on-Android.patch +++ /dev/null @@ -1,35 +0,0 @@ -From 63d07ae4a1e3b77cbe023364599f7c2c3e853d5f Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Thu, 28 Feb 2013 23:40:57 -0400 -Subject: [PATCH] hack to build on Android - ---- - Codec/Compression/Zlib/Stream.hsc | 4 ++-- - zlib.cabal | 2 +- - 2 files changed, 3 insertions(+), 3 deletions(-) - -diff --git a/Codec/Compression/Zlib/Stream.hsc b/Codec/Compression/Zlib/Stream.hsc -index fe851e6..c6168f4 100644 ---- a/Codec/Compression/Zlib/Stream.hsc -+++ b/Codec/Compression/Zlib/Stream.hsc -@@ -921,7 +921,7 @@ foreign import ccall unsafe "zlib.h inflateInit2_" - - c_inflateInit2 :: StreamState -> CInt -> IO CInt - c_inflateInit2 z n = -- withCAString #{const_str ZLIB_VERSION} $ \versionStr -> -+ withCAString "1.2.5" $ \versionStr -> - c_inflateInit2_ z n versionStr (#{const sizeof(z_stream)} :: CInt) - - foreign import ccall unsafe "zlib.h inflate" -@@ -940,7 +940,7 @@ foreign import ccall unsafe "zlib.h deflateInit2_" - c_deflateInit2 :: StreamState - -> CInt -> CInt -> CInt -> CInt -> CInt -> IO CInt - c_deflateInit2 z a b c d e = -- withCAString #{const_str ZLIB_VERSION} $ \versionStr -> -+ withCAString "1.2.5" $ \versionStr -> - c_deflateInit2_ z a b c d e versionStr (#{const sizeof(z_stream)} :: CInt) - - foreign import ccall unsafe "zlib.h deflateSetDictionary" --- -1.7.10.4 - diff --git a/standalone/android/icons/drawable-hdpi/ic_launcher.png b/standalone/android/icons/drawable-hdpi/ic_launcher.png deleted file mode 100644 index f438747802..0000000000 Binary files a/standalone/android/icons/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/standalone/android/icons/drawable-hdpi/ic_stat_service_notification_icon.png b/standalone/android/icons/drawable-hdpi/ic_stat_service_notification_icon.png deleted file mode 100644 index f30483b38d..0000000000 Binary files a/standalone/android/icons/drawable-hdpi/ic_stat_service_notification_icon.png and /dev/null differ diff --git a/standalone/android/icons/drawable-ldpi/ic_launcher.png b/standalone/android/icons/drawable-ldpi/ic_launcher.png deleted file mode 100644 index 8decfec44a..0000000000 Binary files a/standalone/android/icons/drawable-ldpi/ic_launcher.png and /dev/null differ diff --git a/standalone/android/icons/drawable-ldpi/ic_stat_service_notification_icon.png b/standalone/android/icons/drawable-ldpi/ic_stat_service_notification_icon.png deleted file mode 100644 index 0e0b33e959..0000000000 Binary files a/standalone/android/icons/drawable-ldpi/ic_stat_service_notification_icon.png and /dev/null differ diff --git a/standalone/android/icons/drawable-mdpi/ic_launcher.png b/standalone/android/icons/drawable-mdpi/ic_launcher.png deleted file mode 100644 index aaf2c79219..0000000000 Binary files a/standalone/android/icons/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/standalone/android/icons/drawable-mdpi/ic_stat_service_notification_icon.png b/standalone/android/icons/drawable-mdpi/ic_stat_service_notification_icon.png deleted file mode 100644 index 7febe040d0..0000000000 Binary files a/standalone/android/icons/drawable-mdpi/ic_stat_service_notification_icon.png and /dev/null differ diff --git a/standalone/android/icons/drawable-xhdpi/ic_launcher.png b/standalone/android/icons/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 4a4ec146a4..0000000000 Binary files a/standalone/android/icons/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/standalone/android/icons/drawable-xhdpi/ic_stat_service_notification_icon.png b/standalone/android/icons/drawable-xhdpi/ic_stat_service_notification_icon.png deleted file mode 100644 index 253e90eb80..0000000000 Binary files a/standalone/android/icons/drawable-xhdpi/ic_stat_service_notification_icon.png and /dev/null differ diff --git a/standalone/android/icons/drawable/ic_launcher.png b/standalone/android/icons/drawable/ic_launcher.png deleted file mode 120000 index 28d94e566c..0000000000 --- a/standalone/android/icons/drawable/ic_launcher.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-mdpi/ic_launcher.png \ No newline at end of file diff --git a/standalone/android/icons/drawable/ic_stat_service_notification_icon.png b/standalone/android/icons/drawable/ic_stat_service_notification_icon.png deleted file mode 120000 index 3c30c49b06..0000000000 --- a/standalone/android/icons/drawable/ic_stat_service_notification_icon.png +++ /dev/null @@ -1 +0,0 @@ -../drawable-mdpi/ic_stat_service_notification_icon.png \ No newline at end of file diff --git a/standalone/android/install-haskell-packages b/standalone/android/install-haskell-packages deleted file mode 100755 index db6cf621a2..0000000000 --- a/standalone/android/install-haskell-packages +++ /dev/null @@ -1,133 +0,0 @@ -#!/bin/bash -# Bootstraps from an empty cabal to all the necessary haskell packages -# being installed, with the necessary patches to work on Android. -# -# You should install ghc-android first. -# -# The cabal.config is used to pin the haskell packages to the last -# versions that have been gotten working. To update, delete the -# cabal.config, run this script with an empty cabal and fix up the broken -# patches, and then use cabal freeze to generate a new cabal.config. - -set -e - -if [ ! -d haskell-patches ]; then - cd standalone/android -fi - -setupcabal () { - # Some packages fail to install in a non unicode locale. - LANG=en_US.UTF-8 - export LANG -} - -patched () { - pkg=$1 - ver=$2 - if [ -z "$ver" ]; then - ver="$(grep " $pkg " ../cabal.config | cut -d= -f 3 | sed 's/,$//')" - fi - if [ -z "$ver" ]; then - cabal unpack --pristine $pkg - else - cabal unpack --pristine $pkg-$ver - fi - cd $pkg* - git init - git config user.name dummy - git config user.email dummy@example.com - git add . - git commit -m "pre-patched state of $pkg" - ln -sf ../../cabal.config - for patch in ../../haskell-patches/${pkg}_* ../../../no-th/haskell-patches/${pkg}_*; do - if [ -e "$patch" ]; then - echo trying $patch - if ! patch -p1 < $patch; then - echo "failed to apply $patch" - echo "please resolve this, replace the patch with a new version, and exit the subshell to continue" - $SHELL - fi - fi - done - if [ -e config.sub ]; then - cp /usr/share/misc/config.sub . - fi - if [ -e config.guess ]; then - cp /usr/share/misc/config.guess . - fi - cabal install # --force-reinstalls --reinstall - rm -f cabal.config - - rm -rf $pkg* - cd .. -} - -installgitannexdeps () { - pushd ../.. - ln -sf standalone/android/cabal.config - cabal install --only-dependencies --flags="-magicmime -concurrentoutput" "$@" # --force-reinstalls --reinstall - rm -f cabal.config - popd -} - -install_pkgs () { - rm -rf tmp - mkdir tmp - cd tmp -cat <pw_dir, -+ file = percent_expand(filename, "h", _PATH_ROOT_HOME_PREFIX, - "u", pw->pw_name, (char *)NULL); - - /* -@@ -347,7 +347,7 @@ expand_authorized_keys(const char *filename, struct passwd *pw) - if (*file == '/') - return (file); - -- i = snprintf(ret, sizeof(ret), "%s/%s", pw->pw_dir, file); -+ i = snprintf(ret, sizeof(ret), "%s/%s", _PATH_ROOT_HOME_PREFIX, file); - if (i < 0 || (size_t)i >= sizeof(ret)) - fatal("expand_authorized_keys: path too long"); - xfree(file); -@@ -436,7 +436,7 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, - strerror(errno)); - return -1; - } -- if (realpath(pw->pw_dir, homedir) != NULL) -+ if (realpath(_PATH_ROOT_HOME_PREFIX, homedir) != NULL) - comparehome = 1; - - /* check the open file to avoid races */ -diff --git a/authfile.c b/authfile.c -index 7dd4496..00462e9 100644 ---- a/authfile.c -+++ b/authfile.c -@@ -613,6 +613,7 @@ int - key_perm_ok(int fd, const char *filename) - { - struct stat st; -+ return 1; /* check doesn't make sense on android */ - - if (fstat(fd, &st) < 0) - return 0; -diff --git a/misc.c b/misc.c -index 0bf2db6..4327d03 100644 ---- a/misc.c -+++ b/misc.c -@@ -25,6 +25,7 @@ - */ - - #include "includes.h" -+#include "pathnames.h" - - #include - #include -@@ -538,12 +539,13 @@ tilde_expand_filename(const char *filename, uid_t uid) - } else if ((pw = getpwuid(uid)) == NULL) /* ~/path */ - fatal("tilde_expand_filename: No such uid %ld", (long)uid); - -- if (strlcpy(ret, pw->pw_dir, sizeof(ret)) >= sizeof(ret)) -+ char *pw_dir=_PATH_ROOT_HOME_PREFIX; -+ if (strlcpy(ret, pw_dir, sizeof(ret)) >= sizeof(ret)) - fatal("tilde_expand_filename: Path too long"); - - /* Make sure directory has a trailing '/' */ -- len = strlen(pw->pw_dir); -- if ((len == 0 || pw->pw_dir[len - 1] != '/') && -+ len = strlen(pw_dir); -+ if ((len == 0 || pw_dir[len - 1] != '/') && - strlcat(ret, "/", sizeof(ret)) >= sizeof(ret)) - fatal("tilde_expand_filename: Path too long"); - -diff --git a/openbsd-compat/getrrsetbyname.c b/openbsd-compat/getrrsetbyname.c -index d2bea21..5b5d599 100644 ---- a/openbsd-compat/getrrsetbyname.c -+++ b/openbsd-compat/getrrsetbyname.c -@@ -56,8 +56,7 @@ - #include - - #include "getrrsetbyname.h" --#include "nameser.h" --#include "nameser_compat.h" -+#include "arpa/nameser.h" - - #if defined(HAVE_DECL_H_ERRNO) && !HAVE_DECL_H_ERRNO - extern int h_errno; -diff --git a/pathnames.h b/pathnames.h -index b7b9d91..3c10b11 100644 ---- a/pathnames.h -+++ b/pathnames.h -@@ -67,7 +67,7 @@ - #endif - - #ifndef _PATH_ROOT_HOME_PREFIX --#define _PATH_ROOT_HOME_PREFIX "/data" -+#define _PATH_ROOT_HOME_PREFIX getenv("HOME") - #endif - - /* -diff --git a/readconf.c b/readconf.c -index 097bb05..dcbc008 100644 ---- a/readconf.c -+++ b/readconf.c -@@ -1085,7 +1085,7 @@ read_config_file(const char *filename, const char *host, Options *options, - if ((f = fopen(filename, "r")) == NULL) - return 0; - -- if (checkperm) { -+ if (checkperm && 0) { - struct stat sb; - - if (fstat(fileno(f), &sb) == -1) -diff --git a/ssh-add.c b/ssh-add.c -index 738644d..f6fce4a 100644 ---- a/ssh-add.c -+++ b/ssh-add.c -@@ -471,7 +471,7 @@ main(int argc, char **argv) - } - - for (i = 0; default_files[i]; i++) { -- snprintf(buf, sizeof(buf), "%s/%s", pw->pw_dir, -+ snprintf(buf, sizeof(buf), "%s/%s", _PATH_ROOT_HOME_PREFIX, - default_files[i]); - if (stat(buf, &st) < 0) - continue; -diff --git a/ssh-keygen.c b/ssh-keygen.c -index 4baf7df..ef8bb25 100644 ---- a/ssh-keygen.c -+++ b/ssh-keygen.c -@@ -224,7 +224,7 @@ ask_filename(struct passwd *pw, const char *prompt) - } - } - snprintf(identity_file, sizeof(identity_file), "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, name); -+ _PATH_ROOT_HOME_PREFIX, name); - fprintf(stderr, "%s (%s): ", prompt, identity_file); - if (fgets(buf, sizeof(buf), stdin) == NULL) - exit(1); -@@ -2268,7 +2268,7 @@ main(int argc, char **argv) - - /* Create ~/.ssh directory if it doesn't already exist. */ - snprintf(dotsshdir, sizeof dotsshdir, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); - if (strstr(identity_file, dotsshdir) != NULL) { - if (stat(dotsshdir, &st) < 0) { -diff --git a/ssh.c b/ssh.c -index 898e966..ef6c858 100644 ---- a/ssh.c -+++ b/ssh.c -@@ -703,7 +703,7 @@ main(int ac, char **av) - fatal("Can't open user config file %.100s: " - "%.100s", config, strerror(errno)); - } else { -- r = snprintf(buf, sizeof buf, "%s/%s", pw->pw_dir, -+ r = snprintf(buf, sizeof buf, "%s/%s", _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_CONFFILE); - if (r > 0 && (size_t)r < sizeof(buf)) - (void)read_config_file(buf, host, &options, 1); -@@ -748,7 +748,7 @@ main(int ac, char **av) - if (options.local_command != NULL) { - debug3("expanding LocalCommand: %s", options.local_command); - cp = options.local_command; -- options.local_command = percent_expand(cp, "d", pw->pw_dir, -+ options.local_command = percent_expand(cp, "d", _PATH_ROOT_HOME_PREFIX, - "h", host, "l", thishost, "n", host_arg, "r", options.user, - "p", portstr, "u", pw->pw_name, "L", shorthost, - (char *)NULL); -@@ -888,7 +888,7 @@ main(int ac, char **av) - */ - if (config == NULL) { - r = snprintf(buf, sizeof buf, "%s/%s", -- strcmp(pw->pw_dir, "/") ? pw->pw_dir : _PATH_ROOT_HOME_PREFIX, -+ _PATH_ROOT_HOME_PREFIX, - _PATH_SSH_USER_DIR); - if (r > 0 && (size_t)r < sizeof(buf) && stat(buf, &st) < 0) { - #ifdef WITH_SELINUX -@@ -1532,7 +1532,7 @@ load_public_identity_files(void) - if ((pw = getpwuid(original_real_uid)) == NULL) - fatal("load_public_identity_files: getpwuid failed"); - pwname = xstrdup(pw->pw_name); -- pwdir = xstrdup(pw->pw_dir); -+ pwdir = xstrdup(_PATH_ROOT_HOME_PREFIX); - if (gethostname(thishost, sizeof(thishost)) == -1) - fatal("load_public_identity_files: gethostname: %s", - strerror(errno)); -diff --git a/uidswap.c b/uidswap.c -index bc6194e..5cbf5d1 100644 ---- a/uidswap.c -+++ b/uidswap.c -@@ -28,7 +28,6 @@ - #include "xmalloc.h" - - #ifdef ANDROID --#include - #include - #include - #endif -@@ -230,7 +229,7 @@ permanently_set_uid(struct passwd *pw) - debug("permanently_set_uid: %u/%u", (u_int)pw->pw_uid, - (u_int)pw->pw_gid); - --#ifdef ANDROID -+#if 0 - if (pw->pw_uid == AID_SHELL) { - prctl(PR_SET_KEEPCAPS, 1, 0, 0, 0); - -@@ -317,7 +316,7 @@ permanently_set_uid(struct passwd *pw) - (u_int)pw->pw_uid); - } - --#ifdef ANDROID -+#if 0 - if (pw->pw_uid == AID_SHELL) { - /* set CAP_SYS_BOOT capability, so "adb reboot" will succeed */ - header.version = _LINUX_CAPABILITY_VERSION; diff --git a/standalone/android/rsync.patch b/standalone/android/rsync.patch deleted file mode 100644 index 692e9cabb1..0000000000 --- a/standalone/android/rsync.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f91df535053958600d57f9df78d9ce84c8718655 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 13 Feb 2013 15:51:40 -0400 -Subject: [PATCH] android portability - ---- - authenticate.c | 3 ++- - batch.c | 2 +- - 2 files changed, 3 insertions(+), 2 deletions(-) - -diff --git a/authenticate.c b/authenticate.c -index 7650377..626dec6 100644 ---- a/authenticate.c -+++ b/authenticate.c -@@ -296,7 +296,8 @@ void auth_client(int fd, const char *user, const char *challenge) - * - * OpenBSD has a readpassphrase() that might be more suitable. - */ -- pass = getpass("Password: "); -+ /*pass = getpass("Password: "); */ -+ exit(1); - } - - if (!pass) -diff --git a/batch.c b/batch.c -index a3e9dca..ee31532 100644 ---- a/batch.c -+++ b/batch.c -@@ -221,7 +221,7 @@ void write_batch_shell_file(int argc, char *argv[], int file_arg_cnt) - stringjoin(filename, sizeof filename, - batch_name, ".sh", NULL); - fd = do_open(filename, O_WRONLY | O_CREAT | O_TRUNC, -- S_IRUSR | S_IWUSR | S_IEXEC); -+ S_IRUSR | S_IWUSR); - if (fd < 0) { - rsyserr(FERROR, errno, "Batch file %s open error", - filename); --- -1.7.10.4 - diff --git a/standalone/android/runshell b/standalone/android/runshell deleted file mode 100755 index 68f23b481b..0000000000 --- a/standalone/android/runshell +++ /dev/null @@ -1,133 +0,0 @@ -#!/system/bin/sh -# This is runs a shell in an environment configured for git-annex. -# Nearly the only command that can be used in here is busybox! -# lib.start.so will run us in the root of our app directory -base=$(./busybox pwd) -cmd=$base/busybox - -set -e - -prep () { - # Cannot rely on Android providing a sane HOME - HOME="/sdcard/git-annex.home" - export HOME -} - -buildtree () { - $cmd echo "Installation starting to $base" - $cmd cat "lib/lib.version.so" - - if $cmd test -e "$base/bin"; then - $cmd mv "$base/bin" "$base/bin.old" - fi - $cmd mkdir -p "$base/bin" - - for prog in busybox git-annex git-shell git-upload-pack git gpg rsync ssh ssh-keygen; do - $cmd echo "installing $prog" - if $cmd test -e "$base/bin/$prog"; then - $cmd rm -f "$base/bin/$prog" - fi - $cmd ln -s "$base/lib/lib.$prog.so" "$base/bin/$prog" - done - - $cmd --install -s $base/bin - - $cmd rm -rf "$base/bin.old" - - $cmd tar zxf $base/lib/lib.git.tar.gz.so - for prog in git git-shell git-upload-pack; do - for link in $($cmd cat "$base/links/$prog"); do - $cmd echo "linking $link to $prog" - if $cmd test -e "$base/$link"; then - $cmd rm -f "$base/$link" - fi - $cmd ln -s "$base/bin/$prog" "$base/$link" - done - $cmd rm -f "$base/links/$prog" - done - - $cmd mkdir -p "$base/templates" - $cmd mkdir -p "$base/tmp" - - $cmd echo "#!/system/bin/sh" > "$base/runshell" - $cmd echo "exec $base/lib/lib.start.so" >> "$base/runshell" - $cmd chmod 755 runshell - - $cmd cat "$base/lib/lib.trustedkeys.so" > "$base/bin/trustedkeys.gpg" - $cmd cat "$base/lib/lib.version.so" > "$base/installed-version" - $cmd echo "Installation complete" -} - -install () { - if ! $cmd mkdir -p "$HOME"; then - $cmd echo "mkdir of $HOME failed!" - fi - if $cmd test ! -e "$base/bin/git-annex"; then - if ! buildtree > $HOME/git-annex-install.log 2>&1; then - $cmd echo "Installation failed! Please report a bug and attach $HOME/git-annex-install.log" - $cmd sh - fi - elif $cmd test ! -e "$base/installed-version" || ! $cmd cmp "$base/installed-version" "$base/lib/lib.version.so" >/dev/null; then - if ! buildtree > $HOME/git-annex-install.log 2>&1; then - $cmd echo "Upgrade failed! Please report a bug and attach $HOME/git-annex-install.log" - fi - fi -} - -run () { - PATH="$base/bin:$PATH" - export PATH - - ORIG_GIT_EXEC_PATH="$GIT_EXEC_PATH" - export ORIG_GIT_EXEC_PATH - GIT_EXEC_PATH=$base/libexec/git-core - export GIT_EXEC_PATH - - ORIG_GIT_TEMPLATE_DIR="$GIT_TEMPLATE_DIR" - export ORIG_GIT_TEMPLATE_DIR - GIT_TEMPLATE_DIR="$base/templates" - export GIT_TEMPLATE_DIR - - # Indicate which variables were exported above. - GIT_ANNEX_STANDLONE_ENV="GIT_EXEC_PATH GIT_TEMPLATE_DIR" - export GIT_ANNEX_STANDLONE_ENV - - # This is a temporary directory on a non-crippled filesystem. - # Needs to be as short a path as possible, for ssh sockets. - GIT_ANNEX_TMP_DIR=$base/tmp - export GIT_ANNEX_TMP_DIR - # /tmp probably doesn't exist, so also use it as TMPDIR - TMPDIR=$GIT_ANNEX_TMP_DIR - export TMPDIR - - if $cmd test ! -e "$HOME/.gitconfig"; then - git config --global user.email "git-annex@android" - git config --global user.name "android" - fi - - if $cmd test "$1"; then - cmd="$1" - shift 1 - exec "$cmd" "$@" - else - # As good a start point as any. - cd "$HOME" - - /system/bin/sh - fi -} - -if $cmd test -n "$MKFIFO"; then - # because java is insane - $cmd mkfifo "$MKFIFO" -else - if ! prep; then - $cmd echo "prep failed. Please report a bug." - read line - fi - if ! install; then - $cmd echo "install failed. Please report a bug." - read line - fi - run -fi diff --git a/standalone/android/start.c b/standalone/android/start.c deleted file mode 100644 index c67c5da0ce..0000000000 --- a/standalone/android/start.c +++ /dev/null @@ -1,64 +0,0 @@ -/* Installed as lib.start.so, this bootstraps a working busybox and uses - * it to run lib.runshell.so. */ - -#include -#include -#include -#include -#include -#include - -void chopdir (char *s) { - char *p=strrchr(s, '/'); - if (p == NULL) { - fprintf(stderr, "cannot find directory in %s", s); - exit(1); - } - p[0] = '\0'; -} - -main () { - char buf[1024]; - char *p; - struct stat st_buf; - - /* Get something like /data/data/ga.androidterm/lib/lib.start.so */ - int n=readlink("/proc/self/exe", buf, 1023); - if (n < 1) { - fprintf(stderr, "failed to find own name"); - exit(1); - } - buf[n] = '\0'; - - /* Change directory to something like /data/data/ga.androidterm */ - chopdir(buf); - chopdir(buf); - if (chdir(buf) != 0) { - perror("chdir"); - exit(1); - } - - if (stat("lib/lib.busybox.so", &st_buf) != 0) { - /* TODO my lib dir should be in LD_LIBRARY_PATH; check that */ - fprintf(stderr, "Falling back to hardcoded app location; cannot find expected files in %s\n", buf); - if (chdir("/data/data/ga.androidterm") != 0) { - perror("chdir"); - exit(1); - } - } - - /* If this is the first run, set up busybox symlink, - * which allows busybox to run. */ - if (stat("busybox", &st_buf) != 0) { - if (symlink("lib/lib.busybox.so", "busybox") != 0) { - /* Just in case! */ - if (link("lib/lib.busybox.so", "busybox") != 0) { - perror("link busybox"); - exit(1); - } - } - } - - execl("./busybox", "./busybox", "sh", "lib/lib.runshell.so", NULL); - perror("error running busybox sh"); -} diff --git a/standalone/android/term.patch b/standalone/android/term.patch deleted file mode 100644 index c0ceefd740..0000000000 --- a/standalone/android/term.patch +++ /dev/null @@ -1,598 +0,0 @@ -diff --git a/AndroidManifest.xml b/AndroidManifest.xml -index b0e866a..1ab8515 100644 ---- a/AndroidManifest.xml -+++ b/AndroidManifest.xml -@@ -7,6 +7,7 @@ - - - -+ - - - - -+ - -@@ -34,8 +36,6 @@ - android:icon="@drawable/ic_menu_preferences" /> - -- - - Predešlé okno - Další okno - Reset terminálu -- Napiš email -+ WebApp - Speciální znaky - Přepnout soft. klávesnici - -@@ -124,4 +124,4 @@ - Není nastaveno žádné tlačitko pro funkční klávesu. - - Zavřít okno? -- -\ No newline at end of file -+ -diff --git a/res/values-de/strings.xml b/res/values-de/strings.xml -index f6134a5..06d2e1f 100644 ---- a/res/values-de/strings.xml -+++ b/res/values-de/strings.xml -@@ -23,7 +23,7 @@ - Vorh. Fenster - Nächst. Fenster - Zurücksetzen -- Email schreiben -+ WebApp - Spezialtasten - Tastatur an/aus - -@@ -124,4 +124,4 @@ - - Beliebige Scripte im Terminal Emulator ausführen - Erlaubt Anwendungen, neue Fenster im Android Terminal Emulator zu öffnen und in diesen Befehle auszuführen. Dies schließt alle Berechtigungen von Android Terminal Emulator ein, inklusive Internetzugang und Schreib-/Leserechte auf der SD-Karte. -- -\ No newline at end of file -+ -diff --git a/res/values-es/strings.xml b/res/values-es/strings.xml -index 94553b2..92d9e2a 100644 ---- a/res/values-es/strings.xml -+++ b/res/values-es/strings.xml -@@ -23,7 +23,7 @@ - Ventana anterior - Ventana posterior - Reiniciar consola -- Enviar email -+ WebApp - Teclas especiales - Ver/ocultar teclado - -diff --git a/res/values-eu/strings.xml b/res/values-eu/strings.xml -index b9f0586..92a16a0 100644 ---- a/res/values-eu/strings.xml -+++ b/res/values-eu/strings.xml -@@ -23,7 +23,7 @@ - Aurreko leihoa - Hurrengo leihoa - Berrezarri terminala -- Bidali eposta ...(r)i -+ WebApp - Tekla bereziak - Txandakatu soft teklatua - -diff --git a/res/values-fr/strings.xml b/res/values-fr/strings.xml -index beab2be..529f720 100644 ---- a/res/values-fr/strings.xml -+++ b/res/values-fr/strings.xml -@@ -24,7 +24,7 @@ - Fenêtre Préc. - Fenêtre Suiv. - Terminal par défaut -- Envoyer un e-mail -+ WebApp - Touches spéciales - Afficher/Masquer Clavier - -diff --git a/res/values-hu/strings.xml b/res/values-hu/strings.xml -index 5dbecb5..ce917c5 100644 ---- a/res/values-hu/strings.xml -+++ b/res/values-hu/strings.xml -@@ -23,7 +23,7 @@ - Előző ablak - Következő ablak - Alaphelyzet -- Küldés emailben -+ WebApp - Speciális billentyűk - Billentyűzet ki/be - -@@ -148,4 +148,4 @@ - Az Alt billentyű ESC-et küld - Az Alt billentyű ESC-et küld. - Az Alt billentyű nem ESC-et küld. -- -\ No newline at end of file -+ -diff --git a/res/values-it/strings.xml b/res/values-it/strings.xml -index e6a7294..9d97869 100644 ---- a/res/values-it/strings.xml -+++ b/res/values-it/strings.xml -@@ -23,7 +23,7 @@ - Fin. successiva - Fin. precedente - Reset terminale -- Invia email -+ WebApp - Tasti speciali - Mostra/nascondi tastiera - -diff --git a/res/values-ja/strings.xml b/res/values-ja/strings.xml -index 502fa23..dbfe9fa 100644 ---- a/res/values-ja/strings.xml -+++ b/res/values-ja/strings.xml -@@ -23,7 +23,7 @@ - 前のウインドウ - 次のウインドウ - 端末をリセット -- メール送信 -+ WebApp - 特殊キー - ソフトキーボード - -diff --git a/res/values-ka/strings.xml b/res/values-ka/strings.xml -index 06629d0..1d545b6 100644 ---- a/res/values-ka/strings.xml -+++ b/res/values-ka/strings.xml -@@ -23,7 +23,7 @@ - წინა ფანჯარა - შემდეგი ფანჯარა - ტერმინალის რესტარტი -- ელ-ფოსტის გაგზავნა -+ WebApp - სპეციალური ღილაკები - პროგრამული კლავიატურის ჩართ./გამორთ. - -diff --git a/res/values-nb/strings.xml b/res/values-nb/strings.xml -index d81ee07..c370c6f 100644 ---- a/res/values-nb/strings.xml -+++ b/res/values-nb/strings.xml -@@ -18,7 +18,7 @@ - Terminal Emulator - Innstillinger - Tilbakestill terminal -- Send epost til -+ WebApp - Spesielle tegn - Veksle virtuelt tastatur - -diff --git a/res/values-nl/strings.xml b/res/values-nl/strings.xml -index 19fa3d0..e24fbf5 100644 ---- a/res/values-nl/strings.xml -+++ b/res/values-nl/strings.xml -@@ -23,7 +23,7 @@ - Vorig venster - Volgend venster - Herstellen -- E-mail sturen naar -+ WebApp - Speciale knoppen - Toetsenbord aan/uit - -diff --git a/res/values-pl/strings.xml b/res/values-pl/strings.xml -index 25b3b43..2e0e651 100644 ---- a/res/values-pl/strings.xml -+++ b/res/values-pl/strings.xml -@@ -23,7 +23,7 @@ - Poprzednie okno - Następne okno - Wyczyść terminal -- Wyślij e-mail -+ WebApp - Przyciski specjalne - Pokaż klawiaturę - -diff --git a/res/values-pt-rPT/strings.xml b/res/values-pt-rPT/strings.xml -index aa4ba54..aa3d735 100644 ---- a/res/values-pt-rPT/strings.xml -+++ b/res/values-pt-rPT/strings.xml -@@ -18,7 +18,7 @@ - Terminal Emulator - Preferências - Reset terminal -- Email para -+ WebApp - Teclas especiais - Abrir teclado - -diff --git a/res/values-pt/strings.xml b/res/values-pt/strings.xml -index 2d992f9..e53a9ac 100644 ---- a/res/values-pt/strings.xml -+++ b/res/values-pt/strings.xml -@@ -23,7 +23,7 @@ - Anterior - Seguinte - Repor terminal -- Enviar mensagem para -+ WebApp - Teclas especiais - Mostrar/ocultar teclado - -diff --git a/res/values-ro/strings.xml b/res/values-ro/strings.xml -index 3c7ea06..7a072d0 100644 ---- a/res/values-ro/strings.xml -+++ b/res/values-ro/strings.xml -@@ -21,7 +21,7 @@ - "Fereastra anterioră" - "Fereastra următoare" - "Resetaţi " -- "E-mail" -+ WebApp - "Taste speciale" - "Comutați tastatura" - -@@ -123,4 +123,4 @@ - "Tasta Alt trimite ESC" - "Tasta Alt trimite ESC." - "Tasta Alt nu trimite ESC." -- -\ No newline at end of file -+ -diff --git a/res/values-ru/strings.xml b/res/values-ru/strings.xml -index 0e96360..762324e 100644 ---- a/res/values-ru/strings.xml -+++ b/res/values-ru/strings.xml -@@ -8,7 +8,7 @@ - Предыдущее окно - Следующее окно - Сбросить терминал -- Отправить Email -+ WebApp - Специальные клавиши - Экранная клавиатура - Терминальное состояние этого окна было сброшено. -diff --git a/res/values-sk/strings.xml b/res/values-sk/strings.xml -index ef35366..cc31d80 100644 ---- a/res/values-sk/strings.xml -+++ b/res/values-sk/strings.xml -@@ -23,7 +23,7 @@ - Dalšie okno - Predch. okno - Obnoviť term. -- Poslať e-mailom -+ WebApp - Špec. klávesy - Skryť/zobraziť klávesnicu - -diff --git a/res/values-sv/strings.xml b/res/values-sv/strings.xml -index 1aa9055..8de6c09 100644 ---- a/res/values-sv/strings.xml -+++ b/res/values-sv/strings.xml -@@ -3,7 +3,7 @@ - Terminalemulator - Inställningar - Återställ terminal -- E-posta till -+ WebApp - Special tangenter - Växla till virtuellt tangentbord - Aktivera VäckningsLås -diff --git a/res/values-tr/strings.xml b/res/values-tr/strings.xml -index b45fa12..fb70f78 100644 ---- a/res/values-tr/strings.xml -+++ b/res/values-tr/strings.xml -@@ -18,7 +18,7 @@ - Terminal Emülatörü - Tercihler - Terminali yeniden başlat -- Email olarak yolla -+ WebApp - Özel tuşlar - Ekran klavyesine geç - -diff --git a/res/values-uk/strings.xml b/res/values-uk/strings.xml -index 2f267a9..d3622c4 100644 ---- a/res/values-uk/strings.xml -+++ b/res/values-uk/strings.xml -@@ -8,7 +8,7 @@ - Попереднє вікно - Наступне вікно - Скинути термінал -- Відіслати Email -+ WebApp - Спеціальні клавіші - Екранна клавіатура - "Термінальний стан цього вікна було скинуто." -diff --git a/res/values-zh-rCN/strings.xml b/res/values-zh-rCN/strings.xml -index 6f47b4f..81316ec 100644 ---- a/res/values-zh-rCN/strings.xml -+++ b/res/values-zh-rCN/strings.xml -@@ -18,7 +18,7 @@ - 终端模拟器 - 首选项 - 重置终端 -- 发送电子邮件到... -+ WebApp - 特殊键 - 打开/关闭软键盘 - -diff --git a/res/values-zh-rTW/strings.xml b/res/values-zh-rTW/strings.xml -index afda0f1..37d1b50 100644 ---- a/res/values-zh-rTW/strings.xml -+++ b/res/values-zh-rTW/strings.xml -@@ -18,7 +18,7 @@ - 模擬終端 - 設定 - 結束 -- 以電郵傳送 -+ WebApp - 特別按鍵 - 顯示/隱藏鍵盤 - -diff --git a/res/values/defaults.xml b/res/values/defaults.xml -index 67287b2..9b7cfcd 100644 ---- a/res/values/defaults.xml -+++ b/res/values/defaults.xml -@@ -13,10 +13,10 @@ - 4 - 0 - false -- /system/bin/sh - -- -+ /data/data/ga.androidterm/lib/lib.start.so -+ git annex webapp - screen -- true -+ false - true - true - true -diff --git a/res/values/strings.xml b/res/values/strings.xml -index f1464e9..b06ec9a 100644 ---- a/res/values/strings.xml -+++ b/res/values/strings.xml -@@ -23,7 +23,7 @@ - Prev window - Next window - Reset term -- Email to -+ Open WebApp - Special keys - Toggle soft keyboard - -diff --git a/src/jackpal/androidterm/ShellTermSession.java b/src/jackpal/androidterm/ShellTermSession.java -index 501e7ab..0b43513 100644 ---- a/src/jackpal/androidterm/ShellTermSession.java -+++ b/src/jackpal/androidterm/ShellTermSession.java -@@ -80,12 +80,12 @@ public class ShellTermSession extends TermSession { - } - }; - -- public ShellTermSession(TermSettings settings, String initialCommand) { -+ public ShellTermSession(TermSettings settings, String initialCommand, String webAppFifo) { - super(); - - updatePrefs(settings); - -- initializeSession(); -+ initializeSession(webAppFifo); - mInitialCommand = initialCommand; - - mWatcherThread = new Thread() { -@@ -106,7 +106,7 @@ public class ShellTermSession extends TermSession { - setDefaultUTF8Mode(settings.defaultToUTF8Mode()); - } - -- private void initializeSession() { -+ private void initializeSession(String webAppFifo) { - TermSettings settings = mSettings; - - int[] processId = new int[1]; -@@ -128,9 +128,10 @@ public class ShellTermSession extends TermSession { - if (settings.verifyPath()) { - path = checkPath(path); - } -- String[] env = new String[2]; -+ String[] env = new String[3]; - env[0] = "TERM=" + settings.getTermType(); - env[1] = "PATH=" + path; -+ env[2] = "FIFO=" + webAppFifo; - - createSubprocess(processId, settings.getShell(), env); - mProcId = processId[0]; -diff --git a/src/jackpal/androidterm/Term.java b/src/jackpal/androidterm/Term.java -index 8a3a4ac..824025d 100644 ---- a/src/jackpal/androidterm/Term.java -+++ b/src/jackpal/androidterm/Term.java -@@ -20,6 +20,13 @@ import java.io.UnsupportedEncodingException; - import java.text.Collator; - import java.util.Arrays; - import java.util.Locale; -+import java.lang.Process; -+import java.lang.ProcessBuilder; -+import java.util.Map; -+ -+import java.io.FileReader; -+import java.io.BufferedReader; -+import java.io.File; - - import android.app.Activity; - import android.app.AlertDialog; -@@ -59,6 +66,11 @@ import android.view.inputmethod.InputMethodManager; - import android.widget.TextView; - import android.widget.Toast; - -+import android.content.Intent; -+import android.net.Uri; -+import android.app.Activity; -+import android.content.Context; -+ - import jackpal.androidterm.emulatorview.ColorScheme; - import jackpal.androidterm.emulatorview.EmulatorView; - import jackpal.androidterm.emulatorview.TermSession; -@@ -107,6 +119,9 @@ public class Term extends Activity implements UpdateCallback { - public static final String EXTRA_WINDOW_ID = "jackpal.androidterm.window_id"; - private int onResumeSelectWindow = -1; - -+ public static String appDir; -+ public static String webAppFifo; -+ - private PowerManager.WakeLock mWakeLock; - private WifiManager.WifiLock mWifiLock; - // Available on API 12 and later -@@ -257,6 +272,48 @@ public class Term extends Activity implements UpdateCallback { - @Override - public void onCreate(Bundle icicle) { - super.onCreate(icicle); -+ -+ try { -+ appDir = getApplicationContext().getPackageManager().getPackageInfo(getPackageName(), 0).applicationInfo.dataDir; -+ } catch (Exception e) { -+ appDir = "/data/data/ga.androidterm"; -+ } -+ webAppFifo = appDir + "/fifo"; -+ -+ /* webapp url opening thread */ -+ new Thread() { -+ @Override -+ public void run() { -+ try { -+ /* First, set up the fifo that urls to open will be -+ * read from. This is complicated by java not being -+ * able to mkfifo. */ -+ File f = new File (webAppFifo); -+ if (! f.exists()) { -+ ProcessBuilder pb = new ProcessBuilder(appDir + "/lib/lib.start.so"); -+ Map env = pb.environment(); -+ env.put("MKFIFO", webAppFifo); -+ Process p = pb.start(); -+ p.waitFor(); -+ } -+ -+ /* Reading from the fifo blocks until a url is written -+ * to it. */ -+ while (true) { -+ BufferedReader buf = new BufferedReader(new FileReader(webAppFifo)); -+ String s = buf.readLine(); -+ try { -+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(s)); -+ startActivity(intent); -+ } catch (Exception e) { -+ } -+ -+ } -+ } catch (Exception e) { -+ } -+ } -+ }.start(); -+ - Log.e(TermDebug.LOG_TAG, "onCreate"); - mPrefs = PreferenceManager.getDefaultSharedPreferences(this); - mSettings = new TermSettings(getResources(), mPrefs); -@@ -427,7 +484,7 @@ public class Term extends Activity implements UpdateCallback { - } - - protected static TermSession createTermSession(Context context, TermSettings settings, String initialCommand) { -- ShellTermSession session = new ShellTermSession(settings, initialCommand); -+ ShellTermSession session = new ShellTermSession(settings, initialCommand, webAppFifo); - // XXX We should really be able to fetch this from within TermSession - session.setProcessExitMessage(context.getString(R.string.process_exit_message)); - -@@ -911,31 +968,15 @@ public class Term extends Activity implements UpdateCallback { - } - - private void doEmailTranscript() { -+ // Hack: repurposed to open the git-annex webapp - TermSession session = getCurrentTermSession(); - if (session != null) { -- // Don't really want to supply an address, but -- // currently it's required, otherwise nobody -- // wants to handle the intent. -- String addr = "user@example.com"; -- Intent intent = -- new Intent(Intent.ACTION_SENDTO, Uri.parse("mailto:" -- + addr)); -- -- String subject = getString(R.string.email_transcript_subject); -- String title = session.getTitle(); -- if (title != null) { -- subject = subject + " - " + title; -- } -- intent.putExtra(Intent.EXTRA_SUBJECT, subject); -- intent.putExtra(Intent.EXTRA_TEXT, -- session.getTranscriptText().trim()); - try { -- startActivity(Intent.createChooser(intent, -- getString(R.string.email_transcript_chooser_title))); -- } catch (ActivityNotFoundException e) { -- Toast.makeText(this, -- R.string.email_transcript_no_email_activity_found, -- Toast.LENGTH_LONG).show(); -+ BufferedReader buf = new BufferedReader(new FileReader("/sdcard/git-annex.home/.git-annex-url")); -+ String s = buf.readLine(); -+ Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(s)); -+ startActivity(intent); -+ } catch (Exception e) { - } - } - } -diff --git a/tools/build-debug b/tools/build-debug -index 1f15cd2..e611956 100755 ---- a/tools/build-debug -+++ b/tools/build-debug -@@ -34,4 +34,4 @@ fi - - rm -rf `find . -name bin -o -name obj -prune` - cd jni --$ANDROID_NDK_ROOT/ndk-build && cd .. && ant debug -+$ANDROID_NDK_ROOT/ndk-build && cd .. -diff --git a/tools/update.sh b/tools/update.sh -index 57219c3..79b45ef 100755 ---- a/tools/update.sh -+++ b/tools/update.sh -@@ -18,7 +18,7 @@ command -v "$ANDROID" >/dev/null 2>&1 || { echo >&2 "The $ANDROID tool is not fo - - # Make sure target-11 is installed - --$ANDROID update sdk -u -t android-11 -+$ANDROID update sdk -u -t android-19 - - DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" - ATE_ROOT="$( cd $DIR/.. && pwd )" -@@ -31,5 +31,5 @@ for PROJECT_FILE in $PROJECT_FILES - do - PROJECT_DIR="$( dirname "$PROJECT_FILE" )" - echo "Updating $PROJECT_FILE" -- $ANDROID update project -p "$PROJECT_DIR" --target android-11 -+ $ANDROID update project -p "$PROJECT_DIR" --target android-19 - done diff --git a/standalone/android/toolchainpath b/standalone/android/toolchainpath deleted file mode 100755 index bbed01c88f..0000000000 --- a/standalone/android/toolchainpath +++ /dev/null @@ -1,54 +0,0 @@ -#!/bin/sh -# Outputs a new PATH setting that is prefixed by the path to the -# Android cross-compiler toolchain to use for a given Android version. -# -# For Android 5, force PIE build flags -# -# Since the ghc-android wrappers actually hardcode the path to the -# toolchain, and we want to wrap the toolchain programs, the binaries -# are moved to .orig and replaced by wrappers. - -androidversion="$1" - -# Allow running from the top or inside this directory. -if [ -e abiversion ]; then - top=. -else - top=standalone/android -fi - -wrap () { - sed -e "s!PROG!$1!" -e "s!OPTS!$3!" < $top/wrapper.pl > "$2" - chmod +x "$2" -} - -# location to toolchain as installed by ghc-android -androidtoolchain="$HOME/.ghc/$(cat $top/abiversion)/bin" - -for f in $(find "$androidtoolchain" -maxdepth 1 -type f -printf '%f\n' | grep -v \.orig); do - bin="$androidtoolchain/$f" - orig="$androidtoolchain/$f.orig" - if [ ! -e "$orig" ]; then - cp -a "$bin" "$orig" - fi - if [ "$androidversion" = 5 ]; then - case "$f" in - *-ld*) - wrap "$orig" "$bin" "-pie" - ;; - *-gcc) - wrap "$orig" "$bin" "-pie -fPIE" - ;; - *'-g++') - wrap "$orig" "$bin" "-pie -fPIE" - ;; - *) - cp -a "$orig" "$bin" - ;; - esac - else - cp -a "$orig" "$bin" - fi -done - -echo "$androidtoolchain:$PATH" diff --git a/standalone/android/wrapper.pl b/standalone/android/wrapper.pl deleted file mode 100644 index e7cb98150e..0000000000 --- a/standalone/android/wrapper.pl +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/bin/perl -my $prog=q{PROG}; # replaced -my @opts=qw{OPTS}; # replaced - -if (grep { $_ eq "-r" || $_ eq "--relocatable" } @ARGV) { - exec($prog,@ARGV) || die "failed to run $prog"; -} -else { - my @args=grep { ! m/-no-pie/ } @ARGV; - exec($prog,@opts,@args) || die "failed to run $prog"; -} diff --git a/standalone/no-th/evilsplicer-headers.hs b/standalone/no-th/evilsplicer-headers.hs deleted file mode 100644 index 64076d5f7e..0000000000 --- a/standalone/no-th/evilsplicer-headers.hs +++ /dev/null @@ -1,50 +0,0 @@ - - -{- This file was modified by the EvilSplicer, adding these headers, - - and expanding Template Haskell. - - - - ** DO NOT COMMIT ** - -} -import qualified Data.Monoid -import qualified Control.Applicative -import qualified Data.Set -import qualified Data.Set as Data.Set.Base -import qualified Data.Map -import qualified Data.Map as Data.Map.Base -import qualified Data.HashMap.Strict -import qualified Data.HashMap.Strict as Data.HashMap.Base -import qualified Data.Foldable -import qualified Data.Text -import qualified Data.Text.Lazy.Builder -import qualified Data.Text.Lazy.Builder as Data.Text.Internal.Builder -import qualified Text.Shakespeare -import qualified Text.Hamlet -import qualified Text.Julius -import qualified Text.Css -import qualified "blaze-markup" Text.Blaze.Internal -import qualified Yesod.Core.Widget -import qualified Yesod.Routes.TH.Types -import qualified Yesod.Core.Dispatch -import qualified Yesod.Routes.Dispatch -import qualified WaiAppStatic.Storage.Embedded -import qualified WaiAppStatic.Storage.Embedded.Runtime -import qualified Data.FileEmbed -import qualified Data.ByteString.Internal -import qualified Data.Text.Encoding -import qualified Network.Wai -import qualified Network.Wai as Network.Wai.Internal -import qualified Yesod.Core.Types -import qualified GHC.IO -import qualified Data.ByteString.Unsafe -import qualified Data.ByteString.Char8 -import qualified Database.Persist.Class as Database.Persist.Class.PersistField -import qualified Database.Persist as Database.Persist.Class.PersistField -import qualified Database.Persist.Sql as Database.Persist.Sql.Class -import qualified Database.Persist.Sql as Database.Persist.Types.Base -import qualified Control.Monad.Logger -import qualified Control.Monad.IO.Class -import qualified Control.Monad.Trans.Control -import Database.Persist.Sql (fromPersistValue) -{- End EvilSplicer headers. -} - - diff --git a/standalone/no-th/haskell-patches/DAV_build-without-TH.patch b/standalone/no-th/haskell-patches/DAV_build-without-TH.patch deleted file mode 100644 index 6d17d634e9..0000000000 --- a/standalone/no-th/haskell-patches/DAV_build-without-TH.patch +++ /dev/null @@ -1,420 +0,0 @@ -From e54cfacbb9fb24f75d3d93cd8ee6da67b161574f Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 16 Oct 2014 02:51:28 +0000 -Subject: [PATCH] remove TH - ---- - DAV.cabal | 28 +---- - Network/Protocol/HTTP/DAV.hs | 92 +++++++++++++--- - Network/Protocol/HTTP/DAV/TH.hs | 232 +++++++++++++++++++++++++++++++++++++++- - 3 files changed, 306 insertions(+), 46 deletions(-) - -diff --git a/DAV.cabal b/DAV.cabal -index 95fffd8..5669c51 100644 ---- a/DAV.cabal -+++ b/DAV.cabal -@@ -47,33 +47,7 @@ library - , utf8-string - , xml-conduit >= 1.0 && < 1.3 - , xml-hamlet >= 0.4 && < 0.5 --executable hdav -- main-is: hdav.hs -- ghc-options: -Wall -- build-depends: base >= 4.5 && < 5 -- , bytestring -- , bytestring -- , case-insensitive >= 0.4 -- , containers -- , data-default -- , either >= 4.3 -- , errors -- , exceptions -- , http-client >= 0.2 -- , http-client-tls >= 0.2 -- , http-types >= 0.7 -- , lens >= 3.0 -- , mtl >= 2.1 -- , optparse-applicative >= 0.10.0 -- , transformers >= 0.3 -- , transformers-base -- , utf8-string -- , xml-conduit >= 1.0 && < 1.3 -- , xml-hamlet >= 0.4 && < 0.5 -- if flag(network-uri) -- build-depends: network-uri >= 2.6, network >= 2.6 -- else -- build-depends: network >= 2.3 && <2.6 -+ , text - - source-repository head - type: git -diff --git a/Network/Protocol/HTTP/DAV.hs b/Network/Protocol/HTTP/DAV.hs -index 4c6d68f..55979b6 100644 ---- a/Network/Protocol/HTTP/DAV.hs -+++ b/Network/Protocol/HTTP/DAV.hs -@@ -82,6 +82,7 @@ import Network.HTTP.Types (hContentType, Method, Status, RequestHeaders, unautho - import qualified Text.XML as XML - import Text.XML.Cursor (($/), (&/), element, node, fromDocument, checkName) - import Text.Hamlet.XML (xml) -+import qualified Data.Text - - import Data.CaseInsensitive (mk) - -@@ -330,31 +331,88 @@ withLockIfPossibleForDelete nocreate f = do - propname :: XML.Document - propname = XML.Document (XML.Prologue [] Nothing []) root [] - where -- root = XML.Element "D:propfind" (Map.fromList [("xmlns:D", "DAV:")]) [xml| -- --|] -+ root = XML.Element "D:propfind" (Map.fromList [("xmlns:D", "DAV:")]) $ concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "D:allprop") Nothing Nothing) -+ Map.empty -+ (concat []))]] -+ - - locky :: XML.Document - locky = XML.Document (XML.Prologue [] Nothing []) root [] - where -- root = XML.Element "D:lockinfo" (Map.fromList [("xmlns:D", "DAV:")]) [xml| -- -- -- -- --Haskell DAV user --|] -+ root = XML.Element "D:lockinfo" (Map.fromList [("xmlns:D", "DAV:")]) $ concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "D:lockscope") Nothing Nothing) -+ Map.empty -+ (concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "D:exclusive") Nothing Nothing) -+ Map.empty -+ (concat []))]]))], -+ [XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "D:locktype") Nothing Nothing) -+ Map.empty -+ (concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name (Data.Text.pack "D:write") Nothing Nothing) -+ Map.empty -+ (concat []))]]))], -+ [XML.NodeElement -+ (XML.Element -+ (XML.Name (Data.Text.pack "D:owner") Nothing Nothing) -+ Map.empty -+ (concat -+ [[XML.NodeContent -+ (Data.Text.pack "Haskell DAV user")]]))]] -+ - - calendarquery :: XML.Document - calendarquery = XML.Document (XML.Prologue [] Nothing []) root [] - where -- root = XML.Element "C:calendar-query" (Map.fromList [("xmlns:D", "DAV:"),("xmlns:C", "urn:ietf:params:xml:ns:caldav")]) [xml| -- -- -- -- -- --|] -+ root = XML.Element "C:calendar-query" (Map.fromList [("xmlns:D", "DAV:"),("xmlns:C", "urn:ietf:params:xml:ns:caldav")]) $ concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name (Data.Text.pack "D:prop") Nothing Nothing) -+ Map.empty -+ (concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "D:getetag") Nothing Nothing) -+ Map.empty -+ (concat []))], -+ [XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "C:calendar-data") Nothing Nothing) -+ Map.empty -+ (concat []))]]))], -+ [XML.NodeElement -+ (XML.Element -+ (XML.Name (Data.Text.pack "C:filter") Nothing Nothing) -+ Map.empty -+ (concat -+ [[XML.NodeElement -+ (XML.Element -+ (XML.Name -+ (Data.Text.pack "C:comp-filter") Nothing Nothing) -+ (Map.insert -+ (XML.Name (Data.Text.pack "name") Nothing Nothing) -+ (Data.Text.concat -+ [Data.Text.pack "VCALENDAR"]) -+ Map.empty) -+ (concat []))]]))]] -+ - - -- | Normally, DAVT actions act on the url that is provided to eg, evalDAVT. - -- Sometimes, it's useful to adjust the url that is acted on, while -diff --git a/Network/Protocol/HTTP/DAV/TH.hs b/Network/Protocol/HTTP/DAV/TH.hs -index 0ecd476..1653bf6 100644 ---- a/Network/Protocol/HTTP/DAV/TH.hs -+++ b/Network/Protocol/HTTP/DAV/TH.hs -@@ -20,9 +20,11 @@ - - module Network.Protocol.HTTP.DAV.TH where - --import Control.Lens (makeLenses) -+import Control.Lens - import qualified Data.ByteString as B - import Network.HTTP.Client (Manager, Request) -+import qualified Data.Functor -+import qualified Control.Lens.Type - - data Depth = Depth0 | Depth1 | DepthInfinity - instance Read Depth where -@@ -47,4 +49,230 @@ data DAVContext = DAVContext { - , _lockToken :: Maybe B.ByteString - , _userAgent :: B.ByteString - } --makeLenses ''DAVContext -+allowedMethods :: Control.Lens.Type.Lens' DAVContext [B.ByteString] -+allowedMethods -+ _f_a3iH -+ (DAVContext __allowedMethods'_a3iI -+ __baseRequest_a3iK -+ __basicusername_a3iL -+ __basicpassword_a3iM -+ __complianceClasses_a3iN -+ __depth_a3iO -+ __httpManager_a3iP -+ __lockToken_a3iQ -+ __userAgent_a3iR) -+ = ((\ __allowedMethods_a3iJ -+ -> DAVContext -+ __allowedMethods_a3iJ -+ __baseRequest_a3iK -+ __basicusername_a3iL -+ __basicpassword_a3iM -+ __complianceClasses_a3iN -+ __depth_a3iO -+ __httpManager_a3iP -+ __lockToken_a3iQ -+ __userAgent_a3iR) -+ Data.Functor.<$> (_f_a3iH __allowedMethods'_a3iI)) -+{-# INLINE allowedMethods #-} -+baseRequest :: Control.Lens.Type.Lens' DAVContext Request -+baseRequest -+ _f_a3iS -+ (DAVContext __allowedMethods_a3iT -+ __baseRequest'_a3iU -+ __basicusername_a3iW -+ __basicpassword_a3iX -+ __complianceClasses_a3iY -+ __depth_a3iZ -+ __httpManager_a3j0 -+ __lockToken_a3j1 -+ __userAgent_a3j2) -+ = ((\ __baseRequest_a3iV -+ -> DAVContext -+ __allowedMethods_a3iT -+ __baseRequest_a3iV -+ __basicusername_a3iW -+ __basicpassword_a3iX -+ __complianceClasses_a3iY -+ __depth_a3iZ -+ __httpManager_a3j0 -+ __lockToken_a3j1 -+ __userAgent_a3j2) -+ Data.Functor.<$> (_f_a3iS __baseRequest'_a3iU)) -+{-# INLINE baseRequest #-} -+basicpassword :: Control.Lens.Type.Lens' DAVContext B.ByteString -+basicpassword -+ _f_a3j3 -+ (DAVContext __allowedMethods_a3j4 -+ __baseRequest_a3j5 -+ __basicusername_a3j6 -+ __basicpassword'_a3j7 -+ __complianceClasses_a3j9 -+ __depth_a3ja -+ __httpManager_a3jb -+ __lockToken_a3jc -+ __userAgent_a3jd) -+ = ((\ __basicpassword_a3j8 -+ -> DAVContext -+ __allowedMethods_a3j4 -+ __baseRequest_a3j5 -+ __basicusername_a3j6 -+ __basicpassword_a3j8 -+ __complianceClasses_a3j9 -+ __depth_a3ja -+ __httpManager_a3jb -+ __lockToken_a3jc -+ __userAgent_a3jd) -+ Data.Functor.<$> (_f_a3j3 __basicpassword'_a3j7)) -+{-# INLINE basicpassword #-} -+basicusername :: Control.Lens.Type.Lens' DAVContext B.ByteString -+basicusername -+ _f_a3je -+ (DAVContext __allowedMethods_a3jf -+ __baseRequest_a3jg -+ __basicusername'_a3jh -+ __basicpassword_a3jj -+ __complianceClasses_a3jk -+ __depth_a3jl -+ __httpManager_a3jm -+ __lockToken_a3jn -+ __userAgent_a3jo) -+ = ((\ __basicusername_a3ji -+ -> DAVContext -+ __allowedMethods_a3jf -+ __baseRequest_a3jg -+ __basicusername_a3ji -+ __basicpassword_a3jj -+ __complianceClasses_a3jk -+ __depth_a3jl -+ __httpManager_a3jm -+ __lockToken_a3jn -+ __userAgent_a3jo) -+ Data.Functor.<$> (_f_a3je __basicusername'_a3jh)) -+{-# INLINE basicusername #-} -+complianceClasses :: -+ Control.Lens.Type.Lens' DAVContext [B.ByteString] -+complianceClasses -+ _f_a3jp -+ (DAVContext __allowedMethods_a3jq -+ __baseRequest_a3jr -+ __basicusername_a3js -+ __basicpassword_a3jt -+ __complianceClasses'_a3ju -+ __depth_a3jw -+ __httpManager_a3jx -+ __lockToken_a3jy -+ __userAgent_a3jz) -+ = ((\ __complianceClasses_a3jv -+ -> DAVContext -+ __allowedMethods_a3jq -+ __baseRequest_a3jr -+ __basicusername_a3js -+ __basicpassword_a3jt -+ __complianceClasses_a3jv -+ __depth_a3jw -+ __httpManager_a3jx -+ __lockToken_a3jy -+ __userAgent_a3jz) -+ Data.Functor.<$> (_f_a3jp __complianceClasses'_a3ju)) -+{-# INLINE complianceClasses #-} -+depth :: Control.Lens.Type.Lens' DAVContext (Maybe Depth) -+depth -+ _f_a3jA -+ (DAVContext __allowedMethods_a3jB -+ __baseRequest_a3jC -+ __basicusername_a3jD -+ __basicpassword_a3jE -+ __complianceClasses_a3jF -+ __depth'_a3jG -+ __httpManager_a3jI -+ __lockToken_a3jJ -+ __userAgent_a3jK) -+ = ((\ __depth_a3jH -+ -> DAVContext -+ __allowedMethods_a3jB -+ __baseRequest_a3jC -+ __basicusername_a3jD -+ __basicpassword_a3jE -+ __complianceClasses_a3jF -+ __depth_a3jH -+ __httpManager_a3jI -+ __lockToken_a3jJ -+ __userAgent_a3jK) -+ Data.Functor.<$> (_f_a3jA __depth'_a3jG)) -+{-# INLINE depth #-} -+httpManager :: Control.Lens.Type.Lens' DAVContext (Maybe Manager) -+httpManager -+ _f_a3jL -+ (DAVContext __allowedMethods_a3jM -+ __baseRequest_a3jN -+ __basicusername_a3jO -+ __basicpassword_a3jP -+ __complianceClasses_a3jQ -+ __depth_a3jR -+ __httpManager'_a3jS -+ __lockToken_a3jU -+ __userAgent_a3jV) -+ = ((\ __httpManager_a3jT -+ -> DAVContext -+ __allowedMethods_a3jM -+ __baseRequest_a3jN -+ __basicusername_a3jO -+ __basicpassword_a3jP -+ __complianceClasses_a3jQ -+ __depth_a3jR -+ __httpManager_a3jT -+ __lockToken_a3jU -+ __userAgent_a3jV) -+ Data.Functor.<$> (_f_a3jL __httpManager'_a3jS)) -+{-# INLINE httpManager #-} -+lockToken :: -+ Control.Lens.Type.Lens' DAVContext (Maybe B.ByteString) -+lockToken -+ _f_a3jW -+ (DAVContext __allowedMethods_a3jX -+ __baseRequest_a3jY -+ __basicusername_a3jZ -+ __basicpassword_a3k0 -+ __complianceClasses_a3k1 -+ __depth_a3k2 -+ __httpManager_a3k3 -+ __lockToken'_a3k4 -+ __userAgent_a3k6) -+ = ((\ __lockToken_a3k5 -+ -> DAVContext -+ __allowedMethods_a3jX -+ __baseRequest_a3jY -+ __basicusername_a3jZ -+ __basicpassword_a3k0 -+ __complianceClasses_a3k1 -+ __depth_a3k2 -+ __httpManager_a3k3 -+ __lockToken_a3k5 -+ __userAgent_a3k6) -+ Data.Functor.<$> (_f_a3jW __lockToken'_a3k4)) -+{-# INLINE lockToken #-} -+userAgent :: Control.Lens.Type.Lens' DAVContext B.ByteString -+userAgent -+ _f_a3k7 -+ (DAVContext __allowedMethods_a3k8 -+ __baseRequest_a3k9 -+ __basicusername_a3ka -+ __basicpassword_a3kb -+ __complianceClasses_a3kc -+ __depth_a3kd -+ __httpManager_a3ke -+ __lockToken_a3kf -+ __userAgent'_a3kg) -+ = ((\ __userAgent_a3kh -+ -> DAVContext -+ __allowedMethods_a3k8 -+ __baseRequest_a3k9 -+ __basicusername_a3ka -+ __basicpassword_a3kb -+ __complianceClasses_a3kc -+ __depth_a3kd -+ __httpManager_a3ke -+ __lockToken_a3kf -+ __userAgent_a3kh) -+ Data.Functor.<$> (_f_a3k7 __userAgent'_a3kg)) -+{-# INLINE userAgent #-} --- -2.1.1 - diff --git a/standalone/no-th/haskell-patches/aeson_remove-TH.patch b/standalone/no-th/haskell-patches/aeson_remove-TH.patch deleted file mode 100644 index dc40de79ed..0000000000 --- a/standalone/no-th/haskell-patches/aeson_remove-TH.patch +++ /dev/null @@ -1,40 +0,0 @@ -From f147ec9aeaa03ca6e30232c84c413ef29b95fb62 Mon Sep 17 00:00:00 2001 -From: Your Name -Date: Tue, 20 May 2014 19:53:55 +0000 -Subject: [PATCH] avoid TH - ---- - aeson.cabal | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/aeson.cabal b/aeson.cabal -index 493d625..02dc6f4 100644 ---- a/aeson.cabal -+++ b/aeson.cabal -@@ -88,7 +88,6 @@ library - Data.Aeson.Generic - Data.Aeson.Parser - Data.Aeson.Types -- Data.Aeson.TH - - other-modules: - Data.Aeson.Functions -@@ -121,7 +120,6 @@ library - old-locale, - scientific >= 0.3.1 && < 0.4, - syb, -- template-haskell >= 2.4, - time, - unordered-containers >= 0.2.3.0, - vector >= 0.7.1 -@@ -164,7 +162,6 @@ test-suite tests - base, - containers, - bytestring, -- template-haskell, - test-framework, - test-framework-quickcheck2, - test-framework-hunit, --- -2.0.0.rc2 - diff --git a/standalone/no-th/haskell-patches/file-embed_remove-TH.patch b/standalone/no-th/haskell-patches/file-embed_remove-TH.patch deleted file mode 100644 index 12e344504c..0000000000 --- a/standalone/no-th/haskell-patches/file-embed_remove-TH.patch +++ /dev/null @@ -1,132 +0,0 @@ -From 497d09a91f9eb1e5979948cd128078491b0e8bca Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Fri, 12 Sep 2014 20:52:08 -0400 -Subject: [PATCH] remove TH - ---- - Data/FileEmbed.hs | 87 ++++--------------------------------------------------- - 1 file changed, 5 insertions(+), 82 deletions(-) - -diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs -index 5617493..adacdba 100644 ---- a/Data/FileEmbed.hs -+++ b/Data/FileEmbed.hs -@@ -17,13 +17,13 @@ - -- > {-# LANGUAGE TemplateHaskell #-} - module Data.FileEmbed - ( -- * Embed at compile time -- embedFile -- , embedOneFileOf -- , embedDir -- , getDir -+ -- embedFile -+ --, embedOneFileOf -+ --, embedDir -+ getDir - -- * Inject into an executable - #if MIN_VERSION_template_haskell(2,5,0) -- , dummySpace -+ --, dummySpace - #endif - , inject - , injectFile -@@ -56,73 +56,12 @@ import Data.ByteString.Unsafe (unsafePackAddressLen) - import System.IO.Unsafe (unsafePerformIO) - import System.FilePath (()) - ---- | Embed a single file in your source code. ---- ---- > import qualified Data.ByteString ---- > ---- > myFile :: Data.ByteString.ByteString ---- > myFile = $(embedFile "dirName/fileName") --embedFile :: FilePath -> Q Exp --embedFile fp = --#if MIN_VERSION_template_haskell(2,7,0) -- qAddDependentFile fp >> --#endif -- (runIO $ B.readFile fp) >>= bsToExp -- ---- | Embed a single existing file in your source code ---- out of list a list of paths supplied. ---- ---- > import qualified Data.ByteString ---- > ---- > myFile :: Data.ByteString.ByteString ---- > myFile = $(embedFile' [ "dirName/fileName", "src/dirName/fileName" ]) --embedOneFileOf :: [FilePath] -> Q Exp --embedOneFileOf ps = -- (runIO $ readExistingFile ps) >>= \ ( path, content ) -> do --#if MIN_VERSION_template_haskell(2,7,0) -- qAddDependentFile path --#endif -- bsToExp content -- where -- readExistingFile :: [FilePath] -> IO ( FilePath, B.ByteString ) -- readExistingFile xs = do -- ys <- filterM doesFileExist xs -- case ys of -- (p:_) -> B.readFile p >>= \ c -> return ( p, c ) -- _ -> throw $ ErrorCall "Cannot find file to embed as resource" -- ---- | Embed a directory recursively in your source code. ---- ---- > import qualified Data.ByteString ---- > ---- > myDir :: [(FilePath, Data.ByteString.ByteString)] ---- > myDir = $(embedDir "dirName") --embedDir :: FilePath -> Q Exp --embedDir fp = do -- typ <- [t| [(FilePath, B.ByteString)] |] -- e <- ListE <$> ((runIO $ fileList fp) >>= mapM (pairToExp fp)) -- return $ SigE e typ -- - -- | Get a directory tree in the IO monad. - -- - -- This is the workhorse of 'embedDir' - getDir :: FilePath -> IO [(FilePath, B.ByteString)] - getDir = fileList - --pairToExp :: FilePath -> (FilePath, B.ByteString) -> Q Exp --pairToExp _root (path, bs) = do --#if MIN_VERSION_template_haskell(2,7,0) -- qAddDependentFile $ _root ++ '/' : path --#endif -- exp' <- bsToExp bs -- return $! TupE [LitE $ StringL path, exp'] -- --bsToExp :: B.ByteString -> Q Exp --bsToExp bs = do -- helper <- [| stringToBs |] -- let chars = B8.unpack bs -- return $! AppE helper $! LitE $! StringL chars -- - stringToBs :: String -> B.ByteString - stringToBs = B8.pack - -@@ -164,22 +103,6 @@ padSize i = - let s = show i - in replicate (sizeLen - length s) '0' ++ s - --#if MIN_VERSION_template_haskell(2,5,0) --dummySpace :: Int -> Q Exp --dummySpace space = do -- let size = padSize space -- let start = magic ++ size -- let chars = LitE $ StringPrimL $ --#if MIN_VERSION_template_haskell(2,6,0) -- map (toEnum . fromEnum) $ --#endif -- start ++ replicate space '0' -- let len = LitE $ IntegerL $ fromIntegral $ length start + space -- upi <- [|unsafePerformIO|] -- pack <- [|unsafePackAddressLen|] -- getInner' <- [|getInner|] -- return $ getInner' `AppE` (upi `AppE` (pack `AppE` len `AppE` chars)) --#endif - - inject :: B.ByteString -- ^ bs to inject - -> B.ByteString -- ^ original BS containing dummy --- -2.1.0 - diff --git a/standalone/no-th/haskell-patches/generic-deriving_remove-TH.patch b/standalone/no-th/haskell-patches/generic-deriving_remove-TH.patch deleted file mode 100644 index 83c8ffd2a7..0000000000 --- a/standalone/no-th/haskell-patches/generic-deriving_remove-TH.patch +++ /dev/null @@ -1,394 +0,0 @@ -From 9a41401d903f160e11d56fff35c24eb59d97885d Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Tue, 17 Dec 2013 19:04:40 +0000 -Subject: [PATCH] remove TH - ---- - src/Generics/Deriving/TH.hs | 354 -------------------------------------------- - 1 file changed, 354 deletions(-) - -diff --git a/src/Generics/Deriving/TH.hs b/src/Generics/Deriving/TH.hs -index 783cb65..9aab713 100644 ---- a/src/Generics/Deriving/TH.hs -+++ b/src/Generics/Deriving/TH.hs -@@ -19,18 +19,6 @@ - - -- Adapted from Generics.Regular.TH - module Generics.Deriving.TH ( -- -- deriveMeta -- , deriveData -- , deriveConstructors -- , deriveSelectors -- --#if __GLASGOW_HASKELL__ < 701 -- , deriveAll -- , deriveRepresentable0 -- , deriveRep0 -- , simplInstance --#endif - ) where - - import Generics.Deriving.Base -@@ -41,124 +29,6 @@ import Language.Haskell.TH.Syntax (Lift(..)) - import Data.List (intercalate) - import Control.Monad - ---- | Given the names of a generic class, a type to instantiate, a function in ---- the class and the default implementation, generates the code for a basic ---- generic instance. --simplInstance :: Name -> Name -> Name -> Name -> Q [Dec] --simplInstance cl ty fn df = do -- i <- reify (genRepName 0 ty) -- x <- newName "x" -- let typ = ForallT [PlainTV x] [] -- ((foldl (\a -> AppT a . VarT . tyVarBndrToName) (ConT (genRepName 0 ty)) -- (typeVariables i)) `AppT` (VarT x)) -- fmap (: []) $ instanceD (cxt []) (conT cl `appT` conT ty) -- [funD fn [clause [] (normalB (varE df `appE` -- (sigE (global 'undefined) (return typ)))) []]] -- -- ---- | Given the type and the name (as string) for the type to derive, ---- generate the 'Data' instance, the 'Constructor' instances, the 'Selector' ---- instances, and the 'Representable0' instance. --deriveAll :: Name -> Q [Dec] --deriveAll n = -- do a <- deriveMeta n -- b <- deriveRepresentable0 n -- return (a ++ b) -- ---- | Given the type and the name (as string) for the type to derive, ---- generate the 'Data' instance, the 'Constructor' instances, and the 'Selector' ---- instances. --deriveMeta :: Name -> Q [Dec] --deriveMeta n = -- do a <- deriveData n -- b <- deriveConstructors n -- c <- deriveSelectors n -- return (a ++ b ++ c) -- ---- | Given a datatype name, derive a datatype and instance of class 'Datatype'. --deriveData :: Name -> Q [Dec] --deriveData = dataInstance -- ---- | Given a datatype name, derive datatypes and ---- instances of class 'Constructor'. --deriveConstructors :: Name -> Q [Dec] --deriveConstructors = constrInstance -- ---- | Given a datatype name, derive datatypes and instances of class 'Selector'. --deriveSelectors :: Name -> Q [Dec] --deriveSelectors = selectInstance -- ---- | Given the type and the name (as string) for the Representable0 type ---- synonym to derive, generate the 'Representable0' instance. --deriveRepresentable0 :: Name -> Q [Dec] --deriveRepresentable0 n = do -- rep0 <- deriveRep0 n -- inst <- deriveInst n -- return $ rep0 ++ inst -- ---- | Derive only the 'Rep0' type synonym. Not needed if 'deriveRepresentable0' ---- is used. --deriveRep0 :: Name -> Q [Dec] --deriveRep0 n = do -- i <- reify n -- fmap (:[]) $ tySynD (genRepName 0 n) (typeVariables i) (rep0Type n) -- --deriveInst :: Name -> Q [Dec] --deriveInst t = do -- i <- reify t -- let typ q = foldl (\a -> AppT a . VarT . tyVarBndrToName) (ConT q) -- (typeVariables i) --#if __GLASGOW_HASKELL__ >= 707 -- let tyIns = TySynInstD ''Rep (TySynEqn [typ t] (typ (genRepName 0 t))) --#else -- let tyIns = TySynInstD ''Rep [typ t] (typ (genRepName 0 t)) --#endif -- fcs <- mkFrom t 1 0 t -- tcs <- mkTo t 1 0 t -- liftM (:[]) $ -- instanceD (cxt []) (conT ''Generic `appT` return (typ t)) -- [return tyIns, funD 'from fcs, funD 'to tcs] -- -- --dataInstance :: Name -> Q [Dec] --dataInstance n = do -- i <- reify n -- case i of -- TyConI (DataD _ n _ _ _) -> mkInstance n -- TyConI (NewtypeD _ n _ _ _) -> mkInstance n -- _ -> return [] -- where -- mkInstance n = do -- ds <- mkDataData n -- is <- mkDataInstance n -- return $ [ds,is] -- --constrInstance :: Name -> Q [Dec] --constrInstance n = do -- i <- reify n -- case i of -- TyConI (DataD _ n _ cs _) -> mkInstance n cs -- TyConI (NewtypeD _ n _ c _) -> mkInstance n [c] -- _ -> return [] -- where -- mkInstance n cs = do -- ds <- mapM (mkConstrData n) cs -- is <- mapM (mkConstrInstance n) cs -- return $ ds ++ is -- --selectInstance :: Name -> Q [Dec] --selectInstance n = do -- i <- reify n -- case i of -- TyConI (DataD _ n _ cs _) -> mkInstance n cs -- TyConI (NewtypeD _ n _ c _) -> mkInstance n [c] -- _ -> return [] -- where -- mkInstance n cs = do -- ds <- mapM (mkSelectData n) cs -- is <- mapM (mkSelectInstance n) cs -- return $ concat (ds ++ is) -- - typeVariables :: Info -> [TyVarBndr] - typeVariables (TyConI (DataD _ _ tv _ _)) = tv - typeVariables (TyConI (NewtypeD _ _ tv _ _)) = tv -@@ -179,233 +49,9 @@ genName = mkName . (++"_") . intercalate "_" . map nameBase - genRepName :: Int -> Name -> Name - genRepName n = mkName . (++"_") . (("Rep" ++ show n) ++) . nameBase - --mkDataData :: Name -> Q Dec --mkDataData n = dataD (cxt []) (genName [n]) [] [] [] -- --mkConstrData :: Name -> Con -> Q Dec --mkConstrData dt (NormalC n _) = -- dataD (cxt []) (genName [dt, n]) [] [] [] --mkConstrData dt r@(RecC _ _) = -- mkConstrData dt (stripRecordNames r) --mkConstrData dt (InfixC t1 n t2) = -- mkConstrData dt (NormalC n [t1,t2]) -- --mkSelectData :: Name -> Con -> Q [Dec] --mkSelectData dt r@(RecC n fs) = return (map one fs) -- where one (f, _, _) = DataD [] (genName [dt, n, f]) [] [] [] --mkSelectData dt _ = return [] -- -- --mkDataInstance :: Name -> Q Dec --mkDataInstance n = -- instanceD (cxt []) (appT (conT ''Datatype) (conT $ genName [n])) -- [funD 'datatypeName [clause [wildP] (normalB (stringE (nameBase n))) []] -- ,funD 'moduleName [clause [wildP] (normalB (stringE name)) []]] -- where -- name = maybe (error "Cannot fetch module name!") id (nameModule n) -- --instance Lift Fixity where -- lift Prefix = conE 'Prefix -- lift (Infix a n) = conE 'Infix `appE` [| a |] `appE` [| n |] -- --instance Lift Associativity where -- lift LeftAssociative = conE 'LeftAssociative -- lift RightAssociative = conE 'RightAssociative -- lift NotAssociative = conE 'NotAssociative -- --mkConstrInstance :: Name -> Con -> Q Dec --mkConstrInstance dt (NormalC n _) = mkConstrInstanceWith dt n [] --mkConstrInstance dt (RecC n _) = mkConstrInstanceWith dt n -- [ funD 'conIsRecord [clause [wildP] (normalB (conE 'True)) []]] --mkConstrInstance dt (InfixC t1 n t2) = -- do -- i <- reify n -- let fi = case i of -- DataConI _ _ _ f -> convertFixity f -- _ -> Prefix -- instanceD (cxt []) (appT (conT ''Constructor) (conT $ genName [dt, n])) -- [funD 'conName [clause [wildP] (normalB (stringE (nameBase n))) []], -- funD 'conFixity [clause [wildP] (normalB [| fi |]) []]] -- where -- convertFixity (Fixity n d) = Infix (convertDirection d) n -- convertDirection InfixL = LeftAssociative -- convertDirection InfixR = RightAssociative -- convertDirection InfixN = NotAssociative -- --mkConstrInstanceWith :: Name -> Name -> [Q Dec] -> Q Dec --mkConstrInstanceWith dt n extra = -- instanceD (cxt []) (appT (conT ''Constructor) (conT $ genName [dt, n])) -- (funD 'conName [clause [wildP] (normalB (stringE (nameBase n))) []] : extra) -- --mkSelectInstance :: Name -> Con -> Q [Dec] --mkSelectInstance dt r@(RecC n fs) = return (map one fs) where -- one (f, _, _) = -- InstanceD ([]) (AppT (ConT ''Selector) (ConT $ genName [dt, n, f])) -- [FunD 'selName [Clause [WildP] -- (NormalB (LitE (StringL (nameBase f)))) []]] --mkSelectInstance _ _ = return [] -- --rep0Type :: Name -> Q Type --rep0Type n = -- do -- -- runIO $ putStrLn $ "processing " ++ show n -- i <- reify n -- let b = case i of -- TyConI (DataD _ dt vs cs _) -> -- (conT ''D1) `appT` (conT $ genName [dt]) `appT` -- (foldr1' sum (conT ''V1) -- (map (rep0Con (dt, map tyVarBndrToName vs)) cs)) -- TyConI (NewtypeD _ dt vs c _) -> -- (conT ''D1) `appT` (conT $ genName [dt]) `appT` -- (rep0Con (dt, map tyVarBndrToName vs) c) -- TyConI (TySynD t _ _) -> error "type synonym?" -- _ -> error "unknown construct" -- --appT b (conT $ mkName (nameBase n)) -- b where -- sum :: Q Type -> Q Type -> Q Type -- sum a b = conT ''(:+:) `appT` a `appT` b -- -- --rep0Con :: (Name, [Name]) -> Con -> Q Type --rep0Con (dt, vs) (NormalC n []) = -- conT ''C1 `appT` (conT $ genName [dt, n]) `appT` -- (conT ''S1 `appT` conT ''NoSelector `appT` conT ''U1) --rep0Con (dt, vs) (NormalC n fs) = -- conT ''C1 `appT` (conT $ genName [dt, n]) `appT` -- (foldr1 prod (map (repField (dt, vs) . snd) fs)) where -- prod :: Q Type -> Q Type -> Q Type -- prod a b = conT ''(:*:) `appT` a `appT` b --rep0Con (dt, vs) r@(RecC n []) = -- conT ''C1 `appT` (conT $ genName [dt, n]) `appT` conT ''U1 --rep0Con (dt, vs) r@(RecC n fs) = -- conT ''C1 `appT` (conT $ genName [dt, n]) `appT` -- (foldr1 prod (map (repField' (dt, vs) n) fs)) where -- prod :: Q Type -> Q Type -> Q Type -- prod a b = conT ''(:*:) `appT` a `appT` b -- --rep0Con d (InfixC t1 n t2) = rep0Con d (NormalC n [t1,t2]) -- ----dataDeclToType :: (Name, [Name]) -> Type ----dataDeclToType (dt, vs) = foldl (\a b -> AppT a (VarT b)) (ConT dt) vs -- --repField :: (Name, [Name]) -> Type -> Q Type ----repField d t | t == dataDeclToType d = conT ''I --repField d t = conT ''S1 `appT` conT ''NoSelector `appT` -- (conT ''Rec0 `appT` return t) -- --repField' :: (Name, [Name]) -> Name -> (Name, Strict, Type) -> Q Type ----repField' d ns (_, _, t) | t == dataDeclToType d = conT ''I --repField' (dt, vs) ns (f, _, t) = conT ''S1 `appT` conT (genName [dt, ns, f]) -- `appT` (conT ''Rec0 `appT` return t) ---- Note: we should generate Par0 too, at some point -- -- --mkFrom :: Name -> Int -> Int -> Name -> Q [Q Clause] --mkFrom ns m i n = -- do -- -- runIO $ putStrLn $ "processing " ++ show n -- let wrapE e = lrE m i e -- i <- reify n -- let b = case i of -- TyConI (DataD _ dt vs cs _) -> -- zipWith (fromCon wrapE ns (dt, map tyVarBndrToName vs) -- (length cs)) [0..] cs -- TyConI (NewtypeD _ dt vs c _) -> -- [fromCon wrapE ns (dt, map tyVarBndrToName vs) 1 0 c] -- TyConI (TySynD t _ _) -> error "type synonym?" -- -- [clause [varP (field 0)] (normalB (wrapE $ conE 'K1 `appE` varE (field 0))) []] -- _ -> error "unknown construct" -- return b -- --mkTo :: Name -> Int -> Int -> Name -> Q [Q Clause] --mkTo ns m i n = -- do -- -- runIO $ putStrLn $ "processing " ++ show n -- let wrapP p = lrP m i p -- i <- reify n -- let b = case i of -- TyConI (DataD _ dt vs cs _) -> -- zipWith (toCon wrapP ns (dt, map tyVarBndrToName vs) -- (length cs)) [0..] cs -- TyConI (NewtypeD _ dt vs c _) -> -- [toCon wrapP ns (dt, map tyVarBndrToName vs) 1 0 c] -- TyConI (TySynD t _ _) -> error "type synonym?" -- -- [clause [wrapP $ conP 'K1 [varP (field 0)]] (normalB $ varE (field 0)) []] -- _ -> error "unknown construct" -- return b -- --fromCon :: (Q Exp -> Q Exp) -> Name -> (Name, [Name]) -> Int -> Int -> Con -> Q Clause --fromCon wrap ns (dt, vs) m i (NormalC cn []) = -- clause -- [conP cn []] -- (normalB $ appE (conE 'M1) $ wrap $ lrE m i $ appE (conE 'M1) $ -- conE 'M1 `appE` (conE 'U1)) [] --fromCon wrap ns (dt, vs) m i (NormalC cn fs) = -- -- runIO (putStrLn ("constructor " ++ show ix)) >> -- clause -- [conP cn (map (varP . field) [0..length fs - 1])] -- (normalB $ appE (conE 'M1) $ wrap $ lrE m i $ conE 'M1 `appE` -- foldr1 prod (zipWith (fromField (dt, vs)) [0..] (map snd fs))) [] -- where prod x y = conE '(:*:) `appE` x `appE` y --fromCon wrap ns (dt, vs) m i r@(RecC cn []) = -- clause -- [conP cn []] -- (normalB $ appE (conE 'M1) $ wrap $ lrE m i $ conE 'M1 `appE` (conE 'U1)) [] --fromCon wrap ns (dt, vs) m i r@(RecC cn fs) = -- clause -- [conP cn (map (varP . field) [0..length fs - 1])] -- (normalB $ appE (conE 'M1) $ wrap $ lrE m i $ conE 'M1 `appE` -- foldr1 prod (zipWith (fromField (dt, vs)) [0..] (map trd fs))) [] -- where prod x y = conE '(:*:) `appE` x `appE` y --fromCon wrap ns (dt, vs) m i (InfixC t1 cn t2) = -- fromCon wrap ns (dt, vs) m i (NormalC cn [t1,t2]) -- --fromField :: (Name, [Name]) -> Int -> Type -> Q Exp ----fromField (dt, vs) nr t | t == dataDeclToType (dt, vs) = conE 'I `appE` varE (field nr) --fromField (dt, vs) nr t = conE 'M1 `appE` (conE 'K1 `appE` varE (field nr)) -- --toCon :: (Q Pat -> Q Pat) -> Name -> (Name, [Name]) -> Int -> Int -> Con -> Q Clause --toCon wrap ns (dt, vs) m i (NormalC cn []) = -- clause -- [wrap $ conP 'M1 [lrP m i $ conP 'M1 [conP 'M1 [conP 'U1 []]]]] -- (normalB $ conE cn) [] --toCon wrap ns (dt, vs) m i (NormalC cn fs) = -- -- runIO (putStrLn ("constructor " ++ show ix)) >> -- clause -- [wrap $ conP 'M1 [lrP m i $ conP 'M1 -- [foldr1 prod (zipWith (toField (dt, vs)) [0..] (map snd fs))]]] -- (normalB $ foldl appE (conE cn) (map (varE . field) [0..length fs - 1])) [] -- where prod x y = conP '(:*:) [x,y] --toCon wrap ns (dt, vs) m i r@(RecC cn []) = -- clause -- [wrap $ conP 'M1 [lrP m i $ conP 'M1 [conP 'U1 []]]] -- (normalB $ conE cn) [] --toCon wrap ns (dt, vs) m i r@(RecC cn fs) = -- clause -- [wrap $ conP 'M1 [lrP m i $ conP 'M1 -- [foldr1 prod (zipWith (toField (dt, vs)) [0..] (map trd fs))]]] -- (normalB $ foldl appE (conE cn) (map (varE . field) [0..length fs - 1])) [] -- where prod x y = conP '(:*:) [x,y] --toCon wrap ns (dt, vs) m i (InfixC t1 cn t2) = -- toCon wrap ns (dt, vs) m i (NormalC cn [t1,t2]) -- --toField :: (Name, [Name]) -> Int -> Type -> Q Pat ----toField (dt, vs) nr t | t == dataDeclToType (dt, vs) = conP 'I [varP (field nr)] --toField (dt, vs) nr t = conP 'M1 [conP 'K1 [varP (field nr)]] -- -- - field :: Int -> Name - field n = mkName $ "f" ++ show n - --lrP :: Int -> Int -> (Q Pat -> Q Pat) --lrP 1 0 p = p --lrP m 0 p = conP 'L1 [p] --lrP m i p = conP 'R1 [lrP (m-1) (i-1) p] -- --lrE :: Int -> Int -> (Q Exp -> Q Exp) --lrE 1 0 e = e --lrE m 0 e = conE 'L1 `appE` e --lrE m i e = conE 'R1 `appE` lrE (m-1) (i-1) e - - trd (_,_,c) = c - --- -1.8.5.1 - diff --git a/standalone/no-th/haskell-patches/lens_no-TH.patch b/standalone/no-th/haskell-patches/lens_no-TH.patch deleted file mode 100644 index bc453bfa1a..0000000000 --- a/standalone/no-th/haskell-patches/lens_no-TH.patch +++ /dev/null @@ -1,230 +0,0 @@ -From 10c9ade98b3ac2054947f411d77db2eb28896b9f Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 16 Oct 2014 01:43:10 +0000 -Subject: [PATCH] avoid TH - ---- - lens.cabal | 17 +---------------- - src/Control/Lens.hs | 8 ++------ - src/Control/Lens/Cons.hs | 2 -- - src/Control/Lens/Internal/Fold.hs | 2 -- - src/Control/Lens/Operators.hs | 2 +- - src/Control/Lens/Prism.hs | 2 -- - src/Control/Monad/Primitive/Lens.hs | 1 - - 7 files changed, 4 insertions(+), 30 deletions(-) - -diff --git a/lens.cabal b/lens.cabal -index 5388301..d7b02b9 100644 ---- a/lens.cabal -+++ b/lens.cabal -@@ -10,7 +10,7 @@ stability: provisional - homepage: http://github.com/ekmett/lens/ - bug-reports: http://github.com/ekmett/lens/issues - copyright: Copyright (C) 2012-2014 Edward A. Kmett --build-type: Custom -+build-type: Simple - -- build-tools: cpphs - tested-with: GHC == 7.4.1, GHC == 7.4.2, GHC == 7.6.3, GHC == 7.8.1, GHC == 7.8.2 - synopsis: Lenses, Folds and Traversals -@@ -217,7 +217,6 @@ library - Control.Exception.Lens - Control.Lens - Control.Lens.Action -- Control.Lens.At - Control.Lens.Combinators - Control.Lens.Cons - Control.Lens.Each -@@ -234,8 +233,6 @@ library - Control.Lens.Internal.Context - Control.Lens.Internal.Deque - Control.Lens.Internal.Exception -- Control.Lens.Internal.FieldTH -- Control.Lens.Internal.PrismTH - Control.Lens.Internal.Fold - Control.Lens.Internal.Getter - Control.Lens.Internal.Indexed -@@ -247,25 +244,21 @@ library - Control.Lens.Internal.Reflection - Control.Lens.Internal.Review - Control.Lens.Internal.Setter -- Control.Lens.Internal.TH - Control.Lens.Internal.Zoom - Control.Lens.Iso - Control.Lens.Lens - Control.Lens.Level - Control.Lens.Loupe - Control.Lens.Operators -- Control.Lens.Plated - Control.Lens.Prism - Control.Lens.Reified - Control.Lens.Review - Control.Lens.Setter -- Control.Lens.TH - Control.Lens.Traversal - Control.Lens.Tuple - Control.Lens.Type - Control.Lens.Wrapped - Control.Lens.Zoom -- Control.Monad.Error.Lens - Control.Monad.Primitive.Lens - Control.Parallel.Strategies.Lens - Control.Seq.Lens -@@ -291,12 +284,8 @@ library - Data.Typeable.Lens - Data.Vector.Lens - Data.Vector.Generic.Lens -- Generics.Deriving.Lens -- GHC.Generics.Lens - System.Exit.Lens - System.FilePath.Lens -- System.IO.Error.Lens -- Language.Haskell.TH.Lens - Numeric.Lens - - other-modules: -@@ -403,7 +392,6 @@ test-suite doctests - deepseq, - doctest >= 0.9.1, - filepath, -- generic-deriving, - mtl, - nats, - parallel, -@@ -441,7 +429,6 @@ benchmark plated - comonad, - criterion, - deepseq, -- generic-deriving, - lens, - transformers - -@@ -476,7 +463,6 @@ benchmark unsafe - comonads-fd, - criterion, - deepseq, -- generic-deriving, - lens, - transformers - -@@ -493,6 +479,5 @@ benchmark zipper - comonads-fd, - criterion, - deepseq, -- generic-deriving, - lens, - transformers -diff --git a/src/Control/Lens.hs b/src/Control/Lens.hs -index 7e15267..433f1fc 100644 ---- a/src/Control/Lens.hs -+++ b/src/Control/Lens.hs -@@ -41,7 +41,6 @@ - ---------------------------------------------------------------------------- - module Control.Lens - ( module Control.Lens.Action -- , module Control.Lens.At - , module Control.Lens.Cons - , module Control.Lens.Each - , module Control.Lens.Empty -@@ -53,12 +52,11 @@ module Control.Lens - , module Control.Lens.Lens - , module Control.Lens.Level - , module Control.Lens.Loupe -- , module Control.Lens.Plated - , module Control.Lens.Prism - , module Control.Lens.Reified - , module Control.Lens.Review - , module Control.Lens.Setter --#ifndef DISABLE_TEMPLATE_HASKELL -+#if 0 - , module Control.Lens.TH - #endif - , module Control.Lens.Traversal -@@ -69,7 +67,6 @@ module Control.Lens - ) where - - import Control.Lens.Action --import Control.Lens.At - import Control.Lens.Cons - import Control.Lens.Each - import Control.Lens.Empty -@@ -81,12 +78,11 @@ import Control.Lens.Iso - import Control.Lens.Lens - import Control.Lens.Level - import Control.Lens.Loupe --import Control.Lens.Plated - import Control.Lens.Prism - import Control.Lens.Reified - import Control.Lens.Review - import Control.Lens.Setter --#ifndef DISABLE_TEMPLATE_HASKELL -+#if 0 - import Control.Lens.TH - #endif - import Control.Lens.Traversal -diff --git a/src/Control/Lens/Cons.hs b/src/Control/Lens/Cons.hs -index a80e9c8..7d27b80 100644 ---- a/src/Control/Lens/Cons.hs -+++ b/src/Control/Lens/Cons.hs -@@ -55,8 +55,6 @@ import Data.Vector.Unboxed (Unbox) - import qualified Data.Vector.Unboxed as Unbox - import Data.Word - --{-# ANN module "HLint: ignore Eta reduce" #-} -- - -- $setup - -- >>> :set -XNoOverloadedStrings - -- >>> import Control.Lens -diff --git a/src/Control/Lens/Internal/Fold.hs b/src/Control/Lens/Internal/Fold.hs -index ab09c6b..43aa905 100644 ---- a/src/Control/Lens/Internal/Fold.hs -+++ b/src/Control/Lens/Internal/Fold.hs -@@ -37,8 +37,6 @@ import Data.Maybe - import Data.Semigroup hiding (Min, getMin, Max, getMax) - import Data.Reflection - --{-# ANN module "HLint: ignore Avoid lambda" #-} -- - ------------------------------------------------------------------------------ - -- Folding - ------------------------------------------------------------------------------ -diff --git a/src/Control/Lens/Operators.hs b/src/Control/Lens/Operators.hs -index 9992e63..631e8e6 100644 ---- a/src/Control/Lens/Operators.hs -+++ b/src/Control/Lens/Operators.hs -@@ -111,7 +111,7 @@ module Control.Lens.Operators - , (<#~) - , (<#=) - -- * "Control.Lens.Plated" -- , (...) -+ --, (...) - -- * "Control.Lens.Review" - , ( # ) - -- * "Control.Lens.Setter" -diff --git a/src/Control/Lens/Prism.hs b/src/Control/Lens/Prism.hs -index b75c870..c6c6596 100644 ---- a/src/Control/Lens/Prism.hs -+++ b/src/Control/Lens/Prism.hs -@@ -61,8 +61,6 @@ import Unsafe.Coerce - import Data.Profunctor.Unsafe - #endif - --{-# ANN module "HLint: ignore Use camelCase" #-} -- - -- $setup - -- >>> :set -XNoOverloadedStrings - -- >>> import Control.Lens -diff --git a/src/Control/Monad/Primitive/Lens.hs b/src/Control/Monad/Primitive/Lens.hs -index ee942c6..2f37134 100644 ---- a/src/Control/Monad/Primitive/Lens.hs -+++ b/src/Control/Monad/Primitive/Lens.hs -@@ -20,7 +20,6 @@ import Control.Lens - import Control.Monad.Primitive (PrimMonad(..)) - import GHC.Prim (State#) - --{-# ANN module "HLint: ignore Unused LANGUAGE pragma" #-} - - prim :: (PrimMonad m) => Iso' (m a) (State# (PrimState m) -> (# State# (PrimState m), a #)) - prim = iso internal primitive --- -2.1.1 - diff --git a/standalone/no-th/haskell-patches/monad-logger_remove-TH.patch b/standalone/no-th/haskell-patches/monad-logger_remove-TH.patch deleted file mode 100644 index c24fa5aa26..0000000000 --- a/standalone/no-th/haskell-patches/monad-logger_remove-TH.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 8e78a25ce0cc19e52d063f66bd4cd316462393d4 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 6 Mar 2014 23:27:06 +0000 -Subject: [PATCH] disable th - ---- - monad-logger.cabal | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/monad-logger.cabal b/monad-logger.cabal -index b0aa271..cd56c0f 100644 ---- a/monad-logger.cabal -+++ b/monad-logger.cabal -@@ -14,8 +14,8 @@ cabal-version: >=1.8 - - flag template_haskell { - Description: Enable Template Haskell support -- Default: True -- Manual: True -+ Default: False -+ Manual: False - } - - library --- -1.9.0 - diff --git a/standalone/no-th/haskell-patches/optparse-applicative_remove-ANN.patch b/standalone/no-th/haskell-patches/optparse-applicative_remove-ANN.patch deleted file mode 100644 index 1bb843524e..0000000000 --- a/standalone/no-th/haskell-patches/optparse-applicative_remove-ANN.patch +++ /dev/null @@ -1,33 +0,0 @@ -From b128590966d4946219e45e2efd88acf7a354abc2 Mon Sep 17 00:00:00 2001 -From: androidbuilder -Date: Tue, 14 Oct 2014 02:28:02 +0000 -Subject: [PATCH] remove ANN - ---- - Options/Applicative.hs | 2 -- - Options/Applicative/Help/Core.hs | 2 -- - 2 files changed, 4 deletions(-) - -diff --git a/Options/Applicative.hs b/Options/Applicative.hs -index bd4129d..f412062 100644 ---- a/Options/Applicative.hs -+++ b/Options/Applicative.hs -@@ -34,5 +34,3 @@ import Options.Applicative.Common - import Options.Applicative.Builder - import Options.Applicative.Builder.Completer - import Options.Applicative.Extra -- --{-# ANN module "HLint: ignore Use import/export shortcut" #-} -diff --git a/Options/Applicative/Help/Core.hs b/Options/Applicative/Help/Core.hs -index 0a79169..3f1ce3f 100644 ---- a/Options/Applicative/Help/Core.hs -+++ b/Options/Applicative/Help/Core.hs -@@ -139,5 +139,3 @@ parserUsage pprefs p progn = hsep - [ string "Usage:" - , string progn - , align (extractChunk (briefDesc pprefs p)) ] -- --{-# ANN footerHelp "HLint: ignore Eta reduce" #-} --- -1.7.10.4 - diff --git a/standalone/no-th/haskell-patches/persistent-template_stub-out.patch b/standalone/no-th/haskell-patches/persistent-template_stub-out.patch deleted file mode 100644 index 506fa1add0..0000000000 --- a/standalone/no-th/haskell-patches/persistent-template_stub-out.patch +++ /dev/null @@ -1,68 +0,0 @@ -From b22a4d77c1262f77ce4298b53ca90a138a14ceb7 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Sun, 22 Feb 2015 15:21:19 -0400 -Subject: [PATCH] stub out TH - -this method avoids needing to delete the entire file contents, so patch is -kept minimal ---- - Database/Persist/TH.hs | 1 + - persistent-template.cabal | 1 + - stub/Database/Persist/TH.hs | 21 +++++++++++++++++++++ - 3 files changed, 23 insertions(+) - create mode 100644 stub/Database/Persist/TH.hs - -diff --git a/Database/Persist/TH.hs b/Database/Persist/TH.hs -index 43eb3ee..2172b77 100644 ---- a/Database/Persist/TH.hs -+++ b/Database/Persist/TH.hs -@@ -35,6 +35,7 @@ module Database.Persist.TH - -- * Internal - , packPTH - , lensPTH -+ , plusPlus - ) where - - import Prelude hiding ((++), take, concat, splitAt) -diff --git a/persistent-template.cabal b/persistent-template.cabal -index 59b4149..4705d97 100644 ---- a/persistent-template.cabal -+++ b/persistent-template.cabal -@@ -30,6 +30,7 @@ library - ghc-options: -Wall - if impl(ghc >= 7.4) - cpp-options: -DGHC_7_4 -+ hs-source-dirs: stub - - test-suite test - type: exitcode-stdio-1.0 -diff --git a/stub/Database/Persist/TH.hs b/stub/Database/Persist/TH.hs -new file mode 100644 -index 0000000..dfbb874 ---- /dev/null -+++ b/stub/Database/Persist/TH.hs -@@ -0,0 +1,21 @@ -+{-# LANGUAGE RecordWildCards #-} -+{-# LANGUAGE CPP #-} -+{-# LANGUAGE OverloadedStrings #-} -+{-# LANGUAGE RankNTypes #-} -+{-# OPTIONS_GHC -fno-warn-orphans -fno-warn-missing-fields #-} -+-- | This module provides utilities for creating backends. Regular users do not -+-- need to use this module. -+module Database.Persist.TH where -+ -+import Data.Text -+ -+type Lens s t a b = forall f. Functor f => (a -> f b) -> s -> f t -+ -+lensPTH :: (s -> a) -> (s -> b -> t) -> Lens s t a b -+lensPTH sa sbt afb s = fmap (sbt s) (afb $ sa s) -+ -+packPTH :: String -> Text -+packPTH = pack -+#if !MIN_VERSION_text(0, 11, 2) -+{-# NOINLINE packPTH #-} -+#endif --- -2.1.4 - diff --git a/standalone/no-th/haskell-patches/persistent_1.1.5.1_0001-disable-TH.patch b/standalone/no-th/haskell-patches/persistent_1.1.5.1_0001-disable-TH.patch deleted file mode 100644 index cd86ccd2db..0000000000 --- a/standalone/no-th/haskell-patches/persistent_1.1.5.1_0001-disable-TH.patch +++ /dev/null @@ -1,41 +0,0 @@ -From aae3ace106cf26c931cc94c96fb6fbfe83f950f2 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Wed, 15 Oct 2014 17:05:37 +0000 -Subject: [PATCH] avoid TH - ---- - Database/Persist/Sql/Raw.hs | 4 +--- - 1 file changed, 1 insertion(+), 3 deletions(-) - -diff --git a/Database/Persist/Sql/Raw.hs b/Database/Persist/Sql/Raw.hs -index 3ac2ca9..bcc2011 100644 ---- a/Database/Persist/Sql/Raw.hs -+++ b/Database/Persist/Sql/Raw.hs -@@ -11,7 +11,7 @@ import Data.IORef (writeIORef, readIORef, newIORef) - import Control.Exception (throwIO) - import Control.Monad (when, liftM) - import Data.Text (Text, pack) --import Control.Monad.Logger (logDebugS) -+--import Control.Monad.Logger (logDebugS) - import Data.Int (Int64) - import Control.Monad.Trans.Class (lift) - import qualified Data.Text as T -@@ -23,7 +23,6 @@ rawQuery :: (MonadSqlPersist m, MonadResource m) - -> [PersistValue] - -> Source m [PersistValue] - rawQuery sql vals = do -- lift $ $logDebugS (pack "SQL") $ pack $ show sql ++ " " ++ show vals - conn <- lift askSqlConn - bracketP - (getStmtConn conn sql) -@@ -35,7 +34,6 @@ rawExecute x y = liftM (const ()) $ rawExecuteCount x y - - rawExecuteCount :: MonadSqlPersist m => Text -> [PersistValue] -> m Int64 - rawExecuteCount sql vals = do -- $logDebugS (pack "SQL") $ pack $ show sql ++ " " ++ show vals - stmt <- getStmt sql - res <- liftIO $ stmtExecute stmt vals - liftIO $ stmtReset stmt --- -2.1.1 - diff --git a/standalone/no-th/haskell-patches/process-conduit_avoid-TH.patch b/standalone/no-th/haskell-patches/process-conduit_avoid-TH.patch deleted file mode 100644 index 875119afdb..0000000000 --- a/standalone/no-th/haskell-patches/process-conduit_avoid-TH.patch +++ /dev/null @@ -1,24 +0,0 @@ -From ed77588c57704030a9d412dd49f11c172c6268ab Mon Sep 17 00:00:00 2001 -From: dummy -Date: Tue, 14 Oct 2014 03:46:03 +0000 -Subject: [PATCH] unused - ---- - process-conduit.cabal | 1 - - 1 file changed, 1 deletion(-) - -diff --git a/process-conduit.cabal b/process-conduit.cabal -index 34bb168..2f137a8 100644 ---- a/process-conduit.cabal -+++ b/process-conduit.cabal -@@ -22,7 +22,6 @@ source-repository head - - library - exposed-modules: Data.Conduit.ProcessOld -- System.Process.QQ - - build-depends: base == 4.* - , template-haskell >= 2.4 --- -1.7.10.4 - diff --git a/standalone/no-th/haskell-patches/profunctors_3.3-0001-fix-cross-build.patch b/standalone/no-th/haskell-patches/profunctors_3.3-0001-fix-cross-build.patch deleted file mode 100644 index 45397f3e5d..0000000000 --- a/standalone/no-th/haskell-patches/profunctors_3.3-0001-fix-cross-build.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 392602f5ff14c0b5a801397d075ddcbcd890aa83 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Thu, 18 Apr 2013 17:50:59 -0400 -Subject: [PATCH] fix cross build - ---- - src/Data/Profunctor/Unsafe.hs | 3 --- - 1 file changed, 3 deletions(-) - -diff --git a/src/Data/Profunctor/Unsafe.hs b/src/Data/Profunctor/Unsafe.hs -index 025c7c4..0249274 100644 ---- a/src/Data/Profunctor/Unsafe.hs -+++ b/src/Data/Profunctor/Unsafe.hs -@@ -40,9 +40,6 @@ import Data.Tagged - import Prelude hiding (id,(.),sequence) - import Unsafe.Coerce - --{-# ANN module "Hlint: ignore Redundant lambda" #-} --{-# ANN module "Hlint: ignore Collapse lambdas" #-} -- - infixr 9 #. - infixl 8 .# - --- -1.8.2.rc3 - diff --git a/standalone/no-th/haskell-patches/reflection_remove-TH.patch b/standalone/no-th/haskell-patches/reflection_remove-TH.patch deleted file mode 100644 index 4f8b4bc20f..0000000000 --- a/standalone/no-th/haskell-patches/reflection_remove-TH.patch +++ /dev/null @@ -1,59 +0,0 @@ -From c0f5dcfd6ba7a05bb84b6adc4664c8dde109e6ac Mon Sep 17 00:00:00 2001 -From: dummy -Date: Fri, 7 Mar 2014 04:30:22 +0000 -Subject: [PATCH] remove TH - ---- - fast/Data/Reflection.hs | 8 +++++--- - 1 file changed, 5 insertions(+), 3 deletions(-) - -diff --git a/fast/Data/Reflection.hs b/fast/Data/Reflection.hs -index ca57d35..d3f8356 100644 ---- a/fast/Data/Reflection.hs -+++ b/fast/Data/Reflection.hs -@@ -59,7 +59,7 @@ module Data.Reflection - , Given(..) - , give - -- * Template Haskell reflection -- , int, nat -+ --, int, nat - -- * Useful compile time naturals - , Z, D, SD, PD - ) where -@@ -161,6 +161,7 @@ instance Reifies n Int => Reifies (PD n) Int where - -- instead of @$(int 3)@. Sometimes the two will produce the same - -- representation (if compiled without the @-DUSE_TYPE_LITS@ preprocessor - -- directive). -+{- - int :: Int -> TypeQ - int n = case quotRem n 2 of - (0, 0) -> conT ''Z -@@ -176,7 +177,7 @@ nat :: Int -> TypeQ - nat n - | n >= 0 = int n - | otherwise = error "nat: negative" -- -+-} - #if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL < 704 - instance Show (Q a) - instance Eq (Q a) -@@ -195,6 +196,7 @@ instance Fractional a => Fractional (Q a) where - recip = fmap recip - fromRational = return . fromRational - -+{- - -- | This permits the use of $(5) as a type splice. - instance Num Type where - #ifdef USE_TYPE_LITS -@@ -254,7 +256,7 @@ instance Num Exp where - abs = onProxyType1 abs - signum = onProxyType1 signum - fromInteger n = ConE 'Proxy `SigE` (ConT ''Proxy `AppT` fromInteger n) -- -+-} - #ifdef USE_TYPE_LITS - addProxy :: Proxy a -> Proxy b -> Proxy (a + b) - addProxy _ _ = Proxy --- -1.9.0 - diff --git a/standalone/no-th/haskell-patches/shakespeare_remove-TH.patch b/standalone/no-th/haskell-patches/shakespeare_remove-TH.patch deleted file mode 100644 index 68226dcc6f..0000000000 --- a/standalone/no-th/haskell-patches/shakespeare_remove-TH.patch +++ /dev/null @@ -1,1438 +0,0 @@ -From 4694f3a7ee4eb15d33ecda9d62712ea236304c1b Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 2 Jul 2015 22:17:29 +0000 -Subject: [PATCH] hack TH - ---- - Text/Cassius.hs | 30 +--- - Text/Coffee.hs | 56 +------- - Text/Css.hs | 151 --------------------- - Text/CssCommon.hs | 22 --- - Text/Hamlet.hs | 346 +++-------------------------------------------- - Text/Julius.hs | 59 +------- - Text/Lucius.hs | 47 +------ - Text/Roy.hs | 52 +------ - Text/Shakespeare.hs | 70 ++-------- - Text/Shakespeare/Base.hs | 28 ---- - Text/Shakespeare/Text.hs | 117 ++-------------- - Text/TypeScript.hs | 48 +------ - shakespeare.cabal | 6 +- - 13 files changed, 69 insertions(+), 963 deletions(-) - -diff --git a/Text/Cassius.hs b/Text/Cassius.hs -index ba73bdd..ffe7c51 100644 ---- a/Text/Cassius.hs -+++ b/Text/Cassius.hs -@@ -14,12 +14,7 @@ module Text.Cassius - , renderCss - , renderCssUrl - -- * Parsing -- , cassius -- , cassiusFile -- , cassiusFileDebug -- , cassiusFileReload - -- ** Mixims -- , cassiusMixin - , Mixin - -- * ToCss instances - -- ** Color -@@ -27,15 +22,12 @@ module Text.Cassius - , colorRed - , colorBlack - -- ** Size -- , mkSize -+ --, mkSize - , AbsoluteUnit (..) - , AbsoluteSize (..) - , absoluteSize -- , EmSize (..) -- , ExSize (..) - , PercentageSize (..) - , percentageSize -- , PixelSize (..) - -- * Internal - , cassiusUsedIdentifiers - ) where -@@ -47,25 +39,9 @@ import Language.Haskell.TH.Quote (QuasiQuoter (..)) - import Language.Haskell.TH.Syntax - import qualified Data.Text.Lazy as TL - import Text.CssCommon --import Text.Lucius (lucius) - import qualified Text.Lucius - import Text.IndentToBrace (i2b) - --cassius :: QuasiQuoter --cassius = QuasiQuoter { quoteExp = quoteExp lucius . i2b } -- --cassiusFile :: FilePath -> Q Exp --cassiusFile fp = do --#ifdef GHC_7_4 -- qAddDependentFile fp --#endif -- contents <- fmap TL.unpack $ qRunIO $ readUtf8File fp -- quoteExp cassius contents -- --cassiusFileDebug, cassiusFileReload :: FilePath -> Q Exp --cassiusFileDebug = cssFileDebug True [|Text.Lucius.parseTopLevels|] Text.Lucius.parseTopLevels --cassiusFileReload = cassiusFileDebug -- - -- | Determine which identifiers are used by the given template, useful for - -- creating systems like yesod devel. - cassiusUsedIdentifiers :: String -> [(Deref, VarType)] -@@ -74,10 +50,6 @@ cassiusUsedIdentifiers = cssUsedIdentifiers True Text.Lucius.parseTopLevels - -- | Create a mixin with Cassius syntax. - -- - -- Since 2.0.3 --cassiusMixin :: QuasiQuoter --cassiusMixin = QuasiQuoter -- { quoteExp = quoteExp Text.Lucius.luciusMixin . i2bMixin -- } - - i2bMixin :: String -> String - i2bMixin s' = -diff --git a/Text/Coffee.hs b/Text/Coffee.hs -index 488c81b..4e28c94 100644 ---- a/Text/Coffee.hs -+++ b/Text/Coffee.hs -@@ -51,13 +51,13 @@ module Text.Coffee - -- ** Template-Reading Functions - -- | These QuasiQuoter and Template Haskell methods return values of - -- type @'JavascriptUrl' url@. See the Yesod book for details. -- coffee -- , coffeeFile -- , coffeeFileReload -- , coffeeFileDebug -+ -- coffee -+ --, coffeeFile -+ --, coffeeFileReload -+ --, coffeeFileDebug - - #ifdef TEST_EXPORT -- , coffeeSettings -+ -- , coffeeSettings - #endif - ) where - -@@ -65,49 +65,3 @@ import Language.Haskell.TH.Quote (QuasiQuoter (..)) - import Language.Haskell.TH.Syntax - import Text.Shakespeare - import Text.Julius -- --coffeeSettings :: Q ShakespeareSettings --coffeeSettings = do -- jsettings <- javascriptSettings -- return $ jsettings { varChar = '%' -- , preConversion = Just PreConvert { -- preConvert = ReadProcess "coffee" ["-spb"] -- , preEscapeIgnoreBalanced = "'\"`" -- don't insert backtacks for variable already inside strings or backticks. -- , preEscapeIgnoreLine = "#" -- ignore commented lines -- , wrapInsertion = Just WrapInsertion { -- wrapInsertionIndent = Just " " -- , wrapInsertionStartBegin = "(" -- , wrapInsertionSeparator = ", " -- , wrapInsertionStartClose = ") =>" -- , wrapInsertionEnd = "" -- , wrapInsertionAddParens = False -- } -- } -- } -- ---- | Read inline, quasiquoted CoffeeScript. --coffee :: QuasiQuoter --coffee = QuasiQuoter { quoteExp = \s -> do -- rs <- coffeeSettings -- quoteExp (shakespeare rs) s -- } -- ---- | Read in a CoffeeScript template file. This function reads the file once, at ---- compile time. --coffeeFile :: FilePath -> Q Exp --coffeeFile fp = do -- rs <- coffeeSettings -- shakespeareFile rs fp -- ---- | Read in a CoffeeScript template file. This impure function uses ---- unsafePerformIO to re-read the file on every call, allowing for rapid ---- iteration. --coffeeFileReload :: FilePath -> Q Exp --coffeeFileReload fp = do -- rs <- coffeeSettings -- shakespeareFileReload rs fp -- ---- | Deprecated synonym for 'coffeeFileReload' --coffeeFileDebug :: FilePath -> Q Exp --coffeeFileDebug = coffeeFileReload --{-# DEPRECATED coffeeFileDebug "Please use coffeeFileReload instead." #-} -diff --git a/Text/Css.hs b/Text/Css.hs -index 75dc549..20c206c 100644 ---- a/Text/Css.hs -+++ b/Text/Css.hs -@@ -166,22 +166,6 @@ cssUsedIdentifiers toi2b parseBlocks s' = - (scope, rest') = go rest - go' (Attr k v) = k ++ v - --cssFileDebug :: Bool -- ^ perform the indent-to-brace conversion -- -> Q Exp -- -> Parser [TopLevel Unresolved] -- -> FilePath -- -> Q Exp --cssFileDebug toi2b parseBlocks' parseBlocks fp = do -- s <- fmap TL.unpack $ qRunIO $ readUtf8File fp --#ifdef GHC_7_4 -- qAddDependentFile fp --#endif -- let vs = cssUsedIdentifiers toi2b parseBlocks s -- c <- mapM vtToExp vs -- cr <- [|cssRuntime toi2b|] -- parseBlocks'' <- parseBlocks' -- return $ cr `AppE` parseBlocks'' `AppE` (LitE $ StringL fp) `AppE` ListE c -- - combineSelectors :: HasLeadingSpace - -> [Contents] - -> [Contents] -@@ -287,18 +271,6 @@ cssRuntime toi2b parseBlocks fp cd render' = unsafePerformIO $ do - - addScope scope = map (DerefIdent . Ident *** CDPlain . fromString) scope ++ cd - --vtToExp :: (Deref, VarType) -> Q Exp --vtToExp (d, vt) = do -- d' <- lift d -- c' <- c vt -- return $ TupE [d', c' `AppE` derefToExp [] d] -- where -- c :: VarType -> Q Exp -- c VTPlain = [|CDPlain . toCss|] -- c VTUrl = [|CDUrl|] -- c VTUrlParam = [|CDUrlParam|] -- c VTMixin = [|CDMixin|] -- - getVars :: Monad m => [(String, String)] -> Content -> m [(Deref, VarType)] - getVars _ ContentRaw{} = return [] - getVars scope (ContentVar d) = -@@ -342,111 +314,8 @@ compressBlock (Block x y blocks mixins) = - cc (ContentRaw a:ContentRaw b:c) = cc $ ContentRaw (a ++ b) : c - cc (a:b) = a : cc b - --blockToMixin :: Name -- -> Scope -- -> Block Unresolved -- -> Q Exp --blockToMixin r scope (Block _sel props subblocks mixins) = -- [|Mixin -- { mixinAttrs = concat -- $ $(listE $ map go props) -- : map mixinAttrs $mixinsE -- -- FIXME too many complications to implement sublocks for now... -- , mixinBlocks = [] -- foldr (.) id $(listE $ map subGo subblocks) [] -- }|] -- {- -- . foldr (.) id $(listE $ map subGo subblocks) -- . (concatMap mixinBlocks $mixinsE ++) -- |] -- -} -- where -- mixinsE = return $ ListE $ map (derefToExp []) mixins -- go (Attr x y) = conE 'Attr -- `appE` (contentsToBuilder r scope x) -- `appE` (contentsToBuilder r scope y) -- subGo (Block sel' b c d) = blockToCss r scope $ Block sel' b c d -- --blockToCss :: Name -- -> Scope -- -> Block Unresolved -- -> Q Exp --blockToCss r scope (Block sel props subblocks mixins) = -- [|((Block -- { blockSelector = $(selectorToBuilder r scope sel) -- , blockAttrs = concat -- $ $(listE $ map go props) -- : map mixinAttrs $mixinsE -- , blockBlocks = () -- , blockMixins = () -- } :: Block Resolved):) -- . foldr (.) id $(listE $ map subGo subblocks) -- . (concatMap mixinBlocks $mixinsE ++) -- |] -- where -- mixinsE = return $ ListE $ map (derefToExp []) mixins -- go (Attr x y) = conE 'Attr -- `appE` (contentsToBuilder r scope x) -- `appE` (contentsToBuilder r scope y) -- subGo (hls, Block sel' b c d) = -- blockToCss r scope $ Block sel'' b c d -- where -- sel'' = combineSelectors hls sel sel' -- --selectorToBuilder :: Name -> Scope -> [Contents] -> Q Exp --selectorToBuilder r scope sels = -- contentsToBuilder r scope $ intercalate [ContentRaw ","] sels -- --contentsToBuilder :: Name -> Scope -> [Content] -> Q Exp --contentsToBuilder r scope contents = -- appE [|mconcat|] $ listE $ map (contentToBuilder r scope) contents -- --contentToBuilder :: Name -> Scope -> Content -> Q Exp --contentToBuilder _ _ (ContentRaw x) = -- [|fromText . pack|] `appE` litE (StringL x) --contentToBuilder _ scope (ContentVar d) = -- case d of -- DerefIdent (Ident s) -- | Just val <- lookup s scope -> [|fromText . pack|] `appE` litE (StringL val) -- _ -> [|toCss|] `appE` return (derefToExp [] d) --contentToBuilder r _ (ContentUrl u) = -- [|fromText|] `appE` -- (varE r `appE` return (derefToExp [] u) `appE` listE []) --contentToBuilder r _ (ContentUrlParam u) = -- [|fromText|] `appE` -- ([|uncurry|] `appE` varE r `appE` return (derefToExp [] u)) --contentToBuilder _ _ ContentMixin{} = error "contentToBuilder on ContentMixin" -- - type Scope = [(String, String)] - --topLevelsToCassius :: [TopLevel Unresolved] -- -> Q Exp --topLevelsToCassius a = do -- r <- newName "_render" -- lamE [varP r] $ appE [|CssNoWhitespace . foldr ($) []|] $ fmap ListE $ go r [] a -- where -- go _ _ [] = return [] -- go r scope (TopBlock b:rest) = do -- e <- [|(++) $ map TopBlock ($(blockToCss r scope b) [])|] -- es <- go r scope rest -- return $ e : es -- go r scope (TopAtBlock name s b:rest) = do -- let s' = contentsToBuilder r scope s -- e <- [|(:) $ TopAtBlock $(lift name) $(s') $(blocksToCassius r scope b)|] -- es <- go r scope rest -- return $ e : es -- go r scope (TopAtDecl dec cs:rest) = do -- e <- [|(:) $ TopAtDecl $(lift dec) $(contentsToBuilder r scope cs)|] -- es <- go r scope rest -- return $ e : es -- go r scope (TopVar k v:rest) = go r ((k, v) : scope) rest -- --blocksToCassius :: Name -- -> Scope -- -> [Block Unresolved] -- -> Q Exp --blocksToCassius r scope a = do -- appE [|foldr ($) []|] $ listE $ map (blockToCss r scope) a -- - renderCss :: Css -> TL.Text - renderCss css = - toLazyText $ mconcat $ map go tops -@@ -515,23 +384,3 @@ renderBlock haveWhiteSpace indent (Block sel attrs () ()) - | haveWhiteSpace = fromString ";\n" - | otherwise = singleton ';' - --instance Lift Mixin where -- lift (Mixin a b) = [|Mixin a b|] --instance Lift (Attr Unresolved) where -- lift (Attr k v) = [|Attr k v :: Attr Unresolved |] --instance Lift (Attr Resolved) where -- lift (Attr k v) = [|Attr $(liftBuilder k) $(liftBuilder v) :: Attr Resolved |] -- --liftBuilder :: Builder -> Q Exp --liftBuilder b = [|fromText $ pack $(lift $ TL.unpack $ toLazyText b)|] -- --instance Lift Content where -- lift (ContentRaw s) = [|ContentRaw s|] -- lift (ContentVar d) = [|ContentVar d|] -- lift (ContentUrl d) = [|ContentUrl d|] -- lift (ContentUrlParam d) = [|ContentUrlParam d|] -- lift (ContentMixin m) = [|ContentMixin m|] --instance Lift (Block Unresolved) where -- lift (Block a b c d) = [|Block a b c d|] --instance Lift (Block Resolved) where -- lift (Block a b () ()) = [|Block $(liftBuilder a) b () ()|] -diff --git a/Text/CssCommon.hs b/Text/CssCommon.hs -index 719e0a8..0635cf4 100644 ---- a/Text/CssCommon.hs -+++ b/Text/CssCommon.hs -@@ -1,4 +1,3 @@ --{-# LANGUAGE TemplateHaskell #-} - {-# LANGUAGE GeneralizedNewtypeDeriving #-} - {-# LANGUAGE FlexibleInstances #-} - {-# LANGUAGE CPP #-} -@@ -47,24 +46,6 @@ colorBlack = Color 0 0 0 - - -- CSS size wrappers - ---- | Create a CSS size, e.g. $(mkSize "100px"). --mkSize :: String -> ExpQ --mkSize s = appE nameE valueE -- where [(value, unit)] = reads s :: [(Double, String)] -- absoluteSizeE = varE $ mkName "absoluteSize" -- nameE = case unit of -- "cm" -> appE absoluteSizeE (conE $ mkName "Centimeter") -- "em" -> conE $ mkName "EmSize" -- "ex" -> conE $ mkName "ExSize" -- "in" -> appE absoluteSizeE (conE $ mkName "Inch") -- "mm" -> appE absoluteSizeE (conE $ mkName "Millimeter") -- "pc" -> appE absoluteSizeE (conE $ mkName "Pica") -- "pt" -> appE absoluteSizeE (conE $ mkName "Point") -- "px" -> conE $ mkName "PixelSize" -- "%" -> varE $ mkName "percentageSize" -- _ -> error $ "In mkSize, invalid unit: " ++ unit -- valueE = litE $ rationalL (toRational value) -- - -- | Absolute size units. - data AbsoluteUnit = Centimeter - | Inch -@@ -156,6 +137,3 @@ showSize :: Rational -> String -> String - showSize value' unit = printf "%f" value ++ unit - where value = fromRational value' :: Double - --mkSizeType "EmSize" "em" --mkSizeType "ExSize" "ex" --mkSizeType "PixelSize" "px" -diff --git a/Text/Hamlet.hs b/Text/Hamlet.hs -index 4618be3..4ad3633 100644 ---- a/Text/Hamlet.hs -+++ b/Text/Hamlet.hs -@@ -11,36 +11,36 @@ - module Text.Hamlet - ( -- * Plain HTML - Html -- , shamlet -- , shamletFile -- , xshamlet -- , xshamletFile -+ --, shamlet -+ --, shamletFile -+ --, xshamlet -+ --, xshamletFile - -- * Hamlet - , HtmlUrl -- , hamlet -- , hamletFile -- , hamletFileReload -- , ihamletFileReload -- , xhamlet -- , xhamletFile -+ --, hamlet -+ -- , hamletFile -+ -- , hamletFileReload -+ -- , ihamletFileReload -+ -- , xhamlet -+ -- , xhamletFile - -- * I18N Hamlet - , HtmlUrlI18n -- , ihamlet -- , ihamletFile -+ -- , ihamlet -+ -- , ihamletFile - -- * Type classes - , ToAttributes (..) - -- * Internal, for making more - , HamletSettings (..) - , NewlineStyle (..) -- , hamletWithSettings -- , hamletFileWithSettings -+ -- , hamletWithSettings -+ -- , hamletFileWithSettings - , defaultHamletSettings - , xhtmlHamletSettings -- , Env (..) -- , HamletRules (..) -- , hamletRules -- , ihamletRules -- , htmlRules -+ --, Env (..) -+ --, HamletRules (..) -+ --, hamletRules -+ --, ihamletRules -+ --, htmlRules - , CloseStyle (..) - -- * Used by generated code - , condH -@@ -109,48 +109,9 @@ type HtmlUrl url = Render url -> Html - -- | A function generating an 'Html' given a message translator and a URL rendering function. - type HtmlUrlI18n msg url = Translate msg -> Render url -> Html - --docsToExp :: Env -> HamletRules -> Scope -> [Doc] -> Q Exp --docsToExp env hr scope docs = do -- exps <- mapM (docToExp env hr scope) docs -- case exps of -- [] -> [|return ()|] -- [x] -> return x -- _ -> return $ DoE $ map NoBindS exps -- - unIdent :: Ident -> String - unIdent (Ident s) = s - --bindingPattern :: Binding -> Q (Pat, [(Ident, Exp)]) --bindingPattern (BindAs i@(Ident s) b) = do -- name <- newName s -- (pattern, scope) <- bindingPattern b -- return (AsP name pattern, (i, VarE name):scope) --bindingPattern (BindVar i@(Ident s)) -- | s == "_" = return (WildP, []) -- | all isDigit s = do -- return (LitP $ IntegerL $ read s, []) -- | otherwise = do -- name <- newName s -- return (VarP name, [(i, VarE name)]) --bindingPattern (BindTuple is) = do -- (patterns, scopes) <- fmap unzip $ mapM bindingPattern is -- return (TupP patterns, concat scopes) --bindingPattern (BindList is) = do -- (patterns, scopes) <- fmap unzip $ mapM bindingPattern is -- return (ListP patterns, concat scopes) --bindingPattern (BindConstr con is) = do -- (patterns, scopes) <- fmap unzip $ mapM bindingPattern is -- return (ConP (mkConName con) patterns, concat scopes) --bindingPattern (BindRecord con fields wild) = do -- let f (Ident field,b) = -- do (p,s) <- bindingPattern b -- return ((mkName field,p),s) -- (patterns, scopes) <- fmap unzip $ mapM f fields -- (patterns1, scopes1) <- if wild -- then bindWildFields con $ map fst fields -- else return ([],[]) -- return (RecP (mkConName con) (patterns++patterns1), concat scopes ++ scopes1) -- - mkConName :: DataConstr -> Name - mkConName = mkName . conToStr - -@@ -158,257 +119,15 @@ conToStr :: DataConstr -> String - conToStr (DCUnqualified (Ident x)) = x - conToStr (DCQualified (Module xs) (Ident x)) = intercalate "." $ xs ++ [x] - ---- Wildcards bind all of the unbound fields to variables whose name ---- matches the field name. ---- ---- For example: data R = C { f1, f2 :: Int } ---- C {..} is equivalent to C {f1=f1, f2=f2} ---- C {f1 = a, ..} is equivalent to C {f1=a, f2=f2} ---- C {f2 = a, ..} is equivalent to C {f1=f1, f2=a} --bindWildFields :: DataConstr -> [Ident] -> Q ([(Name, Pat)], [(Ident, Exp)]) --bindWildFields conName fields = do -- fieldNames <- recordToFieldNames conName -- let available n = nameBase n `notElem` map unIdent fields -- let remainingFields = filter available fieldNames -- let mkPat n = do -- e <- newName (nameBase n) -- return ((n,VarP e), (Ident (nameBase n), VarE e)) -- fmap unzip $ mapM mkPat remainingFields -- ---- Important note! reify will fail if the record type is defined in the ---- same module as the reify is used. This means quasi-quoted Hamlet ---- literals will not be able to use wildcards to match record types ---- defined in the same module. --recordToFieldNames :: DataConstr -> Q [Name] --recordToFieldNames conStr = do -- -- use 'lookupValueName' instead of just using 'mkName' so we reify the -- -- data constructor and not the type constructor if their names match. -- Just conName <- lookupValueName $ conToStr conStr -- DataConI _ _ typeName _ <- reify conName -- TyConI (DataD _ _ _ cons _) <- reify typeName -- [fields] <- return [fields | RecC name fields <- cons, name == conName] -- return [fieldName | (fieldName, _, _) <- fields] -- --docToExp :: Env -> HamletRules -> Scope -> Doc -> Q Exp --docToExp env hr scope (DocForall list idents inside) = do -- let list' = derefToExp scope list -- (pat, extraScope) <- bindingPattern idents -- let scope' = extraScope ++ scope -- mh <- [|F.mapM_|] -- inside' <- docsToExp env hr scope' inside -- let lam = LamE [pat] inside' -- return $ mh `AppE` lam `AppE` list' --docToExp env hr scope (DocWith [] inside) = do -- inside' <- docsToExp env hr scope inside -- return $ inside' --docToExp env hr scope (DocWith ((deref, idents):dis) inside) = do -- let deref' = derefToExp scope deref -- (pat, extraScope) <- bindingPattern idents -- let scope' = extraScope ++ scope -- inside' <- docToExp env hr scope' (DocWith dis inside) -- let lam = LamE [pat] inside' -- return $ lam `AppE` deref' --docToExp env hr scope (DocMaybe val idents inside mno) = do -- let val' = derefToExp scope val -- (pat, extraScope) <- bindingPattern idents -- let scope' = extraScope ++ scope -- inside' <- docsToExp env hr scope' inside -- let inside'' = LamE [pat] inside' -- ninside' <- case mno of -- Nothing -> [|Nothing|] -- Just no -> do -- no' <- docsToExp env hr scope no -- j <- [|Just|] -- return $ j `AppE` no' -- mh <- [|maybeH|] -- return $ mh `AppE` val' `AppE` inside'' `AppE` ninside' --docToExp env hr scope (DocCond conds final) = do -- conds' <- mapM go conds -- final' <- case final of -- Nothing -> [|Nothing|] -- Just f -> do -- f' <- docsToExp env hr scope f -- j <- [|Just|] -- return $ j `AppE` f' -- ch <- [|condH|] -- return $ ch `AppE` ListE conds' `AppE` final' -- where -- go :: (Deref, [Doc]) -> Q Exp -- go (d, docs) = do -- let d' = derefToExp ((specialOrIdent, VarE 'or):scope) d -- docs' <- docsToExp env hr scope docs -- return $ TupE [d', docs'] --docToExp env hr scope (DocCase deref cases) = do -- let exp_ = derefToExp scope deref -- matches <- mapM toMatch cases -- return $ CaseE exp_ matches -- where -- toMatch :: (Binding, [Doc]) -> Q Match -- toMatch (idents, inside) = do -- (pat, extraScope) <- bindingPattern idents -- let scope' = extraScope ++ scope -- insideExp <- docsToExp env hr scope' inside -- return $ Match pat (NormalB insideExp) [] --docToExp env hr v (DocContent c) = contentToExp env hr v c -- --contentToExp :: Env -> HamletRules -> Scope -> Content -> Q Exp --contentToExp _ hr _ (ContentRaw s) = do -- os <- [|preEscapedText . pack|] -- let s' = LitE $ StringL s -- return $ hrFromHtml hr `AppE` (os `AppE` s') --contentToExp _ hr scope (ContentVar d) = do -- str <- [|toHtml|] -- return $ hrFromHtml hr `AppE` (str `AppE` derefToExp scope d) --contentToExp env hr scope (ContentUrl hasParams d) = -- case urlRender env of -- Nothing -> error "URL interpolation used, but no URL renderer provided" -- Just wrender -> wrender $ \render -> do -- let render' = return render -- ou <- if hasParams -- then [|\(u, p) -> $(render') u p|] -- else [|\u -> $(render') u []|] -- let d' = derefToExp scope d -- pet <- [|toHtml|] -- return $ hrFromHtml hr `AppE` (pet `AppE` (ou `AppE` d')) --contentToExp env hr scope (ContentEmbed d) = hrEmbed hr env $ derefToExp scope d --contentToExp env hr scope (ContentMsg d) = -- case msgRender env of -- Nothing -> error "Message interpolation used, but no message renderer provided" -- Just wrender -> wrender $ \render -> -- return $ hrFromHtml hr `AppE` (render `AppE` derefToExp scope d) --contentToExp _ hr scope (ContentAttrs d) = do -- html <- [|attrsToHtml . toAttributes|] -- return $ hrFromHtml hr `AppE` (html `AppE` derefToExp scope d) -- --shamlet :: QuasiQuoter --shamlet = hamletWithSettings htmlRules defaultHamletSettings -- --xshamlet :: QuasiQuoter --xshamlet = hamletWithSettings htmlRules xhtmlHamletSettings -- --htmlRules :: Q HamletRules --htmlRules = do -- i <- [|id|] -- return $ HamletRules i ($ (Env Nothing Nothing)) (\_ b -> return b) -- --hamlet :: QuasiQuoter --hamlet = hamletWithSettings hamletRules defaultHamletSettings -- --xhamlet :: QuasiQuoter --xhamlet = hamletWithSettings hamletRules xhtmlHamletSettings -- - asHtmlUrl :: HtmlUrl url -> HtmlUrl url - asHtmlUrl = id - --hamletRules :: Q HamletRules --hamletRules = do -- i <- [|id|] -- let ur f = do -- r <- newName "_render" -- let env = Env -- { urlRender = Just ($ (VarE r)) -- , msgRender = Nothing -- } -- h <- f env -- return $ LamE [VarP r] h -- return $ HamletRules i ur em -- where -- em (Env (Just urender) Nothing) e = do -- asHtmlUrl' <- [|asHtmlUrl|] -- urender $ \ur' -> return ((asHtmlUrl' `AppE` e) `AppE` ur') -- em _ _ = error "bad Env" -- --ihamlet :: QuasiQuoter --ihamlet = hamletWithSettings ihamletRules defaultHamletSettings -- --ihamletRules :: Q HamletRules --ihamletRules = do -- i <- [|id|] -- let ur f = do -- u <- newName "_urender" -- m <- newName "_mrender" -- let env = Env -- { urlRender = Just ($ (VarE u)) -- , msgRender = Just ($ (VarE m)) -- } -- h <- f env -- return $ LamE [VarP m, VarP u] h -- return $ HamletRules i ur em -- where -- em (Env (Just urender) (Just mrender)) e = -- urender $ \ur' -> mrender $ \mr -> return (e `AppE` mr `AppE` ur') -- em _ _ = error "bad Env" -- --hamletWithSettings :: Q HamletRules -> HamletSettings -> QuasiQuoter --hamletWithSettings hr set = -- QuasiQuoter -- { quoteExp = hamletFromString hr set -- } -- --data HamletRules = HamletRules -- { hrFromHtml :: Exp -- , hrWithEnv :: (Env -> Q Exp) -> Q Exp -- , hrEmbed :: Env -> Exp -> Q Exp -- } -- --data Env = Env -- { urlRender :: Maybe ((Exp -> Q Exp) -> Q Exp) -- , msgRender :: Maybe ((Exp -> Q Exp) -> Q Exp) -- } -- --hamletFromString :: Q HamletRules -> HamletSettings -> String -> Q Exp --hamletFromString qhr set s = do -- hr <- qhr -- hrWithEnv hr $ \env -> docsToExp env hr [] $ docFromString set s -- - docFromString :: HamletSettings -> String -> [Doc] - docFromString set s = - case parseDoc set s of - Error s' -> error s' - Ok (_, d) -> d - --hamletFileWithSettings :: Q HamletRules -> HamletSettings -> FilePath -> Q Exp --hamletFileWithSettings qhr set fp = do --#ifdef GHC_7_4 -- qAddDependentFile fp --#endif -- contents <- fmap TL.unpack $ qRunIO $ readUtf8File fp -- hamletFromString qhr set contents -- --hamletFile :: FilePath -> Q Exp --hamletFile = hamletFileWithSettings hamletRules defaultHamletSettings -- --hamletFileReload :: FilePath -> Q Exp --hamletFileReload = hamletFileReloadWithSettings runtimeRules defaultHamletSettings -- where runtimeRules = HamletRuntimeRules { hrrI18n = False } -- --ihamletFileReload :: FilePath -> Q Exp --ihamletFileReload = hamletFileReloadWithSettings runtimeRules defaultHamletSettings -- where runtimeRules = HamletRuntimeRules { hrrI18n = True } -- --xhamletFile :: FilePath -> Q Exp --xhamletFile = hamletFileWithSettings hamletRules xhtmlHamletSettings -- --shamletFile :: FilePath -> Q Exp --shamletFile = hamletFileWithSettings htmlRules defaultHamletSettings -- --xshamletFile :: FilePath -> Q Exp --xshamletFile = hamletFileWithSettings htmlRules xhtmlHamletSettings -- --ihamletFile :: FilePath -> Q Exp --ihamletFile = hamletFileWithSettings ihamletRules defaultHamletSettings -- --varName :: Scope -> String -> Exp --varName _ "" = error "Illegal empty varName" --varName scope v@(_:_) = fromMaybe (strToExp v) $ lookup (Ident v) scope -- --strToExp :: String -> Exp --strToExp s@(c:_) -- | all isDigit s = LitE $ IntegerL $ read s -- | isUpper c = ConE $ mkName s -- | otherwise = VarE $ mkName s --strToExp "" = error "strToExp on empty string" -- - -- | Checks for truth in the left value in each pair in the first argument. If - -- a true exists, then the corresponding right action is performed. Only the - -- first is performed. In there are no true values, then the second argument is -@@ -461,33 +180,6 @@ data HamletRuntimeRules = HamletRuntimeRules { - hrrI18n :: Bool - } - --hamletFileReloadWithSettings :: HamletRuntimeRules -- -> HamletSettings -> FilePath -> Q Exp --hamletFileReloadWithSettings hrr settings fp = do -- s <- readFileQ fp -- let b = hamletUsedIdentifiers settings s -- c <- mapM vtToExp b -- rt <- if hrrI18n hrr -- then [|hamletRuntimeMsg settings fp|] -- else [|hamletRuntime settings fp|] -- return $ rt `AppE` ListE c -- where -- vtToExp :: (Deref, VarType) -> Q Exp -- vtToExp (d, vt) = do -- d' <- lift d -- c' <- toExp vt -- return $ TupE [d', c' `AppE` derefToExp [] d] -- where -- toExp = c -- where -- c :: VarType -> Q Exp -- c VTAttrs = [|EPlain . attrsToHtml . toAttributes|] -- c VTPlain = [|EPlain . toHtml|] -- c VTUrl = [|EUrl|] -- c VTUrlParam = [|EUrlParam|] -- c VTMixin = [|\r -> EMixin $ \c -> r c|] -- c VTMsg = [|EMsg|] -- - -- move to Shakespeare.Base? - readFileUtf8 :: FilePath -> IO String - readFileUtf8 fp = fmap TL.unpack $ readUtf8File fp -diff --git a/Text/Julius.hs b/Text/Julius.hs -index 8c15a99..47b42fd 100644 ---- a/Text/Julius.hs -+++ b/Text/Julius.hs -@@ -14,17 +14,9 @@ module Text.Julius - -- ** Template-Reading Functions - -- | These QuasiQuoter and Template Haskell methods return values of - -- type @'JavascriptUrl' url@. See the Yesod book for details. -- js -- , julius -- , juliusFile -- , jsFile -- , juliusFileDebug -- , jsFileDebug -- , juliusFileReload -- , jsFileReload - - -- * Datatypes -- , JavascriptUrl -+ JavascriptUrl - , Javascript (..) - , RawJavascript (..) - -@@ -37,9 +29,9 @@ module Text.Julius - , renderJavascriptUrl - - -- ** internal, used by 'Text.Coffee' -- , javascriptSettings -+ --, javascriptSettings - -- ** internal -- , juliusUsedIdentifiers -+ --, juliusUsedIdentifiers - , asJavascriptUrl - ) where - -@@ -102,48 +94,3 @@ instance RawJS TL.Text where rawJS = RawJavascript . fromLazyText - instance RawJS Builder where rawJS = RawJavascript - instance RawJS Bool where rawJS = RawJavascript . unJavascript . toJavascript - --javascriptSettings :: Q ShakespeareSettings --javascriptSettings = do -- toJExp <- [|toJavascript|] -- wrapExp <- [|Javascript|] -- unWrapExp <- [|unJavascript|] -- asJavascriptUrl' <- [|asJavascriptUrl|] -- return $ defaultShakespeareSettings { toBuilder = toJExp -- , wrap = wrapExp -- , unwrap = unWrapExp -- , modifyFinalValue = Just asJavascriptUrl' -- } -- --js, julius :: QuasiQuoter --js = QuasiQuoter { quoteExp = \s -> do -- rs <- javascriptSettings -- quoteExp (shakespeare rs) s -- } -- --julius = js -- --jsFile, juliusFile :: FilePath -> Q Exp --jsFile fp = do -- rs <- javascriptSettings -- shakespeareFile rs fp -- --juliusFile = jsFile -- -- --jsFileReload, juliusFileReload :: FilePath -> Q Exp --jsFileReload fp = do -- rs <- javascriptSettings -- shakespeareFileReload rs fp -- --juliusFileReload = jsFileReload -- --jsFileDebug, juliusFileDebug :: FilePath -> Q Exp --juliusFileDebug = jsFileReload --{-# DEPRECATED juliusFileDebug "Please use juliusFileReload instead." #-} --jsFileDebug = jsFileReload --{-# DEPRECATED jsFileDebug "Please use jsFileReload instead." #-} -- ---- | Determine which identifiers are used by the given template, useful for ---- creating systems like yesod devel. --juliusUsedIdentifiers :: String -> [(Deref, VarType)] --juliusUsedIdentifiers = shakespeareUsedIdentifiers defaultShakespeareSettings -diff --git a/Text/Lucius.hs b/Text/Lucius.hs -index 3226b79..fd0b7be 100644 ---- a/Text/Lucius.hs -+++ b/Text/Lucius.hs -@@ -9,13 +9,13 @@ - {-# OPTIONS_GHC -fno-warn-missing-fields #-} - module Text.Lucius - ( -- * Parsing -- lucius -- , luciusFile -- , luciusFileDebug -- , luciusFileReload -+ -- lucius -+ --, luciusFile -+ --, luciusFileDebug -+ --, luciusFileReload - -- ** Mixins -- , luciusMixin -- , Mixin -+ --, luciusMixin -+ Mixin - -- ** Runtime - , luciusRT - , luciusRT' -@@ -37,15 +37,12 @@ module Text.Lucius - , colorRed - , colorBlack - -- ** Size -- , mkSize -+ --, mkSize - , AbsoluteUnit (..) - , AbsoluteSize (..) - , absoluteSize -- , EmSize (..) -- , ExSize (..) - , PercentageSize (..) - , percentageSize -- , PixelSize (..) - -- * Internal - , parseTopLevels - , luciusUsedIdentifiers -@@ -72,13 +69,6 @@ import Text.Shakespeare (VarType) - -- - -- >>> renderCss ([lucius|foo{bar:baz}|] undefined) - -- "foo{bar:baz}" --lucius :: QuasiQuoter --lucius = QuasiQuoter { quoteExp = luciusFromString } -- --luciusFromString :: String -> Q Exp --luciusFromString s = -- topLevelsToCassius -- $ either (error . show) id $ parse parseTopLevels s s - - whiteSpace :: Parser () - whiteSpace = many whiteSpace1 >> return () -@@ -219,18 +209,6 @@ parseComment = do - _ <- manyTill anyChar $ try $ string "*/" - return $ ContentRaw "" - --luciusFile :: FilePath -> Q Exp --luciusFile fp = do --#ifdef GHC_7_4 -- qAddDependentFile fp --#endif -- contents <- fmap TL.unpack $ qRunIO $ readUtf8File fp -- luciusFromString contents -- --luciusFileDebug, luciusFileReload :: FilePath -> Q Exp --luciusFileDebug = cssFileDebug False [|parseTopLevels|] parseTopLevels --luciusFileReload = luciusFileDebug -- - parseTopLevels :: Parser [TopLevel Unresolved] - parseTopLevels = - go id -@@ -379,14 +357,3 @@ luciusRTMinified tl scope = either Left (Right . renderCss . CssNoWhitespace) $ - luciusUsedIdentifiers :: String -> [(Deref, VarType)] - luciusUsedIdentifiers = cssUsedIdentifiers False parseTopLevels - --luciusMixin :: QuasiQuoter --luciusMixin = QuasiQuoter { quoteExp = luciusMixinFromString } -- --luciusMixinFromString :: String -> Q Exp --luciusMixinFromString s' = do -- r <- newName "_render" -- case fmap compressBlock $ parse parseBlock s s of -- Left e -> error $ show e -- Right block -> blockToMixin r [] block -- where -- s = concat ["mixin{", s', "}"] -diff --git a/Text/Roy.hs b/Text/Roy.hs -index 6e5e246..a08b019 100644 ---- a/Text/Roy.hs -+++ b/Text/Roy.hs -@@ -39,12 +39,12 @@ module Text.Roy - -- ** Template-Reading Functions - -- | These QuasiQuoter and Template Haskell methods return values of - -- type @'JavascriptUrl' url@. See the Yesod book for details. -- roy -- , royFile -- , royFileReload -+ -- roy -+ --, royFile -+ --, royFileReload - - #ifdef TEST_EXPORT -- , roySettings -+ --, roySettings - #endif - ) where - -@@ -52,47 +52,3 @@ import Language.Haskell.TH.Quote (QuasiQuoter (..)) - import Language.Haskell.TH.Syntax - import Text.Shakespeare - import Text.Julius -- ---- | The Roy language compiles down to Javascript. ---- We do this compilation once at compile time to avoid needing to do it during the request. ---- We call this a preConversion because other shakespeare modules like Lucius use Haskell to compile during the request instead rather than a system call. --roySettings :: Q ShakespeareSettings --roySettings = do -- jsettings <- javascriptSettings -- return $ jsettings { varChar = '#' -- , preConversion = Just PreConvert { -- preConvert = ReadProcess "roy" ["--stdio", "--browser"] -- , preEscapeIgnoreBalanced = "'\"" -- , preEscapeIgnoreLine = "//" -- , wrapInsertion = Just WrapInsertion { -- wrapInsertionIndent = Just " " -- , wrapInsertionStartBegin = "(\\" -- , wrapInsertionSeparator = " " -- , wrapInsertionStartClose = " ->\n" -- , wrapInsertionEnd = ")" -- , wrapInsertionAddParens = True -- } -- } -- } -- ---- | Read inline, quasiquoted Roy. --roy :: QuasiQuoter --roy = QuasiQuoter { quoteExp = \s -> do -- rs <- roySettings -- quoteExp (shakespeare rs) s -- } -- ---- | Read in a Roy template file. This function reads the file once, at ---- compile time. --royFile :: FilePath -> Q Exp --royFile fp = do -- rs <- roySettings -- shakespeareFile rs fp -- ---- | Read in a Roy template file. This impure function uses ---- unsafePerformIO to re-read the file on every call, allowing for rapid ---- iteration. --royFileReload :: FilePath -> Q Exp --royFileReload fp = do -- rs <- roySettings -- shakespeareFileReload rs fp -diff --git a/Text/Shakespeare.hs b/Text/Shakespeare.hs -index 98c0c2d..2f6431b 100644 ---- a/Text/Shakespeare.hs -+++ b/Text/Shakespeare.hs -@@ -16,12 +16,12 @@ module Text.Shakespeare - , WrapInsertion (..) - , PreConversion (..) - , defaultShakespeareSettings -- , shakespeare -- , shakespeareFile -- , shakespeareFileReload -+ -- , shakespeare -+ -- , shakespeareFile -+ -- , shakespeareFileReload - -- * low-level -- , shakespeareFromString -- , shakespeareUsedIdentifiers -+ -- , shakespeareFromString -+ -- , shakespeareUsedIdentifiers - , RenderUrl - , VarType (..) - , Deref -@@ -153,38 +153,6 @@ defaultShakespeareSettings = ShakespeareSettings { - , modifyFinalValue = Nothing - } - --instance Lift PreConvert where -- lift (PreConvert convert ignore comment wrapInsertion) = -- [|PreConvert $(lift convert) $(lift ignore) $(lift comment) $(lift wrapInsertion)|] -- --instance Lift WrapInsertion where -- lift (WrapInsertion indent sb sep sc e wp) = -- [|WrapInsertion $(lift indent) $(lift sb) $(lift sep) $(lift sc) $(lift e) $(lift wp)|] -- --instance Lift PreConversion where -- lift (ReadProcess command args) = -- [|ReadProcess $(lift command) $(lift args)|] -- lift Id = [|Id|] -- --instance Lift ShakespeareSettings where -- lift (ShakespeareSettings x1 x2 x3 x4 x5 x6 x7 x8 x9) = -- [|ShakespeareSettings -- $(lift x1) $(lift x2) $(lift x3) -- $(liftExp x4) $(liftExp x5) $(liftExp x6) $(lift x7) $(lift x8) $(liftMExp x9)|] -- where -- liftExp (VarE n) = [|VarE $(liftName n)|] -- liftExp (ConE n) = [|ConE $(liftName n)|] -- liftExp _ = error "liftExp only supports VarE and ConE" -- liftMExp Nothing = [|Nothing|] -- liftMExp (Just e) = [|Just|] `appE` liftExp e -- liftName (Name (OccName a) b) = [|Name (OccName $(lift a)) $(liftFlavour b)|] -- liftFlavour NameS = [|NameS|] -- liftFlavour (NameQ (ModName a)) = [|NameQ (ModName $(lift a))|] -- liftFlavour (NameU _) = error "liftFlavour NameU" -- [|NameU $(lift $ fromIntegral a)|] -- liftFlavour (NameL _) = error "liftFlavour NameL" -- [|NameU $(lift $ fromIntegral a)|] -- liftFlavour (NameG ns (PkgName p) (ModName m)) = [|NameG $(liftNS ns) (PkgName $(lift p)) (ModName $(lift m))|] -- liftNS VarName = [|VarName|] -- liftNS DataName = [|DataName|] - - type QueryParameters = [(TS.Text, TS.Text)] - type RenderUrl url = (url -> QueryParameters -> TS.Text) -@@ -348,6 +316,7 @@ pack' = TS.pack - {-# NOINLINE pack' #-} - #endif - -+{- - contentsToShakespeare :: ShakespeareSettings -> [Content] -> Q Exp - contentsToShakespeare rs a = do - r <- newName "_render" -@@ -399,16 +368,19 @@ shakespeareFile r fp = - qAddDependentFile fp >> - #endif - readFileQ fp >>= shakespeareFromString r -+-} - - data VarType = VTPlain | VTUrl | VTUrlParam | VTMixin - deriving (Show, Eq, Ord, Enum, Bounded, Typeable, Data, Generic) - -+{- - getVars :: Content -> [(Deref, VarType)] - getVars ContentRaw{} = [] - getVars (ContentVar d) = [(d, VTPlain)] - getVars (ContentUrl d) = [(d, VTUrl)] - getVars (ContentUrlParam d) = [(d, VTUrlParam)] - getVars (ContentMix d) = [(d, VTMixin)] -+-} - - data VarExp url = EPlain Builder - | EUrl url -@@ -417,8 +389,10 @@ data VarExp url = EPlain Builder - - -- | Determine which identifiers are used by the given template, useful for - -- creating systems like yesod devel. -+{- - shakespeareUsedIdentifiers :: ShakespeareSettings -> String -> [(Deref, VarType)] - shakespeareUsedIdentifiers settings = concatMap getVars . contentFromString settings -+-} - - type MTime = UTCTime - -@@ -435,28 +409,6 @@ insertReloadMap :: FilePath -> (MTime, [Content]) -> IO [Content] - insertReloadMap fp (mt, content) = atomicModifyIORef reloadMapRef - (\reloadMap -> (M.insert fp (mt, content) reloadMap, content)) - --shakespeareFileReload :: ShakespeareSettings -> FilePath -> Q Exp --shakespeareFileReload settings fp = do -- str <- readFileQ fp -- s <- qRunIO $ preFilter (Just fp) settings str -- let b = shakespeareUsedIdentifiers settings s -- c <- mapM vtToExp b -- rt <- [|shakespeareRuntime settings fp|] -- wrap' <- [|\x -> $(return $ wrap settings) . x|] -- return $ wrap' `AppE` (rt `AppE` ListE c) -- where -- vtToExp :: (Deref, VarType) -> Q Exp -- vtToExp (d, vt) = do -- d' <- lift d -- c' <- c vt -- return $ TupE [d', c' `AppE` derefToExp [] d] -- where -- c :: VarType -> Q Exp -- c VTPlain = [|EPlain . $(return $ -- InfixE (Just $ unwrap settings) (VarE '(.)) (Just $ toBuilder settings))|] -- c VTUrl = [|EUrl|] -- c VTUrlParam = [|EUrlParam|] -- c VTMixin = [|\x -> EMixin $ \r -> $(return $ unwrap settings) $ x r|] - - - -diff --git a/Text/Shakespeare/Base.hs b/Text/Shakespeare/Base.hs -index a0e983c..23b4692 100644 ---- a/Text/Shakespeare/Base.hs -+++ b/Text/Shakespeare/Base.hs -@@ -52,34 +52,6 @@ data Deref = DerefModulesIdent [String] Ident - | DerefTuple [Deref] - deriving (Show, Eq, Read, Data, Typeable, Ord) - --instance Lift Ident where -- lift (Ident s) = [|Ident|] `appE` lift s --instance Lift Deref where -- lift (DerefModulesIdent v s) = do -- dl <- [|DerefModulesIdent|] -- v' <- lift v -- s' <- lift s -- return $ dl `AppE` v' `AppE` s' -- lift (DerefIdent s) = do -- dl <- [|DerefIdent|] -- s' <- lift s -- return $ dl `AppE` s' -- lift (DerefBranch x y) = do -- x' <- lift x -- y' <- lift y -- db <- [|DerefBranch|] -- return $ db `AppE` x' `AppE` y' -- lift (DerefIntegral i) = [|DerefIntegral|] `appE` lift i -- lift (DerefRational r) = do -- n <- lift $ numerator r -- d <- lift $ denominator r -- per <- [|(%) :: Int -> Int -> Ratio Int|] -- dr <- [|DerefRational|] -- return $ dr `AppE` InfixE (Just n) per (Just d) -- lift (DerefString s) = [|DerefString|] `appE` lift s -- lift (DerefList x) = [|DerefList $(lift x)|] -- lift (DerefTuple x) = [|DerefTuple $(lift x)|] -- - derefParens, derefCurlyBrackets :: UserParser a Deref - derefParens = between (char '(') (char ')') parseDeref - derefCurlyBrackets = between (char '{') (char '}') parseDeref -diff --git a/Text/Shakespeare/Text.hs b/Text/Shakespeare/Text.hs -index f490d7f..5154618 100644 ---- a/Text/Shakespeare/Text.hs -+++ b/Text/Shakespeare/Text.hs -@@ -7,20 +7,20 @@ module Text.Shakespeare.Text - ( TextUrl - , ToText (..) - , renderTextUrl -- , stext -- , text -- , textFile -- , textFileDebug -- , textFileReload -- , st -- | strict text -- , lt -- | lazy text, same as stext :) -- , sbt -- | strict text whose left edge is aligned with bar ('|') -- , lbt -- | lazy text, whose left edge is aligned with bar ('|') -+ --, stext -+ --, text -+ --, textFile -+ --, textFileDebug -+ --, textFileReload -+ --, st -- | strict text -+ --, lt -- | lazy text, same as stext :) -+ --, sbt -- | strict text whose left edge is aligned with bar ('|') -+ --, lbt -- | lazy text, whose left edge is aligned with bar ('|') - -- * Yesod code generation -- , codegen -- , codegenSt -- , codegenFile -- , codegenFileReload -+ --, codegen -+ --, codegenSt -+ --, codegenFile -+ --, codegenFileReload - ) where - - import Language.Haskell.TH.Quote (QuasiQuoter (..)) -@@ -59,66 +59,12 @@ settings = do - } - - --stext, lt, st, text, lbt, sbt :: QuasiQuoter --stext = -- QuasiQuoter { quoteExp = \s -> do -- rs <- settings -- render <- [|toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } --lt = stext -- --st = -- QuasiQuoter { quoteExp = \s -> do -- rs <- settings -- render <- [|TL.toStrict . toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } -- --text = QuasiQuoter { quoteExp = \s -> do -- rs <- settings -- quoteExp (shakespeare rs) $ filter (/='\r') s -- } -- - dropBar :: [TL.Text] -> [TL.Text] - dropBar [] = [] - dropBar (c:cx) = c:dropBar' cx - where - dropBar' txt = reverse $ drop 1 $ map (TL.drop 1 . TL.dropWhile (/= '|')) $ reverse txt - --lbt = -- QuasiQuoter { quoteExp = \s -> do -- rs <- settings -- render <- [|TL.unlines . dropBar . TL.lines . toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } -- --sbt = -- QuasiQuoter { quoteExp = \s -> do -- rs <- settings -- render <- [|TL.toStrict . TL.unlines . dropBar . TL.lines . toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } -- --textFile :: FilePath -> Q Exp --textFile fp = do -- rs <- settings -- shakespeareFile rs fp -- -- --textFileDebug :: FilePath -> Q Exp --textFileDebug = textFileReload --{-# DEPRECATED textFileDebug "Please use textFileReload instead" #-} -- --textFileReload :: FilePath -> Q Exp --textFileReload fp = do -- rs <- settings -- shakespeareFileReload rs fp -- - -- | codegen is designed for generating Yesod code, including templates - -- So it uses different interpolation characters that won't clash with templates. - codegenSettings :: Q ShakespeareSettings -@@ -135,40 +81,3 @@ codegenSettings = do - , justVarInterpolation = True -- always! - } - ---- | codegen is designed for generating Yesod code, including templates ---- So it uses different interpolation characters that won't clash with templates. ---- You can use the normal text quasiquoters to generate code --codegen :: QuasiQuoter --codegen = -- QuasiQuoter { quoteExp = \s -> do -- rs <- codegenSettings -- render <- [|toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } -- ---- | Generates strict Text ---- codegen is designed for generating Yesod code, including templates ---- So it uses different interpolation characters that won't clash with templates. --codegenSt :: QuasiQuoter --codegenSt = -- QuasiQuoter { quoteExp = \s -> do -- rs <- codegenSettings -- render <- [|TL.toStrict . toLazyText|] -- rendered <- shakespeareFromString rs { justVarInterpolation = True } s -- return (render `AppE` rendered) -- } -- --codegenFileReload :: FilePath -> Q Exp --codegenFileReload fp = do -- rs <- codegenSettings -- render <- [|TL.toStrict . toLazyText|] -- rendered <- shakespeareFileReload rs{ justVarInterpolation = True } fp -- return (render `AppE` rendered) -- --codegenFile :: FilePath -> Q Exp --codegenFile fp = do -- rs <- codegenSettings -- render <- [|TL.toStrict . toLazyText|] -- rendered <- shakespeareFile rs{ justVarInterpolation = True } fp -- return (render `AppE` rendered) -diff --git a/Text/TypeScript.hs b/Text/TypeScript.hs -index 85f6abd..3188272 100644 ---- a/Text/TypeScript.hs -+++ b/Text/TypeScript.hs -@@ -57,12 +57,12 @@ module Text.TypeScript - -- ** Template-Reading Functions - -- | These QuasiQuoter and Template Haskell methods return values of - -- type @'JavascriptUrl' url@. See the Yesod book for details. -- tsc -- , typeScriptFile -- , typeScriptFileReload -+ -- tsc -+ --, typeScriptFile -+ --, typeScriptFileReload - - #ifdef TEST_EXPORT -- , typeScriptSettings -+ --, typeScriptSettings - #endif - ) where - -@@ -74,43 +74,3 @@ import Text.Julius - -- | The TypeScript language compiles down to Javascript. - -- We do this compilation once at compile time to avoid needing to do it during the request. - -- We call this a preConversion because other shakespeare modules like Lucius use Haskell to compile during the request instead rather than a system call. --typeScriptSettings :: Q ShakespeareSettings --typeScriptSettings = do -- jsettings <- javascriptSettings -- return $ jsettings { varChar = '#' -- , preConversion = Just PreConvert { -- preConvert = ReadProcess "sh" ["-c", "TMP_IN=$(mktemp XXXXXXXXXX.ts); TMP_OUT=$(mktemp XXXXXXXXXX.js); cat /dev/stdin > ${TMP_IN} && tsc --out ${TMP_OUT} ${TMP_IN} && cat ${TMP_OUT}; rm ${TMP_IN} && rm ${TMP_OUT}"] -- , preEscapeIgnoreBalanced = "'\"" -- , preEscapeIgnoreLine = "//" -- , wrapInsertion = Just WrapInsertion { -- wrapInsertionIndent = Nothing -- , wrapInsertionStartBegin = ";(function(" -- , wrapInsertionSeparator = ", " -- , wrapInsertionStartClose = "){" -- , wrapInsertionEnd = "})" -- , wrapInsertionAddParens = False -- } -- } -- } -- ---- | Read inline, quasiquoted TypeScript --tsc :: QuasiQuoter --tsc = QuasiQuoter { quoteExp = \s -> do -- rs <- typeScriptSettings -- quoteExp (shakespeare rs) s -- } -- ---- | Read in a TypeScript template file. This function reads the file once, at ---- compile time. --typeScriptFile :: FilePath -> Q Exp --typeScriptFile fp = do -- rs <- typeScriptSettings -- shakespeareFile rs fp -- ---- | Read in a TypeScript template file. This impure function uses ---- unsafePerformIO to re-read the file on every call, allowing for rapid ---- iteration. --typeScriptFileReload :: FilePath -> Q Exp --typeScriptFileReload fp = do -- rs <- typeScriptSettings -- shakespeareFileReload rs fp -diff --git a/shakespeare.cabal b/shakespeare.cabal -index 37029fc..2c4b557 100644 ---- a/shakespeare.cabal -+++ b/shakespeare.cabal -@@ -62,18 +62,16 @@ library - Text.Shakespeare.Base - Text.Shakespeare - Text.TypeScript -- other-modules: Text.Hamlet.Parse - Text.Css -+ Text.CssCommon -+ other-modules: Text.Hamlet.Parse - Text.MkSizeType - Text.IndentToBrace -- Text.CssCommon - ghc-options: -Wall - - if flag(test_export) - cpp-options: -DTEST_EXPORT - -- extensions: TemplateHaskell -- - if impl(ghc >= 7.4) - cpp-options: -DGHC_7_4 - --- -2.1.4 - diff --git a/standalone/no-th/haskell-patches/skein_hardcode_little-endian.patch b/standalone/no-th/haskell-patches/skein_hardcode_little-endian.patch deleted file mode 100644 index 7333742b00..0000000000 --- a/standalone/no-th/haskell-patches/skein_hardcode_little-endian.patch +++ /dev/null @@ -1,26 +0,0 @@ -From 3a04b41ffce4e4e87b0fedd3a1e3434a3f06cc76 Mon Sep 17 00:00:00 2001 -From: foo -Date: Sun, 22 Sep 2013 00:18:12 +0000 -Subject: [PATCH] hardcode little endian - -This is the same as building with a cabal flag. - ---- - c_impl/optimized/skein_port.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/c_impl/optimized/skein_port.h b/c_impl/optimized/skein_port.h -index a2d0fc2..6929bb0 100644 ---- a/c_impl/optimized/skein_port.h -+++ b/c_impl/optimized/skein_port.h -@@ -45,6 +45,7 @@ typedef uint64_t u64b_t; /* 64-bit unsigned integer */ - * platform-specific code instead (e.g., for big-endian CPUs). - * - */ -+#define SKEIN_NEED_SWAP (0) - #ifndef SKEIN_NEED_SWAP /* compile-time "override" for endianness? */ - - #include "brg_endian.h" /* get endianness selection */ --- -1.7.10.4 - diff --git a/standalone/no-th/haskell-patches/vector_hack-to-build-with-new-ghc.patch b/standalone/no-th/haskell-patches/vector_hack-to-build-with-new-ghc.patch deleted file mode 100644 index f89f0d60b5..0000000000 --- a/standalone/no-th/haskell-patches/vector_hack-to-build-with-new-ghc.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 6ffd4fcb7d27ec6df709d80a40a262406446a259 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Wed, 15 Oct 2014 17:00:56 +0000 -Subject: [PATCH] cross build - ---- - Data/Vector/Fusion/Stream/Monadic.hs | 1 - - Data/Vector/Unboxed/Base.hs | 13 ------------- - 2 files changed, 14 deletions(-) - -diff --git a/Data/Vector/Fusion/Stream/Monadic.hs b/Data/Vector/Fusion/Stream/Monadic.hs -index 51fec75..b089b3d 100644 ---- a/Data/Vector/Fusion/Stream/Monadic.hs -+++ b/Data/Vector/Fusion/Stream/Monadic.hs -@@ -101,7 +101,6 @@ import GHC.Exts ( SpecConstrAnnotation(..) ) - - data SPEC = SPEC | SPEC2 - #if __GLASGOW_HASKELL__ >= 700 --{-# ANN type SPEC ForceSpecConstr #-} - #endif - - emptyStream :: String -diff --git a/Data/Vector/Unboxed/Base.hs b/Data/Vector/Unboxed/Base.hs -index 00350cb..34bfc4a 100644 ---- a/Data/Vector/Unboxed/Base.hs -+++ b/Data/Vector/Unboxed/Base.hs -@@ -65,19 +65,6 @@ vectorTyCon = mkTyCon3 "vector" - vectorTyCon m s = mkTyCon $ m ++ "." ++ s - #endif - --instance Typeable1 Vector where -- typeOf1 _ = mkTyConApp (vectorTyCon "Data.Vector.Unboxed" "Vector") [] -- --instance Typeable2 MVector where -- typeOf2 _ = mkTyConApp (vectorTyCon "Data.Vector.Unboxed.Mutable" "MVector") [] -- --instance (Data a, Unbox a) => Data (Vector a) where -- gfoldl = G.gfoldl -- toConstr _ = error "toConstr" -- gunfold _ _ = error "gunfold" -- dataTypeOf _ = G.mkType "Data.Vector.Unboxed.Vector" -- dataCast1 = G.dataCast -- - -- ---- - -- Unit - -- ---- --- -2.1.1 - diff --git a/standalone/no-th/haskell-patches/wai-app-static_deal-with-TH.patch b/standalone/no-th/haskell-patches/wai-app-static_deal-with-TH.patch deleted file mode 100644 index 93314312f7..0000000000 --- a/standalone/no-th/haskell-patches/wai-app-static_deal-with-TH.patch +++ /dev/null @@ -1,82 +0,0 @@ -From 3aef808eee43c973ae1fbf6e8769d89b7f0d355b Mon Sep 17 00:00:00 2001 -From: dummy -Date: Tue, 10 Jun 2014 14:47:42 +0000 -Subject: [PATCH] deal with TH - -Export modules referenced by it. - -Should not need these icons in git-annex, so not worth using the Evil -Splicer. ---- - Network/Wai/Application/Static.hs | 4 ---- - WaiAppStatic/Storage/Embedded.hs | 8 ++++---- - wai-app-static.cabal | 4 +--- - 3 files changed, 5 insertions(+), 11 deletions(-) - -diff --git a/Network/Wai/Application/Static.hs b/Network/Wai/Application/Static.hs -index db2b835..b2c1aec 100644 ---- a/Network/Wai/Application/Static.hs -+++ b/Network/Wai/Application/Static.hs -@@ -33,8 +33,6 @@ import Control.Monad.IO.Class (liftIO) - - import Blaze.ByteString.Builder (toByteString) - --import Data.FileEmbed (embedFile) -- - import Data.Text (Text) - import qualified Data.Text as T - -@@ -198,8 +196,6 @@ staticAppPieces _ _ req sendResponse - H.status405 - [("Content-Type", "text/plain")] - "Only GET is supported" --staticAppPieces _ [".hidden", "folder.png"] _ sendResponse = sendResponse $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/folder.png")] --staticAppPieces _ [".hidden", "haskell.png"] _ sendResponse = sendResponse $ W.responseLBS H.status200 [("Content-Type", "image/png")] $ L.fromChunks [$(embedFile "images/haskell.png")] - staticAppPieces ss rawPieces req sendResponse = liftIO $ do - case toPieces rawPieces of - Just pieces -> checkPieces ss pieces req >>= response -diff --git a/WaiAppStatic/Storage/Embedded.hs b/WaiAppStatic/Storage/Embedded.hs -index daa6e50..9873d4e 100644 ---- a/WaiAppStatic/Storage/Embedded.hs -+++ b/WaiAppStatic/Storage/Embedded.hs -@@ -3,10 +3,10 @@ module WaiAppStatic.Storage.Embedded( - embeddedSettings - - -- * Template Haskell -- , Etag -- , EmbeddableEntry(..) -- , mkSettings -+ --, Etag -+ --, EmbeddableEntry(..) -+ --, mkSettings - ) where - - import WaiAppStatic.Storage.Embedded.Runtime --import WaiAppStatic.Storage.Embedded.TH -+--import WaiAppStatic.Storage.Embedded.TH -diff --git a/wai-app-static.cabal b/wai-app-static.cabal -index ef6f898..9a59d71 100644 ---- a/wai-app-static.cabal -+++ b/wai-app-static.cabal -@@ -33,7 +33,6 @@ library - , containers >= 0.2 - , time >= 1.1.4 - , old-locale >= 1.0.0.2 -- , file-embed >= 0.0.3.1 - , text >= 0.7 - , blaze-builder >= 0.2.1.4 - , base64-bytestring >= 0.1 -@@ -61,9 +60,8 @@ library - WaiAppStatic.Listing - WaiAppStatic.Types - WaiAppStatic.CmdLine -- other-modules: Util - WaiAppStatic.Storage.Embedded.Runtime -- WaiAppStatic.Storage.Embedded.TH -+ other-modules: Util - ghc-options: -Wall - extensions: CPP - --- -2.0.0 - diff --git a/standalone/no-th/haskell-patches/xml-hamlet_remove_TH.patch b/standalone/no-th/haskell-patches/xml-hamlet_remove_TH.patch deleted file mode 100644 index b6334d31f4..0000000000 --- a/standalone/no-th/haskell-patches/xml-hamlet_remove_TH.patch +++ /dev/null @@ -1,108 +0,0 @@ -From b53713fbb4f3bb6bdd25b07afcaed4940b32dfa8 Mon Sep 17 00:00:00 2001 -From: Joey Hess -Date: Wed, 18 Dec 2013 03:32:44 +0000 -Subject: [PATCH] remove TH - ---- - Text/Hamlet/XML.hs | 81 +----------------------------------------------------- - 1 file changed, 1 insertion(+), 80 deletions(-) - -diff --git a/Text/Hamlet/XML.hs b/Text/Hamlet/XML.hs -index f587410..4e830bd 100644 ---- a/Text/Hamlet/XML.hs -+++ b/Text/Hamlet/XML.hs -@@ -1,9 +1,7 @@ - {-# LANGUAGE TemplateHaskell #-} - {-# OPTIONS_GHC -fno-warn-missing-fields #-} - module Text.Hamlet.XML -- ( xml -- , xmlFile -- ) where -+ () where - - import Language.Haskell.TH.Syntax - import Language.Haskell.TH.Quote -@@ -19,80 +17,3 @@ import qualified Data.Foldable as F - import Data.Maybe (fromMaybe) - import qualified Data.Map as Map - --xml :: QuasiQuoter --xml = QuasiQuoter { quoteExp = strToExp } -- --xmlFile :: FilePath -> Q Exp --xmlFile = strToExp . TL.unpack <=< qRunIO . readUtf8File -- --strToExp :: String -> Q Exp --strToExp s = -- case parseDoc s of -- Error e -> error e -- Ok x -> docsToExp [] x -- --docsToExp :: Scope -> [Doc] -> Q Exp --docsToExp scope docs = [| concat $(fmap ListE $ mapM (docToExp scope) docs) |] -- --docToExp :: Scope -> Doc -> Q Exp --docToExp scope (DocTag name attrs cs) = -- [| [ X.NodeElement (X.Element ($(liftName name)) $(mkAttrs scope attrs) $(docsToExp scope cs)) -- ] |] --docToExp _ (DocContent (ContentRaw s)) = [| [ X.NodeContent (pack $(lift s)) ] |] --docToExp scope (DocContent (ContentVar d)) = [| [ X.NodeContent $(return $ derefToExp scope d) ] |] --docToExp scope (DocContent (ContentEmbed d)) = return $ derefToExp scope d --docToExp scope (DocForall deref ident@(Ident ident') inside) = do -- let list' = derefToExp scope deref -- name <- newName ident' -- let scope' = (ident, VarE name) : scope -- inside' <- docsToExp scope' inside -- let lam = LamE [VarP name] inside' -- [| F.concatMap $(return lam) $(return list') |] --docToExp scope (DocWith [] inside) = docsToExp scope inside --docToExp scope (DocWith ((deref, ident@(Ident name)):dis) inside) = do -- let deref' = derefToExp scope deref -- name' <- newName name -- let scope' = (ident, VarE name') : scope -- inside' <- docToExp scope' (DocWith dis inside) -- let lam = LamE [VarP name'] inside' -- return $ lam `AppE` deref' --docToExp scope (DocMaybe deref ident@(Ident name) just nothing) = do -- let deref' = derefToExp scope deref -- name' <- newName name -- let scope' = (ident, VarE name') : scope -- inside' <- docsToExp scope' just -- let inside'' = LamE [VarP name'] inside' -- nothing' <- -- case nothing of -- Nothing -> [| [] |] -- Just n -> docsToExp scope n -- [| maybe $(return nothing') $(return inside'') $(return deref') |] --docToExp scope (DocCond conds final) = do -- unit <- [| () |] -- body <- fmap GuardedB $ mapM go $ conds ++ [(DerefIdent $ Ident "otherwise", fromMaybe [] final)] -- return $ CaseE unit [Match (TupP []) body []] -- where -- go (deref, inside) = do -- inside' <- docsToExp scope inside -- return (NormalG $ derefToExp scope deref, inside') -- --mkAttrs :: Scope -> [(Maybe Deref, String, [Content])] -> Q Exp --mkAttrs _ [] = [| Map.empty |] --mkAttrs scope ((mderef, name, value):rest) = do -- rest' <- mkAttrs scope rest -- this <- [| Map.insert $(liftName name) (T.concat $(fmap ListE $ mapM go value)) |] -- let with = [| $(return this) $(return rest') |] -- case mderef of -- Nothing -> with -- Just deref -> [| if $(return $ derefToExp scope deref) then $(with) else $(return rest') |] -- where -- go (ContentRaw s) = [| pack $(lift s) |] -- go (ContentVar d) = return $ derefToExp scope d -- go ContentEmbed{} = error "Cannot use embed interpolation in attribute value" -- --liftName :: String -> Q Exp --liftName s = do -- X.Name local mns _ <- return $ fromString s -- case mns of -- Nothing -> [| X.Name (pack $(lift $ unpack local)) Nothing Nothing |] -- Just ns -> [| X.Name (pack $(lift $ unpack local)) (Just $ pack $(lift $ unpack ns)) Nothing |] --- -1.8.5.1 - diff --git a/standalone/no-th/haskell-patches/yesod-auth_don-t-really-build.patch b/standalone/no-th/haskell-patches/yesod-auth_don-t-really-build.patch deleted file mode 100644 index 3e0d0d9ba7..0000000000 --- a/standalone/no-th/haskell-patches/yesod-auth_don-t-really-build.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 583575461dc58b76c6c7e14d429f73182d49ef81 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Tue, 10 Jun 2014 20:29:51 +0000 -Subject: [PATCH] don't really build - ---- - yesod-auth.cabal | 11 ----------- - 1 file changed, 11 deletions(-) - -diff --git a/yesod-auth.cabal b/yesod-auth.cabal -index 906c08b..b4bc841 100644 ---- a/yesod-auth.cabal -+++ b/yesod-auth.cabal -@@ -65,17 +65,6 @@ library - , conduit-extra - , attoparsec-conduit - -- exposed-modules: Yesod.Auth -- Yesod.Auth.BrowserId -- Yesod.Auth.Dummy -- Yesod.Auth.Email -- Yesod.Auth.OpenId -- Yesod.Auth.Rpxnow -- Yesod.Auth.Message -- Yesod.Auth.GoogleEmail -- Yesod.Auth.GoogleEmail2 -- other-modules: Yesod.Auth.Routes -- Yesod.PasswordStore - ghc-options: -Wall - - source-repository head --- -2.0.0 - diff --git a/standalone/no-th/haskell-patches/yesod-core_expand_TH.patch b/standalone/no-th/haskell-patches/yesod-core_expand_TH.patch deleted file mode 100644 index f58fcb353e..0000000000 --- a/standalone/no-th/haskell-patches/yesod-core_expand_TH.patch +++ /dev/null @@ -1,768 +0,0 @@ -From f1feea61dcba0b16afed5ce8dd5d2433fe505461 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 16 Oct 2014 02:15:23 +0000 -Subject: [PATCH] hack TH - ---- - Yesod/Core.hs | 30 +++--- - Yesod/Core/Class/Yesod.hs | 256 ++++++++++++++++++++++++++++++--------------- - Yesod/Core/Dispatch.hs | 38 ++----- - Yesod/Core/Handler.hs | 25 ++--- - Yesod/Core/Internal/Run.hs | 6 +- - Yesod/Core/Internal/TH.hs | 111 -------------------- - Yesod/Core/Types.hs | 3 +- - Yesod/Core/Widget.hs | 32 +----- - 8 files changed, 213 insertions(+), 288 deletions(-) - -diff --git a/Yesod/Core.hs b/Yesod/Core.hs -index 9b29317..7c0792d 100644 ---- a/Yesod/Core.hs -+++ b/Yesod/Core.hs -@@ -31,16 +31,16 @@ module Yesod.Core - , unauthorizedI - -- * Logging - , LogLevel (..) -- , logDebug -- , logInfo -- , logWarn -- , logError -- , logOther -- , logDebugS -- , logInfoS -- , logWarnS -- , logErrorS -- , logOtherS -+ --, logDebug -+ --, logInfo -+ --, logWarn -+ --, logError -+ --, logOther -+ --, logDebugS -+ --, logInfoS -+ --, logWarnS -+ --, logErrorS -+ --, logOtherS - -- * Sessions - , SessionBackend (..) - , customizeSessionCookies -@@ -87,17 +87,15 @@ module Yesod.Core - , readIntegral - -- * Shakespeare - -- ** Hamlet -- , hamlet -- , shamlet -- , xhamlet -+ --, hamlet -+ -- , shamlet -+ --, xhamlet - , HtmlUrl - -- ** Julius -- , julius -+ --, julius - , JavascriptUrl - , renderJavascriptUrl - -- ** Cassius/Lucius -- , cassius -- , lucius - , CssUrl - , renderCssUrl - ) where -diff --git a/Yesod/Core/Class/Yesod.hs b/Yesod/Core/Class/Yesod.hs -index 8631d27..c40eb10 100644 ---- a/Yesod/Core/Class/Yesod.hs -+++ b/Yesod/Core/Class/Yesod.hs -@@ -5,18 +5,22 @@ - {-# LANGUAGE CPP #-} - module Yesod.Core.Class.Yesod where - --import Control.Monad.Logger (logErrorS) -+--import Control.Monad.Logger (logErrorS) - import Yesod.Core.Content - import Yesod.Core.Handler - - import Yesod.Routes.Class -+import qualified Text.Blaze.Internal -+import qualified Control.Monad.Logger -+import qualified Text.Hamlet -+import qualified Data.Foldable - - import Blaze.ByteString.Builder (Builder) - import Blaze.ByteString.Builder.Char.Utf8 (fromText) - import Control.Arrow ((***), second) - import Control.Monad (forM, when, void) - import Control.Monad.IO.Class (MonadIO (liftIO)) --import Control.Monad.Logger (LogLevel (LevelInfo, LevelOther), -+import Control.Monad.Logger (Loc, LogLevel (LevelInfo, LevelOther), - LogSource) - import qualified Data.ByteString.Char8 as S8 - import qualified Data.ByteString.Lazy as L -@@ -33,7 +37,6 @@ import qualified Data.Text.Encoding.Error as TEE - import Data.Text.Lazy.Builder (toLazyText) - import Data.Text.Lazy.Encoding (encodeUtf8) - import Data.Word (Word64) --import Language.Haskell.TH.Syntax (Loc (..)) - import Network.HTTP.Types (encodePath) - import qualified Network.Wai as W - import Data.Default (def) -@@ -94,18 +97,26 @@ class RenderRoute site => Yesod site where - defaultLayout w = do - p <- widgetToPageContent w - mmsg <- getMessage -- withUrlRenderer [hamlet| -- $newline never -- $doctype 5 -- -- -- #{pageTitle p} -- ^{pageHead p} -- <body> -- $maybe msg <- mmsg -- <p .message>#{msg} -- ^{pageBody p} -- |] -+ withUrlRenderer $ \ _render_aHra -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "<!DOCTYPE html>\n<html><head><title>"); -+ id (TBH.toHtml (pageTitle p)); -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) ""); -+ Text.Hamlet.asHtmlUrl (pageHead p) _render_aHra; -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) ""); -+ Text.Hamlet.maybeH -+ mmsg -+ (\ msg_aHrb -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

"); -+ id (TBH.toHtml msg_aHrb); -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) "

") }) -+ Nothing; -+ Text.Hamlet.asHtmlUrl (pageBody p) _render_aHra; -+ id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) "") } - - -- | Override the rendering function for a particular URL. One use case for - -- this is to offload static hosting to a different domain name to avoid -@@ -374,45 +385,103 @@ widgetToPageContent w = do - -- modernizr should be at the end of the http://www.modernizr.com/docs/#installing - -- the asynchronous loader means your page doesn't have to wait for all the js to load - let (mcomplete, asyncScripts) = asyncHelper render scripts jscript jsLoc -- regularScriptLoad = [hamlet| -- $newline never -- $forall s <- scripts -- ^{mkScriptTag s} -- $maybe j <- jscript -- $maybe s <- jsLoc -- ") }) -+ (Just -+ (do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) "") }))) -+ Nothing } -+ -+ -+ headAll = \ _render_aHsW -+ -> do { Text.Hamlet.asHtmlUrl head' _render_aHsW; -+ Data.Foldable.mapM_ -+ (\ s_aHsX -> Text.Hamlet.asHtmlUrl (mkLinkTag s_aHsX) _render_aHsW) -+ stylesheets; -+ Data.Foldable.mapM_ -+ (\ s_aHsY -+ -> do { Text.Hamlet.maybeH -+ (right (snd s_aHsY)) -+ (\ t_aHsZ -+ -> Text.Hamlet.maybeH -+ (fst s_aHsY) -+ (\ media_aHt0 -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "") }) -+ (Just -+ (do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "") }))) -+ Nothing; -+ Text.Hamlet.maybeH -+ (left (snd s_aHsY)) -+ (\ content_aHt1 -+ -> Text.Hamlet.maybeH -+ (fst s_aHsY) -+ (\ media_aHt2 -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "") }) -+ (Just -+ (do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "") }))) -+ Nothing }) -+ css; -+ case jsLoader master of { -+ BottomOfBody -> return () -+ ; BottomOfHeadAsync asyncJsLoader_aHt3 -+ -> Text.Hamlet.asHtmlUrl -+ (asyncJsLoader_aHt3 asyncScripts mcomplete) _render_aHsW -+ ; BottomOfHeadBlocking -+ -> Text.Hamlet.asHtmlUrl regularScriptLoad _render_aHsW } } -+ -+ let bodyScript = \ _render_aHt8 -> do { Text.Hamlet.asHtmlUrl body _render_aHt8; -+ Text.Hamlet.asHtmlUrl regularScriptLoad _render_aHt8 } -+ - - return $ PageContent title headAll $ - case jsLoader master of -@@ -442,10 +511,13 @@ defaultErrorHandler NotFound = selectRep $ do - r <- waiRequest - let path' = TE.decodeUtf8With TEE.lenientDecode $ W.rawPathInfo r - setTitle "Not Found" -- toWidget [hamlet| --

Not Found --

#{path'} -- |] -+ toWidget $ \ _render_aHte -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

Not Found

\n

"); -+ id (TBH.toHtml path'); -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) "

") } -+ - provideRep $ return $ object ["message" .= ("Not Found" :: Text)] - - -- For API requests. -@@ -455,10 +527,11 @@ defaultErrorHandler NotFound = selectRep $ do - defaultErrorHandler NotAuthenticated = selectRep $ do - provideRep $ defaultLayout $ do - setTitle "Not logged in" -- toWidget [hamlet| --

Not logged in --

Set the authRoute and the user will be redirected there. -- |] -+ toWidget $ \ _render_aHti -+ -> id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

Not logged in

\n

Set the authRoute and the user will be redirected there.

") -+ - - provideRep $ do - -- 401 *MUST* include a WWW-Authenticate header -@@ -480,10 +553,13 @@ defaultErrorHandler NotAuthenticated = selectRep $ do - defaultErrorHandler (PermissionDenied msg) = selectRep $ do - provideRep $ defaultLayout $ do - setTitle "Permission Denied" -- toWidget [hamlet| --

Permission denied --

#{msg} -- |] -+ toWidget $ \ _render_aHtq -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

Permission denied

\n

"); -+ id (TBH.toHtml msg); -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) "

") } -+ - provideRep $ - return $ object $ [ - "message" .= ("Permission Denied. " <> msg) -@@ -492,30 +568,42 @@ defaultErrorHandler (PermissionDenied msg) = selectRep $ do - defaultErrorHandler (InvalidArgs ia) = selectRep $ do - provideRep $ defaultLayout $ do - setTitle "Invalid Arguments" -- toWidget [hamlet| --

Invalid Arguments --
    -- $forall msg <- ia --
  • #{msg} -- |] -+ toWidget $ \ _render_aHtv -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

    Invalid Arguments

    \n
      "); -+ Data.Foldable.mapM_ -+ (\ msg_aHtw -+ -> do { id ((Text.Blaze.Internal.preEscapedText . T.pack) "
    • "); -+ id (TBH.toHtml msg_aHtw); -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) "
    • ") }) -+ ia; -+ id ((Text.Blaze.Internal.preEscapedText . T.pack) "
    ") } -+ - provideRep $ return $ object ["message" .= ("Invalid Arguments" :: Text), "errors" .= ia] - defaultErrorHandler (InternalError e) = do -- $logErrorS "yesod-core" e - selectRep $ do - provideRep $ defaultLayout $ do - setTitle "Internal Server Error" -- toWidget [hamlet| --

    Internal Server Error --
    #{e}
    --            |]
    -+            toWidget  $             \ _render_aHtC
    -+              -> do { id
    -+                        ((Text.Blaze.Internal.preEscapedText . T.pack)
    -+                           "

    Internal Server Error

    \n
    ");
    -+                      id (TBH.toHtml e);
    -+                      id ((Text.Blaze.Internal.preEscapedText . T.pack) "
    ") } -+ - provideRep $ return $ object ["message" .= ("Internal Server Error" :: Text), "error" .= e] - defaultErrorHandler (BadMethod m) = selectRep $ do - provideRep $ defaultLayout $ do - setTitle"Bad Method" -- toWidget [hamlet| --

    Method Not Supported --

    Method #{S8.unpack m} not supported -- |] -+ toWidget $ \ _render_aHtH -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "

    Method Not Supported

    \n

    Method "); -+ id (TBH.toHtml (S8.unpack m)); -+ id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ " not supported

    ") } - provideRep $ return $ object ["message" .= ("Bad method" :: Text), "method" .= TE.decodeUtf8With TEE.lenientDecode m] - - asyncHelper :: (url -> [x] -> Text) -@@ -682,8 +770,4 @@ loadClientSession key getCachedDate sessionName req = load - -- turn the TH Loc loaction information into a human readable string - -- leaving out the loc_end parameter - fileLocationToString :: Loc -> String --fileLocationToString loc = (loc_package loc) ++ ':' : (loc_module loc) ++ -- ' ' : (loc_filename loc) ++ ':' : (line loc) ++ ':' : (char loc) -- where -- line = show . fst . loc_start -- char = show . snd . loc_start -+fileLocationToString loc = "unknown" -diff --git a/Yesod/Core/Dispatch.hs b/Yesod/Core/Dispatch.hs -index e0d1f0e..cc23fdd 100644 ---- a/Yesod/Core/Dispatch.hs -+++ b/Yesod/Core/Dispatch.hs -@@ -1,4 +1,3 @@ --{-# LANGUAGE TemplateHaskell #-} - {-# LANGUAGE OverloadedStrings #-} - {-# LANGUAGE TypeFamilies #-} - {-# LANGUAGE FlexibleInstances #-} -@@ -6,18 +5,18 @@ - {-# LANGUAGE CPP #-} - module Yesod.Core.Dispatch - ( -- * Quasi-quoted routing -- parseRoutes -- , parseRoutesNoCheck -- , parseRoutesFile -- , parseRoutesFileNoCheck -- , mkYesod -+ -- parseRoutes -+ --, parseRoutesNoCheck -+ --, parseRoutesFile -+ --, parseRoutesFileNoCheck -+ --, mkYesod - -- ** More fine-grained -- , mkYesodData -- , mkYesodSubData -- , mkYesodDispatch -- , mkYesodSubDispatch -+ --, mkYesodData -+ --, mkYesodSubData -+ --, mkYesodDispatch -+ --, mkYesodSubDispatch - -- ** Path pieces -- , PathPiece (..) -+ PathPiece (..) - , PathMultiPiece (..) - , Texts - -- * Convert to WAI -@@ -135,13 +134,6 @@ toWaiAppLogger logger site = do - , yreSite = site - , yreSessionBackend = sb - } -- messageLoggerSource -- site -- logger -- $(qLocation >>= liftLoc) -- "yesod-core" -- LevelInfo -- (toLogStr ("Application launched" :: S.ByteString)) - middleware <- mkDefaultMiddlewares logger - return $ middleware $ toWaiAppYre yre - -@@ -170,14 +162,7 @@ warp port site = do - ] - -} - , Network.Wai.Handler.Warp.settingsOnException = const $ \e -> -- when (shouldLog' e) $ -- messageLoggerSource -- site -- logger -- $(qLocation >>= liftLoc) -- "yesod-core" -- LevelError -- (toLogStr $ "Exception from Warp: " ++ show e) -+ when (shouldLog' e) $ error (show e) - } - where - shouldLog' = -@@ -211,7 +196,6 @@ defaultMiddlewaresNoLogging = acceptOverride . autohead . gzip def . methodOverr - -- | Deprecated synonym for 'warp'. - warpDebug :: YesodDispatch site => Int -> site -> IO () - warpDebug = warp --{-# DEPRECATED warpDebug "Please use warp instead" #-} - - -- | Runs your application using default middlewares (i.e., via 'toWaiApp'). It - -- reads port information from the PORT environment variable, as used by tools -diff --git a/Yesod/Core/Handler.hs b/Yesod/Core/Handler.hs -index d2b196b..13cac17 100644 ---- a/Yesod/Core/Handler.hs -+++ b/Yesod/Core/Handler.hs -@@ -174,7 +174,7 @@ import Data.Text.Encoding (decodeUtf8With, encodeUtf8) - import Data.Text.Encoding.Error (lenientDecode) - import qualified Data.Text.Lazy as TL - import qualified Text.Blaze.Html.Renderer.Text as RenderText --import Text.Hamlet (Html, HtmlUrl, hamlet) -+import Text.Hamlet (Html, HtmlUrl) - - import qualified Data.ByteString as S - import qualified Data.ByteString.Lazy as L -@@ -203,6 +203,7 @@ import Control.Exception (throwIO) - import Blaze.ByteString.Builder (Builder) - import Safe (headMay) - import Data.CaseInsensitive (CI) -+import qualified Text.Blaze.Internal - import qualified Data.Conduit.List as CL - import Control.Monad (unless) - import Control.Monad.Trans.Resource (MonadResource, InternalState, runResourceT, withInternalState, getInternalState, liftResourceT, resourceForkIO -@@ -855,19 +856,15 @@ redirectToPost :: (MonadHandler m, RedirectUrl (HandlerSite m) url) - -> m a - redirectToPost url = do - urlText <- toTextUrl url -- withUrlRenderer [hamlet| --$newline never --$doctype 5 -- -- -- -- Redirecting... -- <body onload="document.getElementById('form').submit()"> -- <form id="form" method="post" action=#{urlText}> -- <noscript> -- <p>Javascript has been disabled; please click on the button below to be redirected. -- <input type="submit" value="Continue"> --|] >>= sendResponse -+ withUrlRenderer $ \ _render_awps -+ -> do { id -+ ((Text.Blaze.Internal.preEscapedText . T.pack) -+ "<!DOCTYPE html>\n<html><head><title>Redirecting...
    ") } -+ >>= sendResponse - - -- | Wraps the 'Content' generated by 'hamletToContent' in a 'RepHtml'. - hamletToRepHtml :: MonadHandler m => HtmlUrl (Route (HandlerSite m)) -> m Html -diff --git a/Yesod/Core/Internal/Run.hs b/Yesod/Core/Internal/Run.hs -index 311f208..63f666f 100644 ---- a/Yesod/Core/Internal/Run.hs -+++ b/Yesod/Core/Internal/Run.hs -@@ -16,7 +16,7 @@ import Control.Exception.Lifted (catch) - import Control.Monad (mplus) - import Control.Monad.IO.Class (MonadIO) - import Control.Monad.IO.Class (liftIO) --import Control.Monad.Logger (LogLevel (LevelError), LogSource, -+import Control.Monad.Logger (Loc, LogLevel (LevelError), LogSource, - liftLoc) - import Control.Monad.Trans.Resource (runResourceT, withInternalState, runInternalState, createInternalState, closeInternalState) - import qualified Data.ByteString as S -@@ -31,7 +31,7 @@ import qualified Data.Text as T - import Data.Text.Encoding (encodeUtf8) - import Data.Text.Encoding (decodeUtf8With) - import Data.Text.Encoding.Error (lenientDecode) --import Language.Haskell.TH.Syntax (Loc, qLocation) -+import Language.Haskell.TH.Syntax (qLocation) - import qualified Network.HTTP.Types as H - import Network.Wai - #if MIN_VERSION_wai(2, 0, 0) -@@ -158,8 +158,6 @@ safeEh :: (Loc -> LogSource -> LogLevel -> LogStr -> IO ()) - -> ErrorResponse - -> YesodApp - safeEh log' er req = do -- liftIO $ log' $(qLocation >>= liftLoc) "yesod-core" LevelError -- $ toLogStr $ "Error handler errored out: " ++ show er - return $ YRPlain - H.status500 - [] -diff --git a/Yesod/Core/Internal/TH.hs b/Yesod/Core/Internal/TH.hs -index 7e84c1c..a273c29 100644 ---- a/Yesod/Core/Internal/TH.hs -+++ b/Yesod/Core/Internal/TH.hs -@@ -23,114 +23,3 @@ import Yesod.Core.Content - import Yesod.Core.Class.Dispatch - import Yesod.Core.Internal.Run - ---- | Generates URL datatype and site function for the given 'Resource's. This ---- is used for creating sites, /not/ subsites. See 'mkYesodSub' for the latter. ---- Use 'parseRoutes' to create the 'Resource's. --mkYesod :: String -- ^ name of the argument datatype -- -> [ResourceTree String] -- -> Q [Dec] --mkYesod name = fmap (uncurry (++)) . mkYesodGeneral name [] False -- ---- | Sometimes, you will want to declare your routes in one file and define ---- your handlers elsewhere. For example, this is the only way to break up a ---- monolithic file into smaller parts. Use this function, paired with ---- 'mkYesodDispatch', to do just that. --mkYesodData :: String -> [ResourceTree String] -> Q [Dec] --mkYesodData name res = mkYesodDataGeneral name False res -- --mkYesodSubData :: String -> [ResourceTree String] -> Q [Dec] --mkYesodSubData name res = mkYesodDataGeneral name True res -- --mkYesodDataGeneral :: String -> Bool -> [ResourceTree String] -> Q [Dec] --mkYesodDataGeneral name isSub res = do -- let (name':rest) = words name -- fmap fst $ mkYesodGeneral name' rest isSub res -- ---- | See 'mkYesodData'. --mkYesodDispatch :: String -> [ResourceTree String] -> Q [Dec] --mkYesodDispatch name = fmap snd . mkYesodGeneral name [] False -- ---- | Get the Handler and Widget type synonyms for the given site. --masterTypeSyns :: Type -> [Dec] --masterTypeSyns site = -- [ TySynD (mkName "Handler") [] -- $ ConT ''HandlerT `AppT` site `AppT` ConT ''IO -- , TySynD (mkName "Widget") [] -- $ ConT ''WidgetT `AppT` site `AppT` ConT ''IO `AppT` ConT ''() -- ] -- --mkYesodGeneral :: String -- ^ foundation type -- -> [String] -- ^ arguments for the type -- -> Bool -- ^ it this a subsite -- -> [ResourceTree String] -- -> Q([Dec],[Dec]) --mkYesodGeneral name args isSub resS = do -- renderRouteDec <- mkRenderRouteInstance site res -- routeAttrsDec <- mkRouteAttrsInstance site res -- dispatchDec <- mkDispatchInstance site res -- parse <- mkParseRouteInstance site res -- let rname = mkName $ "resources" ++ name -- eres <- lift resS -- let resourcesDec = -- [ SigD rname $ ListT `AppT` (ConT ''ResourceTree `AppT` ConT ''String) -- , FunD rname [Clause [] (NormalB eres) []] -- ] -- let dataDec = concat -- [ [parse] -- , renderRouteDec -- , [routeAttrsDec] -- , resourcesDec -- , if isSub then [] else masterTypeSyns site -- ] -- return (dataDec, dispatchDec) -- where site = foldl' AppT (ConT $ mkName name) (map (VarT . mkName) args) -- res = map (fmap parseType) resS -- --mkMDS :: Q Exp -> MkDispatchSettings --mkMDS rh = MkDispatchSettings -- { mdsRunHandler = rh -- , mdsSubDispatcher = -- [|\parentRunner getSub toParent env -> yesodSubDispatch -- YesodSubRunnerEnv -- { ysreParentRunner = parentRunner -- , ysreGetSub = getSub -- , ysreToParentRoute = toParent -- , ysreParentEnv = env -- } -- |] -- , mdsGetPathInfo = [|W.pathInfo|] -- , mdsSetPathInfo = [|\p r -> r { W.pathInfo = p }|] -- , mdsMethod = [|W.requestMethod|] -- , mds404 = [|notFound >> return ()|] -- , mds405 = [|badMethod >> return ()|] -- , mdsGetHandler = defaultGetHandler -- } -- ---- | If the generation of @'YesodDispatch'@ instance require finer ---- control of the types, contexts etc. using this combinator. You will ---- hardly need this generality. However, in certain situations, like ---- when writing library/plugin for yesod, this combinator becomes ---- handy. --mkDispatchInstance :: Type -- ^ The master site type -- -> [ResourceTree a] -- ^ The resource -- -> DecsQ --mkDispatchInstance master res = do -- clause' <- mkDispatchClause (mkMDS [|yesodRunner|]) res -- let thisDispatch = FunD 'yesodDispatch [clause'] -- return [InstanceD [] yDispatch [thisDispatch]] -- where -- yDispatch = ConT ''YesodDispatch `AppT` master -- --mkYesodSubDispatch :: [ResourceTree a] -> Q Exp --mkYesodSubDispatch res = do -- clause' <- mkDispatchClause (mkMDS [|subHelper . fmap toTypedContent|]) res -- inner <- newName "inner" -- let innerFun = FunD inner [clause'] -- helper <- newName "helper" -- let fun = FunD helper -- [ Clause -- [] -- (NormalB $ VarE inner) -- [innerFun] -- ] -- return $ LetE [fun] (VarE helper) -diff --git a/Yesod/Core/Types.hs b/Yesod/Core/Types.hs -index 388dfe3..b3fce0f 100644 ---- a/Yesod/Core/Types.hs -+++ b/Yesod/Core/Types.hs -@@ -21,6 +21,7 @@ import Control.Monad.Catch (MonadCatch (..)) - import Control.Monad.Catch (MonadMask (..)) - #endif - import Control.Monad.IO.Class (MonadIO (liftIO)) -+import qualified Control.Monad.Logger - import Control.Monad.Logger (LogLevel, LogSource, - MonadLogger (..)) - import Control.Monad.Trans.Control (MonadBaseControl (..)) -@@ -191,7 +192,7 @@ data RunHandlerEnv site = RunHandlerEnv - , rheRoute :: !(Maybe (Route site)) - , rheSite :: !site - , rheUpload :: !(RequestBodyLength -> FileUpload) -- , rheLog :: !(Loc -> LogSource -> LogLevel -> LogStr -> IO ()) -+ , rheLog :: !(Control.Monad.Logger.Loc -> LogSource -> LogLevel -> LogStr -> IO ()) - , rheOnError :: !(ErrorResponse -> YesodApp) - -- ^ How to respond when an error is thrown internally. - -- -diff --git a/Yesod/Core/Widget.hs b/Yesod/Core/Widget.hs -index 481199e..8489fbe 100644 ---- a/Yesod/Core/Widget.hs -+++ b/Yesod/Core/Widget.hs -@@ -16,8 +16,8 @@ module Yesod.Core.Widget - WidgetT - , PageContent (..) - -- * Special Hamlet quasiquoter/TH for Widgets -- , whamlet -- , whamletFile -+ --, whamlet -+ --, whamletFile - , ihamletToRepHtml - , ihamletToHtml - -- * Convert to Widget -@@ -46,7 +46,7 @@ module Yesod.Core.Widget - , widgetToParentWidget - , handlerToWidget - -- * Internal -- , whamletFileWithSettings -+ --, whamletFileWithSettings - , asWidgetT - ) where - -@@ -207,35 +207,9 @@ addScriptRemote = flip addScriptRemoteAttrs [] - addScriptRemoteAttrs :: MonadWidget m => Text -> [(Text, Text)] -> m () - addScriptRemoteAttrs x y = tell $ GWData mempty mempty (toUnique $ Script (Remote x) y) mempty mempty mempty mempty - --whamlet :: QuasiQuoter --whamlet = NP.hamletWithSettings rules NP.defaultHamletSettings -- --whamletFile :: FilePath -> Q Exp --whamletFile = NP.hamletFileWithSettings rules NP.defaultHamletSettings -- --whamletFileWithSettings :: NP.HamletSettings -> FilePath -> Q Exp --whamletFileWithSettings = NP.hamletFileWithSettings rules -- - asWidgetT :: WidgetT site m () -> WidgetT site m () - asWidgetT = id - --rules :: Q NP.HamletRules --rules = do -- ah <- [|asWidgetT . toWidget|] -- let helper qg f = do -- x <- newName "urender" -- e <- f $ VarE x -- let e' = LamE [VarP x] e -- g <- qg -- bind <- [|(>>=)|] -- return $ InfixE (Just g) bind (Just e') -- let ur f = do -- let env = NP.Env -- (Just $ helper [|getUrlRenderParams|]) -- (Just $ helper [|liftM (toHtml .) getMessageRender|]) -- f env -- return $ NP.HamletRules ah ur $ \_ b -> return $ ah `AppE` b -- - -- | Wraps the 'Content' generated by 'hamletToContent' in a 'RepHtml'. - ihamletToRepHtml :: (MonadHandler m, RenderMessage (HandlerSite m) message) - => HtmlUrlI18n message (Route (HandlerSite m)) --- -2.1.1 - diff --git a/standalone/no-th/haskell-patches/yesod-form_spliced-TH.patch b/standalone/no-th/haskell-patches/yesod-form_spliced-TH.patch deleted file mode 100644 index 84314a8d93..0000000000 --- a/standalone/no-th/haskell-patches/yesod-form_spliced-TH.patch +++ /dev/null @@ -1,2086 +0,0 @@ -From 1b24ece1a40c9365f719472ca6e342c8c4065c25 Mon Sep 17 00:00:00 2001 -From: dummy -Date: Thu, 16 Oct 2014 02:31:20 +0000 -Subject: [PATCH] hack TH - ---- - Yesod/Form/Bootstrap3.hs | 186 +++++++++-- - Yesod/Form/Fields.hs | 816 +++++++++++++++++++++++++++++++++++------------ - Yesod/Form/Functions.hs | 257 ++++++++++++--- - Yesod/Form/Jquery.hs | 134 ++++++-- - Yesod/Form/MassInput.hs | 226 ++++++++++--- - Yesod/Form/Nic.hs | 67 +++- - 6 files changed, 1322 insertions(+), 364 deletions(-) - -diff --git a/Yesod/Form/Bootstrap3.hs b/Yesod/Form/Bootstrap3.hs -index 84e85fc..1954fb4 100644 ---- a/Yesod/Form/Bootstrap3.hs -+++ b/Yesod/Form/Bootstrap3.hs -@@ -26,6 +26,9 @@ import Data.String (IsString(..)) - import Yesod.Core - - import qualified Data.Text as T -+import qualified Text.Hamlet -+import qualified Text.Blaze.Internal -+import qualified Data.Foldable - - import Yesod.Form.Types - import Yesod.Form.Functions -@@ -152,44 +155,144 @@ renderBootstrap3 formLayout aform fragment = do - let views = views' [] - has (Just _) = True - has Nothing = False -- widget = [whamlet| -- $newline never -- #{fragment} -- $forall view <- views --
    -- $case formLayout -- $of BootstrapBasicForm -- $if fvId view /= bootstrapSubmitId --