Files
gentoo-overlay/app-text/context/context-2025.06.12.ebuild

79 lines
1.7 KiB
Bash

# Copyright 2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
CMAKE_MAKEFILE_GENERATOR="ninja"
TEXMFROOT=/usr/share/texmf-dist
TEXMFBIN="${TEXMFROOT}/tex/texmf-linux-64/bin"
DESCRIPTION="ConTeXt"
HOMEPAGE="https://wiki.contextgarden.net
https://www.pragma-ade.com
https://github.com/contextgarden/context"
inherit cmake greadme
IUSE="doc"
COMMIT="fb28e149a3cbfdeb4224fc0ff32fa6881255b1bc"
SRC_URI="https://github.com/contextgarden/${PN}/archive/${COMMIT}.tar.gz
-> ${P}.tar.gz"
S="${WORKDIR}"/${PN}-${COMMIT}
LICENSE=""
SLOT="0"
KEYWORDS="~amd64"
DEPEND=""
RDEPEND="${DEPEND}
!dev-texlive/texlive-context"
BDEPEND=""
src_prepare() {
CMAKE_USE_DIR="${S}"/source/luametatex cmake_src_prepare
}
src_configure() {
CMAKE_USE_DIR="${S}"/source/luametatex cmake_src_configure
}
src_compile(){
CMAKE_USE_DIR="${S}"/source/luametatex cmake_src_compile
}
src_install(){
DESTDIR="${T}" cmake_build install
into "${TEXMFBIN}"
dobin ${T}/usr/bin/luametatex
insinto "${TEXMFROOT}"
doins -r bibtex colors context context-readme.txt fonts metapost scripts tex web2c
if use doc; then
doins -r doc
fi
exeinto "${TEXMFBIN}"
doexe scripts/context/lua/context.lua
doexe scripts/context/lua/mtxrun.lua
echo PATH="${TEXMFBIN}" > "${T}"/99texmf-linux-context
doenvd "${T}"/99texmf-linux-context
dosym -r "${TEXMFBIN}"/luametatex "${TEXMFBIN}"/mtxrun
dosym -r "${TEXMFBIN}"/luametatex "${TEXMFBIN}"/context
greadme_stdin <<-EOF
If you plan to use mkIV and its 'context' command to generate your documents,
you have to run 'mtxrun --generate' as normal user before first use.
EOF
}
pkg_postinst() {
greadme_pkg_postinst
}