File: rules

package info (click to toggle)
pandoc 2.2.1-3
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 17,456 kB
  • sloc: haskell: 55,993; xml: 3,297; makefile: 112; sh: 7
file content (155 lines) | stat: -rwxr-xr-x 5,769 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
#!/usr/bin/make -f

# Copyright © 2006-2010 John MacFarlane <jgm@berkeley.edu>
# Copyright © 2007-2008 Recai Oktaş <roktas@debian.org>
# Copyright © 2008-2018 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for Pandoc
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/class/hlibrary.mk

pkg = $(DEB_SOURCE_PACKAGE)

# helper macros for GHC dependencies, e.g.: foo bar,dev,prof doc,>=,1.2,<<,1.3 baz
expand-or-strip-ghc-dep = $(foreach expandsuffix,$1,\
 $(comma) libghc-$3-$(expandsuffix) $(if $4,($4 $5))\
 $(if $6,\
  $(comma) libghc-$3-$(expandsuffix) ($6 $7)))\
 $(foreach stripsuffix,$2,\
  $(comma) libghc-$3-$(stripsuffix))
expand-ghc-deps = $(foreach dep,$(sort $3),$(call expand-or-strip-ghc-dep,\
 $1,\
 $2,$(strip \
 $(word 1,$(subst $(comma),$(space),$(dep)))),$(strip \
 $(word 2,$(subst $(comma),$(space),$(dep)))),$(strip \
 $(word 3,$(subst $(comma),$(space),$(dep)))),$(strip \
 $(word 4,$(subst $(comma),$(space),$(dep)))),$(strip \
 $(word 5,$(subst $(comma),$(space),$(dep))))))

# Haskell dependencies for any build from pandoc.cabal
ghc-deps += syb,<<,0.8
ghc-deps += unordered-containers,<<,0.3
ghc-deps += parsec3,<<,3.2
ghc-deps += mtl,>=,2.2,<<,2.3
ghc-deps += exceptions,>=,0.8,<<,0.11
ghc-deps += text,<<,1.3
ghc-deps += safe,<<,0.4
ghc-deps += zip-archive,<<,0.4
ghc-deps += http,<<,1:4000.4
ghc-deps += texmath,>=,0.10,<<,0.12
ghc-deps += xml,<<,1.4
ghc-deps += split,<<,0.3
ghc-deps += random,<<,1.2
ghc-deps += pandoc-types,>=,1.17.4.2,<<,1.18
ghc-deps += aeson,<<,1.4
ghc-deps += aeson-pretty,>=,0.8.5,<<,0.9
ghc-deps += tagsoup,>=,0.14.6,<<,0.15
ghc-deps += base64-bytestring,<<,1.1
ghc-deps += zlib,<<,0.7
ghc-deps += skylighting,>=,0.5.1,<<,0.8
ghc-deps += data-default,<<,0.8
ghc-deps += temporary,<<,1.4
ghc-deps += blaze-html,>=,0.9,<<,0.10
ghc-deps += blaze-markup,>=,0.8,<<,0.9
ghc-deps += yaml,<<,0.9
ghc-deps += scientific,<<,0.4
ghc-deps += vector,<<,0.13
ghc-deps += hslua,>=,0.9.5,<<,0.9.6
ghc-deps += hslua-module-text,<<,0.2
ghc-deps += sha,<<,1.7
ghc-deps += haddock-library,<<,1.6
ghc-deps += juicypixels,<<,3.3
ghc-deps += glob,<<,0.10
ghc-deps += cmark-gfm,<<,0.2
ghc-deps += doctemplates,>=,0.2.1,<<,0.3
ghc-deps += http-client,>=,0.4.30,,<<,0.6
ghc-deps += http-client-tls,>=,0.2.4,<<,0.4
ghc-deps += http-types,<<,0.13
ghc-deps += case-insensitive,>=,1.2,<<,1.3
ghc-deps += network,>=,2.6
ghc-deps += network-uri,<<,2.7

# Haskell dependencies for testsuite from pandoc.cabal
ghc-deps-test += diff,<<,0.4
ghc-deps-test += tasty,>=,0.11,<<,1.2
ghc-deps-test += tasty-hunit,<<,0.11
ghc-deps-test += tasty-quickcheck,<<,0.11
ghc-deps-test += tasty-golden,>=,2.3,<<,2.4
ghc-deps-test += quickcheck2,<<,2.12
ghc-deps-test += executable-path,<<,0.1

# Haskell dependencies (maybe) needed for documentation
# TODO: actually use these (not maintain Build-depends-indep by hand)
ghc-deps-doc += blaze-builder
ghc-deps-doc += digest
ghc-deps-doc += dlist
ghc-deps-doc += hs-bibutils
ghc-deps-doc += pcre-light
ghc-deps-doc += rts
ghc-deps-doc += transformers
ghc-deps-doc += utf8-string

# Needed by upstream build process
CDBS_BUILD_DEPENDS +=, ghc, ghc-prof, alex, happy
CDBS_BUILD_DEPENDS += $(call expand-ghc-deps,dev,prof,$(ghc-deps))
CDBS_BUILD_DEPENDS += $(call expand-ghc-deps,dev,,$(ghc-deps-test))
CDBS_BUILD_DEPENDS_INDEP +=, ghc-doc
CDBS_BUILD_DEPENDS_INDEP +=, $(call expand-ghc-deps,,doc,$(ghc-deps) $(ghc-deps-doc))

# Needed for our packaging
#  * recent haskell-devscripts needed for version-less datadir
CDBS_BUILD_DEPENDS +=, haskell-devscripts

# Needed (always/often/seldom) at runtime
#  texlive-* needed for PDF output
#  librsvg2-bin (rsvg-convert) needed for SVG in PDF output
#  groff needed for groff man and groff ms output
# TODO: suggest slide show Javascript libraries when in Debian
CDBS_SUGGESTS_$(pkg) = texlive-latex-recommended, texlive-xetex, texlive-luatex
CDBS_SUGGESTS_$(pkg) +=, pandoc-citeproc, texlive-latex-extra, context
CDBS_SUGGESTS_$(pkg) +=, wkhtmltopdf, librsvg2-bin, groff, ghc, nodejs,
CDBS_SUGGESTS_$(pkg) +=, php, perl, python, ruby, r-base-core
CDBS_SUGGESTS_$(pkg) +=, libjs-mathjax, node-katex

# Fix exception thrown building documentation:
# haddock: internal error: <stdout>: commitBuffer: invalid argument (invalid character)
export LANG=C.UTF-8

# Use threaded RTS only when supported
DEB_SETUP_GHC_CONFIGURE_ARGS += $(if $(wildcard /usr/lib/ghc-$(GHC_VERSION)/libHSrts_thr.a),,--flags=-threaded)

# Disable timer to help build on slow arches like hppa
DEB_SETUP_GHC_CONFIGURE_ARGS += --ghc-options="+RTS -V0 -RTS"

ifneq (,$(filter $(DEB_BUILD_ARCH),mips mipsel))
    DEB_SETUP_GHC_CONFIGURE_ARGS += --ghc-options="-optc--param -optcggc-min-expand=10"
endif

DEB_ENABLE_TESTS = yes
DEB_SETUP_GHC_CONFIGURE_ARGS += $(if $(filter nocheck,$(DEB_BUILD_OPTIONS)),,-ftests)

DEB_INSTALL_DOCS_ALL += README.md

DEB_INSTALL_MANPAGES_$(pkg) = man/pandoc.1

CDBS_BUILD_DEPENDS +=, bash-completion
post-install/$(pkg)::
	debian/tmp-inst-*/usr/bin/pandoc --bash-completion \
		> debian/pandoc.bash-completion
binary-install/$(pkg)::
	dh_bash-completion
clean::
	rm -f debian/pandoc.bash-completion