Skip to content

Commit

Permalink
cleaning + migrating
Browse files Browse the repository at this point in the history
  • Loading branch information
Ducasse committed Aug 23, 2024
1 parent b79c214 commit b925438
Show file tree
Hide file tree
Showing 18 changed files with 387 additions and 196 deletions.
31 changes: 0 additions & 31 deletions _support/latex/ensure-deps-2018.sh

This file was deleted.

28 changes: 0 additions & 28 deletions _support/latex/ensure-deps-2019.sh

This file was deleted.

32 changes: 0 additions & 32 deletions _support/latex/ensure-deps.sh

This file was deleted.

109 changes: 109 additions & 0 deletions _support/latex/sbabook/.drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
---
kind: pipeline
type: docker
name: TeXlive

steps:
- name: build
image: texlive/texlive
commands:
- tlmgr option repository https://ctan.gutenberg-asso.fr/systems/texlive/tlnet
- tlmgr update --self --all
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: minimal TeXlive

steps:
- name: build
image: texlive/texlive:latest-minimal
pull: always
commands:
- tlmgr option repository https://ctan.gutenberg-asso.fr/systems/texlive/tlnet
- tlmgr update --self --all
- tlmgr install latex-bin latexmk
- xargs tlmgr install < texlive.deps
- tlmgr path add
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: Ubuntu + TeXlive 2023

environment:
TEXLIVE_RELEASE: 2023

steps:
- name: build
image: ubuntu
commands:
- apt update && apt install -y curl perl
- export PATH=$HOME/texlive/bin/x86_64-linux:$HOME/texlive/bin/aarch64-linux:$PATH
- ./ci/install-texlive
- xargs tlmgr install < texlive-2023.deps
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]

---
kind: pipeline
type: docker
name: Ubuntu + TeXlive rolling

environment:
TEXLIVE_RELEASE: rolling

steps:
- name: build
image: ubuntu
commands:
- apt update && apt install -y curl perl
- export PATH=$HOME/texlive/bin/x86_64-linux:$HOME/texlive/bin/aarch64-linux:$PATH
- ./ci/install-texlive
- xargs tlmgr install < texlive.deps
- latexmk sbabook
- latexmk sbabook.bod
- latexmk sbabook.spiral

- name: build log
image: alpine
commands:
- cat sbabook.log
- cat sbabook.bod.log
- cat sbabook.spiral.log
when:
status: [failure, success]
8 changes: 4 additions & 4 deletions _support/latex/sbabook/.gitrepo
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
;
[subrepo]
remote = https://github.com/cdlm/sbabook.git
branch = master
commit = 6ba943f40408c19528b5c62d5c498c9507e44335
parent = d9663feb3a92f12b7cc6268e6cc41a5d6aef60da
branch = v0.2.8
commit = ffabafecf60c20d856b706f9377595a45be7704f
parent = 45207449de0cce8a515afcfe358fabf185a14d30
method = merge
cmdver = 0.4.1
cmdver = 0.4.6
27 changes: 0 additions & 27 deletions _support/latex/sbabook/.travis.yml

This file was deleted.

Binary file added _support/latex/sbabook/CreativeCommons-BY-SA.pdf
Binary file not shown.
Binary file removed _support/latex/sbabook/CreativeCommons-BYNOCND.pdf
Binary file not shown.
5 changes: 2 additions & 3 deletions _support/latex/sbabook/README.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ SBAbook — A LaTeX class for technical books
This is a set of layout, typography, and markup definitions for LaTeX books based on the [memoir][] document class.
It is intended for use by [Square Bracket Associates (SBA)][sba], and heavily customized in this direction — by this I mean it's made to setup specific semantic markup and typographic style, rather than to be flexible.

[![Build Status](https://travis-ci.org/cdlm/sbabook.svg?branch=master)](https://travis-ci.org/cdlm/sbabook)
[![Flattr this git repo](https://button.flattr.com/flattr-badge-large.png)](https://flattr.com/submit/auto?url=https%3A%2F%2Fgithub.com%2Fcdlm%2Fsbabook)
[![Donate](https://liberapay.com/assets/widgets/donate.svg)](https://liberapay.com/cdlm/donate "Donate using Liberapay")


## Usage (nearly there)

The preamble is limited to the minimum:
Here is the minimal preamble:

```latex
\documentclass{sbabook}
Expand Down
73 changes: 33 additions & 40 deletions _support/latex/sbabook/ci/install-texlive
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -4,56 +4,43 @@ trap 's=$?; echo "$0: Error on line "$LINENO": $BASH_COMMAND"; exit $s' ERR
IFS=$'\n\t'
# preamble from https://disconnected.systems/blog/another-bash-strict-mode/

: "${TEXLIVE_TARBALL:=install-tl-unx.tar.gz}"

function die() {
echo "$@" >&2
exit 1
}

function texlive-repo() {
[[ $# -eq 1 ]] || die "${FUNCNAME[0]}: No release specified (YYYY or rolling)"
local release="$1"
local release="$1" url

if [[ "$release" = rolling ]]; then
echo 'http://mirror.ctan.org/systems/texlive/tlnet'
url='http://mirror.ctan.org/systems/texlive/tlnet'
else
[[ "$release" = [0-9][0-9][0-9][0-9] ]] || die "${FUNCNAME[0]}: incorrect release '$release'"
echo "https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/${release}/tlnet-final/"
url="https://ftp.tu-chemnitz.de/pub/tug/historic/systems/texlive/${release}/tlnet-final/"
# the rolling release is missing the shasum, and the tlnet directory
# US mirror: http://ftp.math.utah.edu/pub/tex/historic/systems/texlive/${release}/
fi
}

function deps-file() {
if [[ "$1" = [0-9][0-9][0-9][0-9] ]]; then
echo "texlive-$1.deps"
else
echo texlive.deps
fi
}

function texlive-release() {
tlmgr --version \
| grep 'TeX Live .*version' \
| grep --only-matching '\d\d\d\d'
# resolve possible mirror to fixed URL
curl -LIs -o /dev/null -w '%{url_effective}' "$url"
}

# Ensure meaningful default values for required environment variables.
# Override the full repository URL or set TEXLIVE_RELEASE to pick that year's frozen release.
# Defaults to the current rolling release.
: "${TEXLIVE_RELEASE:=rolling}"
: "${TEXLIVE_REPOSITORY:="$(texlive-repo "$TEXLIVE_RELEASE")"}"
: "${TEXLIVE_TARBALL:=install-tl-unx.tar.gz}"

function get-texlive-installer() {
[[ $# -eq 1 ]] || die "Usage: ${FUNCNAME[0]} texlive-repo-url"
local repo="$1"

# download, checksum, extract
curl --silent --location --remote-name-all "${TEXLIVE_REPOSITORY}/${TEXLIVE_TARBALL}"{,.sha512}
shasum --check "${TEXLIVE_TARBALL}.sha512"
curl --silent --location --remote-name-all "${repo}/${TEXLIVE_TARBALL}"{,.sha512}
sha512sum --check "${TEXLIVE_TARBALL}.sha512"
tar --extract --gzip --file "${TEXLIVE_TARBALL}"
}

function texlive-profile() {
cat <<EOF
selected_scheme scheme-basic
selected_scheme scheme-infraonly
TEXDIR $HOME/texlive
TEXMFLOCAL \$TEXDIR/texmf-local
Expand All @@ -76,36 +63,42 @@ tlpdbopt_generate_updmap 0
tlpdbopt_install_docfiles 0
tlpdbopt_install_srcfiles 0
tlpdbopt_post_code 1
tlpdbopt_sys_bin /usr/local/bin
tlpdbopt_sys_info /usr/local/info
tlpdbopt_sys_man /usr/local/man
EOF
}

function install-texlive() {
[[ $TRAVIS = true ]] || die "Should only run on Travis"
echo "Downloading minimal TeXlive..."
echo " release $TEXLIVE_RELEASE"
echo " from $TEXLIVE_REPOSITORY"
[[ $# -eq 2 ]] || die "Usage: ${FUNCNAME[0]} (YYYY | rolling) texlive-repository-url"
local release="$1" repo="$2"

get-texlive-installer
echo "Downloading TeXlive..."
echo " release ${release}"
echo " from ${repo}"

get-texlive-installer "$repo"

# find installer path from archive listing, sanity check
local installer
installer="$(tar --list --gzip --file "${TEXLIVE_TARBALL}" | grep '/install-tl$' )"
[[ -x "$installer" ]] || die "can not find TeXlive installer at ${installer}";

texlive-profile >> texlive.profile
"$installer" --repository "$TEXLIVE_REPOSITORY" --profile texlive.profile
}
"$installer" --repository "$repo" --profile texlive.profile
tlmgr option repository "$repo"

function install-deps() {
xargs tlmgr install \
latexmk \
< "$(deps-file "$TEXLIVE_RELEASE")"
tlmgr update --self --all
tlmgr install latex-bin latexmk
}

# Only call the main function if this script was called as a command. This makes
# it possible to source this script as a library.
if [[ ${BASH_SOURCE[0]} == "$0" ]]; then
install-texlive
install-deps
# Override the full repository URL or set TEXLIVE_RELEASE to pick that year's frozen release.
# Defaults to the current rolling release.
release="${1:-${TEXLIVE_RELEASE:-rolling}}"
repo="${2:-${TEXLIVE_REPOSITORY:-$(texlive-repo "$release")}}"

install-texlive "$release" "$repo"
fi
Loading

0 comments on commit b925438

Please sign in to comment.