diff options
author | Sebastian Pipping <sping@gentoo.org> | 2024-04-11 20:45:14 +0200 |
---|---|---|
committer | Sebastian Pipping <sping@gentoo.org> | 2024-04-11 20:57:31 +0200 |
commit | 2209495e99d764db2ca8e97ba906127276b1ae61 (patch) | |
tree | 4ed95a945d48ef5b41d4155e2dd1aed5f273c055 | |
parent | dev-libs/libunique: EAPI8 for SLOT=1 and SLOT=3 (diff) | |
download | gentoo-2209495e99d764db2ca8e97ba906127276b1ae61.tar.gz gentoo-2209495e99d764db2ca8e97ba906127276b1ae61.tar.bz2 gentoo-2209495e99d764db2ca8e97ba906127276b1ae61.zip |
dev-tex/rubber: Fix 1.6.4 tests by fixing PythonTeX invokation
Signed-off-by: Sebastian Pipping <sping@gentoo.org>
-rw-r--r-- | dev-tex/rubber/files/rubber-1.6.4-pythontex.patch | 30 | ||||
-rw-r--r-- | dev-tex/rubber/rubber-1.6.4-r1.ebuild | 115 |
2 files changed, 145 insertions, 0 deletions
diff --git a/dev-tex/rubber/files/rubber-1.6.4-pythontex.patch b/dev-tex/rubber/files/rubber-1.6.4-pythontex.patch new file mode 100644 index 000000000000..2befc0e54ea5 --- /dev/null +++ b/dev-tex/rubber/files/rubber-1.6.4-pythontex.patch @@ -0,0 +1,30 @@ +From 9915f94d320662a719802e32763a7f4e2e4045c7 Mon Sep 17 00:00:00 2001 +From: Sebastian Pipping <sebastian@pipping.org> +Date: Thu, 11 Apr 2024 20:25:55 +0200 +Subject: [PATCH] Invoke PythonTeX as "pythontex.py" in Gentoo + +In Gentoo: +> /usr/bin/pythontex.py + +In Debian: +> /usr/bin/pythontex +--- + rubber/latex_modules/pythontex.py | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/rubber/latex_modules/pythontex.py b/rubber/latex_modules/pythontex.py +index 3c5675b..b0bb535 100644 +--- a/rubber/latex_modules/pythontex.py ++++ b/rubber/latex_modules/pythontex.py +@@ -20,7 +20,7 @@ class PythonTeXDep(rubber.depend.Shell): + def __init__(self, document): + self.doc = document + basename = self.doc.basename() +- super().__init__(('pythontex', basename)) ++ super().__init__(('pythontex.py', basename)) + self.pythontex_files = 'pythontex-files-' + basename + + pytxcode = basename + '.pytxcode' +-- +2.44.0 + diff --git a/dev-tex/rubber/rubber-1.6.4-r1.ebuild b/dev-tex/rubber/rubber-1.6.4-r1.ebuild new file mode 100644 index 000000000000..405bf11742ff --- /dev/null +++ b/dev-tex/rubber/rubber-1.6.4-r1.ebuild @@ -0,0 +1,115 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{9..11} ) +DISTUTILS_USE_PEP517=hatchling + +inherit distutils-r1 + +if [[ ${PV} == "9999" ]] || [[ -n "${EGIT_COMMIT_ID}" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/latex-rubber/${PN}.git" +else + # NOTE: Cannot be "PYPI_PN=latex-rubber" + "inherit pypi" due to missing tests + SRC_URI="https://gitlab.com/latex-rubber/${PN}/-/archive/${PV}/${P}.tar.bz2" + KEYWORDS="~amd64 ~ppc ~riscv ~x86" +fi + +DESCRIPTION="A LaTeX wrapper for automatically building documents" +HOMEPAGE="https://gitlab.com/latex-rubber/rubber" + +LICENSE="GPL-3+" +SLOT="0" +IUSE="test" +RESTRICT="!test? ( test )" + +RDEPEND="virtual/latex-base" + +# Test dependencies: +# - app-text/texlive-core for rubber's 'cweave' test +# - dev-lang/R for rubber's 'knitr' test (requires knitr R library, currently disabled) +# - dev-texlive/texlive-latexextra for rubber's 'combine' test (currently disabled) +BDEPEND=" + ${RDEPEND} + virtual/texi2dvi + test? ( + app-text/ghostscript-gpl + app-text/texlive-core + dev-tex/biber + dev-tex/biblatex + dev-tex/glossaries + dev-tex/latex-beamer + $(python_gen_cond_dep 'dev-tex/pythontex[${PYTHON_USEDEP}]') + dev-texlive/texlive-latexextra + dev-texlive/texlive-pstricks + media-gfx/asymptote + ) +" + +PATCHES=( + "${FILESDIR}"/${PN}-1.6.4-pythontex.patch +) + +pkg_setup() { + # https://bugs.gentoo.org/727996 + export VARTEXFONTS="${T}"/fonts +} + +python_test() { + cd tests || die + + # Disable the broken 'combine' test as it uses the 'combine' as a + # latex package when it is only a document class (probably only in + # newer versions of combine). Also note that this tests works + # under debian 'buster'. TODO: Look into potential modifications + # done by debian. + touch combine/disable || die + + # This test does not work under Gentoo nor Debian 'buster'. + # TODO: Investigate why it does not work. + touch cweb-latex/disable || die + + # TODO: Investigate why the following are failing. + touch fig2dev-dvi/disable || die + touch fig2dev-path/disable || die + touch fig2dev-path-inplace/disable || die + touch fig2dev-path-into/disable || die + touch graphicx-dotted-files/disable || die + touch hooks-input-file/disable || die + touch knitr/disable || die + + # Even tough metapost is available, those tests fail on Gentoo + # (while they succeed on Debian 'buster'). + # TODO: Determine why. + # ERROR:mpost:I can't read MetaPost's log file, this is wrong. + touch metapost/disable || die + # expected error message not reported by Rubber + touch metapost-error/disable || die + # ERROR:mpost:I can't read MetaPost's log file, this is wrong. + touch metapost-input/disable || die + + ./run.sh * || die "Tests failed with ${EPYTHON}" +} + +python_install() { + local my_install_args=( + --mandir="${EPREFIX}/usr/share/man" + --infodir="${EPREFIX}/usr/share/info" + --docdir="${EPREFIX}/usr/share/doc/${PF}" + ) + + distutils-r1_python_install "${my_install_args[@]}" +} + +src_install() { + distutils-r1_src_install + + # Fix file misplacements + dodir /usr/share/man/fr + mv "${D}"/usr/share/{doc/man-fr,man/fr/man1} || die + mv "${D}"/usr/share/{doc/man-en,man/man1} || die + dodir /usr/share/doc/${P} + mv "${D}"/usr/share/doc/{rubber.*,${PF}/} || die +} |