[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
44/44: gnu: Add pandoc-citeproc.
From: |
guix-commits |
Subject: |
44/44: gnu: Add pandoc-citeproc. |
Date: |
Thu, 13 Aug 2020 08:44:59 -0400 (EDT) |
rekado pushed a commit to branch wip-haskell
in repository guix.
commit 408b87fbb96037faa300d6d900fba1f563b35ac8
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Mon Jun 29 12:40:46 2020 +0200
gnu: Add pandoc-citeproc.
* gnu/packages/haskell-xyz.scm (pandoc-citeproc): New variable.
---
gnu/packages/haskell-xyz.scm | 102 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 102 insertions(+)
diff --git a/gnu/packages/haskell-xyz.scm b/gnu/packages/haskell-xyz.scm
index b51320c..737865e 100644
--- a/gnu/packages/haskell-xyz.scm
+++ b/gnu/packages/haskell-xyz.scm
@@ -9007,6 +9007,108 @@ and also has a mode for converting bibliographic
databases a YAML format
suitable for inclusion in pandoc YAML metadata.")
(license license:bsd-3)))
+(define-public pandoc-citeproc
+ (package (inherit ghc-pandoc-citeproc)
+ (name "pandoc-citeproc")
+ (arguments
+ `(#:configure-flags
+ (list "-fstatic"
+ "--disable-shared"
+ "--disable-executable-dynamic"
+ ;; That's where we place all static libraries
+ "--extra-lib-dirs=static-libs/"
+ "--ghc-option=-static")
+ #:modules ((guix build haskell-build-system)
+ (guix build utils)
+ (ice-9 match)
+ (srfi srfi-1))
+ #:phases
+ (modify-phases %standard-phases
+ ;; Many YAML tests (44) are failing do to changes in ghc-yaml:
+ ;; <https://github.com/jgm/pandoc-citeproc/issues/342>.
+ (add-before 'configure 'patch-tests
+ (lambda _
+ (substitute* "tests/test-pandoc-citeproc.hs"
+ (("let allTests = citeprocTests \\+\\+ biblio2yamlTests")
+ "let allTests = citeprocTests"))))
+ ;; Tests need to be run after installation.
+ (delete 'check)
+ (add-after 'install 'post-install-check
+ (assoc-ref %standard-phases 'check))
+ (add-after 'unpack 'create-simple-paths-module
+ (lambda* (#:key outputs #:allow-other-keys)
+ (call-with-output-file "Paths_pandoc_citeproc.hs"
+ (lambda (port)
+ (format port "\
+{-# LANGUAGE CPP #-}
+{-# LANGUAGE NoRebindableSyntax #-}
+{-# OPTIONS_GHC -fno-warn-missing-import-lists #-}
+module Paths_pandoc_citeproc (version,getDataFileName) where
+import Prelude
+import Data.Version (Version(..))
+import System.Info
+version :: Version
+version = Version [~a] []
+
+datadir :: FilePath
+datadir = \"~a/share/\" ++
+ arch ++ \"-\" ++
+ os ++ \"-\" ++
+ compilerName ++ \"-~a/pandoc-citeproc-~a\"
+
+getDataDir :: IO FilePath
+getDataDir = return datadir
+
+getDataFileName :: FilePath -> IO FilePath
+getDataFileName name = do
+ dir <- getDataDir
+ return (dir ++ \"/\" ++ name)
+"
+ (string-map (lambda (chr) (if (eq? chr #\.) #\, chr))
+ ,(package-version ghc-pandoc-citeproc))
+ (assoc-ref outputs "out")
+ ,(package-version ghc)
+ ,(package-version ghc-pandoc-citeproc))))
+ #t))
+ (add-after 'unpack 'prepare-static-libraries
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p (string-append (getcwd) "/static-libs"))
+ (for-each
+ (lambda (input)
+ (when (or (string-prefix? "static-" (car input))
+ (string-prefix? "ghc" (car input)))
+ (match (find-files (cdr input) "\\.a$")
+ ((and (first . rest) libs)
+ (for-each (lambda (lib)
+ (let ((target (string-append (getcwd)
"/static-libs/"
+ (basename lib))))
+ (unless (file-exists? target)
+ (symlink first target))))
+ libs))
+ (_ #f))))
+ inputs)
+ #t)))))
+ (inputs
+ (let* ((direct-inputs
+ (cons `("ghc-pandoc" ,pandoc)
+ (alist-delete "ghc-pandoc"
+ (package-inputs ghc-pandoc-citeproc))))
+ (all-static-inputs
+ (map (lambda (pkg)
+ (list (string-append "static-" (package-name pkg))
+ pkg "static"))
+ (delete-duplicates
+ (append (map cadr direct-inputs)
+ (filter (lambda (pkg)
+ (string-prefix? "ghc-" (package-name
pkg)))
+ (package-closure
+ (map cadr direct-inputs))))))))
+ `(("zlib:static" ,zlib "static")
+ ("pandoc" ,pandoc "lib")
+ ,@all-static-inputs
+ ,@direct-inputs)))
+ (synopsis "Pandoc filter for bibliographic references")))
+
(define-public ghc-pandoc-types
(package
(name "ghc-pandoc-types")
- 28/44: gnu: ghc-haskell-src-exts: Add "doc" output., (continued)
- 28/44: gnu: ghc-haskell-src-exts: Add "doc" output., guix-commits, 2020/08/13
- 32/44: gnu: ghc-mono-traversable: Add "doc" output., guix-commits, 2020/08/13
- 33/44: gnu: ghc-profunctors: Add "doc" output., guix-commits, 2020/08/13
- 34/44: gnu: ghc-rebase: Add "doc" output., guix-commits, 2020/08/13
- 35/44: gnu: ghc-regex-tdfa: Add "doc" output., guix-commits, 2020/08/13
- 39/44: gnu: ghc-distributive: Update to 0.6.2., guix-commits, 2020/08/13
- 40/44: gnu: ghc-pandoc-types: Avoid embedding spurious references., guix-commits, 2020/08/13
- 41/44: gnu: ghc-http: Prevent embedding of spurious references., guix-commits, 2020/08/13
- 43/44: gnu: Add pandoc., guix-commits, 2020/08/13
- 38/44: gnu: ghc-unliftio: Add "doc" output., guix-commits, 2020/08/13
- 44/44: gnu: Add pandoc-citeproc.,
guix-commits <=
- 42/44: gnu: ghc-pandoc: Fix tests., guix-commits, 2020/08/13