update android haskell patches

This commit is contained in:
Sören Brunk 2014-05-25 10:04:37 +02:00
parent f5982447eb
commit 5e9e9d3cc7
9 changed files with 232 additions and 2038 deletions

View file

@ -1,34 +0,0 @@
From 8c4220e4dd48ad197aa0ad49214e6e7bd768044e Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:28:57 -0400
Subject: [PATCH] fix build (not Android specific)
---
src/System/Cmd/Utils.hs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/System/Cmd/Utils.hs b/src/System/Cmd/Utils.hs
index a9fa46f..6c6aba2 100644
--- a/src/System/Cmd/Utils.hs
+++ b/src/System/Cmd/Utils.hs
@@ -325,7 +325,7 @@ forceSuccess (PipeHandle pid fp args funcname) =
Just (Exited (ExitSuccess)) -> return ()
Just (Exited (ExitFailure fc)) ->
cmdfailed funcname fp args fc
- Just (Terminated sig) ->
+ Just (Terminated sig _) ->
warnfail fp args $ "Terminated by signal " ++ show sig
Just (Stopped sig) ->
warnfail fp args $ "Stopped by signal " ++ show sig
@@ -351,7 +351,7 @@ safeSystem command args =
case ec of
Exited ExitSuccess -> return ()
Exited (ExitFailure fc) -> cmdfailed "safeSystem" command args fc
- Terminated s -> cmdsignalled "safeSystem" command args s
+ Terminated s _ -> cmdsignalled "safeSystem" command args s
Stopped s -> cmdsignalled "safeSystem" command args s
#endif
--
1.7.10.4

View file

@ -1,12 +1,27 @@
From 09bcaf4f203c39c967a6951d56fd015347bb5dae Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sat, 21 Sep 2013 21:57:21 +0000
From bfbbfe26817bb06ef518b72a9f942dd3843be618 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sun, 25 May 2014 08:53:50 +0200
Subject: [PATCH] fix build with newer base
---
Data/BloomFilter/Array.hs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
Data/BloomFilter.hs | 3 ++-
Data/BloomFilter/Array.hs | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/Data/BloomFilter.hs b/Data/BloomFilter.hs
index 69711ef..7a284b8 100644
--- a/Data/BloomFilter.hs
+++ b/Data/BloomFilter.hs
@@ -93,7 +93,8 @@ import Control.Monad (liftM, forM_)
import Control.Monad.ST (ST, runST)
import Control.DeepSeq (NFData(..))
import Data.Array.Base (unsafeAt, unsafeRead, unsafeWrite)
-import Data.Array.ST (STUArray, thaw, unsafeFreeze)
+import Data.Array.ST (STUArray, thaw)
+import Data.Array.Unsafe (unsafeFreeze)
import Data.Array.Unboxed (UArray)
import Data.Bits ((.&.), (.|.))
import Data.BloomFilter.Array (newArray)
diff --git a/Data/BloomFilter/Array.hs b/Data/BloomFilter/Array.hs
index e085bbe..d94757a 100644
--- a/Data/BloomFilter/Array.hs
@ -22,5 +37,5 @@ index e085bbe..d94757a 100644
#if __GLASGOW_HASKELL__ >= 704
import Foreign.C.Types (CInt(..), CSize(..))
--
1.7.10.4
2.0.0.rc2

View file

@ -1,25 +0,0 @@
From 6cd7b7d3a8e38ada9b1e3989770525c63f9f1d7d Mon Sep 17 00:00:00 2001
From: androidbuilder <androidbuilder@example.com>
Date: Fri, 18 Oct 2013 23:10:16 +0000
Subject: [PATCH] cross build
---
distributive.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/distributive.cabal b/distributive.cabal
index 5d4ac69..82d7593 100644
--- a/distributive.cabal
+++ b/distributive.cabal
@@ -12,7 +12,7 @@ bug-reports: http://github.com/ekmett/distributive/issues
copyright: Copyright (C) 2011-2013 Edward A. Kmett
synopsis: Haskell 98 Distributive functors -- Dual to Traversable
description: Haskell 98 Distributive functors -- Dual to Traversable
-build-type: Custom
+build-type: Simple
extra-source-files:
.ghci
.travis.yml
--
1.7.10.4

View file

@ -0,0 +1,25 @@
From 86eca0993e1716b4db14570836efbe838626892f Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
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

View file

@ -1,25 +0,0 @@
From 8a98fa29048b508c64d5bb1e03ef89bfad8adc01 Mon Sep 17 00:00:00 2001
From: foo <foo@bar>
Date: Sat, 21 Sep 2013 21:34:17 +0000
Subject: [PATCH] crossbuild
---
lifted-base.cabal | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lifted-base.cabal b/lifted-base.cabal
index 24f2860..3bef225 100644
--- a/lifted-base.cabal
+++ b/lifted-base.cabal
@@ -9,7 +9,7 @@ Copyright: (c) 2011-2012 Bas van Dijk, Anders Kaseorg
Homepage: https://github.com/basvandijk/lifted-base
Bug-reports: https://github.com/basvandijk/lifted-base/issues
Category: Control
-Build-type: Custom
+Build-type: Simple
Cabal-version: >= 1.8
Description: @lifted-base@ exports IO operations from the base library lifted to
any instance of 'MonadBase' or 'MonadBaseControl'.
--
1.7.10.4

View file

@ -0,0 +1,161 @@
From b3cb294077b627892721a2ebf9e0ce81f35f8c4c Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
Date: Sun, 25 May 2014 09:28:45 +0200
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/Socket.hsc | 22 ++++++----------------
Network/Socket/ByteString.hsc | 2 +-
Network/Socket/Internal.hsc | 2 +-
Network/Socket/Types.hsc | 4 ++--
cbits/HsNet.c | 14 ++++++++++++++
configure | 1 +
6 files changed, 25 insertions(+), 20 deletions(-)
diff --git a/Network/Socket.hsc b/Network/Socket.hsc
index 607b270..04a83e8 100644
--- a/Network/Socket.hsc
+++ b/Network/Socket.hsc
@@ -35,7 +35,7 @@ module Network.Socket
, SockAddr(..)
, SocketStatus(..)
, HostAddress
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
, HostAddress6
, FlowInfo
, ScopeID
@@ -52,7 +52,7 @@ module Network.Socket
, HostName
, ServiceName
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORT) || 1
, AddrInfo(..)
, AddrInfoFlag(..)
@@ -134,7 +134,7 @@ module Network.Socket
-- * Special constants
, aNY_PORT
, iNADDR_ANY
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
, iN6ADDR_ANY
#endif
, sOMAXCONN
@@ -326,16 +326,6 @@ socket family stype protocol = do
setNonBlockIfNeeded fd
socket_status <- newMVar NotConnected
let sock = MkSocket fd family stype protocol socket_status
-#if HAVE_DECL_IPV6_V6ONLY
-# if defined(mingw32_HOST_OS)
- -- the IPv6Only option is only supported on Windows Vista and later,
- -- so trying to change it might throw an error
- when (family == AF_INET6) $
- E.catch (setSocketOption sock IPv6Only 0) $ (\(_ :: E.IOException) -> return ())
-# else
- when (family == AF_INET6) $ setSocketOption sock IPv6Only 0
-# endif
-#endif
return sock
-- | Build a pair of connected socket objects using the given address
@@ -1061,9 +1051,9 @@ aNY_PORT = 0
iNADDR_ANY :: HostAddress
iNADDR_ANY = htonl (#const INADDR_ANY)
-foreign import CALLCONV unsafe "htonl" htonl :: Word32 -> Word32
+foreign import CALLCONV unsafe "my_htonl" htonl :: Word32 -> Word32
-#if defined(IPV6_SOCKET_SUPPORT)
+#if defined(IPV6_SOCKET_SUPPORTNO)
-- | The IPv6 wild card address.
iN6ADDR_ANY :: HostAddress6
@@ -1241,7 +1231,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'.
data AddrInfoFlag
diff --git a/Network/Socket/ByteString.hsc b/Network/Socket/ByteString.hsc
index e21ad1b..c2dd70a 100644
--- a/Network/Socket/ByteString.hsc
+++ b/Network/Socket/ByteString.hsc
@@ -197,7 +197,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 83333f7..0dd6a7d 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 48a43bb..1c5994f 100644
--- a/Network/Socket/Types.hsc
+++ b/Network/Socket/Types.hsc
@@ -711,8 +711,8 @@ 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 "my_ntohs" ntohs :: Word16 -> Word16
+foreign import CALLCONV unsafe "my_htons" htons :: Word16 -> Word16
--foreign import CALLCONV unsafe "ntohl" ntohl :: Word32 -> Word32
instance Enum PortNumber where
diff --git a/cbits/HsNet.c b/cbits/HsNet.c
index 86b55dc..5ea1199 100644
--- a/cbits/HsNet.c
+++ b/cbits/HsNet.c
@@ -6,3 +6,17 @@
#define INLINE
#include "HsNet.h"
+
+#include <sys/endian.h>
+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);
+}
diff --git a/configure b/configure
index db8240d..41674d9 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.
#
--
2.0.0.rc2

View file

@ -1,24 +0,0 @@
From 5cb5c3dabb213f809b8328b0b4049f7c754e9c77 Mon Sep 17 00:00:00 2001
From: Joey Hess <joey@kitenet.net>
Date: Thu, 28 Feb 2013 23:34:32 -0400
Subject: [PATCH] disable i386 opt stuff to allow cross-compilation
---
primitive.cabal | 3 ---
1 file changed, 3 deletions(-)
diff --git a/primitive.cabal b/primitive.cabal
index 8c4328a..9a6093f 100644
--- a/primitive.cabal
+++ b/primitive.cabal
@@ -51,7 +51,4 @@ Library
includes: primitive-memops.h
c-sources: cbits/primitive-memops.c
cc-options: -O3 -ftree-vectorize -fomit-frame-pointer
- if arch(i386) || arch(x86_64) {
- cc-options: -msse2
- }
--
1.7.10.4

View file

@ -0,0 +1,25 @@
From ff2d1519fb294a123636ac6bd80e50741922c856 Mon Sep 17 00:00:00 2001
From: dummy <dummy@example.com>
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