[arch-commits] Commit in haskell-bytestring-handle/repos (3 files)

Felix Yan felixonmars at gemini.archlinux.org
Mon Aug 8 14:38:26 UTC 2022


    Date: Monday, August 8, 2022 @ 14:38:26
  Author: felixonmars
Revision: 1260911

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-bytestring-handle/repos/community-staging-x86_64/
  haskell-bytestring-handle/repos/community-staging-x86_64/PKGBUILD
    (from rev 1260910, haskell-bytestring-handle/trunk/PKGBUILD)
  haskell-bytestring-handle/repos/community-staging-x86_64/ghc9.patch
    (from rev 1260910, haskell-bytestring-handle/trunk/ghc9.patch)

------------+
 PKGBUILD   |   53 ++++++++++++++++++++++++++++++++++++++++++++++++
 ghc9.patch |   65 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 118 insertions(+)

Copied: haskell-bytestring-handle/repos/community-staging-x86_64/PKGBUILD (from rev 1260910, haskell-bytestring-handle/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-08-08 14:38:26 UTC (rev 1260911)
@@ -0,0 +1,53 @@
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+
+_hkgname=bytestring-handle
+pkgname=haskell-bytestring-handle
+pkgver=0.1.0.6
+pkgrel=119
+pkgdesc="ByteString-backed Handles"
+url="http://hub.darcs.net/ganesh/bytestring-handle"
+license=("BSD")
+arch=('x86_64')
+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"
+        ghc9.patch)
+sha256sums=('fe681cdf7e2238389b6d2090e264b10d0e5085658c89e7ffc870c7a0a43ac1a1'
+            '574a5813bbd92a195521c90d4c7e30f883b9b901af8d50cf3d8d53170d402902')
+
+prepare() {
+  uusi -u QuickCheck -u base $_hkgname-$pkgver/$_hkgname.cabal
+  patch -d $_hkgname-$pkgver -p2 < ghc9.patch
+}
+
+build() {
+  cd $_hkgname-$pkgver
+
+  runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+    --prefix=/usr --docdir=/usr/share/doc/$pkgname --datasubdir=$pkgname --enable-tests \
+    --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid --ghc-option=-fllvm \
+    --ghc-option=-optl-Wl\,-z\,relro\,-z\,now \
+    --ghc-option='-pie'
+
+  runhaskell Setup build $MAKEFLAGS
+  runhaskell Setup register --gen-script
+  runhaskell Setup unregister --gen-script
+  sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
+  sed -i -r -e "s|ghc-pkg.*unregister[^ ]* |&'--force' |" unregister.sh
+}
+
+check() {
+  cd $_hkgname-$pkgver
+  runhaskell Setup test --show-details=direct
+}
+
+package() {
+  cd $_hkgname-$pkgver
+
+  install -D -m744 register.sh "$pkgdir"/usr/share/haskell/register/$pkgname.sh
+  install -D -m744 unregister.sh "$pkgdir"/usr/share/haskell/unregister/$pkgname.sh
+  runhaskell Setup copy --destdir="$pkgdir"
+  install -D -m644 LICENSE -t "$pkgdir"/usr/share/licenses/$pkgname/
+  rm -f "$pkgdir"/usr/share/doc/$pkgname/LICENSE
+}

Copied: haskell-bytestring-handle/repos/community-staging-x86_64/ghc9.patch (from rev 1260910, haskell-bytestring-handle/trunk/ghc9.patch)
===================================================================
--- community-staging-x86_64/ghc9.patch	                        (rev 0)
+++ community-staging-x86_64/ghc9.patch	2022-08-08 14:38:26 UTC (rev 1260911)
@@ -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