Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add file DEPENDS.txt #463

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Fixes:
Documentation:

- Fix various typos. (#454, contributed by @mbertucci47)
- Add file `DEPENDS.txt`. (#462, #463)

Continuous Integration:

Expand Down
48 changes: 43 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ ARG DEPENDENCIES="\
python3-pygments \
python3-venv \
retry \
ruby \
unzip \
wget \
zip \
Expand All @@ -35,6 +34,13 @@ ARG DEV_DEPENDENCIES="\
vim \
"

ARG TEXLIVE_DEPENDENCIES="\
l3kernel \
latex \
latexmk \
luatex \
"

ARG BINARY_DIR=/usr/local/bin
ARG BUILD_DIR=/git-repo
ARG INSTALL_DIR=/usr/local/texlive/texmf-local
Expand All @@ -47,6 +53,7 @@ ARG DEV_IMAGE=false
FROM $FROM_IMAGE:$TEXLIVE_TAG as build

ARG DEPENDENCIES
ARG TEXLIVE_DEPENDENCIES

ARG BUILD_DIR
ARG INSTALL_DIR
Expand All @@ -67,7 +74,7 @@ set -o errexit
set -o nounset
set -o xtrace

# Install dependencies
# Install OS dependencies
apt-get -qy update
apt-get -qy install --no-install-recommends ${DEPENDENCIES}

Expand All @@ -80,8 +87,12 @@ then
retry -t 30 -d 60 tlmgr update --self --all --repository ftp://ftp.cstug.cz/pub/tex/local/tlpretest/
fi

# Generate the ConTeXt file database
mtxrun --generate
# Install basic TeX Live dependencies
if echo ${TEXLIVE_TAG} | grep -q latest-minimal
then
retry -t 30 -d 60 tlmgr install ${TEXLIVE_DEPENDENCIES}
tlmgr path add
fi

# Uninstall the distribution Markdown package
rm -rfv ${PREINSTALLED_DIR}/tex/luatex/markdown/
Expand Down Expand Up @@ -112,7 +123,13 @@ cp ${BUILD_DIR}/t-markdown.tex ${INSTALL_DIR}/tex/
cp ${BUILD_DIR}/t-markdownthemewitiko_markdown_defaults.tex ${INSTALL_DIR}/tex/context/third/markdown/

# Generate the ConTeXt file database
mtxrun --generate
if test ${DEV_IMAGE} != true
then
mtxrun --generate
texlua /usr/bin/mtxrun.lua --luatex --generate
context --make
context --luatex --make
fi

# Reindex the TeX directory structure
texhash
Expand Down Expand Up @@ -145,6 +162,9 @@ ENV DEBIAN_FRONTEND=noninteractive
ENV TERM=xterm
ENV TEXMFLOCAL=${INSTALL_DIR}

COPY --from=build ${BUILD_DIR}/DEPENDS.txt ${BUILD_DIR}/DEPENDS.txt
COPY --from=build ${BUILD_DIR}/tests/DEPENDS.txt ${BUILD_DIR}/tests/DEPENDS.txt

RUN <<EOF

set -o errexit
Expand Down Expand Up @@ -172,6 +192,13 @@ then
retry -t 30 -d 60 tlmgr update --self --all --repository ftp://ftp.cstug.cz/pub/tex/local/tlpretest/
fi

# Install TeX Live dependencies
if echo ${TEXLIVE_TAG} | grep -q latest-minimal
then
retry -t 30 -d 60 tlmgr install $(awk '{ print $2 }' ${BUILD_DIR}/DEPENDS.txt ${BUILD_DIR}/tests/DEPENDS.txt | sort -u)
tlmgr path add
fi

# Uninstall the distribution Markdown package
rm -rfv ${PREINSTALLED_DIR}/tex/luatex/markdown/
rm -rfv ${PREINSTALLED_DIR}/scripts/markdown/
Expand Down Expand Up @@ -200,9 +227,20 @@ set -o xtrace
chmod +x ${BINARY_DIR}/markdown-cli

# Generate the ConTeXt file database
if echo ${TEXLIVE_TAG} | grep -q latest-minimal
then
# A temporary fix for ConTeXt, see <https://gitlab.com/islandoftex/images/texlive/-/issues/30>.
sed -i '/package.loaded\["data-ini"\]/a if os.selfpath then environment.ownbin=lfs.symlinktarget(os.selfpath..io.fileseparator..os.selfname);environment.ownpath=environment.ownbin:match("^.*"..io.fileseparator) else environment.ownpath=kpse.new("luatex"):var_value("SELFAUTOLOC");environment.ownbin=environment.ownpath..io.fileseparator..(arg[-2] or arg[-1] or arg[0] or "luatex"):match("[^"..io.fileseparator.."]*$") end' /usr/bin/mtxrun.lua || true
fi
mtxrun --generate
texlua /usr/bin/mtxrun.lua --luatex --generate
context --make
context --luatex --make

# Reindex the TeX directory structure
texhash

# Remove the build directory
rm -rfv ${BUILD_DIR}

EOF
20 changes: 14 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ DTXARCHIVE=markdown.dtx
INSTALLER=markdown.ins docstrip.cfg
TECHNICAL_DOCUMENTATION_RESOURCES=markdown.bib markdown-figure-block-diagram.tex \
markdownthemewitiko_markdown_techdoc.sty
DEPENDENCIES=DEPENDS.txt
TECHNICAL_DOCUMENTATION=markdown.pdf
MARKDOWN_USER_MANUAL=markdown.md markdown.css
HTML_USER_MANUAL=markdown.html markdown.css
Expand All @@ -47,10 +48,11 @@ INSTALLABLES=markdown.lua markdown-cli.lua markdown.tex markdown.sty t-markdown.
markdownthemewitiko_dot.sty markdownthemewitiko_graphicx_http.sty \
markdownthemewitiko_tilde.tex markdownthemewitiko_markdown_defaults.tex \
markdownthemewitiko_markdown_defaults.sty t-markdownthemewitiko_markdown_defaults.tex
EXTRACTABLES=$(INSTALLABLES) $(MARKDOWN_USER_MANUAL) $(TECHNICAL_DOCUMENTATION_RESOURCES)
MAKEABLES=$(TECHNICAL_DOCUMENTATION) $(USER_MANUAL) $(INSTALLABLES) $(EXAMPLES)
EXTRACTABLES=$(INSTALLABLES) $(MARKDOWN_USER_MANUAL) $(TECHNICAL_DOCUMENTATION_RESOURCES) \
$(DEPENDENCIES)
MAKEABLES=$(TECHNICAL_DOCUMENTATION) $(USER_MANUAL) $(INSTALLABLES) $(EXAMPLES) $(DEPENDENCIES)
RESOURCES=$(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(EXAMPLES) \
$(MAKES) $(READMES) $(INSTALLER) $(DTXARCHIVE) $(TESTS)
$(MAKES) $(READMES) $(INSTALLER) $(DTXARCHIVE) $(TESTS) $(DEPENDENCIES)
EVERYTHING=$(RESOURCES) $(INSTALLABLES) $(LIBRARIES)
GITHUB_PAGES=gh-pages

Expand All @@ -68,6 +70,9 @@ ifndef DOCKER_TEXLIVE_TAG
endif
ifeq ($(DOCKER_DEV_IMAGE), true)
DOCKER_TAG_POSTFIX=-no_docs
ifeq ($(DOCKER_TEXLIVE_TAG), latest)
DOCKER_TEXLIVE_TAG=latest-minimal
endif
endif
DOCKER_TEMPORARY_IMAGE=ghcr.io/witiko/markdown
DOCKER_TEMPORARY_TAG=$(VERSION)-$(DOCKER_TEXLIVE_TAG)$(DOCKER_TAG_POSTFIX)
Expand Down Expand Up @@ -129,8 +134,11 @@ $(EXTRACTABLES): $(INSTALLER) $(DTXARCHIVE)
-e 's#(((LASTMODIFIED)))#$(LASTMODIFIED)#g' \
$(INSTALLABLES)
sed -i \
-e '/\\ExplSyntaxOff/{N;/\\ExplSyntaxOn/d;}' \
-e '/\\ExplSyntaxOff/ { N; /\\ExplSyntaxOn/d; }' \
$(INSTALLABLES)
( \
sed -n '/^#/ ! { s/\s*#.*//; p }' $(DEPENDENCIES); \
) | sort -u -o $(DEPENDENCIES)

# This target produces the version file.
$(VERSION_FILE): force
Expand Down Expand Up @@ -247,9 +255,9 @@ $(DISTARCHIVE): $(EVERYTHING) $(TDSARCHIVE)
rm -f markdown

# This target produces the CTAN archive.
$(CTANARCHIVE): $(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES) $(TDSARCHIVE)
$(CTANARCHIVE): $(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES) $(TDSARCHIVE) $(DEPENDENCIES)
-ln -s . markdown
zip -MM -r -v -nw --symlinks $@ $(addprefix markdown/,$(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES)) $(TDSARCHIVE)
zip -MM -r -v -nw --symlinks $@ $(addprefix markdown/,$(DTXARCHIVE) $(INSTALLER) $(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(LIBRARIES)) $(TDSARCHIVE) $(DEPENDENCIES)
rm -f markdown

# This pseudo-target removes any existing auxiliary files and directories.
Expand Down
10 changes: 10 additions & 0 deletions examples/DEPENDS.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
soft babel-english
soft collection-context
soft collection-latex
soft collection-latexrecommended
soft collection-luatex
soft dvipng
soft latex-bin
soft make4ht
soft optex
soft xetex
Loading