Debian Codegraph @

debian/rules

raw symbols SCIP
1 #!/usr/bin/make -f
2 # debian/rules file for texlive-bin
3
4 export SHELL=/bin/bash
5 export CONFIG_SHELL=/bin/bash
6
7 export DEBIANTMP=debian/tmp
8
9 # this ships out the test logs when a test failed, set it in any case
10 export VERBOSE=1
11
12 # See FEATURE AREAS in dpkg-buildflags(1).
13 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
14
15 #
16 # the configure code already checks a lot, but it does not catch
17 # all cases. We have now two ways to test for where to build.
18 # One by disabling on the other platforms, one by whitelisting
19 # and building only on some platforms.
20 LUAJIT_GOOD_ARCHS := amd64 armel armhf arm64 hurd-amd64 hurd-i386 i386 powerpc
21
22 # In case one wants to build with old automake (<< 1.13.1), the following
23 # variable has to be set. By default the debian/control requires high
24 # enough versions of automake and friends
25 #export AM_V_P=false
26
27 include /usr/share/dpkg/architecture.mk
28
29 ifeq ($(DEB_HOST_ARCH), alpha)
30 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--no-relax
31 endif
32
33 #
34 #
35 # architectures where icu related programs (xetex) have problems
36 # and core dump etc. Possible fix, but sub-optimal because slowing down
37 # programs
38 # TODO should be checked whether this still happens!
39 BROKEN_ICU_ARCHS := sparc64
40 ifneq (,$(findstring $(DEB_HOST_ARCH), $(BROKEN_ICU_ARCHS)))
41 export DEB_CFLAGS_MAINT_APPEND += -DU_IS_BIG_ENDIAN=0
42 export DEB_CXXFLAGS_MAINT_APPEND += -DU_IS_BIG_ENDIAN=0
43 else
44 endif
45
46
47 # for whitelisting good archs
48 ifeq (,$(filter $(DEB_HOST_ARCH), $(LUAJIT_GOOD_ARCHS)))
49 # it is not in the list of good archs -> disable luajittex
50 BUILDLUAJITTEX=--disable-luajittex --disable-mfluajit --disable-luajithbtex
51 WITHLUAJIT=no
52 else
53 # not necessary, but for completeness
54 BUILDLUAJITTEX=--enable-luajittex --enable-mfluajit --enable-luajithbtex
55 WITHLUAJIT=yes
56 endif
57
58 ZZIPLIB=--with-system-zziplib
59
60 ifeq ($(DEB_HOST_ARCH_CPU), i386)
61 # Not use system zziplib on i386 arches.
62 ZZIPLIB=--without-system-zziplib
63 endif
64
65 #
66 # it seems that ARM metafont segfaults due to a problem with armhf's malloc
67 # see Debian bug #678604
68 # Building in arm mode helps
69 #
70 ifeq ($(DEB_HOST_ARCH), armhf)
71 DEB_CFLAGS_MAINT_APPEND += -marm
72 endif
73
74 # warning: if the --with autoreconf is removed then
75 # the patch debian/patches/debian-no-linked-scripts
76 # must be adapted to also patch the Makefile.in!
77
78 # Workaround for incompatibility to GCC 15.
79 # Mostly lua[hb][jit]text, pdftex & ps2pk are not fixed yet.
80 #DEB_CFLAGS_MAINT_APPEND += -std=gnu17
81
82 # Workaround for incompatibility to GCC 16. Bug#1133647.
83 # https://sourceforge.net/p/xetex/bugs/205/
84 #DEB_CXXFLAGS_MAINT_APPEND += -std=c++17
85
86 export DEB_CFLAGS_MAINT_APPEND
87 #export DEB_CXXFLAGS_MAINT_APPEND
88
89 %:
90 dh $@ --builddirectory Work --max-parallel=8
91
92 #
93 # we use TL provided reautoconf script as it has some built-in magic
94 override_dh_autoreconf-arch:
95 dh_autoreconf ./reautoconf
96
97 override_dh_autoreconf-indep:
98 # Nothing to do here
99
100 # this was used before, but I am not sure whether the -as-needed is necessary
101 # dh_autoreconf --as-needed
102
103 #
104 # poppler is used two times in TeX Live:
105 # once for pdftex/xetex
106 # once for luatex -> obsolete, luatex uses pplib
107 # - the pdftex/xetex version is controlled via --with-system-xpdf
108 # - the luatex version is controlled via --with-system-poppler
109 #
110 # Status as of 20180118
111 # poppler in Debian is NOT enough for current, so we use the shipped
112 # libraries for both.
113 # --with-system-poppler \
114 # --with-system-xpdf \
115 #
116 # Status as of 20230913
117 # TL upstream stopped using poppler to get pdf support in pdftex
118 # and pdftosrc. Instead they use the shipped xpdf "library". The
119 # configure option "--with-system-xpdf" does not do anything.
120 # https://tug.org/pipermail/tex-live/2023-September/049457.html ff.
121
122 # disable-largefile seems to break omegafonts, as they core dump
123 # leave it as is for now and see what else pops up
124 # --disable-largefile \
125
126 override_dh_auto_configure-arch:
127 # we have to make sure that the mendex test case that is added
128 # by a patch is executable, same for pdftexdir - stupid dpkg-source
129 chmod 0755 texk/mendexk/tests/mendex.test
130 chmod 0755 texk/web2c/pdftexdir/expanded.test
131 # make sure that the lacheck test script is executable
132 # this is only necessary since quilt/dpkg does not support
133 # permissions
134 chmod ugo+x utils/lacheck/test-def.test
135 #chmod ugo+x libs/zziplib/zziplib.test
136
137 # run out configure script
138 dh_auto_configure -- -C --prefix=/usr \
139 --datarootdir=/usr/share/texlive \
140 --disable-native-texlive-build \
141 --disable-missing \
142 --disable-linked-scripts \
143 --with-banner-add=/Debian \
144 --enable-shared \
145 --with-system-zlib \
146 --with-system-zzlib \
147 --with-system-potrace \
148 --with-system-graphite2 \
149 --with-system-harfbuzz \
150 --with-system-libgs \
151 --with-system-pixman \
152 --with-system-libpaper \
153 $(ZZIPLIB) \
154 --with-system-icu \
155 --with-system-gmp \
156 --with-system-mpfi \
157 --with-system-mpfr \
158 --with-system-freetype2 \
159 --with-freetype2-include=/usr/include/freetype2 \
160 --with-system-libpng \
161 --with-system-gd \
162 --with-system-cairo \
163 --with-system-teckit \
164 --with-x \
165 --with-mf-x-toolkit \
166 --with-xdvi-x-toolkit=xaw \
167 $(BUILDLUAJITTEX) \
168 --disable-lcdf-typetools \
169 --disable-biber \
170 --disable-dvipng \
171 --disable-ps2eps \
172 --disable-psutils \
173 --disable-t1utils \
174 --disable-cjkutils \
175 --disable-chktex \
176 --disable-lacheck \
177 --disable-texdoctk \
178 --disable-ttf2pk \
179 --disable-dvisvgm \
180 --enable-ttf2pk2 \
181 --enable-ipc
182
183 # HACK: manually create the detex-src subdirectory inside the build
184 # directory to ensure it exists; the situation is the following:
185 # - texk/detex/Makefile.am has a rule to generate detex-src/detex.h
186 # from detex-src/detex.l using lex (wrapped in build-aux/ylwrap)
187 # - ylwrap does not create any missing subdirectory for the output file
188 # - automake (currently 1.17) generate a rule to create the needed
189 # subdirectory, however it is only added as dependency for the
190 # detex-src/detex.o object file (build from detex-src/detex.c, which
191 # includes the generated detex-src/detex.h); this rule is also
192 # written in the Makefile after the rule to invoke ylwrap
193 # - GNU make starting from 4.4 remakes rules in the same order they
194 # were processed, rather the opposite as in previous versions
195 # When building with a single build job, the rule to generate
196 # detex-src/detex.h is processed before the rule to create the output
197 # subdirectory; thus in a builddir!=srcdir build ylwrap fails as:
198 # ../../../texk/detex/../../build-aux/ylwrap: line 204: ../detex-src/detex.c: No such file or directory
199 # While this feels like a bug in automake, work around it for now.
200 # https://lists.gnu.org/archive/html/bug-automake/2017-06/msg00005.html
201 #mkdir -p $(CURDIR)/Work/texk/detex/detex-src/
202
203 override_dh_auto_configure-indep:
204 # Nothing to do here
205
206 override_dh_auto_install-arch:
207 dh_auto_install -- DESTDIR=$(CURDIR)/$(DEBIANTMP)
208
209 override_dh_auto_install-indep:
210 mkdir -p $(CURDIR)/$(DEBIANTMP)
211
212 override_dh_install-arch:
213 # remove .la files which we do not install, so that dh_install
214 # can work with --fail-missing
215 rm -f $(DEBIANTMP)/usr/lib/*.la $(DEBIANTMP)/usr/lib/*/*.la
216 # mv c-auto.h into arch-dependent include path
217 mkdir -p $(DEBIANTMP)/usr/include/$(DEB_HOST_MULTIARCH)/kpathsea
218 mv $(DEBIANTMP)/usr/include/kpathsea/c-auto.h \
219 $(DEBIANTMP)/usr/include/$(DEB_HOST_MULTIARCH)/kpathsea/
220 dh_install --sourcedir=$(CURDIR)/$(DEBIANTMP)
221
222 execute_after_dh_install-arch:
223 # replace xdvi wrapper shell script with perl variant to
224 # allow for opening of gz etc files
225 rm debian/texlive-binaries/usr/bin/xdvi
226 install -m 0755 debian/xdvi-pl debian/texlive-binaries/usr/bin/xdvi
227 # remove texlive directories, they should not be shipped here
228 rm -rf debian/texlive-binaries/usr/share/texlive
229 # remove wrongly added info/dir.gz
230 rm -f debian/texlive-binaries/usr/share/info/dir*
231 # remove tlbuild info document, not needed
232 rm debian/texlive-binaries/usr/share/info/tlbuild.info*
233 # remove various man pages
234 for i in latex latex-dev pdflatex pdflatex-dev lamed lualatex-dev dvilualatex-dev \
235 dviluatex platex-dev uplatex-dev xelatex-dev amstex \
236 eptex euptex ptex pbibtex ppltotf ptftopl upbibtex uppltotf uptex uptftopl \
237 texprof texprofile ; do \
238 rm debian/texlive-binaries/usr/share/man/man1/$$i.1* ; \
239 done
240 #
241 # Remove luajit* binaries from texlive-binaries
242 rm -f debian/texlive-binaries/usr/bin/*luajit*
243 rm -f debian/texlive-binaries/usr/share/man/man*/*luajit*
244 #
245 # remove tex4ht links, they are shipped with tl-htmlxml
246 for i in ht htcontext htlatex htmex httex httexi htxelatex htxetex mk4ht xhlatex ; do \
247 rm debian/texlive-binaries/usr/bin/$$i ; \
248 done
249 #
250 # install dvisvgm man page
251 #install -m 0644 texk/dvisvgm/dvisvgm-src/doc/dvisvgm.1 \
252 # debian/texlive-binaries/usr/share/man/man1/dvisvgm.1
253 # for alternatives treatment we rename usr/bin/bibtex to
254 # usr/bin/bibtex.original
255 mv debian/texlive-binaries/usr/bin/bibtex \
256 debian/texlive-binaries/usr/bin/bibtex.original
257 mv debian/texlive-binaries/usr/share/man/man1/bibtex.1 \
258 debian/texlive-binaries/usr/share/man/man1/bibtex.original.1
259 # find dangling symlinks in /usr/bin and error out if found
260 err=0 ; for i in `find debian/texlive-binaries/usr/bin -type l` ; do \
261 f=`realpath $$i` ; \
262 if [ ! -r "$$f" ] ; then \
263 echo "ERROR: dangling symbolic link $$f" ; \
264 err=1 ; \
265 fi ; \
266 done ; if [ $$err = 1 ] ; then exit 1 ; fi
267
268 override_dh_installdocs-arch:
269 dh_installdocs
270 dh_installdocs -plibptexenc1 -plibptexenc-dev \
271 texk/ptexenc/COPYRIGHT texk/ptexenc/README
272 dh_installdocs -plibkpathsea6 -plibkpathsea-dev \
273 texk/kpathsea/AUTHORS \
274 texk/kpathsea/NEWS texk/kpathsea/PROJECTS \
275 texk/kpathsea/README
276 dh_installdocs -plibsynctex2 -plibsynctex-dev \
277 texk/web2c/synctexdir/README.txt \
278 texk/web2c/synctexdir/synctex_parser_readme.txt
279 ifeq ($(WITHLUAJIT), yes)
280 dh_installdocs -plibtexluajit2 -plibtexluajit-dev
281 endif
282
283 #override_dh_installdocs-indep:
284 # dh_installdocs -plibtexlua53 -plibtexlua53-dev
285
286 override_dh_installchangelogs:
287 dh_installchangelogs
288 dh_installchangelogs -plibkpathsea6 -plibkpathsea-dev \
289 texk/kpathsea/ChangeLog
290 dh_installchangelogs -plibptexenc1 -plibptexenc-dev \
291 texk/ptexenc/ChangeLog
292 dh_installchangelogs -plibsynctex2 -plibsynctex-dev \
293 texk/web2c/synctexdir/ChangeLog
294 dh_installchangelogs -plibtexlua53-5 -plibtexlua-dev \
295 libs/lua53/TLpatches/ChangeLog
296 ifeq ($(WITHLUAJIT), yes)
297 dh_installchangelogs -plibtexluajit2 -plibtexluajit-dev \
298 libs/luajit/TLpatches/ChangeLog
299 endif
300
301 override_dh_compress:
302 dh_compress -X.pdf
303
304 override_dh_missing:
305 dh_missing --sourcedir=$(CURDIR)/$(DEBIANTMP) --fail-missing
306
307 override_dh_makeshlibs:
308 dh_makeshlibs -plibkpathsea6
309 dh_makeshlibs -plibptexenc1
310 dh_makeshlibs -plibsynctex2
311 dh_makeshlibs -plibtexlua53-5
312 ifeq ($(WITHLUAJIT), yes)
313 dh_makeshlibs -plibtexluajit2
314 endif
315
316 SHLIBDEPS = -l debian/libkpathsea6/usr/lib/* \
317 -l debian/libptexenc1/usr/lib/* \
318 -l debian/libsynctex2/usr/lib/* \
319 -l debian/libtexlua53-5/usr/lib/*
320
321 ifeq ($(WITHLUAJIT), yes)
322 SHLIBDEPS += -l debian/libtexluajit2/usr/lib/*
323 endif
324 override_dh_shlibdeps:
325 dh_shlibdeps $(SHLIBDEPS)
326
327 override_dh_clean:
328 dh_clean -X.orig