From ccfb8d41ad851432e73a82b486a29707d0faa405 Mon Sep 17 00:00:00 2001 From: Mohammad Akhlaghi Date: Sat, 1 Dec 2018 01:30:26 +0000 Subject: Improved TeXLive installation checks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Thanks to the check by Cristina Martínez, some corrections were made when we attempt to download and install TeXLive. Further checks and corrections will be in due time. --- configure | 13 ++++--- reproduce/src/make/dependencies.mk | 72 +++++++++++++++++++++++++------------- reproduce/src/make/initialize.mk | 2 +- 3 files changed, 54 insertions(+), 33 deletions(-) diff --git a/configure b/configure index b39d825..c3c11f7 100755 --- a/configure +++ b/configure @@ -636,9 +636,8 @@ numthreads=$($instdir/bin/nproc) # it. It will just stop at the stage when all the processing is complete # and it is only necessary to build the PDF. So we don't want to stop the # pipeline if its not present. -if ! [ -f $instdir/bin/texlive-ready ]; then - $instdir/bin/texlive-ready-tlmgr - rm -rf $instdir/texlive +texlive_result=$(cat $instdir/bin/texlive-ready-tlmgr) +if [ x$texlive_result = x"NOT!" ]; then cat < texlive.conf - ./install-tl --profile=texlive.conf - # Put a symbolic link of the TeX Live executables in `ibdir'. The - # main problem is that the year and build system (for example - # `x86_64-linux') are also in the directory names, making it hard - # to be generic. We are using wildcards here, but only in this - # Makefile, not in any other. - ln -fs $(idir)/texlive/20*/bin/*/* $(ibdir)/ + # TeX Live's installation may fail due to any reason. But TeX Live + # is optional (only necessary for building the final PDF). So we + # don't want the configure script to fail if it can't run. + if ./install-tl --profile=texlive.conf; then - # Clean up and build the final target. - cd .. && rm -rf install-tl-* $(tdir)/install-tl-unx.tar.gz - echo "TeX Live is ready." > $@ + # Put a symbolic link of the TeX Live executables in `ibdir'. The + # main problem is that the year and build system (for example + # `x86_64-linux') are also in the directory names, making it hard + # to be generic. We are using wildcards here, but only in this + # Makefile, not in any other. + ln -fs $(idir)/texlive/20*/bin/*/* $(ibdir)/ + + # Register that the build was successful. + echo "TeX Live is ready." > $@ + else + echo "NOT!" > $@ + fi + + # Clean up + cd .. + rm -rf install-tl-* @@ -315,12 +339,14 @@ $(ibdir)/texlive-ready-tlmgr: $(tdir)/install-tl-unx.tar.gz \ # To keep things modular and simple, we'll break up the installation of TeX # Live itself (only very basic TeX and LaTeX) and the installation of its # necessary packages into two packages. -$(ibdir)/texlive-ready: reproduce/config/pipeline/dependency-texlive.mk \ - $(ibdir)/texlive-ready-tlmgr +$(ddir)/texlive-versions.tex: reproduce/config/pipeline/dependency-texlive.mk \ + $(ibdir)/texlive-ready-tlmgr # To work with TeX live installation, we'll need the internet. - res=$(cat $(ibdir)/texlive-ready-tlmgr) - if [ -f $(ibdir)/texlive-ready-tlmgr ]; then + @res=$$(cat $(ibdir)/texlive-ready-tlmgr) + if [ x$$res = x"NOT!" ]; then + echo "" > $@ + else # The current directory is necessary later. topdir=$$(pwd) @@ -342,10 +368,9 @@ $(ibdir)/texlive-ready: reproduce/config/pipeline/dependency-texlive.mk \ ln -fs $(idir)/texlive/20*/bin/*/* $(ibdir)/ # Get all the necessary versions. - tv=$(ddir)/texlive-versions.tex texlive=$$(pdflatex --version | awk 'NR==1' | sed 's/.*(\(.*\))/\1/' \ | awk '{print $$NF}'); - echo "\newcommand{\\texliveversion}{$$texlive}" > $$tv + echo "\newcommand{\\texliveversion}{$$texlive}" > $@ # LaTeX Package versions. tlmgr info $(texlive-packages) --only-installed | awk \ @@ -355,8 +380,5 @@ $(ibdir)/texlive-ready: reproduce/config/pipeline/dependency-texlive.mk \ $$1=="cat-version:" {version=$$NF} \ $$1=="cat-date:" {if(version==0) version=$$2; \ printf("\\newcommand{\\tex%sversion}{%s}\n", \ - name, version)}' >> $$tv - - # Write the target if TeX live was actually installed. - echo "TeX Live's packages are also ready." > $@ + name, version)}' >> $@ fi diff --git a/reproduce/src/make/initialize.mk b/reproduce/src/make/initialize.mk index 9141b30..db27289 100644 --- a/reproduce/src/make/initialize.mk +++ b/reproduce/src/make/initialize.mk @@ -254,5 +254,5 @@ $(mtexdir)/initialize.tex: | $(mtexdir) wcslibversion) $(call lvcheck, zlib.h, $(zlib-version), zlib, zlibversion) - # TeX versions + # TeX package versions cat $(BDIR)/dependencies/texlive-versions.tex >> $@ -- cgit v1.2.1