#!/bin/bash # # Provisioner # # Parameters DIRNAME="`dirname $0`" BASEDIR="$DIRNAME/.." # Load optional customizations # # Search in multiple levels to account when this repository is vendorized. [ -f "$BASEDIR/.env" ] && source $BASEDIR/.env [ -f "$BASEDIR/../.env" ] && source $BASEDIR/../.env [ -f "$BASEDIR/../../.env" ] && source $BASEDIR/../../.env # Bookdown packaging approach BOOKDOWN_PACKAGING="${BOOKDOWN_PACKAGING:-DEB}" # Dependencies DEPENDENCIES="make" DEPENDENCIES="$DEPENDENCIES texlive-latex-base texlive-latex-recommended texlive-latex-extra texlive-fonts-extra texlive-extra-utils texlive-xetex texlive-lang-portuguese vim-latexsuite" DEPENDENCIES="$DEPENDENCIES pandoc pandoc-sidenote" DEPENDENCIES="$DEPENDENCIES fonts-liberation fonts-linuxlibertine" DEPENDENCIES="$DEPENDENCIES libfontconfig1-dev libharfbuzz-dev libfribidi-dev libfreetype6-dev libpng-dev libtiff5-dev libjpeg-dev" DEPENDENCIES="$DEPENDENCIES r-cran-rmarkdown r-cran-magick" DEPENDENCIES="$DEPENDENCIES libpoppler-cpp-dev" DEPENDENCIES="$DEPENDENCIES graphviz" DEPENDENCIES="$DEPENDENCIES biber pybtex" # Additional BibTeX dependencies #DEPENDENCIES="$DEPENDENCIES texlive-bibtex-extra" # For pdfcrop support DEPENDENCIES="$DEPENDENCIES texlive-extra-utils" # Old dependencies #DEPENDENCIES="$DEPENDENCIES python-yaml python-cheetah python-unidecode python-pycurl python-shortuuid" #DEPENDNECIES="$DEPENDENCIES python-sphinx python-sphinx-bootstrap-theme python-sphinx-paramlinks python-sphinx-patchqueue python-sphinx-rtd-theme python-sphinx-gallery python-sphinxcontrib.bibtex-doc" #DEPENDENCIES="$DEPENDENCIES pelican hugo jekyll" # Check for sudo if [ "`whoami`" != "root" ]; then SUDO="sudo" fi # Configure Debian backports if which trashman &> /dev/null; then trashman install debian-backports fi # Ensure an up-to-date system $SUDO apt-get update && $SUDO apt-get dist-upgrade -y && \ $SUDO apt-get autoremove -y && $SUDO apt-get clean # Install dependencies $SUDO apt install -y $DEPENDENCIES # Additional software #$SUDO apt install -y python3-pandocfilters # Try to install pandoc-citeproc, may be unavailable on Debian bookworm onwards #$SUDO apt install -y pandoc-citeproc # Tufte CSS #$SUDO apt install cabal-install #$SUDO cabal update #$SUDO cabal install pandoc-sidenote #$SUDO apt install -y libghc-pandoc-sidenote-dev \ # libghc-pandoc-sidenote-doc libghc-pandoc-sidenote-prof # Bookdown dependencies $SUDO apt install -y libcurl4-openssl-dev libssl-dev if [ "$BOOKDOWN_PACKAGING" == "CRAN" ]; then $SUDO $DIRNAME/provision.R else $SUDO apt install -y r-cran-bookdown $SUDO apt install -y r-cran-pdftools # As of 2024-08-16, this package is not available on Debian bookworm $SUDO Rscript -e 'install.packages("eulerr")' # As of 2024-08-16, ggplot2 from Debian bookworm version is 3.4.1, whereas # some downstreams need functionality from 3.5.0 (specifically, the ability # to use 'theme(legend.position = "inside"' constructs. # # Therefore we're currently installing a ggplot2 version from CRAN. $SUDO Rscript -e 'install.packages("ggplot2")' fi