summaryrefslogtreecommitdiff
path: root/textproc
diff options
context:
space:
mode:
authorpho <pho@pkgsrc.org>2020-01-19 12:08:08 +0000
committerpho <pho@pkgsrc.org>2020-01-19 12:08:08 +0000
commit566a49fe5db1ea31e6b76026088625d296a28aaa (patch)
tree6a7c0f56ef4096b5dbe6d9e8b4b2b7c6b7f70b98 /textproc
parent6701d8a873187411e46552fa66f9e73ca816c91f (diff)
downloadpkgsrc-566a49fe5db1ea31e6b76026088625d296a28aaa.tar.gz
Import cheapskate-0.1.1.1
This is an experimental Markdown processor in pure Haskell. It aims to process Markdown efficiently and in the most forgiving possible way. It is designed to deal with any input, including garbage, with linear performance. Output is sanitized by default for protection against XSS attacks. Several markdown extensions are implemented, including fenced code blocks, significant list start numbers, and autolinked URLs.
Diffstat (limited to 'textproc')
-rw-r--r--textproc/hs-cheapskate/DESCR8
-rw-r--r--textproc/hs-cheapskate/Makefile19
-rw-r--r--textproc/hs-cheapskate/buildlink3.mk19
-rw-r--r--textproc/hs-cheapskate/distinfo7
-rw-r--r--textproc/hs-cheapskate/patches/patch-Cheapskate_ParserCombinators.hs32
5 files changed, 85 insertions, 0 deletions
diff --git a/textproc/hs-cheapskate/DESCR b/textproc/hs-cheapskate/DESCR
new file mode 100644
index 00000000000..f68a4b79f30
--- /dev/null
+++ b/textproc/hs-cheapskate/DESCR
@@ -0,0 +1,8 @@
+This is an experimental Markdown processor in pure Haskell. It aims to
+process Markdown efficiently and in the most forgiving possible
+way. It is designed to deal with any input, including garbage, with
+linear performance. Output is sanitized by default for protection
+against XSS attacks.
+
+Several markdown extensions are implemented, including fenced code
+blocks, significant list start numbers, and autolinked URLs.
diff --git a/textproc/hs-cheapskate/Makefile b/textproc/hs-cheapskate/Makefile
new file mode 100644
index 00000000000..0e2da0d11c6
--- /dev/null
+++ b/textproc/hs-cheapskate/Makefile
@@ -0,0 +1,19 @@
+# $NetBSD: Makefile,v 1.1 2020/01/19 12:08:08 pho Exp $
+
+DISTNAME= cheapskate-0.1.1.1
+CATEGORIES= textproc
+
+MAINTAINER= pho@cielonegro.org
+COMMENT= Experimental markdown processor
+LICENSE= modified-bsd
+
+# Don't pull in wai and wai-extra as dependencies.
+CONFIGURE_ARGS+= -f-dingus
+
+.include "../../textproc/hs-blaze-html/buildlink3.mk"
+.include "../../devel/hs-data-default/buildlink3.mk"
+.include "../../devel/hs-syb/buildlink3.mk"
+.include "../../devel/hs-uniplate/buildlink3.mk"
+.include "../../www/hs-xss-sanitize/buildlink3.mk"
+.include "../../mk/haskell.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/textproc/hs-cheapskate/buildlink3.mk b/textproc/hs-cheapskate/buildlink3.mk
new file mode 100644
index 00000000000..4da6ee3fbfd
--- /dev/null
+++ b/textproc/hs-cheapskate/buildlink3.mk
@@ -0,0 +1,19 @@
+# $NetBSD: buildlink3.mk,v 1.1 2020/01/19 12:08:08 pho Exp $
+
+BUILDLINK_TREE+= hs-cheapskate
+
+.if !defined(HS_CHEAPSKATE_BUILDLINK3_MK)
+HS_CHEAPSKATE_BUILDLINK3_MK:=
+
+BUILDLINK_API_DEPENDS.hs-cheapskate+= hs-cheapskate>=0.1.1
+BUILDLINK_ABI_DEPENDS.hs-cheapskate+= hs-cheapskate>=0.1.1.1
+BUILDLINK_PKGSRCDIR.hs-cheapskate?= ../../textproc/hs-cheapskate
+
+.include "../../textproc/hs-blaze-html/buildlink3.mk"
+.include "../../devel/hs-data-default/buildlink3.mk"
+.include "../../devel/hs-syb/buildlink3.mk"
+.include "../../devel/hs-uniplate/buildlink3.mk"
+.include "../../www/hs-xss-sanitize/buildlink3.mk"
+.endif # HS_CHEAPSKATE_BUILDLINK3_MK
+
+BUILDLINK_TREE+= -hs-cheapskate
diff --git a/textproc/hs-cheapskate/distinfo b/textproc/hs-cheapskate/distinfo
new file mode 100644
index 00000000000..c574ed197d5
--- /dev/null
+++ b/textproc/hs-cheapskate/distinfo
@@ -0,0 +1,7 @@
+$NetBSD: distinfo,v 1.1 2020/01/19 12:08:08 pho Exp $
+
+SHA1 (cheapskate-0.1.1.1.tar.gz) = 2bbe9c32b2099a6666a2631dc9874df2bb3e8b22
+RMD160 (cheapskate-0.1.1.1.tar.gz) = 335c13460d81489e153063915307223646322abc
+SHA512 (cheapskate-0.1.1.1.tar.gz) = 551fdf43f8ed8e15ed4a5ac1649f319477cc80762a34499eed58c7c77e1f3e2bc0c4f9887aac7632f341e825c202850617d0572fa6cb748104bbf2874dfba353
+Size (cheapskate-0.1.1.1.tar.gz) = 27077 bytes
+SHA1 (patch-Cheapskate_ParserCombinators.hs) = 7a9d984294af467960436de1f13481e476b9c4b0
diff --git a/textproc/hs-cheapskate/patches/patch-Cheapskate_ParserCombinators.hs b/textproc/hs-cheapskate/patches/patch-Cheapskate_ParserCombinators.hs
new file mode 100644
index 00000000000..d34cd9e32a0
--- /dev/null
+++ b/textproc/hs-cheapskate/patches/patch-Cheapskate_ParserCombinators.hs
@@ -0,0 +1,32 @@
+$NetBSD: patch-Cheapskate_ParserCombinators.hs,v 1.1 2020/01/19 12:08:08 pho Exp $
+
+Fix build with recent GHC.
+
+--- Cheapskate/ParserCombinators.hs.orig 2020-01-19 12:04:49.545981538 +0000
++++ Cheapskate/ParserCombinators.hs
+@@ -35,6 +35,7 @@ import Prelude hiding (takeWhile)
+ import Data.Text (Text)
+ import qualified Data.Text as T
+ import Control.Monad
++import Control.Monad.Fail
+ import Control.Applicative
+ import qualified Data.Set as Set
+
+@@ -109,7 +110,6 @@ instance Alternative Parser where
+
+ instance Monad Parser where
+ return x = Parser $ \st -> Right (st, x)
+- fail e = Parser $ \st -> Left $ ParseError (position st) e
+ p >>= g = Parser $ \st ->
+ case evalParser p st of
+ Left e -> Left e
+@@ -117,6 +117,9 @@ instance Monad Parser where
+ {-# INLINE return #-}
+ {-# INLINE (>>=) #-}
+
++instance MonadFail Parser where
++ fail e = Parser $ \st -> Left $ ParseError (position st) e
++
+ instance MonadPlus Parser where
+ mzero = Parser $ \st -> Left $ ParseError (position st) "(mzero)"
+ mplus p1 p2 = Parser $ \st ->