[arch-commits] Commit in haskell-ipynb/trunk (PKGBUILD base64-bytestring-1.1.patch)
Felix Yan
felixonmars at archlinux.org
Mon May 4 05:00:22 UTC 2020
Date: Monday, May 4, 2020 @ 05:00:21
Author: felixonmars
Revision: 624671
upgpkg: haskell-ipynb 0.1.0.1-1: rebuild with ipynb 0.1.0.1
Modified:
haskell-ipynb/trunk/PKGBUILD
Deleted:
haskell-ipynb/trunk/base64-bytestring-1.1.patch
-----------------------------+
PKGBUILD | 15 +-----
base64-bytestring-1.1.patch | 99 ------------------------------------------
2 files changed, 4 insertions(+), 110 deletions(-)
Modified: PKGBUILD
===================================================================
--- PKGBUILD 2020-05-04 04:23:16 UTC (rev 624670)
+++ PKGBUILD 2020-05-04 05:00:21 UTC (rev 624671)
@@ -2,8 +2,8 @@
_hkgname=ipynb
pkgname=haskell-ipynb
-pkgver=0.1
-pkgrel=177
+pkgver=0.1.0.1
+pkgrel=1
pkgdesc="Data structure for working with Jupyter notebooks (ipynb)"
url="https://github.com/jgm/ipynb"
license=('BSD')
@@ -11,16 +11,9 @@
depends=('ghc-libs' 'haskell-aeson' 'haskell-base64-bytestring' 'haskell-unordered-containers')
makedepends=('ghc' 'haskell-aeson-diff' 'haskell-microlens' 'haskell-microlens-aeson'
'haskell-tasty' 'haskell-tasty-hunit' 'haskell-vector')
-source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz
- base64-bytestring-1.1.patch)
-sha512sums=('8717dac6496905afc5e8735abc3b3a4a90b171253b035efa0751a6311b901caad563fdfeaa455987c1307d0532273ab80be37256562143db575f13c326843bf4'
- '705d0d71fb94d139c5e0ef8de9f72c15b9f3152e7417cacbf12519a4270e6ee6b1e4e929062337ada9a3d776741e95a2cafee79ebbe3ac038e5073ca94f14602')
+source=(https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz)
+sha512sums=('b1e547ac9353c84619832c723586146d2fd72c85c75d11b9ff99c16852ae2dfd1a2d61382ab9cc54bc9ad2bf8e1c3c0a8dc50d49c034d525e7a3393057a0275b')
-prepare() {
- cd $_hkgname-$pkgver
- patch -p1 -i ../base64-bytestring-1.1.patch
-}
-
build() {
cd $_hkgname-$pkgver
Deleted: base64-bytestring-1.1.patch
===================================================================
--- base64-bytestring-1.1.patch 2020-05-04 04:23:16 UTC (rev 624670)
+++ base64-bytestring-1.1.patch 2020-05-04 05:00:21 UTC (rev 624671)
@@ -1,99 +0,0 @@
---- ipynb-0.1/test/roundtrip.hs.orig 2020-04-26 07:02:19.792033245 +0800
-+++ ipynb-0.1/test/roundtrip.hs 2020-04-26 07:02:34.438786334 +0800
-@@ -49,7 +49,7 @@
- case Base64.decode (TE.encodeUtf8 (T.filter (/='\n') t)) of
- Left _ -> String t -- textual
- Right b -> String $
-- TE.decodeUtf8 . Base64.joinWith "\n" 76 . Base64.encode $ b
-+ TE.decodeUtf8 . joinWith "\n" 76 . Base64.encode $ b
- go v = v
-
- rtTest :: FilePath -> TestTree
---- ipynb-0.1/src/Data/Ipynb.hs.orig 2020-04-26 07:00:34.408032416 +0800
-+++ ipynb-0.1/src/Data/Ipynb.hs 2020-04-26 07:47:18.956882066 +0800
-@@ -1,3 +1,4 @@
-+{-# LANGUAGE BangPatterns #-}
- {-# LANGUAGE CPP #-}
- {-# LANGUAGE DeriveGeneric #-}
- {-# LANGUAGE FlexibleContexts #-}
-@@ -38,13 +39,17 @@
- , MimeData(..)
- , MimeBundle(..)
- , breakLines
-+ , joinWith
- )
- where
- import Control.Applicative ((<|>))
-+import Control.Exception (assert)
- import Control.Monad (when)
- import Data.Aeson as Aeson
- import qualified Data.Aeson.Types as Aeson
- import Data.ByteString (ByteString)
-+import qualified Data.ByteString as B
-+import Data.ByteString.Internal
- import qualified Data.ByteString.Base64 as Base64
- import Data.Char (isSpace)
- import qualified Data.HashMap.Strict as HM
-@@ -54,6 +59,8 @@
- import Data.Text (Text)
- import qualified Data.Text as T
- import qualified Data.Text.Encoding as TE
-+import Foreign.ForeignPtr (withForeignPtr)
-+import Foreign.Ptr (minusPtr, plusPtr)
- import GHC.Generics
- import Prelude
- #if MIN_VERSION_base(4,11,0)
-@@ -480,10 +487,52 @@
- Left _ -> return (mt, TextualData t)
- Right b -> return (mt, BinaryData b)
-
-+-- | Efficiently intersperse a terminator string into another at
-+-- regular intervals, and terminate the input with it.
-+--
-+-- Examples:
-+--
-+-- > joinWith "|" 2 "----" = "--|--|"
-+--
-+-- > joinWith "\r\n" 3 "foobarbaz" = "foo\r\nbar\r\nbaz\r\n"
-+-- > joinWith "x" 3 "fo" = "fox"
-+joinWith :: ByteString -- ^ String to intersperse and end with
-+ -> Int -- ^ Interval at which to intersperse, in bytes
-+ -> ByteString -- ^ String to transform
-+ -> ByteString
-+joinWith brk@(PS bfp boff blen) every' bs@(PS sfp soff slen)
-+ | every' <= 0 = error "invalid interval"
-+ | blen <= 0 = bs
-+ | B.null bs = brk
-+ | otherwise =
-+ unsafeCreate dlen $ \dptr ->
-+ withForeignPtr bfp $ \bptr -> do
-+ withForeignPtr sfp $ \sptr -> do
-+ let bp = bptr `plusPtr` boff
-+ sp0 = sptr `plusPtr` soff
-+ sEnd = sp0 `plusPtr` slen
-+ dLast = dptr `plusPtr` dlen
-+ loop !dp !sp !written
-+ | dp == dLast = return ()
-+ | otherwise = do
-+ let chunkSize = min every (sEnd `minusPtr` sp)
-+ memcpy dp sp (fromIntegral chunkSize)
-+ let dp' = dp `plusPtr` chunkSize
-+ memcpy dp' bp (fromIntegral blen)
-+ let written' = written + chunkSize + blen
-+ assert (written' <= dlen) $
-+ loop (dp' `plusPtr` blen) (sp `plusPtr` chunkSize) written'
-+ loop dptr sp0 0
-+ where dlast = slen + blen * numBreaks
-+ every = min slen every'
-+ dlen | rmndr > 0 = dlast + blen
-+ | otherwise = dlast
-+ (numBreaks, rmndr) = slen `divMod` every
-+
- instance ToJSON MimeBundle where
- toJSON (MimeBundle m) =
- let mimeBundleToValue (BinaryData bs) =
-- toJSON $ TE.decodeUtf8 . Base64.joinWith "\n" 76 . Base64.encode $ bs
-+ toJSON $ TE.decodeUtf8 . joinWith "\n" 76 . Base64.encode $ bs
- mimeBundleToValue (JsonData v) = v
- mimeBundleToValue (TextualData t) = toJSON (breakLines t)
- in toJSON $ M.map mimeBundleToValue m
More information about the arch-commits
mailing list