diff --git a/Dockerfile b/Dockerfile index 57b8a20f..a3c687a4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,7 +24,6 @@ ARG DEPENDENCIES="\ python3-pygments \ python3-venv \ retry \ - ruby \ unzip \ wget \ zip \ @@ -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 @@ -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 @@ -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} @@ -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/ @@ -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 @@ -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 <. + 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 diff --git a/Makefile b/Makefile index e132389f..da2a1334 100644 --- a/Makefile +++ b/Makefile @@ -50,7 +50,7 @@ INSTALLABLES=markdown.lua markdown-cli.lua markdown.tex markdown.sty t-markdown. markdownthemewitiko_markdown_defaults.sty t-markdownthemewitiko_markdown_defaults.tex EXTRACTABLES=$(INSTALLABLES) $(MARKDOWN_USER_MANUAL) $(TECHNICAL_DOCUMENTATION_RESOURCES) \ $(DEPENDENCIES) -MAKEABLES=$(TECHNICAL_DOCUMENTATION) $(USER_MANUAL) $(INSTALLABLES) $(EXAMPLES) +MAKEABLES=$(TECHNICAL_DOCUMENTATION) $(USER_MANUAL) $(INSTALLABLES) $(EXAMPLES) $(DEPENDENCIES) RESOURCES=$(DOCUMENTATION) $(EXAMPLES_RESOURCES) $(EXAMPLES_SOURCES) $(EXAMPLES) \ $(MAKES) $(READMES) $(INSTALLER) $(DTXARCHIVE) $(TESTS) $(DEPENDENCIES) EVERYTHING=$(RESOURCES) $(INSTALLABLES) $(LIBRARIES) @@ -70,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) @@ -131,9 +134,11 @@ $(EXTRACTABLES): $(INSTALLER) $(DTXARCHIVE) -e 's#(((LASTMODIFIED)))#$(LASTMODIFIED)#g' \ $(INSTALLABLES) sed -i \ - -e '/\\ExplSyntaxOff/{N;/\\ExplSyntaxOn/d;}' \ + -e '/\\ExplSyntaxOff/ { N; /\\ExplSyntaxOn/d; }' \ $(INSTALLABLES) - grep -v '^#' $(DEPENDENCIES) | sort -u -o $(DEPENDENCIES) + ( \ + sed -n '/^#/ ! { s/\s*#.*//; p }' $(DEPENDENCIES); \ + ) | sort -u -o $(DEPENDENCIES) # This target produces the version file. $(VERSION_FILE): force diff --git a/examples/DEPENDS.txt b/examples/DEPENDS.txt new file mode 100644 index 00000000..6d7554dc --- /dev/null +++ b/examples/DEPENDS.txt @@ -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 diff --git a/markdown.dtx b/markdown.dtx index 445f65ef..182da291 100644 --- a/markdown.dtx +++ b/markdown.dtx @@ -1359,6 +1359,7 @@ soft paralist % \end{markdown} % \begin{macrocode} soft latex +soft epstopdf-pkg # required by `latex` % \end{macrocode} % \begin{markdown} % @@ -1382,6 +1383,8 @@ soft fancyvrb % \end{markdown} % \begin{macrocode} soft csvsimple +soft pgf # required by `csvsimple`, which loads `pgfkeys.sty` +soft tools # required by `csvsimple`, which loads `shellesc.sty` % \end{macrocode} % \begin{markdown} % diff --git a/tests/DEPENDS.txt b/tests/DEPENDS.txt new file mode 100644 index 00000000..d362f5ef --- /dev/null +++ b/tests/DEPENDS.txt @@ -0,0 +1,3 @@ +soft context +soft latex-bin +soft xetex