summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPhilipp Gesang <phg@phi-gamma.net>2016-09-06 23:39:52 +0200
committerPhilipp Gesang <phg@phi-gamma.net>2016-09-06 23:39:52 +0200
commit31a8240793afd6a03fd780982144e6de42597458 (patch)
tree979bd97099939fd0cae665b9891c45c8bb63c298
parentd0cbc8b72dc47be67b41c7f51aa58650f54194d3 (diff)
downloadarch-packages-31a8240793afd6a03fd780982144e6de42597458.tar.gz
context-mkiv: add preliminary WIP PKGBUILD and env wrapper
-rw-r--r--context-git/PKGBUILD8
-rw-r--r--context-mkiv/PKGBUILD77
-rw-r--r--context-mkiv/context-setup-env.sh16
-rw-r--r--luatex-svn/PKGBUILD2
4 files changed, 94 insertions, 9 deletions
diff --git a/context-git/PKGBUILD b/context-git/PKGBUILD
index bcdfaf5..ae2c99b 100644
--- a/context-git/PKGBUILD
+++ b/context-git/PKGBUILD
@@ -7,16 +7,8 @@ pkgdesc="The ConTeXt typesetting system; sources from Git"
arch=(any)
url="http://pragma-ade.nl"
license=('GPL2')
-groups=()
-depends=()
makedepends=('git' 'luatex-svn')
-provides=()
conflicts=(context-minimals-git)
-replaces=()
-backup=()
-options=()
-install=
-noextract=()
sha256sums=('SKIP')
_git_repo=bitbucket.org/phg/context-mirror.git
diff --git a/context-mkiv/PKGBUILD b/context-mkiv/PKGBUILD
new file mode 100644
index 0000000..0d8d2a9
--- /dev/null
+++ b/context-mkiv/PKGBUILD
@@ -0,0 +1,77 @@
+# Context MkIV additional distribution files
+# Maintainer: Philipp Gesang <phg@phi-gamma.net>
+pkgname=context-mkiv
+pkgver=20160905_1028
+pkgrel=1
+pkgdesc="The ConTeXt MkIV typesetting system; additional files"
+arch=(any)
+url=""
+license=('GPL')
+groups=()
+depends=(luatex-svn context-git)
+## mtxrun is part of Context; to execute it we need Luatex as the interpreter
+makedepends=(rsync luatex-svn context-git)
+conflicts=(context-minimals-git)
+source=(context-setup-env.sh)
+sha512sums=('17d82d422873abd4eac79660e4cf0eefd8cba7fca3fae0eaad832911a5066385ba18625ccc61638da4c91fd180c4bcf21a6cd7664cdb4248ef530fe6cc2c64b0')
+
+# binaries and scripts installed with deps
+readonly _luatex=/usr/bin/texlua
+readonly _cntroot=/usr/share/context-git
+readonly _mtxpath=./texmf-context/scripts/context/lua
+readonly _mtxrun=${_mtxpath}/mtxrun.lua
+
+_mtx-script () {
+ local scr="mtx-$1.lua"
+ shift
+ ${_luatex} ${_mtxrun} --script "${_mtxpath}/${scr}" $@
+}
+
+pkgver() {
+ # no colon, hyphen, or whitespace permitted
+ cd context
+ _mtx-script context --version 2>/dev/null \
+ |egrep "^mtx-context *| current version: .*$" \
+ |sed -n 's/^.*: \(....\)\.\(..\)\.\(..\) \(..\):\(..\)$/\1\2\3_\4\5/p'
+ exit 42
+}
+
+prepare() {
+ [[ ! -d context ]] && mkdir context
+ cd context
+ if [[ -L ./texmf-context ]]; then
+ msg "Repo symlink already present"
+ else
+ ln -s "${_cntroot}" ./texmf-context
+ fi
+ _mtx-script update \
+ --force --update --context=beta --platform=linux \
+ --engine=luatex --modules=all --texroot=.
+}
+
+build() {
+ cd context
+ ${_luatex} ${_mtxrun} --generate
+}
+
+package() {
+ rm -rf "${pkgdir}"/*
+ local texdst="${pkgdir}/usr/share/texmf"
+ local libdst="${pkgdir}/usr/lib"
+ local execdst="${pkgdir}/usr/bin"
+ local subdirs=( texmf texmf-fonts texmf-modules )
+ cd context
+ install -dm755 "${texdst}"
+ for dir in ${subdirs[@]}; do
+ cp -a "${dir}" "${texdst}"
+ done
+ # install symlink to Context git
+ ln -s /usr/share/context-git "${texdst}/texmf-context"
+ # mktexlsr is the only script we take as-is
+ install -dm755 "${execdst}"
+ install -Dm755 texmf-linux/bin/mktexlsr "${execdst}"
+ install -dm755 "${libdst}"
+ install -Dm644 "${srcdir}/context-setup-env.sh" "${libdst}"
+}
+
+# vim:et:ft=sh:sw=2:ts=8
diff --git a/context-mkiv/context-setup-env.sh b/context-mkiv/context-setup-env.sh
new file mode 100644
index 0000000..99a8def
--- /dev/null
+++ b/context-mkiv/context-setup-env.sh
@@ -0,0 +1,16 @@
+# Context executable wrapper
+declare -r context_root=/usr/share/texmf
+declare font_dirs=""
+if [[ -d "${HOME}/.fonts" ]]; then
+ declare font_dirs+="${HOME}/.fonts"
+fi
+if [[ -d /usr/share/fonts ]]; then
+ [[ -n "${font_dirs}" ]] && declare font_dirs+=";"
+ declare font_dirs+=/usr/share/fonts
+fi
+
+declare -x OSFONTDIR="${font_dirs:-}"
+declare -x TEXMFCACHE=${HOME}/.texmf/texmf-cache
+declare -x TEXMFOS=${context_root}/texmf-context
+
+# vim:et:ft=sh:sw=2:ts=8
diff --git a/luatex-svn/PKGBUILD b/luatex-svn/PKGBUILD
index c981a42..ba31e04 100644
--- a/luatex-svn/PKGBUILD
+++ b/luatex-svn/PKGBUILD
@@ -17,7 +17,7 @@ url="http://www.luatex.org"
license=('GPL2' 'boost' 'MIT' 'libpng' 'LGPL2.1')
depends=()
makedepends=(subversion)
-conflicts=()
+conflicts=(context-minimals-git)
source=()
_svnlocal="${pkgname}-trunk"