[arch-commits] Commit in haskell-cmark-gfm/repos (3 files)

Felix Yan felixonmars at archlinux.org
Sun Aug 26 13:27:38 UTC 2018


    Date: Sunday, August 26, 2018 @ 13:27:37
  Author: felixonmars
Revision: 374230

archrelease: copy trunk to community-staging-x86_64

Added:
  haskell-cmark-gfm/repos/community-staging-x86_64/
  haskell-cmark-gfm/repos/community-staging-x86_64/PKGBUILD
    (from rev 374229, haskell-cmark-gfm/trunk/PKGBUILD)
  haskell-cmark-gfm/repos/community-staging-x86_64/system-cmark-gfm.patch
    (from rev 374229, haskell-cmark-gfm/trunk/system-cmark-gfm.patch)

------------------------+
 PKGBUILD               |   50 ++++++++++++++++++++++++++++++++++++++++++
 system-cmark-gfm.patch |   55 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+)

Copied: haskell-cmark-gfm/repos/community-staging-x86_64/PKGBUILD (from rev 374229, haskell-cmark-gfm/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2018-08-26 13:27:37 UTC (rev 374230)
@@ -0,0 +1,50 @@
+# $Id$
+# Maintainer: Felix Yan <felixonmars at archlinux.org>
+# Contributor: Arch Haskell Team <arch-haskell at haskell.org>
+
+_hkgname=cmark-gfm
+pkgname=haskell-cmark-gfm
+pkgver=0.1.5
+pkgrel=1
+pkgdesc="Fast, accurate GitHub Flavored Markdown parser and renderer"
+url="https://github.com/kivikakk/cmark-gfm-hs"
+license=("custom:BSD3")
+arch=('x86_64')
+depends=('ghc-libs' 'cmark-gfm')
+makedepends=('ghc' 'haskell-hunit')
+source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz")
+sha512sums=('24887a7217abf02a154b5babb76eb40f5d2b5dbb0631622408f807aaa1f5b6b9dba77e89690bec68262bee1978c51f22a5a51fd643bda17a521b313964de1958')
+
+prepare() {
+    cd $_hkgname-$pkgver
+    sed -i 's/cmark-gfmextensions/cmark-gfm-extensions/' $_hkgname.cabal
+}
+
+build() {
+    cd "${srcdir}/${_hkgname}-${pkgver}"
+
+    runhaskell Setup configure -O --enable-shared --enable-executable-dynamic --disable-library-vanilla \
+        --prefix=/usr --docdir="/usr/share/doc/${pkgname}" --enable-tests \
+        --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
+            -fpkgconfig
+    runhaskell Setup build
+    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
+}
+
+package() {
+    cd "${srcdir}/${_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" "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
+    rm -f "${pkgdir}/usr/share/doc/${pkgname}/LICENSE"
+}

Copied: haskell-cmark-gfm/repos/community-staging-x86_64/system-cmark-gfm.patch (from rev 374229, haskell-cmark-gfm/trunk/system-cmark-gfm.patch)
===================================================================
--- community-staging-x86_64/system-cmark-gfm.patch	                        (rev 0)
+++ community-staging-x86_64/system-cmark-gfm.patch	2018-08-26 13:27:37 UTC (rev 374230)
@@ -0,0 +1,55 @@
+commit ff75a191f067ceac00f4edc065cc1317d69d81ba
+Author: Felix Yan <felixonmars at archlinux.org>
+Date:   Mon Aug 20 14:44:55 2018 +0800
+
+    Fix build with system cmark-gfm (fixes #8)
+    
+    Use the public interface cmark_get_default_mem_allocator instead of
+    private CMARK_DEFAULT_MEM_ALLOCATOR.
+
+diff --git a/CMarkGFM.hsc b/CMarkGFM.hsc
+index 6bd4fce..a39579c 100644
+--- a/CMarkGFM.hsc
++++ b/CMarkGFM.hsc
+@@ -58,7 +58,7 @@ ensurePluginsRegistered = c_core_extensions_ensure_registered
+ 
+ -- | Frees a cmark linked list, produced by extsToLlist.
+ freeLlist :: LlistPtr a -> IO ()
+-freeLlist = c_cmark_llist_free c_CMARK_DEFAULT_MEM_ALLOCATOR
++freeLlist = c_cmark_llist_free c_cmark_mem
+ 
+ -- | Converts a list of resolved extension pointers to a single cmark
+ -- linked list, which can be passed to functions requiring a list of
+@@ -67,7 +67,7 @@ extsToLlist :: [ExtensionPtr] -> IO (LlistPtr ExtensionPtr)
+ extsToLlist [] = return nullPtr
+ extsToLlist (h:t) = do
+   t' <- extsToLlist t
+-  c_cmark_llist_append c_CMARK_DEFAULT_MEM_ALLOCATOR t' (castPtr h)
++  c_cmark_llist_append c_cmark_mem t' (castPtr h)
+ 
+ -- | Resolves CMarkExtensions to pointers.
+ resolveExts :: [CMarkExtension] -> IO [ExtensionPtr]
+@@ -633,8 +633,8 @@ foreign import ccall "cmark.h cmark_llist_append"
+ foreign import ccall "cmark.h cmark_llist_free"
+     c_cmark_llist_free :: MemPtr -> LlistPtr a -> IO ()
+ 
+-foreign import ccall "cmark.h &CMARK_DEFAULT_MEM_ALLOCATOR"
+-    c_CMARK_DEFAULT_MEM_ALLOCATOR :: MemPtr
++foreign import ccall "cmark.h cmark_get_default_mem_allocator"
++    c_cmark_mem :: MemPtr
+ 
+ foreign import ccall "cmark_extension_api.h cmark_parser_attach_syntax_extension"
+     c_cmark_parser_attach_syntax_extension :: ParserPtr -> ExtensionPtr -> IO ()
+diff --git a/cmark-gfm.cabal b/cmark-gfm.cabal
+index afe9d1c..6dec4a8 100644
+--- a/cmark-gfm.cabal
++++ b/cmark-gfm.cabal
+@@ -74,7 +74,7 @@ library
+   default-language:    Haskell2010
+   ghc-options:         -Wall -fno-warn-unused-do-bind
+   if flag(pkgconfig)
+-    pkgconfig-depends: libcmark-gfm
++    Extra-Libraries: cmark-gfm cmark-gfmextensions
+   else
+     cc-options:        -Wall -std=c99
+     Include-dirs:      cbits



More information about the arch-commits mailing list