summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: b074a7d405c794f4a71e847770ef251ece518e3c (plain)
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
# Maintainer: xeruf <27jf at pm dot me>

_pkgname=context
pkgname=${_pkgname}-modules
pkgver=2022.09.11_20.44
pkgrel=1
pkgdesc='ConTeXt LMTX with all ConTeXt Garden modules'
arch=('x86_64')
url="https://wiki.contextgarden.net/Installation"
license=(GPL)
depends=()
replaces=()
provides=(${_pkgname} ${_pkgname}-lmtx)
conflicts=(${_pkgname})
optdepends=()
source=("http://lmtx.pragma-ade.nl/install-lmtx/context-linux-64.zip")
sha256sums=(SKIP)
install=${_pkgname}.install

prepare() {
  cd "${srcdir}"

  # https://wiki.contextgarden.net/Modules#ConTeXt_LMTX
  # Synchronize all modules from the ConTeXt Garden in the directory 'modules'
  rsync --recursive --links --times --info=progress2,remove,symsafe,flist,del --human-readable --del rsync://contextgarden.net/minimals/current/modules/ modules

  chmod +x install.sh
  ./install.sh
}

package() {
  context="${pkgdir}/usr/share/texmf-dist"
  cd "tex"

  install -d "$context"
  cp -r texmf texmf-context "$context"
  # Create the union of all modules in tex/texmf-modules.
  rsync -rlt --exclude=/VERSION --del ../modules/*/ "$context"/texmf-modules
  install -Dt "${pkgdir}/usr/local/bin" texmf-linux-64/bin/*
}

pkgver() {
  # TODO use https://wiki.contextgarden.net/LMTX#How_to_check_for_newer_versions.3F
  cat "${srcdir}/tex/texmf-context/tex/context/base/mkxl/context.mkxl" |
    grep "def\\\\contextversion" |
    sed 's/^.*{\(.*\)}.*$/\1/' |
    tr ' :' '_.'
}