diff options
Diffstat (limited to 'Master/tlpkg/bin/tl-update-asy')
-rwxr-xr-x | Master/tlpkg/bin/tl-update-asy | 91 |
1 files changed, 61 insertions, 30 deletions
diff --git a/Master/tlpkg/bin/tl-update-asy b/Master/tlpkg/bin/tl-update-asy index da3929daee4..ec86af4dd5a 100755 --- a/Master/tlpkg/bin/tl-update-asy +++ b/Master/tlpkg/bin/tl-update-asy @@ -10,9 +10,13 @@ # define for myself; feel free to peruse tug.org:~karl/.bash_login, etc. # --karl -test "x$1" = x--build || exit 1 +# but running the script is nevertheless useful sometimes, as described below. +test "x$1" = x--build || test "x$1" = x--bin-github || exit 1 + renice +19 -p $$ >/dev/null 2>&1 +fatal () { echo "$0: goodbye, $*" >&2; exit 1; } + # if false && $update_sources_from_ctan; then # this part is about copying the sources from CTAN to TL. @@ -32,26 +36,26 @@ if false && $update_sources_from_ctan; then # show list of files to remove: diff -qr . /home/ftp/tex-archive/graphics/asymptote/ \ - | egrep -v ' differ' | egrep -v '\.svn' | tee /tmp/asyrm + | egrep -v ' differ' | egrep -v '\.svn|/binaries' | tee /tmp/asyrm sed -e 's,: ,/,' -e 's/^Only in //' /tmp/asyrm svn rm `!!` # final check and commit: svn status | fgrep \? # # don't worry about binaries. svn commit -m"asy $ver sources" . ../README - exit $? # elif test "x$1" = x--build; then # this part is about building the x86 linux asymptote on tug.org. - # Despite all the dire warnings above, this part actually can be run - # as a script, because it's so often necessary to redo. + # Despite all the dire warnings above, this part can be executed. unset GREP_OPTIONS CDPATH PATH=/usr/bin:/usr/sbin; export PATH # system gcc for sake of shared libs + PATH=$PATH:/usr/local/gnu/bin # libtool required PATH=$lb:$PATH # get our kpsewhich - svn=/usr/local/bin/svn # so we need our svn explicitly + PYTHON=python3.9; export PYTHON # 3.6 is too old + svn=/usr/local/bin/svn # so we need our svn explicitly set -x - rhtoolset=/opt/rh/devtoolset-10/enable + rhtoolset=/opt/rh/gcc-toolset-13/enable test -s $rhtoolset && . $rhtoolset set -e @@ -70,13 +74,13 @@ elif test "x$1" = x--build; then --with-latex=/tmp/ainst/latex --with-context=/tmp/ainst/context \ --disable-fftw --disable-gl --disable-gsl --disable-lsp \ --enable-texlive-build \ - CFLAGS=-g CXXFLAGS=-std=c++11 LDFLAGS="-static-libgcc -static-libstdc++" - make + CFLAGS=-g \ + LDFLAGS="-static-libgcc -static-libstdc++" + make -j`nproc` SILENT_MAKE= make check make install-prebuilt exit 0 - # elif false && $update_runtime_from_ainst; then # this part is about copying the results of a successful build @@ -88,6 +92,7 @@ elif false && $update_runtime_from_ainst; then xu=$B/source/utils xy=$xu/asymptote cd $xy + make distclean ver=`awk -F\" '{print $2}' revision.cc | sed 1q`; echo $ver # $cp binaries/x86_64-windows/texlive/asy.exe $pg/asymptote64/ @@ -126,24 +131,50 @@ elif false && $update_runtime_from_ainst; then #svn rm ... svn status $ci # just to see - scom -m"asymptote $ver support files, windows binary" $ci -fi + scom -m"asymptote $ver support files + windows binary" $ci -# the production build on x86_64-linux and i386-linux: -# -# cd .../Build/source/utils -# docker run -it -v "$(pwd)/asymptote:/asymptote" --entrypoint bash debian:10 -# -# In the docker container you are dropped in: -# apt update -# apt upgrade -# # note we do NOT install libtirpc-dev because it cannot disabled by configure -# apt install build-essential pkg-config libeigen3-dev libcurl4-openssl-dev libreadline-dev libboost-filesystem-dev flex libglu1-mesa-dev freeglut3-dev libosmesa6-dev libreadline6-dev zlib1g-dev bison libglm-dev libncurses-dev -# cd /asymptote -# ./configure --prefix=/tmp/asyinst --enable-static --enable-texlive-build CXXFLAGS=-std=c++11 --disable-gsl --disable-fftw --disable-lsp --disable-curl -# sed -i -e 's/^LIBS = /LIBS = -static-libgcc -static-libstdc++ /' Makefile -# make -j6 -# exit -# Strip and copy the resulting asy. -# For i386 binaries: -# docker run -it -v "$(pwd)/asymptote:/asymptote" --entrypoint bash i386/debian:10 +# +elif test "x$1" = x--bin-github; then + # The x86_64-linux binary and other platforms are built via github. See + # Build/source/.github/scripts/build-asy.sh (and workflows/build-asy.yml), + # siblings to the main TL build files there. + # + # The sources are synced every five minutes; see + # https://github.com/TeX-Live/texlive-source/actions/. + # + # The main.yml workflow will run automatically to build all of TL + # (and takes hours to complete); the build-asy.yml workflow has to be + # triggered manually from + # https://github.com/TeX-Live/texlive-source/actions/workflows/build-asy.yml + # + # Then, if it succeeds, the artifacts produced will appear on the + # result page and can be downloaded from there. The download links + # only work in a browser, not wget or curl. + # + # Then can run this script with --bin-github *.zip to install the + # available zips in the bin directories. + shift + mydir=`dirname $0` + Master=`cd $mydir/../.. && pwd` + bin=$Master/bin + test -d "$bin" || fatal "no bin directory: $bin" + echo "$0: installing into $bin..." + + for f in "$@"; do + # filenames: asy-amd64-freebsd.zip asy-i386-linux.zip + # asy-i386-freebsd.zip asy-x86_64-linux.zip + # and they unpack into a single file, asy-amd64-freebsd etc. + + # so, better be a known platform name. + platname=`echo "$f" | sed -e 's/^asy-//' -e 's/\.zip$//'` + platdir=$bin/$platname + test -d "$platdir" || fatal "no platform bin directory: $platdir" + + # and we should be able to unpack into it. + unzip -od "$platdir" "$f" || fatal "unzip -d $platdir failed" + + # and then we should be able to rename the binary to just asy. + mv -v "$platdir/asy-$platname" "$platdir/asy" || fatal "mv failed" + done + # then do the commit in Master/bin manually. +fi |