diff options
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 89 |
1 files changed, 76 insertions, 13 deletions
@@ -525,7 +525,10 @@ if [ $rewritepconfig = yes ]; then $pconf.in >> $pconf else # Read the values from existing configuration file. - inbdir=$(awk '$1=="BDIR" {print $3}' $pconf) + inbdir=$(awk '$1=="BDIR" {print $3}' $pconf) + + # Read the software directory. + ddir=$(awk '$1=="DEPENDENCIES-DIR" {print $3}' $pconf) # The downloader command may contain multiple elements, so we'll just # change the (in memory) first and second tokens to empty space and @@ -629,9 +632,29 @@ if ! [ -d $tardir ]; then mkdir $tardir; fi instdir=$depdir/installed if ! [ -d $instdir ]; then mkdir $instdir; fi +verdir=$instdir/version-info +if ! [ -d $verdir ]; then mkdir $verdir; fi + +ibidir=$verdir/bin +if ! [ -d $ibidir ]; then mkdir $ibidir; fi + +ilidir=$verdir/lib +if ! [ -d $ilidir ]; then mkdir $ilidir; fi + +ipydir=$verdir/python +if ! [ -d $ipydir ]; then mkdir $ipydir; fi + +itidir=$verdir/tex +if ! [ -d $itidir ]; then mkdir $itidir; fi + +texdir=$bdir/tex +if ! [ -d $texdir ]; then mkdir $texdir; fi + +mtexdir=$texdir/macros +if ! [ -d $mtexdir ]; then mkdir $mtexdir; fi + rm -f $installedlink ln -s $instdir $installedlink - # --------- Delete for no Gnuastro --------- rm -f .gnuastro ln -s $(pwd)/reproduce/config/gnuastro .gnuastro @@ -761,7 +784,7 @@ NOTE: the built software will NOT BE INSTALLED on your system (no root access is required). They are only for local usage by this reproduction pipeline. They will be installed in: - $bdir/dependencies/installed + $depdir/installed EOF sleep $tsec @@ -797,8 +820,7 @@ fi # # The reason its sepecial is that we need it to serialize the download # process of the dependency tarballs. -flockversion=$(awk '/flock-version/{print $3}' \ - reproduce/config/pipeline/dependency-versions.mk) +flockversion=$(awk '/flock-version/{print $3}' $pdir/dependency-versions.mk) flocktar=flock-$flockversion.tar.gz flockurl=http://github.com/discoteq/flock/releases/download/v$flockversion/ @@ -819,16 +841,16 @@ if ! [ -f $tardir/$flocktar ]; then fi fi -# If the tarball is newer than the (possibly existing) program, then delete -# the program. +# If the tarball is newer than the (possibly existing) program (the version +# has changed), then delete the program. if [ -f .local/bin/flock ]; then - if [ $tardir/$flocktar -nt .local/bin/flock ]; then - rm .local/bin/flock + if [ $tardir/$flocktar -nt $ibidir/flock ]; then + rm $ibidir/flock fi fi # Build `flock' if necessary. -if ! [ -f .local/bin/flock ]; then +if ! [ -f $ibidir/flock ]; then cd $depdir tar xf $tardir/$flocktar cd flock-$flockversion @@ -836,6 +858,7 @@ if ! [ -f .local/bin/flock ]; then make; make install cd $topdir rm -rf $depdir/flock-$flockversion + echo "Discoteq flock $flockversion" > $ibidir/flock fi @@ -892,7 +915,6 @@ numthreads=$($instdir/bin/nproc) - # Make sure TeX Live installed successfully # ----------------------------------------- # @@ -902,7 +924,7 @@ 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. -texlive_result=$(cat $instdir/bin/texlive-ready-tlmgr) +texlive_result=$(cat $itidir/texlive-ready-tlmgr) if [ x"$texlive_result" = x"NOT!" ]; then cat <<EOF @@ -923,7 +945,7 @@ pipeline, please delete the respective files, then re-run configure as shown below. Within configure, answer 'n' (for "no") when asked to re-write the configuration files. - rm .local/bin/texlive-ready-tlmgr + rm .local/version-info/tex/texlive-ready-tlmgr ./configure !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! @@ -934,6 +956,47 @@ fi +# Put all the names and versions in a human-readable format in LaTeX. +function prepare_name_version() { + # Total number of tools to report. + num=$(cat "$@" | wc -l) + + # Put them all in one paragraph. + cat "$@" \ + | sort \ + | awk 'NF>0{ c++; \ + if(c==1) \ + { \ + if('$num'==1) printf("%s", $0); \ + else printf("%s", $0); \ + } \ + else if(c=='$num') printf(" and %s\n", $0); \ + else printf(", %s", $0)}' +} + +# Separate the parts by context. +proglibs=$(prepare_name_version $verdir/bin/* $verdir/lib/*) +pymodules=$(prepare_name_version $verdir/python/*) +texpkg=$(prepare_name_version $verdir/tex/texlive) + +# Write them as one paragraph for LaTeX. +pkgver=$mtexdir/dependencies.tex +echo "This research was done with the following free" > $pkgver +echo "software programs and libraries: $proglibs." >> $pkgver +npython=$(ls $verdir/python/* | wc -l) +if [ $npython != 0 ]; then + echo "Within Python, the following modules were used: " >> $pkgver + echo "$pymodules." >> $pkgver +fi +echo "The \LaTeX{} source of the paper was compiled to make" >> $pkgver +echo "the PDF using the following packages $texpkg. We are" >> $pkgver +echo "very grateful to all their creators for freely" >> $pkgver +echo "providing this necessary infrastructure. This " >> $pkgver +echo "research (and many others) would not be possible" >> $pkgver +echo "without them." >> $pkgver + + + # Final step: the Makefile |