[arch-commits] Commit in pandoc/trunk (PKGBUILD ghc-8.2.1.patch)

Felix Yan felixonmars at archlinux.org
Thu Aug 17 14:54:30 UTC 2017


    Date: Thursday, August 17, 2017 @ 14:54:29
  Author: felixonmars
Revision: 251701

upgpkg: pandoc 1.19.2.1-105

GHC 8.2.1 rebuild

Added:
  pandoc/trunk/ghc-8.2.1.patch
Modified:
  pandoc/trunk/PKGBUILD

-----------------+
 PKGBUILD        |   25 ++++++++++------
 ghc-8.2.1.patch |   81 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 96 insertions(+), 10 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-08-17 14:52:48 UTC (rev 251700)
+++ PKGBUILD	2017-08-17 14:54:29 UTC (rev 251701)
@@ -4,12 +4,12 @@
 
 pkgname=pandoc
 pkgver=1.19.2.1
-pkgrel=104
+pkgrel=105
 pkgdesc="Conversion between markup formats"
 url="http://pandoc.org"
 license=("GPL")
 arch=('i686' 'x86_64')
-depends=('ghc' "haskell-http" "haskell-juicypixels" "haskell-sha" "haskell-aeson"
+depends=('ghc-libs' "haskell-http" "haskell-juicypixels" "haskell-sha" "haskell-aeson"
          "haskell-base64-bytestring" "haskell-blaze-html" "haskell-blaze-markup" "haskell-cmark"
          "haskell-data-default" "haskell-doctemplates" "haskell-mtl" "haskell-extensible-exceptions"
          "haskell-filemanip" "haskell-haddock-library" "haskell-skylighting" "haskell-hslua"
@@ -22,13 +22,21 @@
             'texlive-core: for pdf output')
 conflicts=('haskell-pandoc')
 replaces=('haskell-pandoc')
-source=("https://hackage.haskell.org/packages/archive/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz")
-sha256sums=('08692f3d77bf95bb9ba3407f7af26de7c23134e7efcdafad0bdaf9050e2c7801')
+makedepends=('ghc')
+source=("https://hackage.haskell.org/packages/archive/${pkgname}/${pkgver}/${pkgname}-${pkgver}.tar.gz"
+        ghc-8.2.1.patch)
+sha256sums=('08692f3d77bf95bb9ba3407f7af26de7c23134e7efcdafad0bdaf9050e2c7801'
+            '2d28962550964540ad543833b38fee8ae8d247d2b8ec08fcef9b9879bf967846')
 
 prepare() {
-    sed -e 's/syb >= 0.1 && < 0.7,/syb >= 0.1 \&\& < 0.8,/' \
-        -e 's/aeson >= 0.7.* && < 1.2,/aeson >= 0.7 \&\& < 1.3,/' \
-        -i $pkgname-$pkgver/$pkgname.cabal
+    cd "${srcdir}/${pkgname}-${pkgver}"
+    patch -p1 -i ../ghc-8.2.1.patch
+    sed -e 's/syb >= 0.1 && < 0.7,/syb >= 0.1,/' \
+        -e 's/aeson >= 0.7.* && < 1.2,/aeson >= 0.7,/' \
+        -e 's/process >= 1 && < 1.5,/process >= 1,/' \
+        -e 's/time >= 1.5 && < 1.7/time >= 1.5/' \
+        -e '/Build-Depends: pandoc,/a \                 texmath,' \
+        -i $pkgname.cabal
 }
 
 build() {
@@ -39,7 +47,6 @@
         --dynlibdir=/usr/lib --libsubdir=\$compiler/site-local/\$pkgid \
             -f-old-locale -fnetwork-uri -fhttps -f-trypandoc -f-embed_data_files -f-weigh-pandoc
     runhaskell Setup build
-    runhaskell Setup haddock --hoogle --html
     runhaskell Setup register --gen-script
     runhaskell Setup unregister --gen-script
     sed -i -r -e "s|ghc-pkg.*update[^ ]* |&'--force' |" register.sh
@@ -50,8 +57,6 @@
     cd "${srcdir}/${pkgbase}-${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"
-    install -d -m755 "${pkgdir}/usr/share/doc/ghc/html/libraries"
-    ln -s "/usr/share/doc/${pkgname}/html" "${pkgdir}/usr/share/doc/ghc/html/libraries/${pkgname}"
     runhaskell Setup copy --destdir="${pkgdir}"
     rm -f "${pkgdir}/usr/share/doc/${pkgname}/COPYING.md"
 

Added: ghc-8.2.1.patch
===================================================================
--- ghc-8.2.1.patch	                        (rev 0)
+++ ghc-8.2.1.patch	2017-08-17 14:54:29 UTC (rev 251701)
@@ -0,0 +1,81 @@
+From 10d91c147968d2e4d63b99b5b0342624827f416f Mon Sep 17 00:00:00 2001
+From: John MacFarlane <jgm at berkeley.edu>
+Date: Sun, 26 Mar 2017 17:22:00 +0200
+Subject: [PATCH] Use file-embed instead of hsb2hs to embed data files.
+
+I think template haskell is robust enough now across platforms
+that this will work.
+
+Motivation: file-embed gives us better dependency tracking:  if a data
+file changes, ghc/stack/cabal know to recompile the Data module.
+
+This also removes hsb2hs as a build dependency.
+---
+ INSTALL.md                            |  3 ---
+ Setup.hs                              | 28 ++--------------------------
+ linux/Dockerfile                      |  1 -
+ macos/make_macos_package.sh           |  3 ---
+ pandoc.cabal                          |  2 +-
+ src/Text/Pandoc/{Data.hsb => Data.hs} |  9 +++++----
+ 6 files changed, 8 insertions(+), 38 deletions(-)
+ rename src/Text/Pandoc/{Data.hsb => Data.hs} (77%)
+
+diff --git a/Setup.hs b/Setup.hs
+index bc6651942..3f6bb2858 100644
+--- a/Setup.hs
++++ b/Setup.hs
+@@ -20,41 +20,17 @@ import Distribution.Simple
+ import Distribution.Simple.PreProcess
+ import Distribution.Simple.Setup (ConfigFlags(..), CopyFlags(..), fromFlag)
+ import Distribution.PackageDescription (PackageDescription(..), FlagName(..))
+-import Distribution.Simple.Utils ( rawSystemExitCode, findProgramVersion )
+ import System.Exit
+-import Distribution.Simple.Utils (info, notice, installOrdinaryFiles)
++import Distribution.Simple.Utils (notice, installOrdinaryFiles)
+ import Distribution.Simple.Program (simpleProgram, Program(..))
+ import Distribution.Simple.LocalBuildInfo
+ import Control.Monad (when)
+
+ main :: IO ()
+ main = defaultMainWithHooks $ simpleUserHooks {
+-      -- enable hsb2hs preprocessor for .hsb files
+-      hookedPreProcessors = [ppBlobSuffixHandler]
+-    , hookedPrograms = [(simpleProgram "hsb2hs"){
+-                           programFindVersion = \verbosity fp ->
+-                             findProgramVersion "--version" id verbosity fp }]
+-    , postCopy = installManPage
++      postCopy = installManPage
+     }
+
+-ppBlobSuffixHandler :: PPSuffixHandler
+-ppBlobSuffixHandler = ("hsb", \_ lbi ->
+-  PreProcessor {
+-    platformIndependent = True,
+-    runPreProcessor = mkSimplePreProcessor $ \infile outfile verbosity ->
+-      do let embedData = case lookup (FlagName "embed_data_files")
+-                              (configConfigurationsFlags (configFlags lbi)) of
+-                              Just True -> True
+-                              _         -> False
+-         when embedData $
+-            do info verbosity $ "Preprocessing " ++ infile ++ " to " ++ outfile
+-               ec <- rawSystemExitCode verbosity "hsb2hs"
+-                          [infile, infile, outfile]
+-               case ec of
+-                    ExitSuccess   -> return ()
+-                    ExitFailure _ -> error "hsb2hs is needed to build this program"
+-  })
+-
+ installManPage :: Args -> CopyFlags
+                -> PackageDescription -> LocalBuildInfo -> IO ()
+ installManPage _ flags pkg lbi = do
+--- a/pandoc.cabal
++++ b/pandoc.cabal
+@@ -332,7 +332,7 @@ Library
+      cpp-options:   -DHTTP_CLIENT
+   if flag(embed_data_files)
+      cpp-options:   -DEMBED_DATA_FILES
+-     Build-Tools:   hsb2hs >= 0.3.1
++     build-depends: file-embed >= 0.0 && < 0.1
+      other-modules: Text.Pandoc.Data
+      if os(darwin)
+         Build-Tools:   cpphs >= 1.19



More information about the arch-commits mailing list