Files
Clemens LangandClemens Lang 3593e1ca3b dblatex: Fix build by disabling pep517
This broke when 3173d46b9a enabled pep517
by default for all python versions >= 3.7. dblatex does not properly
build with the new tooling.

See: #20793
2023-10-19 13:29:15 +02:00

171 lines
6.5 KiB
Tcl

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup python 1.0
PortGroup texlive 1.0
name dblatex
version 0.3.12
revision 2
categories textproc tex
maintainers {cal @neverpanic} openmaintainer
license GPL-2+
platforms {darwin any}
supported_archs noarch
description DocBook to LaTeX Converter
long_description Dblatex transforms a DocBook XML/SGML document to LaTeX. \
Once transformed into LaTeX, standard LaTeX tools are \
used to produce DVI, Postcript or PDF files. \
dblatex tries to hide as much as possible the latex \
compiling stuff by providing a single clean script to \
produce directly DVI, PostScript and PDF output. \
The actual output rendering is done not only by the \
XSL stylesheets transformation, but also by a dedicated \
LaTeX package. The goal is to allow a deep LaTeX \
customisation without changing the XSL stylesheets. \
Post-processing is done by Python, to make publication \
faster, convert the images if needed, and do the whole \
compilation.
homepage http://dblatex.sourceforge.net
distname ${name}3-${version}
master_sites sourceforge:project/dblatex/dblatex/dblatex-${version}
checksums sha256 16e82786272ed1806a079d37914d7ba7a594db792dc4cc34c1c3737dbd4da079 \
rmd160 135ed1bc2a709d4eae2dc9b3656408022f877b99 \
size 1693272
use_bzip2 yes
patchfiles patch-64720.diff
depends_lib port:texlive-latex-extra \
port:texlive-latex-recommended \
port:texlive-math-science \
port:dejavu-fonts \
port:ImageMagick \
port:docbook-xml \
port:docbook-xsl-nons \
port:docbook-xml-5.0
python.link_binaries no
python.default_version 310
python.pep517 no
destroot.target-append --catalogs=${prefix}/etc/xml/catalog
# The mactex variant expects MacTeX to be installed
# and installs dblatex's stylefiles to MacTeX's texmf (local)
set dblatex.texmflocal ""
set dblatex.mactex_bin ""
set dblatex.temp ""
variant mactex description {Allow dblatex to use MacTeX or another\
external TeXLive installation instead of MacPorts TeXLive tools.\
To install the 'mactex' variant the path to the TeX distribution's\
binary directory (for example '/Library/TeX/texbin') must be added\
to 'binpath' in 'macports.conf' *before* installing this port.} {
# Find the binary directory of the external TeX distribution by
# searching the kpsewhich program in the path. We assume that all
# other binaries of the distribution are in this directory, too.
if {[auto_execok kpsewhich] ne ""} {
set dblatex.temp {*}[auto_execok kpsewhich]
}
set dblatex.mactex_bin \
[file dirname [file normalize ${dblatex.temp}]]
if {${dblatex.mactex_bin} eq "."} {
pre-fetch {
return -code error "Cannot find MacTeX or external TeXLive\
installation; aborting. Have you added the path to\
your TeX distribution's binary directory to 'binpath'\
in 'macports.conf'?"
}
} elseif {${dblatex.mactex_bin} eq \
[file dirname [file normalize "${prefix}/bin/kpsewhich"]]} {
pre-fetch {
return -code error "Variant 'mactex' doesn't work with\
installed MacPorts TeXLive packages. Either\
uninstall them or don't use the 'mactex' variant of\
dblatex."
}
} else {
set dblatex.texmflocal \
[exec ${dblatex.mactex_bin}/kpsewhich --expand-var='\$TEXMFLOCAL']
regsub -all {'} ${dblatex.texmflocal} "" dblatex.texmflocal
}
# Make 'port notes dblatex +mactex' work even if neither the package
# nor an external TeXLive is installed.
if {${dblatex.texmflocal} eq ""} {
notes "The 'mactex' variant will install styles into your\
TeXLive's texmf-local tree (which is outside MacPorts'\
common directory structure)."
} else {
notes "\
The 'mactex' variant will install styles into your TeXLive's texmf-local\
tree at
${dblatex.texmflocal}
(which is outside MacPorts' common directory structure)."
}
depends_lib-delete \
port:texlive-latex-extra \
port:texlive-latex-recommended \
port:texlive-math-science
# AND, since we're installing files outside MacPorts' normal
# directories...
destroot.violate_mtree yes
}
post-destroot {
reinplace "s|^#!/usr/bin/env .*|#!${python.bin}|" ${destroot}${python.prefix}/bin/dblatex
fs-traverse f ${destroot}${python.prefix}/share {
if {[file isfile $f]} {
set f [string range $f [string length ${destroot}${python.prefix}/share/] end]
file mkdir [file dirname ${destroot}${prefix}/share/$f]
ln -s ${python.prefix}/share/$f ${destroot}${prefix}/share/$f
}
}
if {![variant_isset mactex]} {
set dblatex.texmflocal ${texlive_texmflocal}
set dblatex.bin ${prefix}/bin
} else {
set dblatex.bin ${dblatex.mactex_bin}
}
file mkdir ${destroot}${dblatex.texmflocal}/tex/latex/dblatex
fs-traverse f ${destroot}${python.prefix}/share/dblatex/latex {
if {[file isfile $f]} {
if {[catch {exec ${dblatex.bin}/kpsewhich -a [file tail $f]} result]} {
set f [string range $f [string length ${destroot}${python.prefix}/share/dblatex/latex/] end]
file mkdir [file dirname ${destroot}${dblatex.texmflocal}/tex/latex/dblatex/$f]
ln -s ${python.prefix}/share/dblatex/latex/$f ${destroot}${dblatex.texmflocal}/tex/latex/dblatex/$f
}
}
}
ln -s ${python.prefix}/bin/dblatex ${destroot}${prefix}/bin/
}
proc dblatex.mktexlsr {} {
if {![variant_isset mactex]} {
texlive.mktexlsr
} else {
global dblatex.mactex_bin
system "${dblatex.mactex_bin}/mktexlsr"
}
}
post-activate {
dblatex.mktexlsr
}
post-deactivate {
dblatex.mktexlsr
}
livecheck.regex /${name}-(\[0-9.\]+)/