texlive: clean up recipe (#45863)
* texlive: clean up recipe * Update the poppler dependency * Fix typo --------- Co-authored-by: jmcarcell <jmcarcell@users.noreply.github.com>
This commit is contained in:
parent
3df3f40984
commit
fe6f5b87dc
@ -3,10 +3,8 @@
|
|||||||
#
|
#
|
||||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||||
|
|
||||||
import os
|
|
||||||
import platform
|
import platform
|
||||||
import re
|
import re
|
||||||
import tempfile
|
|
||||||
|
|
||||||
from spack.package import *
|
from spack.package import *
|
||||||
|
|
||||||
@ -27,19 +25,6 @@ class Texlive(AutotoolsPackage):
|
|||||||
|
|
||||||
license("GPL-2.0-or-later AND GPL-3.0-or-later", checked_by="tgamblin")
|
license("GPL-2.0-or-later AND GPL-3.0-or-later", checked_by="tgamblin")
|
||||||
|
|
||||||
# Below is the url for a binary distribution. This was originally how this
|
|
||||||
# was distributed in Spack, but should be considered deprecated. Note that
|
|
||||||
# the "live" version will pull down the packages so it requires an Internet
|
|
||||||
# connection at install time and the package versions could change over
|
|
||||||
# time. It is better to use a version built from tarballs, as defined with
|
|
||||||
# the "releases" below.
|
|
||||||
version(
|
|
||||||
"live",
|
|
||||||
sha256="e67edec49df6b7c4a987a7d5a9b31bcf41258220f9ac841c7a836080cd334fb5",
|
|
||||||
url="ftp://tug.org/historic/systems/texlive/2022/install-tl-unx.tar.gz",
|
|
||||||
deprecated=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
# Add information for new versions below.
|
# Add information for new versions below.
|
||||||
releases = [
|
releases = [
|
||||||
{
|
{
|
||||||
@ -86,44 +71,27 @@ class Texlive(AutotoolsPackage):
|
|||||||
depends_on("cxx", type="build") # generated
|
depends_on("cxx", type="build") # generated
|
||||||
depends_on("fortran", type="build") # generated
|
depends_on("fortran", type="build") # generated
|
||||||
|
|
||||||
# The following variant is only for the "live" binary installation.
|
depends_on("pkgconfig", type="build")
|
||||||
# There does not seem to be a complete list of schemes.
|
|
||||||
# Examples include:
|
|
||||||
# full scheme (everything)
|
|
||||||
# medium scheme (small + more packages and languages)
|
|
||||||
# small scheme (basic + xetex, metapost, a few languages)
|
|
||||||
# basic scheme (plain and latex)
|
|
||||||
# minimal scheme (plain only)
|
|
||||||
# See:
|
|
||||||
# https://www.tug.org/texlive/doc/texlive-en/texlive-en.html#x1-25025r6
|
|
||||||
variant(
|
|
||||||
"scheme",
|
|
||||||
default="small",
|
|
||||||
values=("minimal", "basic", "small", "medium", "full"),
|
|
||||||
description='Package subset to install, only meaningful for "live" ' "version",
|
|
||||||
)
|
|
||||||
|
|
||||||
depends_on("perl", type="build", when="@live")
|
depends_on("cairo+X")
|
||||||
depends_on("pkgconfig", when="@2019:", type="build")
|
depends_on("freetype")
|
||||||
|
depends_on("ghostscript")
|
||||||
depends_on("cairo+X", when="@2019:")
|
depends_on("gmp")
|
||||||
depends_on("freetype", when="@2019:")
|
depends_on("harfbuzz+graphite2")
|
||||||
depends_on("ghostscript", when="@2019:")
|
depends_on("icu4c")
|
||||||
depends_on("gmp", when="@2019:")
|
depends_on("libgd")
|
||||||
depends_on("harfbuzz+graphite2", when="@2019:")
|
depends_on("libpaper")
|
||||||
depends_on("icu4c", when="@2019:")
|
depends_on("libpng")
|
||||||
depends_on("libgd", when="@2019:")
|
depends_on("libxaw")
|
||||||
depends_on("libpaper", when="@2019:")
|
depends_on("libxt")
|
||||||
depends_on("libpng", when="@2019:")
|
depends_on("mpfr")
|
||||||
depends_on("libxaw", when="@2019:")
|
depends_on("perl")
|
||||||
depends_on("libxt", when="@2019:")
|
depends_on("pixman")
|
||||||
depends_on("mpfr", when="@2019:")
|
depends_on("poppler@:0.83", when="@:2019")
|
||||||
depends_on("perl", when="@2019:")
|
depends_on("poppler", when="@:2020")
|
||||||
depends_on("pixman", when="@2019:")
|
depends_on("teckit")
|
||||||
depends_on("poppler@:0.84", when="@2019:")
|
depends_on("zlib-api")
|
||||||
depends_on("teckit", when="@2019:")
|
depends_on("zziplib")
|
||||||
depends_on("zlib-api", when="@2019:")
|
|
||||||
depends_on("zziplib", when="@2019:")
|
|
||||||
|
|
||||||
build_directory = "spack-build"
|
build_directory = "spack-build"
|
||||||
|
|
||||||
@ -131,7 +99,6 @@ def tex_arch(self):
|
|||||||
tex_arch = "{0}-{1}".format(platform.machine(), platform.system().lower())
|
tex_arch = "{0}-{1}".format(platform.machine(), platform.system().lower())
|
||||||
return tex_arch
|
return tex_arch
|
||||||
|
|
||||||
@when("@2019:")
|
|
||||||
def configure_args(self):
|
def configure_args(self):
|
||||||
args = [
|
args = [
|
||||||
"--bindir={0}".format(join_path(self.prefix.bin, self.tex_arch())),
|
"--bindir={0}".format(join_path(self.prefix.bin, self.tex_arch())),
|
||||||
@ -162,25 +129,21 @@ def configure_args(self):
|
|||||||
|
|
||||||
@run_after("install")
|
@run_after("install")
|
||||||
def setup_texlive(self):
|
def setup_texlive(self):
|
||||||
if not self.spec.satisfies("@live"):
|
mkdirp(self.prefix.tlpkg.TeXLive)
|
||||||
mkdirp(self.prefix.tlpkg.TeXLive)
|
install("texk/tests/TeXLive/*", self.prefix.tlpkg.TeXLive)
|
||||||
install("texk/tests/TeXLive/*", self.prefix.tlpkg.TeXLive)
|
|
||||||
|
|
||||||
with working_dir("spack-build"):
|
with working_dir("spack-build"):
|
||||||
make("texlinks")
|
make("texlinks")
|
||||||
|
|
||||||
copy_tree("texlive-{0}-texmf".format(self.version.string), self.prefix)
|
copy_tree("texlive-{0}-texmf".format(self.version.string), self.prefix)
|
||||||
|
|
||||||
# Create and run setup utilities
|
# Create and run setup utilities
|
||||||
fmtutil_sys = Executable(join_path(self.prefix.bin, self.tex_arch(), "fmtutil-sys"))
|
fmtutil_sys = Executable(join_path(self.prefix.bin, self.tex_arch(), "fmtutil-sys"))
|
||||||
mktexlsr = Executable(join_path(self.prefix.bin, self.tex_arch(), "mktexlsr"))
|
mktexlsr = Executable(join_path(self.prefix.bin, self.tex_arch(), "mktexlsr"))
|
||||||
mtxrun = Executable(join_path(self.prefix.bin, self.tex_arch(), "mtxrun"))
|
mtxrun = Executable(join_path(self.prefix.bin, self.tex_arch(), "mtxrun"))
|
||||||
mktexlsr()
|
mktexlsr()
|
||||||
fmtutil_sys("--all")
|
fmtutil_sys("--all")
|
||||||
mtxrun("--generate")
|
mtxrun("--generate")
|
||||||
|
|
||||||
else:
|
|
||||||
pass
|
|
||||||
|
|
||||||
def setup_build_environment(self, env):
|
def setup_build_environment(self, env):
|
||||||
env.prepend_path("PATH", join_path(self.prefix.bin, self.tex_arch()))
|
env.prepend_path("PATH", join_path(self.prefix.bin, self.tex_arch()))
|
||||||
@ -188,45 +151,6 @@ def setup_build_environment(self, env):
|
|||||||
def setup_run_environment(self, env):
|
def setup_run_environment(self, env):
|
||||||
env.prepend_path("PATH", join_path(self.prefix.bin, self.tex_arch()))
|
env.prepend_path("PATH", join_path(self.prefix.bin, self.tex_arch()))
|
||||||
|
|
||||||
@when("@live")
|
|
||||||
def autoreconf(self, spec, prefix):
|
|
||||||
touch("configure")
|
|
||||||
|
|
||||||
@when("@live")
|
|
||||||
def configure(self, spec, prefix):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@when("@live")
|
|
||||||
def build(self, spec, prefix):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@when("@live")
|
|
||||||
def install(self, spec, prefix):
|
|
||||||
# The binary install needs a profile file to be present
|
|
||||||
tmp_profile = tempfile.NamedTemporaryFile()
|
|
||||||
tmp_profile.write("selected_scheme {0}".format(spec.variants["scheme"]).encode())
|
|
||||||
|
|
||||||
# Using texlive's mirror system leads to mysterious problems,
|
|
||||||
# in lieu of being able to specify a repository as a variant, hardwire
|
|
||||||
# a particular (slow, but central) one for now.
|
|
||||||
_repository = "https://ctan.math.washington.edu/tex-archive/systems/texlive/tlnet/"
|
|
||||||
env = os.environ
|
|
||||||
env["TEXLIVE_INSTALL_PREFIX"] = prefix
|
|
||||||
perl = which("perl")
|
|
||||||
scheme = spec.variants["scheme"].value
|
|
||||||
perl(
|
|
||||||
"./install-tl",
|
|
||||||
"-scheme",
|
|
||||||
scheme,
|
|
||||||
"-repository",
|
|
||||||
_repository,
|
|
||||||
"-portable",
|
|
||||||
"-profile",
|
|
||||||
tmp_profile.name,
|
|
||||||
)
|
|
||||||
|
|
||||||
tmp_profile.close()
|
|
||||||
|
|
||||||
executables = [r"^tex$"]
|
executables = [r"^tex$"]
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -234,15 +158,7 @@ def determine_version(cls, exe):
|
|||||||
# https://askubuntu.com/questions/100406/finding-the-tex-live-version
|
# https://askubuntu.com/questions/100406/finding-the-tex-live-version
|
||||||
# Thanks to @michaelkuhn that told how to reuse the package releases
|
# Thanks to @michaelkuhn that told how to reuse the package releases
|
||||||
# variable.
|
# variable.
|
||||||
# Added 3 older releases: 2018 (CentOS-8), 2017 (Ubuntu-18.04), 2013 (CentOS-7).
|
|
||||||
releases = cls.releases
|
releases = cls.releases
|
||||||
releases.extend(
|
|
||||||
[
|
|
||||||
{"version": "20180414", "year": "2018"},
|
|
||||||
{"version": "20170524", "year": "2017"},
|
|
||||||
{"version": "20130530", "year": "2013"},
|
|
||||||
]
|
|
||||||
)
|
|
||||||
# tex indicates the year only
|
# tex indicates the year only
|
||||||
output = Executable(exe)("--version", output=str, error=str)
|
output = Executable(exe)("--version", output=str, error=str)
|
||||||
match = re.search(r"TeX Live (\d+)", output)
|
match = re.search(r"TeX Live (\d+)", output)
|
||||||
|
Loading…
Reference in New Issue
Block a user