Date: Monday, August 20, 2018 @ 06:50:56 Author: felixonmars Revision: 372821
archrelease: copy trunk to community-staging-x86_64 Added: haskell-cmark-gfm/repos/community-staging-x86_64/PKGBUILD (from rev 372820, haskell-cmark-gfm/trunk/PKGBUILD) haskell-cmark-gfm/repos/community-staging-x86_64/system-cmark-gfm.patch (from rev 372820, haskell-cmark-gfm/trunk/system-cmark-gfm.patch) Deleted: haskell-cmark-gfm/repos/community-staging-x86_64/PKGBUILD ------------------------+ PKGBUILD | 97 +++++++++++++++++++++++++---------------------- system-cmark-gfm.patch | 55 ++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 44 deletions(-) Deleted: PKGBUILD =================================================================== --- PKGBUILD 2018-08-20 06:50:36 UTC (rev 372820) +++ PKGBUILD 2018-08-20 06:50:56 UTC (rev 372821) @@ -1,44 +0,0 @@ -# $Id$ -# Maintainer: Felix Yan <felixonm...@archlinux.org> -# Contributor: Arch Haskell Team <arch-hask...@haskell.org> - -_hkgname=cmark-gfm -pkgname=haskell-cmark-gfm -pkgver=0.1.4 -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') -source=("https://hackage.haskell.org/packages/archive/${_hkgname}/${pkgver}/${_hkgname}-${pkgver}.tar.gz") -sha512sums=('34e914039b385b66859b9438330619c9d0895ed8a71b4de38c66a3bbcc8bf1fafb663afb5e3c8d2ae897351c5fba204ddf44017644860578721946f1a184ecd3') - -prepare() { - sed -i 's/pkgconfig-depends: libcmark-gfm/Extra-Libraries: cmark-gfm/' $_hkgname-$pkgver/$_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}" \ - --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 -} - -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/PKGBUILD (from rev 372820, haskell-cmark-gfm/trunk/PKGBUILD) =================================================================== --- PKGBUILD (rev 0) +++ PKGBUILD 2018-08-20 06:50:56 UTC (rev 372821) @@ -0,0 +1,53 @@ +# $Id$ +# Maintainer: Felix Yan <felixonm...@archlinux.org> +# Contributor: Arch Haskell Team <arch-hask...@haskell.org> + +_hkgname=cmark-gfm +pkgname=haskell-cmark-gfm +pkgver=0.1.4 +pkgrel=2 +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" + system-cmark-gfm.patch) +sha512sums=('34e914039b385b66859b9438330619c9d0895ed8a71b4de38c66a3bbcc8bf1fafb663afb5e3c8d2ae897351c5fba204ddf44017644860578721946f1a184ecd3' + '8924169921274e52590535f052922c80b999088be8a38d39a86f8b4a567d05106d03ae9ae8b497cb683331c3a3aa23cd8ae4b3143ce62edc2a5d2281f29ad382') + +prepare() { + cd $_hkgname-$pkgver + # https://github.com/kivikakk/cmark-gfm-hs/issues/8 + patch -p1 -i ../system-cmark-gfm.patch +} + +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 372820, haskell-cmark-gfm/trunk/system-cmark-gfm.patch) =================================================================== --- system-cmark-gfm.patch (rev 0) +++ system-cmark-gfm.patch 2018-08-20 06:50:56 UTC (rev 372821) @@ -0,0 +1,55 @@ +commit ff75a191f067ceac00f4edc065cc1317d69d81ba +Author: Felix Yan <felixonm...@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