PKGBUILD 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. # Maintainer (archarm): Kevin Mihelich <kevin@archlinuxarm.org>
  2. # Maintainer (arch): Antonio Rojas <arojas@archlinux.org>
  3. # Maintainer (arch): Caleb Maclennan <caleb@alerque.com>
  4. # Contributor: Rémy Oudompheng <remy@archlinux.org>
  5. # Contributor: francois <francois.archlinux.org>
  6. # Contributor: Omar Vega Ramos <ovruni@gnu.org.pe>
  7. # Contributor: André Silva <emulatorman@hyperbola.info>
  8. # Contributor: Michał Masłowski <mtjm@mtjm.eu>
  9. # Contributor: Isaac David <isacdaavid(at)isacdaavid!info>
  10. # Contributor: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
  11. # Contrbutor: bill-auger <bill-auger@programmer.net>
  12. # Contributor: David P. <megver83@parabola.nu>
  13. # parabola changes and rationale:
  14. # technical:
  15. # - re-brand for parabola (due to changes in texlive-{core,fontsextra,latexextra})
  16. # - pin to strongly-coupled dependency versions
  17. # - disable texindy/xindy on armv7h
  18. # - build from upstream sourve-ball, rather than VCS
  19. # archarm changes:
  20. # -fPIC for v6 and v7
  21. # --disable-xindy, remove xindy stuff, segfaults with clisp
  22. # --disable-cxx-runtime-hack
  23. # drop clisp and ffcall makedepends
  24. pkgname=(texlive-bin libsynctex)
  25. pkgver=2024.2
  26. pkgrel=2
  27. pkgrel+=.parabola1
  28. license=(GPL-2.0-or-later)
  29. arch=(x86_64)
  30. arch+=(armv7h i686)
  31. makedepends=(bash
  32. cairo
  33. clisp
  34. ffcall
  35. fontconfig
  36. freetype2
  37. gcc-libs
  38. gd
  39. git
  40. glibc
  41. gmp
  42. graphite
  43. harfbuzz
  44. icu
  45. libjpeg
  46. libpaper
  47. libpng
  48. libsigsegv
  49. libunistring
  50. libx11
  51. libxaw
  52. libxcrypt
  53. libxmu
  54. libxpm
  55. libxt
  56. mpfr
  57. ncurses
  58. perl
  59. pixman
  60. potrace
  61. readline
  62. subversion
  63. t1lib
  64. zlib
  65. zziplib)
  66. url='https://tug.org/texlive/'
  67. _rev=svn70897 # tags/texlive-2024.2
  68. source=(texlive-bin-${_rev}.tar.gz::https://github.com/TeX-Live/texlive-source/archive/refs/tags/${_rev}.tar.gz # we use source-ball
  69. ptex-debug-print.patch)
  70. sha256sums=('a8e1f537febe4b4a5f98ee3e7fd4b6007421e66951ad0e27b8624e6ef6ce3a53'
  71. 'aa838f09003c62c2efb5770a8de66f99b409df049fbd65098d80fd1957d06c50')
  72. # Parabola: remove git, remove clisp and ffcall on armv7h
  73. unset makedepends[8]
  74. if [[ "$CARCH" == armv7h ]]; then
  75. unset makedepends[2] makedepends[3]
  76. fi
  77. prepare() {
  78. cd texlive-source-$_rev
  79. # bibtex-x needs kpathsea flags
  80. sed -i '/AC_SEARCH_LIBS/a KPSE_KPATHSEA_FLAGS' texk/bibtex-x/configure.ac
  81. (cd texk/bibtex-x && autoreconf)
  82. # t4ht expects to be un /usr/share/texmf/bin/t4ht (FS#27251)
  83. sed -i s/SELFAUTOPARENT/TEXMFROOT/ texk/tex4htk/t4ht.c
  84. # remove spurious ptex "guessed encoding" print
  85. patch -p1 -i ../ptex-debug-print.patch
  86. }
  87. build() {
  88. cd texlive-source-$_rev
  89. # HACK: Parabola: Define an array to set CARCH-specific arguments
  90. local carch_args
  91. case "$CARCH" in
  92. "armv7h") carch_args=(--disable-xindy --disable-cxx-runtime-hack) ;;
  93. *) carch_args=(--enable-xindy)
  94. esac
  95. mkdir -p build
  96. cd build
  97. CFLAGS+=" -Wno-incompatible-pointer-types" \
  98. ax_cv_c_float_words_bigendian=no \
  99. ../configure --prefix=/usr -C \
  100. --sysconfdir=/etc \
  101. --datarootdir=/usr/share \
  102. --datadir=/usr/share \
  103. --mandir=/usr/share/man \
  104. --disable-native-texlive-build \
  105. --with-banner-add="/Parabola GNU/Linux-libre" \
  106. --disable-multiplatform \
  107. --disable-dialog \
  108. --disable-psutils \
  109. --disable-t1utils \
  110. --disable-bibtexu \
  111. --disable-dvisvgm \
  112. --disable-xz \
  113. --enable-shared \
  114. --disable-static \
  115. --with-system-zlib \
  116. --with-system-zziplib \
  117. --with-system-pnglib \
  118. --with-system-ncurses \
  119. --with-system-t1lib \
  120. --with-system-gd \
  121. --with-system-freetype2 \
  122. --with-system-pixman \
  123. --with-system-cairo \
  124. --with-system-harfbuzz \
  125. --with-system-graphite \
  126. --with-system-icu \
  127. --with-system-gmp \
  128. --with-system-mpfr \
  129. --with-system-potrace \
  130. --with-system-libpaper \
  131. --with-freetype2-libdir=/usr/lib \
  132. --with-freetype2-include=/usr/include/freetype2 \
  133. --with-xdvi-x-toolkit=xaw \
  134. --disable-dump-share \
  135. --with-clisp-runtime=default \
  136. --disable-xindy-rules \
  137. --disable-xindy-docs "${carch_args[@]}"
  138. # prevent excessive overlinking due to libtool
  139. sed -i -e 's/ -shared / -Wl,-O1,--as-needed\0/g' libtool
  140. make
  141. }
  142. package_libsynctex() {
  143. pkgdesc='Library for synchronization between TeX files and resulting file'
  144. depends=(glibc zlib)
  145. provides=(libsynctex.so)
  146. cd texlive-source-$_rev/build
  147. make -C texk/web2c DESTDIR="$pkgdir" \
  148. install-data-am install-libLTLIBRARIES
  149. # remove docs included in texlive-doc
  150. rm -r "$pkgdir"/usr/share/man
  151. }
  152. package_texlive-bin() {
  153. pkgdesc='TeX Live binaries'
  154. depends=(bash
  155. cairo libcairo.so
  156. ffcall # libffcall.so
  157. fontconfig libfontconfig.so
  158. freetype2 libfreetype.so
  159. gcc-libs # libgcc_s.so libstdc++.so
  160. gd # libgd.so
  161. glibc # ld-linux-x86-64.so libc.so libm.so
  162. gmp
  163. graphite libgraphite2.so
  164. harfbuzz libharfbuzz.so
  165. icu libicui18n.so libicuuc.so
  166. libpaper # libpaper.so
  167. libpng libpng16.so
  168. libsigsegv # libsigsegv.so
  169. libsynctex libsynctex.so
  170. libunistring libunistring.so
  171. libx11 # libX11.so
  172. libxaw # libXaw.so
  173. libxcrypt libcrypt.so
  174. libxmu # libXmu.so
  175. libxpm # libXpm.so
  176. libxt # libXt.so
  177. mpfr libmpfr.so
  178. ncurses libncursesw.so
  179. perl
  180. pixman libpixman-1.so
  181. potrace # libpotrace.so
  182. readline libreadline.so
  183. zlib libz.so
  184. zziplib) # libzzip-0.so
  185. provides=(lcdf-typetools
  186. libptexenc.so
  187. libtexlua53.so
  188. libtexluajit.so
  189. kpathsea
  190. xindy
  191. )
  192. optdepends=('psutils: to manipulate the output of dvips')
  193. # Parabola: remove ffcall and xindy on armv7h
  194. if [[ "$CARCH" == armv7h ]]; then
  195. unset depends[3]
  196. unset provides[5]
  197. fi
  198. cd texlive-source-$_rev
  199. # fixes for xindy
  200. find utils/xindy -name Makefile -exec sed -i -e "s|^prefix =.\+$|prefix = $pkgdir/usr|" -e "s|^mandir =.\+$|mandir = \${prefix}/share/man|" -e "s|^datadir =.\+$|datadir = \${datarootdir}/texmf|" -e "s|^docdir =.\+$|docdir = \${datadir}/doc/xindy|" '{}' \;
  201. cd build
  202. make DESTDIR="$pkgdir" texmf="$pkgdir"/usr/share/texmf install
  203. LD_PRELOAD="$pkgdir"/usr/lib/libkpathsea.so.6 \
  204. make DESTDIR="$pkgdir" texlinks
  205. # remove stuff included in texlive-texmf
  206. rm -r "$pkgdir"/usr/share/texmf-dist
  207. # remove docs included in texlive-doc
  208. rm -r "$pkgdir"/usr/share/{info,man}
  209. # remove links to scripts
  210. for _link in $(ls "$pkgdir"/usr/bin); do
  211. [[ $(readlink -m "$pkgdir"/usr/bin/$_link) == */scripts/* ]] && _rmlinks+="$pkgdir/usr/bin/$_link "
  212. done
  213. rm $_rmlinks
  214. # remove libsynctex
  215. rm "$pkgdir"/usr/include/synctex/*
  216. rm "$pkgdir"/usr/lib/libsynctex.*
  217. rm "$pkgdir"/usr/lib/pkgconfig/synctex.pc
  218. }