···1+commit a03d3b043458f45d29ba32068a77c0d3b8a4223f
2+Author: sternenseemann <0rpkxez4ksa01gb3typccl0i@systemli.org>
3+Date: Fri Apr 2 15:14:02 2021 +0200
4+5+ Allow compilation with pandoc 2.12 and 2.13
6+7+ pandoc 2.13 introduced the following breakages for gitit:
8+9+ * UTF8.readFile now returns a Text which is actually ideal for gitit.
10+ If pandoc is new enough we just make readFileUTF8 an alias for
11+ UTF8.readFile.
12+13+ * Text.Pandoc.Shared no longer exports substitute. In order to be
14+ conservative I've chosen to just copy the substitute function from
15+ pandoc 2.11.4. I need this patch kind of urgently so I didn't want to
16+ make any changes or refactors independently from upstream if
17+ avoidable. However, I'd be happy to rebase this PR branch to adopt a
18+ different solution to just copying the function.
19+20+diff --git a/src/Network/Gitit/Authentication.hs b/src/Network/Gitit/Authentication.hs
21+index 4c240e7..c0f92fd 100644
22+--- a/src/Network/Gitit/Authentication.hs
23++++ b/src/Network/Gitit/Authentication.hs
24+@@ -44,7 +44,7 @@ import System.Exit
25+ import System.Log.Logger (logM, Priority(..))
26+ import Data.Char (isAlphaNum, isAlpha)
27+ import qualified Data.Map as M
28+-import Text.Pandoc.Shared (substitute)
29++import Data.List (stripPrefix)
30+ import Data.Maybe (isJust, fromJust, isNothing, fromMaybe)
31+ import Network.URL (exportURL, add_param, importURL)
32+ import Network.BSD (getHostName)
33+@@ -54,6 +54,16 @@ import Codec.Binary.UTF8.String (encodeString)
34+ import Data.ByteString.UTF8 (toString)
35+ import Network.Gitit.Rpxnow as R
36+37++-- | Replace each occurrence of one sublist in a list with another.
38++-- Vendored in from pandoc 2.11.4 as 2.12 removed this function.
39++substitute :: (Eq a) => [a] -> [a] -> [a] -> [a]
40++substitute _ _ [] = []
41++substitute [] _ xs = xs
42++substitute target replacement lst@(x:xs) =
43++ case stripPrefix target lst of
44++ Just lst' -> replacement ++ substitute target replacement lst'
45++ Nothing -> x : substitute target replacement xs
46++
47+ data ValidationType = Register
48+ | ResetPassword
49+ deriving (Show,Read)
50+diff --git a/src/Network/Gitit/Util.hs b/src/Network/Gitit/Util.hs
51+index c5e9fe5..067130a 100644
52+--- a/src/Network/Gitit/Util.hs
53++++ b/src/Network/Gitit/Util.hs
54+@@ -45,7 +45,11 @@ import Network.URL (encString)
55+56+ -- | Read file as UTF-8 string. Encode filename as UTF-8.
57+ readFileUTF8 :: FilePath -> IO Text
58++#if MIN_VERSION_pandoc(2,12,0)
59++readFileUTF8 = UTF8.readFile
60++#else
61+ readFileUTF8 = fmap T.pack . UTF8.readFile
62++#endif
63+64+ -- | Perform a function a directory and return to working directory.
65+ inDir :: FilePath -> IO a -> IO a
···584 python2nix = throw "python2nix has been removed as it is outdated. Use e.g. nixpkgs-pytools instead."; # added 2021-03-08
585 qca-qt5 = libsForQt5.qca-qt5; # added 2015-12-19
586 qcsxcad = libsForQt5.qcsxcad; # added 2020-11-05
0587 qr-filetransfer = throw ''"qr-filetransfer" has been renamed to "qrcp"''; # added 2020-12-02
588 quake3game = ioquake3; # added 2016-01-14
589 qvim = throw "qvim has been removed."; # added 2020-08-31
···584 python2nix = throw "python2nix has been removed as it is outdated. Use e.g. nixpkgs-pytools instead."; # added 2021-03-08
585 qca-qt5 = libsForQt5.qca-qt5; # added 2015-12-19
586 qcsxcad = libsForQt5.qcsxcad; # added 2020-11-05
587+ qmk_firmware = throw "qmk_firmware has been removed because it was broken"; # added 2021-04-02
588 qr-filetransfer = throw ''"qr-filetransfer" has been renamed to "qrcp"''; # added 2020-12-02
589 quake3game = ioquake3; # added 2016-01-14
590 qvim = throw "qvim has been removed."; # added 2020-08-31