successfully builds (except XMPP)

This commit is contained in:
Joey Hess 2013-09-22 19:13:31 +01:00
parent cc71315c50
commit 00a12afffe
12 changed files with 227 additions and 38 deletions

View file

@ -16,10 +16,9 @@ import Crypto
import Types.Remote (RemoteConfig, RemoteConfigKey)
import Remote.Helper.Encryptable (remoteCipher, embedCreds)
#ifndef mingw32_HOST_OS
import Utility.Env (setEnv)
import Utility.Env (setEnv, getEnv)
#endif
import System.Environment
import qualified Data.ByteString.Lazy.Char8 as L
import qualified Data.Map as M
import Utility.Base64
@ -101,11 +100,10 @@ getRemoteCredPair c storage = maybe fromcache (return . Just) =<< fromenv
{- Gets a CredPair from the environment. -}
getEnvCredPair :: CredPairStorage -> IO (Maybe CredPair)
getEnvCredPair storage = liftM2 (,)
<$> get uenv
<*> get penv
<$> getEnv uenv
<*> getEnv penv
where
(uenv, penv) = credPairEnvironment storage
get = catchMaybeIO . getEnv
{- Stores a CredPair in the environment. -}
setEnvCredPair :: CredPair -> CredPairStorage -> IO ()

View file

@ -160,12 +160,12 @@ osxapp: Build/Standalone Build/OSXMkLibs
rm -f tmp/git-annex.dmg.bz2
bzip2 --fast tmp/git-annex.dmg
ANDROID_FLAGS?=
ANDROID_FLAGS?=-f-XMPP
# 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 $(CABAL) configure -f"-Production $(ANDROID_FLAGS)" -O0; fi
if [ ! -e dist/setup/setup ]; then $(CABAL) configure -f-Production -O0 $(ANDROID_FLAGS); fi
mkdir -p tmp
if ! $(CABAL) build --ghc-options=-ddump-splices 2> tmp/dump-splices; then tail tmp/dump-splices >&2; exit 1; fi
echo "Setting up Android build tree.."
@ -183,9 +183,9 @@ android: Build/EvilSplicer
# Cabal cannot cross compile with custom build type, so workaround.
sed -i 's/Build-type: Custom/Build-type: Simple/' tmp/androidtree/git-annex.cabal
if [ ! -e tmp/androidtree/dist/setup/setup ]; then \
cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal configure -f"Android $(ANDROID_FLAGS)"; \
cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal configure -fAndroid $(ANDROID_FLAGS); \
fi
cd tmp/androidtree && $(CABAL) build
cd tmp/androidtree && $$HOME/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/bin/cabal build
adb:
ANDROID_FLAGS="-Production" $(MAKE) android

View file

@ -133,8 +133,12 @@ Executable git-annex
CPP-Options: -DWITH_FSEVENTS
else
if (! os(windows) && ! os(solaris) && ! os(linux))
CPP-Options: -DWITH_KQUEUE
C-Sources: Utility/libkqueue.c
if flag(Android)
Build-Depends: hinotify
CPP-Options: -DWITH_INOTIFY
else
CPP-Options: -DWITH_KQUEUE
C-Sources: Utility/libkqueue.c
if os(linux) && flag(Dbus)
Build-Depends: dbus (>= 0.10.3)

View file

@ -6,6 +6,7 @@
- ** DO NOT COMMIT **
-}
import qualified Data.Monoid
import qualified Data.Set
import qualified Data.Map
import qualified Data.Map as Data.Map.Base
import qualified Data.Foldable
@ -16,12 +17,16 @@ import qualified Text.Hamlet
import qualified Text.Julius
import qualified Text.Css
import qualified "blaze-markup" Text.Blaze.Internal
import qualified Yesod.Widget
import qualified Yesod.Core.Widget
import qualified Yesod.Routes.TH.Types
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 Yesod.Core.Types
{- End EvilSplicer headers. -}

View file

@ -0,0 +1,25 @@
From 0035f0366e426af213244b2eb25ffb63cb9e74d0 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 06:14:50 +0000
Subject: [PATCH] fix build with new ghc
---
async.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/async.cabal b/async.cabal
index 8e47d9d..98e6312 100644
--- a/async.cabal
+++ b/async.cabal
@@ -70,7 +70,7 @@ source-repository head
library
exposed-modules: Control.Concurrent.Async
- build-depends: base >= 4.3 && < 4.7, stm >= 2.2 && < 2.5
+ build-depends: base >= 4.3 && < 4.9, stm >= 2.2 && < 2.5
test-suite test-async
type: exitcode-stdio-1.0
--
1.7.10.4

View file

@ -0,0 +1,25 @@
From fdbd29ce6e8ff11f721f9e74cac1f4ca14e6773d Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 07:06:33 +0000
Subject: [PATCH] export TH symbols
---
Data/FileEmbed.hs | 2 ++
1 file changed, 2 insertions(+)
diff --git a/Data/FileEmbed.hs b/Data/FileEmbed.hs
index c17f082..6654f60 100644
--- a/Data/FileEmbed.hs
+++ b/Data/FileEmbed.hs
@@ -26,6 +26,8 @@ module Data.FileEmbed
#endif
, inject
, injectFile
+ -- used by TH (pointlessly)
+ , stringToBs
) where
import Language.Haskell.TH.Syntax
--
1.7.10.4

View file

@ -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

View file

@ -1,16 +1,19 @@
From c18ae75852b1340ca502528138bf421659f61a3d Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Mon, 15 Apr 2013 12:44:15 -0400
Subject: [PATCH] remove TH
From 432a8fc47bb11cf8fd0a832e033cfb94a6332dbe Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 07:29:39 +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 ----
1 file changed, 4 deletions(-)
Network/Wai/Application/Static.hs | 4 ----
wai-app-static.cabal | 2 +-
2 files changed, 1 insertion(+), 5 deletions(-)
diff --git a/Network/Wai/Application/Static.hs b/Network/Wai/Application/Static.hs
index 3195fbb..b48aa01 100644
index 3f07391..75709b7 100644
--- a/Network/Wai/Application/Static.hs
+++ b/Network/Wai/Application/Static.hs
@@ -33,8 +33,6 @@ import Control.Monad.IO.Class (liftIO)
@ -31,6 +34,21 @@ index 3195fbb..b48aa01 100644
staticAppPieces ss rawPieces req = liftIO $ do
case toPieces rawPieces of
Just pieces -> checkPieces ss pieces req >>= response
diff --git a/wai-app-static.cabal b/wai-app-static.cabal
index ec22813..e944caa 100644
--- a/wai-app-static.cabal
+++ b/wai-app-static.cabal
@@ -56,9 +56,9 @@ library
WaiAppStatic.Storage.Embedded
WaiAppStatic.Listing
WaiAppStatic.Types
- other-modules: Util
WaiAppStatic.Storage.Embedded.Runtime
WaiAppStatic.Storage.Embedded.TH
+ other-modules: Util
ghc-options: -Wall
extensions: CPP
--
1.8.2.rc3
1.7.10.4

View file

@ -0,0 +1,29 @@
From f6bfe8e01d8fe6d129ad3819070aa17934094a0a Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 06:24:09 +0000
Subject: [PATCH] export module referenced by TH splices
---
yesod-routes.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yesod-routes.cabal b/yesod-routes.cabal
index 0b245f2..a97582a 100644
--- a/yesod-routes.cabal
+++ b/yesod-routes.cabal
@@ -27,11 +27,11 @@ library
Yesod.Routes.Class
Yesod.Routes.Parse
Yesod.Routes.Overlap
+ Yesod.Routes.TH.Types
other-modules: Yesod.Routes.TH.Dispatch
Yesod.Routes.TH.RenderRoute
Yesod.Routes.TH.ParseRoute
Yesod.Routes.TH.RouteAttrs
- Yesod.Routes.TH.Types
ghc-options: -Wall
test-suite runtests
--
1.7.10.4

View file

@ -0,0 +1,41 @@
From 7e815b11f242d6836f9615439e32f9937bf2feaf Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sun, 22 Sep 2013 13:59:34 +0000
Subject: [PATCH] hack around missing symbols
---
Yesod.hs | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/Yesod.hs b/Yesod.hs
index 3050bf5..fbe309c 100644
--- a/Yesod.hs
+++ b/Yesod.hs
@@ -5,7 +5,24 @@ module Yesod
( -- * Re-exports from yesod-core
module Yesod.Core
, module Yesod.Form
+ , insertBy
+ , replace
+ , deleteBy
+ , delete
+ , insert
+ , Key
) where
import Yesod.Core
import Yesod.Form
+
+-- These symbols are usually imported from persistent,
+-- But it is not built on Android. Still export them
+-- just so that hiding them will work.
+data Key = DummyKey
+insertBy = undefined
+replace = undefined
+deleteBy = undefined
+delete = undefined
+insert = undefined
+
--
1.7.10.4

View file

@ -2,18 +2,12 @@
# 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.
#
# Note that the newest version of packages is installed.
# It attempts to reuse patches for older versions, but
# new versions of packages often break cross-compilation by adding TH,
# etc
#
# Needs some extra C libraries and packages to be installed
# on the host system:
# libgnutls-dev libxml2-dev libgsasl7-dev pkg-config c2hs
#
# Also needs some C libraries to be installed inside the cross-compiler
# lib directory (~/.ghc/android-14/arm-linux-androideabi-4.7/arm-linux-androideabi/sysroot/usr/lib/)
# , cross-compiled for Android: libgnutls libxml2
set -e
@ -40,15 +34,11 @@ patched () {
$SHELL
fi
done
cabalinstall "$@"
cabalinstall --force-reinstalls "$@"
rm -rf $pkg*
cd ..
}
unpatched () {
cabalinstall "$@"
}
installgitannexdeps () {
echo cabal install git-annex --only-dependencies
cabal install git-annex --only-dependencies "$@"
@ -76,24 +66,28 @@ install_pkgs () {
patched socks
patched entropy
patched vector
patched wai-app-static
patched persistent
patched profunctors
patched skein
patched lens
patched DAV
patched persistent-template
patched file-embed
patched wai-app-static
patched hamlet
patched shakespeare
patched shakespeare-css
patched shakespeare-js
patched DAV
patched persistent-template
patched hamlet
patched yesod-routes
patched yesod-core
patched yesod-persistent
patched yesod-form
patched yesod-auth
patched yesod
patched async
patched gnuidn
installgitannexdeps -f-Pairing -f-XMPP
installgitannexdeps -fAndroid -f-Pairing
cd ..
rm -rf tmp