texlive: Fix install of @live version (#19941)

The unattended install using the pre-compiled binaries (tl-install)
needs a .profile file or it goes in interactive mode blocking the
install process forever
This commit is contained in:
Ruben Di Battista 2020-11-16 20:26:31 +01:00 committed by GitHub
parent 6142ab56c7
commit 1fb8ae42e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,8 +3,10 @@
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
import os
import platform
import tempfile
class Texlive(AutotoolsPackage):
@ -192,6 +194,11 @@ def build(self, spec, prefix):
@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.
@ -202,4 +209,6 @@ def install(self, spec, prefix):
scheme = spec.variants['scheme'].value
perl('./install-tl', '-scheme', scheme,
'-repository', _repository,
'-portable', '-profile', '/dev/null')
'-portable', '-profile', tmp_profile.name)
tmp_profile.close()