id: "sagemath" aliases: - "sage" name: "SageMath" install: prepare: apt: - python2 apt: - libpng16-16 - libfreetype6 manual: | install -d "${pkg}/opt/sagemath" install -d "${pkg}/usr/local/bin" file="$(curl -fsSL https://mirrors.mit.edu/sage/linux/64bit/index.html | grep -Eo 'sage-[^"]+\.tar\.bz2' | grep Ubuntu | sort -rV | head -n1)" wget "https://mirrors.mit.edu/sage/linux/64bit/${file}" -O sage.tar.bz2 sudo mkdir /opt/sagemath sudo chown riju:riju /opt/sagemath tar -xf sage.tar.bz2 -C /opt/sagemath --strip-components=1 python2 /opt/sagemath/relocate-once.py find /opt/sagemath -name __pycache__ -exec rm -rf '{}' ';' -prune shopt -s dotglob mv /opt/sagemath/* "${pkg}/opt/sagemath/" sudo rmdir /opt/sagemath ln -s /opt/sagemath/sage "${pkg}/usr/local/bin/" repl: | sage main: ".sage/init.sage" template: | print("Hello, world!") createEmpty: "" run: | sage scope: code: | x = 123 * 234