source: trunk/dports/tex/texlive-bin/Portfile @ 111792

Last change on this file since 111792 was 111792, checked in by dports@…, 7 years ago

texlive-bin: backport various fixes from upstream (see #39334, and
http://www.tug.org/pipermail/tldistro/2013q3/000218.html)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 11.1 KB
Line 
1# -*- 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
2# $Id: Portfile 111792 2013-10-01 23:47:49Z dports@macports.org $
3
4PortSystem      1.0
5PortGroup       compiler_blacklist_versions 1.0
6PortGroup       texlive 1.0
7
8name            texlive-bin
9version         2013
10revision        3
11
12categories      tex
13maintainers     dports
14description     TeX Live Binaries.
15long_description    TeX Live is an easy way to get up and running with TeX. \
16    It provides a comprehensive TeX system with binaries for most flavors \
17    of Unix, including GNU/Linux, and also Windows. It includes all the \
18    major TeX-related programs, macro packages, and fonts that are free \
19    software, including support for many languages around the world.
20
21homepage        http://www.tug.org/texlive/
22platforms       darwin
23
24# This port installs two libraries: kpathsea (LGPL-2.1+) and ptexenc (BSD).
25# The binaries are covered under various licenses, but all distributable;
26# see the texlive portfile for more information.
27license         Copyleft Permissive LGPL-2.1+ BSD
28
29# Our distfile is a stripped-down version of the texlive source
30# tarball, available from CTAN in systems/texlive/Source. For faster
31# download time, it omits a number of libraries and utilities that we
32# don't build. However, the port should still work with an unmodified
33# texlive distfile.
34master_sites    http://giraffe.cs.washington.edu/texlive/
35set distversion 20130619
36use_xz          yes
37distname        texlive-source-${distversion}-stripped
38worksrcdir      ${distname}
39
40set tlpkgdistname   tlpkg-TeXLive-${distversion}
41distfiles-append    ${tlpkgdistname}${extract.suffix}
42
43checksums       texlive-source-20130619-stripped.tar.xz \
44                rmd160  566e82917575c8d26a90c73b3d5a780a6017462a \
45                sha256  7a5fc3574f3609fc722cc0f7e6a6b9989d03f2ef536ac13412e152717b6a3172 \
46                tlpkg-TeXLive-20130619.tar.xz \
47                rmd160  fd998013e216d576b41986183069adaeb637f56b \
48                sha256  77c1d0859025f28410805ec493f384c705279e94471790aac7ba80badd586a74
49
50depends_lib     port:fontconfig \
51                port:freetype \
52                port:libpng \
53                port:ncurses \
54                port:zlib \
55                port:libzzip \
56                port:t1lib \
57                port:poppler \
58                path:lib/pkgconfig/cairo.pc:cairo \
59                path:lib/pkgconfig/pixman-1.pc:libpixman \
60                port:graphite2 \
61                port:icu \
62                port:harfbuzz \
63                port:harfbuzz-icu \
64                port:texlive-common
65
66depends_run     port:ghostscript
67
68depends_build   path:bin/perl:perl5 \
69                path:bin/pkg-config:pkgconfig
70
71# make luatex less sensitive to zlib version changes
72# (cf. http://bugs.debian.org/581818)
73patchfiles-append   patch-texk_web2c_luatexdir_luazlib_lzlib.c.diff
74
75# patches related to changes in install paths
76patchfiles-append   patch-texk_kpathsea_Makefile.in.diff \
77                    patch-texk_tex4htk_Makefile.in.diff \
78                    patch-texk_texlive_linked_scripts_Makefile.in.diff \
79                    patch-texk_texlive_tl_scripts_Makefile.in.diff \
80                    patch-texk_xdvik_xdvi-sh.in.diff \
81                    patch-texk_chktex_Makefile.in.diff
82
83# # fixes for makefile brokenness not otherwise specified
84patchfiles-append   patch-libs-freetype-Makefile.in.diff
85
86# backported fixes from upstream
87#  svn31700 fixes #39334
88patchfiles-append   patch-svn31126-luatex.diff \
89                    patch-svn31303-dvipdfmx.diff \
90                    patch-svn31313-pdftex-luatex.diff \
91                    patch-svn31350-dvips.diff \
92                    patch-svn31358-luatex.diff \
93                    patch-svn31621-mendex.diff \
94                    patch-svn31700-dvipdfmx.diff \
95                    patch-svn31735-metapost.diff
96
97post-patch {
98    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/texlive/linked_scripts/Makefile.in
99    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/texlive/tl_scripts/Makefile.in
100    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/tex4htk/Makefile.in
101    reinplace "s|@@TEXLIVE_BINDIR@@|${texlive_bindir}|" ${worksrcpath}/texk/xdvik/xdvi-sh.in
102    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/chktex/Makefile.in
103
104    # Defaults for the texmf search paths need to be compiled into
105    # libkpathsea -- really, just the location of texmf.cnf, which
106    # defines all the other paths. texlive normally finds this file
107    # using a bindir-relative path extracted from texmf.cnf, but this
108    # is both incorrect (it fails to find our texmf.cnf) and overkill
109    # (we know the absolute path of texmf.cnf).
110    #
111    # Accordingly, we patch the kpathsea makefile to not try to derive
112    # the default paths from texmf.cnf, and just provide our own
113    # paths.h with the right path substituted in.
114    delete ${worksrcpath}/texk/kpathsea/texmf.cnf
115    file copy ${filespath}/texk_kpathsea_paths.h ${worksrcpath}/texk/kpathsea/paths.h
116    reinplace "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/texk/kpathsea/paths.h
117    reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|" ${worksrcpath}/texk/kpathsea/paths.h
118}
119
120# llvm-gcc apparently fails on Xcode 4.0.x (#30758)
121compiler.blacklist {llvm-gcc-4.2 < 2335.15}
122
123
124# We use MacPorts-provided libraries instead of the ones included in
125# texlive whenever possible, to avoid redundancy and to better keep
126# current with respect to security updates and the like.
127#
128# Exceptions are freetype1 (not in MacPorts anymore)
129#
130# Many of the --with-system-* and --disable-* flags are actually
131# redundant because we've removed those components from the distfile,
132# but we leave them here for compatibility with the stock distfile.
133configure.args  --bindir=${texlive_bindir} \
134                --mandir=${texlive_bindir} \
135                --infodir=${prefix}/share/info \
136                --enable-shared \
137                --disable-multiplatform \
138                --disable-native-texlive-build \
139                --without-old-mac-fonts \
140                --with-banner-add="/MacPorts ${version}_${revision}" \
141                --with-system-freetype2 \
142                --without-system-freetype \
143                --without-system-icu \
144                --with-system-cairo \
145                --with-system-gd \
146                --with-system-graphite2 \
147                --with-system-harfbuzz \
148                --with-system-icu \
149                --with-system-libpng \
150                --with-libpng-includes=${prefix}/include \
151                --with-libpng-libdir=${prefix}/lib \
152                --with-system-ncurses \
153                --with-system-pixman \
154                --with-system-poppler \
155                --with-system-t1lib \
156                --with-t1lib-includes=${prefix}/include \
157                --with-t1lib-libdir=${prefix}/lib \
158                --with-system-xpdf \
159                --with-system-zlib \
160                --with-system-zziplib \
161                --disable-biber \
162                --disable-etex \
163                --disable-detex \
164                --disable-dvi2tty \
165                --disable-dvipng \
166                --disable-lcdf-typetools \
167                --disable-ps2eps \
168                --disable-psutils \
169                --disable-t1utils \
170                --disable-texinfo \
171                --disable-xindy \
172                --without-x \
173                --without-pdfopen \
174                --enable-build-in-source-tree
175
176# makejvf has some invalid character encodings in one of its source
177# files, which cause certain versions of clang to hang (#38643). Using
178# -Wno-invalid-source-encoding avoids this problem.
179# It appears to be specific to Xcode 4.6, but there's no harm in
180# silencing the warning for all versions of clang.
181post-patch {
182    if {[string match *clang* ${configure.compiler}]} { 
183        reinplace "/^WARNING_CFLAGS =/s/$/ -Wno-invalid-source-encoding/" ${worksrcpath}/texk/makejvf/Makefile.in
184    }
185}
186
187variant universal {}
188configure.cppflags-delete   -I${prefix}/include
189configure.ldflags-delete    -L${prefix}/lib
190configure.cppflags-append   -isystem${prefix}/include
191configure.env-append        LIBRARY_PATH=${prefix}/lib
192
193set cxx_stdlibflags {}
194if {[info exists configure.cxx_stdlib] &&
195    ${configure.cxx_stdlib} ne {} &&
196    [string match *clang* ${configure.cxx}]
197} then {
198    set cxx_stdlibflags -stdlib=${configure.cxx_stdlib}
199}
200
201# TODO: Remove when base supports OBJCXX and OBJCXXFLAGS (2.2.1?).
202configure.env-append        OBJCXX=${configure.cxx} \
203                            OBJCXXFLAGS="${configure.objcflags} ${cxx_stdlibflags} [get_canonical_archflags objc]"
204
205# work around bug in texlive makefiles where $OBJC is not recorded
206# during configure phase
207build.env                   OBJC=${configure.objc} \
208                            OBJCFLAGS="${configure.objcflags} [get_canonical_archflags objc]" \
209                            OBJCXX=${configure.cxx} \
210                            OBJCXXFLAGS="${configure.objcflags} ${cxx_stdlibflags} [get_canonical_archflags objc]"           
211
212post-destroot   {
213    # Anything that gets installed into texmf-dist will be installed
214    # by one of the texmf ports
215    delete ${destroot}${prefix}/share/texmf-dist
216    delete ${destroot}${texlive_texmfdist}
217
218    # Do not install symlinks to scripts that we don't install
219    delete ${destroot}${texlive_bindir}/latexmk
220    delete ${destroot}${texlive_bindir}/tlmgr   
221
222    # install the tlpkg/TeXLive perl module
223    xinstall -d ${destroot}${prefix}/share/tlpkg
224    copy ${workpath}/${tlpkgdistname} ${destroot}${prefix}/share/tlpkg/TeXLive
225
226    # gzip manpages that are installed into texlive_bindir
227    foreach manpage [glob -directory ${destroot}${texlive_bindir} man*/*] {
228        # need to make sure it isn't a symlink
229        if {[file type $manpage] == "file"} {
230            system "gzip $manpage"
231        }
232    }
233
234    # Create version/arch-specific links to the texbin directory used
235    # by the TeXDist prefpane; it seems that future versions of the
236    # prefpane will want these.
237    xinstall -d ${destroot}${texlive_mactex_texdistdir}-${version}
238    if {[variant_isset universal]} {
239        ln -s ${texlive_mactex_texbindir} \
240            ${destroot}${texlive_mactex_texdistdir}-${version}/universal-darwin
241    } else {
242        ln -s ${texlive_mactex_texbindir} \
243            ${destroot}${texlive_mactex_texdistdir}-${version}/${configure.build_arch}-darwin
244    }
245    ln -s ${texlive_mactex_texdistdir}-${version} \
246          ${destroot}${texlive_mactex_texdistdir}
247}
248
249post-activate {
250    system "${texlive_bindir}/mktexlsr"
251}
252
253variant x11 description {Build with x11 support, using Xaw widgets for xdvi} {
254    depends_lib-append port:xorg-libXp
255    configure.args-delete --without-x --without-pdfopen
256    depends_lib-append port:xorg-libXaw
257    configure.args-append --with-xdvi-x-toolkit=xaw
258}
259
260variant motif requires x11 description {Use Motif to build xdvi} {
261    depends_lib-delete port:xorg-libXaw
262    configure.args-delete --with-xdvi-x-toolkit=xaw
263    depends_lib-append lib:libXm:openmotif
264    configure.args-append --with-xdvi-x-toolkit=motif
265}
266
267default_variants    +x11
268
269livecheck.type      regex
270livecheck.url       ${homepage}acquire.html
271livecheck.regex     "TeX Live (\[0-9\]+) "
Note: See TracBrowser for help on using the repository browser.