From 26c60e07ef7c903fa90b0b8ae70f7c259b230ded Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Thu, 16 Oct 2014 00:31:59 -0400 Subject: finished convering android build to pinned packages Package versions match Debian jessie, except for a few differences needed due to the different version of ghc pulling in a few buildin packages with other versions. Most of the patches were cherry-picked from past commits, since these are older versions. --- standalone/android/cabal.config | 22 +-- ...d-net.dns1-command-instead-of-resolv.conf.patch | 49 ++++--- .../gnuidn_fix-build-with-new-base.patch | 50 +++++++ .../shakespeare-text_remove-TH.patch | 153 +++++++++++++++++++++ standalone/android/install-haskell-packages | 13 +- 5 files changed, 244 insertions(+), 43 deletions(-) create mode 100644 standalone/android/haskell-patches/gnuidn_fix-build-with-new-base.patch create mode 100644 standalone/android/haskell-patches/shakespeare-text_remove-TH.patch (limited to 'standalone/android') diff --git a/standalone/android/cabal.config b/standalone/android/cabal.config index 7b6d4b909..4eecbfeaf 100644 --- a/standalone/android/cabal.config +++ b/standalone/android/cabal.config @@ -2,13 +2,13 @@ constraints: Crypto ==4.2.5.1, DAV ==1.0.3, HTTP ==4000.2.17, HUnit ==1.2.5.2, - IfElse ==0.85.0.0.1, + IfElse ==0.85, MissingH ==1.2.1.0, MonadRandom ==0.1.13, QuickCheck ==2.7.6, SHA ==1.6.1, SafeSemaphore ==0.10.1, - aeson ==0.7.0.4, + aeson ==0.7.0.6, ansi-terminal ==0.6.1.1, ansi-wl-pprint ==0.6.7.1, appar ==0.1.4, @@ -16,17 +16,17 @@ constraints: Crypto ==4.2.5.1, asn1-parse ==0.8.1, asn1-types ==0.2.3, async ==2.0.1.5, - attoparsec ==0.10.4.0, + 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 ==1.2.6.10, + bloomfilter ==2.0.0.0, byteable ==0.1.1, byteorder ==1.0.4, - case-insensitive ==1.1.0.2, + case-insensitive ==1.2.0.1, cereal ==0.4.0.1, cipher-aes ==0.2.8, cipher-des ==0.0.6, @@ -48,6 +48,7 @@ constraints: Crypto ==4.2.5.1, cryptohash ==0.11.6, cryptohash-conduit ==0.1.1, css-text ==0.1.2.1, + shakespeare-text ==1.0.2, data-default ==0.5.3, data-default-class ==0.0.1, data-default-instances-base ==0.0.1, @@ -72,7 +73,6 @@ constraints: Crypto ==4.2.5.1, file-embed ==0.0.6, fingertree ==0.1.0.0, free ==4.9, - git-annex ==5.20141013, gnuidn ==0.2, gnutls ==0.1.4, gsasl ==0.3.5, @@ -97,7 +97,7 @@ constraints: Crypto ==4.2.5.1, keys ==3.10.1, language-javascript ==0.5.13, lens ==4.4.0.2, - libxml-sax ==0.7.3, + libxml-sax ==0.7.5, mime-mail ==0.4.1.2, mime-types ==0.1.0.4, mmorph ==1.0.3, @@ -153,7 +153,7 @@ constraints: Crypto ==4.2.5.1, stringprep ==0.1.5, stringsearch ==0.3.6.5, syb ==0.4.0, - system-fileio ==0.3.11, + system-fileio ==0.3.14, system-filepath ==0.4.12, tagged ==0.7.2, tagsoup ==0.13.1, @@ -162,7 +162,7 @@ constraints: Crypto ==4.2.5.1, tasty-hunit ==0.9, tasty-quickcheck ==0.8.1, tasty-rerun ==1.1.3, - text ==0.11.3.1, + text ==1.1.1.0, text-icu ==0.6.3.7, tf-random ==0.5, tls ==1.2.9, @@ -170,7 +170,7 @@ constraints: Crypto ==4.2.5.1, transformers-base ==0.4.1, transformers-compat ==0.3.3.3, unbounded-delays ==0.1.0.8, - unix-compat ==0.4.0.0, + unix-compat ==0.4.1.3, unix-time ==0.2.2, unordered-containers ==0.2.5.0, utf8-string ==0.3.7, @@ -205,4 +205,4 @@ constraints: Crypto ==4.2.5.1, yesod-static ==1.2.4, zlib ==0.5.4.1, bytestring ==0.10.4.0, - scientific ==0.2.0.2 + scientific ==0.3.3.1 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 -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 +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 + #include +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 +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 + diff --git a/standalone/android/install-haskell-packages b/standalone/android/install-haskell-packages index 8ec551ffd..3cd6d3e6a 100755 --- a/standalone/android/install-haskell-packages +++ b/standalone/android/install-haskell-packages @@ -16,8 +16,6 @@ if [ ! -d haskell-patches ]; then fi setupcabal () { - cabal update - # Some packages fail to install in a non unicode locale. LANG=en_US.UTF-8 export LANG @@ -40,6 +38,7 @@ patched () { 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 @@ -50,8 +49,6 @@ patched () { fi fi done - set -x - ln -sf ../../cabal.config if [ -e config.sub ]; then cp /usr/share/misc/config.sub . fi @@ -66,8 +63,7 @@ patched () { } installgitannexdeps () { - pushd - cd ../.. + pushd ../.. ln -sf standalone/android/cabal.config cabal install --only-dependencies "$@" rm -f cabal.config @@ -107,6 +103,7 @@ EOF patched shakespeare-css patched shakespeare-js patched yesod-routes + patched hamlet patched yesod-core patched yesod-persistent patched yesod-form @@ -121,6 +118,8 @@ EOF patched dns patched gnutls patched unbounded-delays + patched gnuidn + patched network-protocol-xmpp cd .. @@ -132,4 +131,6 @@ cabal update PATH=$HOME/.ghc/$(cat abiversion)/bin:$HOME/.ghc/$(cat abiversion)/arm-linux-androideabi/bin:$PATH setupcabal +cabal update + install_pkgs -- cgit v1.2.3