diff options
Diffstat (limited to 'standalone/android/haskell-patches')
3 files changed, 226 insertions, 26 deletions
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 index f58688edc..962a64207 100644 --- 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 @@ -1,20 +1,15 @@ -From 99f349066fc960bfa60b4e369bb21431c87d9b59 Mon Sep 17 00:00:00 2001 +From 087f1ae5e17f0e6d7c9f6b4092a5bb5bb6f5bf60 Mon Sep 17 00:00:00 2001 From: dummy <dummy@example.com> -Date: Tue, 14 Oct 2014 03:54:57 +0000 -Subject: [PATCH] use android net.dns1 command instead of resolv.conf file +Date: Thu, 16 Oct 2014 02:59:11 +0000 +Subject: [PATCH] port -Android has no /etc/resolv.conf. Some might have /system/etc/resolv.conf, -but even that does not seem likely. - -This is likely a little slow, but is at least fine for git-annex's uses, -since it only uses this library for occasional SRV lookups. --- - Network/DNS/Resolver.hs | 11 +++++++++-- - dns.cabal | 1 + - 2 files changed, 10 insertions(+), 2 deletions(-) + 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 9e8342b..4c6c380 100644 +index 5721e03..c4400d1 100644 --- a/Network/DNS/Resolver.hs +++ b/Network/DNS/Resolver.hs @@ -19,7 +19,7 @@ module Network.DNS.Resolver ( @@ -23,10 +18,10 @@ index 9e8342b..4c6c380 100644 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) - import Data.Maybe (fromMaybe) -@@ -33,6 +33,7 @@ import Network.Socket (AddrInfoFlag(..), AddrInfo(..), SockAddr(..), PortNumber( +@@ -32,6 +32,7 @@ import Network.Socket (AddrInfoFlag(..), AddrInfo(..), defaultHints, getAddrInfo import Prelude hiding (lookup) import System.Random (getStdRandom, randomR) import System.Timeout (timeout) @@ -34,26 +29,28 @@ index 9e8342b..4c6c380 100644 #if mingw32_HOST_OS == 1 import Network.Socket (send) -@@ -133,7 +134,13 @@ makeResolvSeed conf = ResolvSeed <$> addr +@@ -130,10 +131,12 @@ makeResolvSeed conf = ResolvSeed <$> addr + where addr = case resolvInfo conf of - RCHostName numhost -> makeAddrInfo numhost Nothing - RCHostPort numhost mport -> makeAddrInfo numhost $ Just mport -- RCFilePath file -> toAddr <$> readFile file >>= \i -> makeAddrInfo i Nothing + 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]) -+ let addr = case ls of ++ makeAddrInfo $ case ls of + [] -> "8.8.8.8" -- google public dns as a fallback only + (l:_) -> l -+ makeAddrInfo addr Nothing - toAddr cs = let l:_ = filter ("nameserver" `isPrefixOf`) $ lines cs - in extract l - extract = reverse . dropWhile isSpace . reverse . dropWhile isSpace . drop 11 + + makeAddrInfo :: HostName -> IO AddrInfo + makeAddrInfo addr = do diff --git a/dns.cabal b/dns.cabal -index fd7d7a3..5ad8a84 100644 +index ceaf5f4..cd15e61 100644 --- a/dns.cabal +++ b/dns.cabal -@@ -38,6 +38,7 @@ Library +@@ -37,6 +37,7 @@ Library , network >= 2.3 , random , resourcet @@ -62,5 +59,5 @@ index fd7d7a3..5ad8a84 100644 Build-Depends: base >= 4 && < 5 , attoparsec -- -1.7.10.4 +2.1.1 diff --git a/standalone/android/haskell-patches/gnuidn_fix-build-with-new-base.patch b/standalone/android/haskell-patches/gnuidn_fix-build-with-new-base.patch new file mode 100644 index 000000000..ff9d8f245 --- /dev/null +++ b/standalone/android/haskell-patches/gnuidn_fix-build-with-new-base.patch @@ -0,0 +1,50 @@ +From afdec6c9e66211a0ac8419fffe191b059d1fd00c Mon Sep 17 00:00:00 2001 +From: foo <foo@bar> +Date: Sun, 22 Sep 2013 17:24:33 +0000 +Subject: [PATCH] fix build with new base + +--- + Data/Text/IDN/IDNA.chs | 1 + + Data/Text/IDN/Punycode.chs | 1 + + Data/Text/IDN/StringPrep.chs | 1 + + 3 files changed, 3 insertions(+) + +diff --git a/Data/Text/IDN/IDNA.chs b/Data/Text/IDN/IDNA.chs +index ed29ee4..dbb4ba5 100644 +--- a/Data/Text/IDN/IDNA.chs ++++ b/Data/Text/IDN/IDNA.chs +@@ -31,6 +31,7 @@ import Foreign + import Foreign.C + + import Data.Text.IDN.Internal ++import System.IO.Unsafe + + #include <idna.h> + #include <idn-free.h> +diff --git a/Data/Text/IDN/Punycode.chs b/Data/Text/IDN/Punycode.chs +index 24b5fa6..4e62555 100644 +--- a/Data/Text/IDN/Punycode.chs ++++ b/Data/Text/IDN/Punycode.chs +@@ -32,6 +32,7 @@ import Data.List (unfoldr) + import qualified Data.ByteString as B + import qualified Data.Text as T + ++import System.IO.Unsafe + import Foreign + import Foreign.C + +diff --git a/Data/Text/IDN/StringPrep.chs b/Data/Text/IDN/StringPrep.chs +index 752dc9e..5e9fd84 100644 +--- a/Data/Text/IDN/StringPrep.chs ++++ b/Data/Text/IDN/StringPrep.chs +@@ -39,6 +39,7 @@ import qualified Data.ByteString as B + import qualified Data.Text as T + import qualified Data.Text.Encoding as TE + ++import System.IO.Unsafe + import Foreign + import Foreign.C + +-- +1.7.10.4 + diff --git a/standalone/android/haskell-patches/shakespeare-text_remove-TH.patch b/standalone/android/haskell-patches/shakespeare-text_remove-TH.patch new file mode 100644 index 000000000..ece906f4b --- /dev/null +++ b/standalone/android/haskell-patches/shakespeare-text_remove-TH.patch @@ -0,0 +1,153 @@ +From dca2a30ca06865bf66cd25cc14b06f5d28190231 Mon Sep 17 00:00:00 2001 +From: dummy <dummy@example.com> +Date: Thu, 16 Oct 2014 02:46:57 +0000 +Subject: [PATCH] remove TH + +--- + Text/Shakespeare/Text.hs | 125 +++++------------------------------------------ + 1 file changed, 11 insertions(+), 114 deletions(-) + +diff --git a/Text/Shakespeare/Text.hs b/Text/Shakespeare/Text.hs +index 6865a5a..e25a8be 100644 +--- a/Text/Shakespeare/Text.hs ++++ b/Text/Shakespeare/Text.hs +@@ -7,18 +7,18 @@ module Text.Shakespeare.Text + ( TextUrl + , ToText (..) + , renderTextUrl +- , stext +- , text +- , textFile +- , textFileDebug +- , textFileReload +- , st -- | strict text +- , lt -- | lazy text, same as stext :) ++ --, stext ++ --, text ++ --, textFile ++ --, textFileDebug ++ --, textFileReload ++ --, st -- | strict text ++ --, lt -- | lazy text, same as stext :) + -- * Yesod code generation +- , codegen +- , codegenSt +- , codegenFile +- , codegenFileReload ++ --, codegen ++ --, codegenSt ++ --, codegenFile ++ --, codegenFileReload + ) where + + import Language.Haskell.TH.Quote (QuasiQuoter (..)) +@@ -45,106 +45,3 @@ instance ToText Int32 where toText = toText . show + instance ToText Int64 where toText = toText . show + instance ToText Int where toText = toText . show + +-settings :: Q ShakespeareSettings +-settings = do +- toTExp <- [|toText|] +- wrapExp <- [|id|] +- unWrapExp <- [|id|] +- return $ defaultShakespeareSettings { toBuilder = toTExp +- , wrap = wrapExp +- , unwrap = unWrapExp +- } +- +- +-stext, lt, st, text :: 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 +- } +- +- +-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 +-codegenSettings = do +- toTExp <- [|toText|] +- wrapExp <- [|id|] +- unWrapExp <- [|id|] +- return $ defaultShakespeareSettings { toBuilder = toTExp +- , wrap = wrapExp +- , unwrap = unWrapExp +- , varChar = '~' +- , urlChar = '*' +- , intChar = '&' +- , 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) +-- +2.1.1 + |