[arch-commits] Commit in haskell-bytestring-handle/trunk (PKGBUILD ghc9.patch)
Felix Yan
felixonmars at archlinux.org
Mon Jun 21 07:30:58 UTC 2021
Date: Monday, June 21, 2021 @ 07:30:57
Author: felixonmars
Revision: 966402
upgpkg: haskell-bytestring-handle 0.1.0.6-59: rebuild with ghc 9.0.1
Added:
haskell-bytestring-handle/trunk/ghc9.patch
Modified:
haskell-bytestring-handle/trunk/PKGBUILD
------------+
PKGBUILD | 9 +++++---
ghc9.patch | 65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 71 insertions(+), 3 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2021-06-21 07:28:49 UTC (rev 966401)
+++ PKGBUILD 2021-06-21 07:30:57 UTC (rev 966402)
@@ -3,7 +3,7 @@
_hkgname=bytestring-handle
pkgname=haskell-bytestring-handle
pkgver=0.1.0.6
-pkgrel=58
+pkgrel=59
pkgdesc="ByteString-backed Handles"
url="http://hub.darcs.net/ganesh/bytestring-handle"
license=("BSD")
@@ -11,11 +11,14 @@
depends=('ghc-libs')
makedepends=('ghc' 'uusi' 'haskell-hunit' 'haskell-quickcheck' 'haskell-test-framework'
'haskell-test-framework-hunit' 'haskell-test-framework-quickcheck2')
-source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz")
-sha256sums=('fe681cdf7e2238389b6d2090e264b10d0e5085658c89e7ffc870c7a0a43ac1a1')
+source=("https://hackage.haskell.org/packages/archive/$_hkgname/$pkgver/$_hkgname-$pkgver.tar.gz"
+ ghc9.patch)
+sha256sums=('fe681cdf7e2238389b6d2090e264b10d0e5085658c89e7ffc870c7a0a43ac1a1'
+ '574a5813bbd92a195521c90d4c7e30f883b9b901af8d50cf3d8d53170d402902')
prepare() {
uusi -u QuickCheck -u base $_hkgname-$pkgver/$_hkgname.cabal
+ patch -d $_hkgname-$pkgver -p2 < ghc9.patch
}
build() {
Added: ghc9.patch
===================================================================
--- ghc9.patch (rev 0)
+++ ghc9.patch 2021-06-21 07:30:57 UTC (rev 966402)
@@ -0,0 +1,65 @@
+--- src/bytestring-handle-0.1.0.6/src/Data/ByteString/Handle/Write.hs.orig 2021-06-21 14:54:12.217134401 +0800
++++ src/bytestring-handle-0.1.0.6/src/Data/ByteString/Handle/Write.hs 2021-06-21 15:24:01.794796505 +0800
+@@ -17,7 +17,7 @@
+
+ import GHC.IO.Buffer ( BufferState(..), emptyBuffer, Buffer(..) )
+ import GHC.IO.BufferedIO ( BufferedIO(..) )
+-import GHC.IO.Device ( IODevice(..), IODeviceType(..), SeekMode(..) )
++import GHC.IO.Device ( IODevice(..), IODeviceType(..), SeekMode(..), RawIO(..) )
+ #if MIN_VERSION_base(4,5,0)
+ import GHC.IO.Encoding ( getLocaleEncoding )
+ #else
+@@ -138,6 +138,7 @@
+ seek_base = error "seek_base needs to be updated"
+ })
+ modifyIORef (write_size ws) (`max` newSeekPos)
++ pure newSeekPos
+
+ tell ws = do
+ ss <- readIORef (write_seek_state ws)
+@@ -152,6 +153,12 @@
+
+ devType _ = return RegularFile -- TODO: is this correct?
+
++instance RawIO WriteState where
++ read _ _ _ _ = return 0
++ readNonBlocking _ _ _ _ = return Nothing
++ write _ _ _ _ = return ()
++ writeNonBlocking _ _ _ _ = return 0
++
+ ioe_seekOutOfRange :: IO a
+ ioe_seekOutOfRange =
+ ioException $ IOError Nothing InvalidArgument ""
+--- src/bytestring-handle-0.1.0.6/src/Data/ByteString/Handle/Read.hs.orig 2021-06-21 14:53:55.433129276 +0800
++++ src/bytestring-handle-0.1.0.6/src/Data/ByteString/Handle/Read.hs 2021-06-21 15:24:25.998784996 +0800
+@@ -24,7 +24,7 @@
+ , emptyBuffer, isEmptyBuffer, newBuffer, newByteBuffer
+ , bufferElems, withBuffer, withRawBuffer )
+ import GHC.IO.BufferedIO ( BufferedIO(..) )
+-import GHC.IO.Device ( IODevice(..), IODeviceType(..), SeekMode(..) )
++import GHC.IO.Device ( IODevice(..), IODeviceType(..), SeekMode(..), RawIO(..) )
+ #if MIN_VERSION_base(4,5,0)
+ import GHC.IO.Encoding ( getLocaleEncoding )
+ #else
+@@ -155,7 +155,7 @@
+ (seek_before_length curSeekState)
+ (fromIntegral (seek_pos curSeekState) + seekPos)
+ SeekFromEnd -> normalisedSeekState (read_chunks_backwards rs) [] (read_length rs) seekPos
+- maybe ioe_seekOutOfRange (writeIORef (read_seek_state rs)) newSeekState
++ maybe ioe_seekOutOfRange (\nss -> writeIORef (read_seek_state rs) nss >> pure (fromIntegral(seek_pos nss))) newSeekState
+
+ tell rs = do
+ ss <- readIORef (read_seek_state rs)
+@@ -166,6 +166,12 @@
+
+ devType _ = return RegularFile -- TODO: is this correct?
+
++instance RawIO ReadState where
++ read _ _ _ _ = return 0
++ readNonBlocking _ _ _ _ = return Nothing
++ write _ _ _ _ = return ()
++ writeNonBlocking _ _ _ _ = return 0
++
+ ioe_seekOutOfRange :: IO a
+ ioe_seekOutOfRange =
+ ioException $ IOError Nothing InvalidArgument ""
More information about the arch-commits
mailing list