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

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

texlive-bin: relax luatex's runtime zlib version check so it doesn't
complain about (ABI-compatible) zlib revision changes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.5 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 89597 2012-02-03 20:25:37Z dports@macports.org $
3
4PortSystem      1.0
5PortGroup       texlive 1.0
6
7name            texlive-bin
8version         2011
9revision        4
10
11categories      tex
12maintainers     dports
13description     TeX Live Binaries.
14long_description    TeX Live is an easy way to get up and running with TeX. \
15    It provides a comprehensive TeX system with binaries for most flavors \
16    of Unix, including GNU/Linux, and also Windows. It includes all the \
17    major TeX-related programs, macro packages, and fonts that are free \
18    software, including support for many languages around the world.
19
20homepage        http://www.tug.org/texlive/
21platforms       darwin
22
23# This port installs two libraries: kpathsea (LGPL-2.1+) and ptexenc (BSD).
24# The binaries are covered under various licenses, but all distributable;
25# see the texlive portfile for more information.
26license         Copyleft Permissive LGPL-2.1+ BSD
27
28# Our distfile is a stripped-down version of the texlive source
29# tarball, available from CTAN in systems/texlive/Source. For faster
30# download time, it omits a number of libraries and utilities that we
31# don't build. However, the port should still work with an unmodified
32# texlive distfile.
33master_sites    http://flute.csail.mit.edu/texlive/
34set distversion 20110705
35distname        texlive-${distversion}-source-stripped
36worksrcdir      ${distname}
37use_xz          yes
38checksums       rmd160 00949298eff3b301025c5a587fe5d93becbfe227 \
39                sha256 996079f1def51553933cf40ef156cbc6bdc0a68aed738ebc23acfb0024ffaeb8
40
41depends_lib     port:fontconfig \
42                port:freetype \
43                port:libpng \
44                port:ncurses \
45                port:zlib \
46                port:libzzip \
47                port:t1lib \
48                port:poppler \
49                port:texlive-common
50
51depends_run     port:ghostscript
52
53depends_build   path:bin/perl:perl5 \
54                path:bin/pkg-config:pkgconfig
55
56# fixes backported from the 2011 branch
57patchfiles-append   patch-r23716-synctex-fix.diff \
58                    patch-r23740-enctex-xetex-segfault.diff \
59                    patch-r24159-file-line-error.diff
60
61# poppler 1.8 compatibility fix backported from trunk
62patchfiles-append   patch-r24218-luatex-poppler-1.8-compat.diff
63
64# eliminate updmap.pl's dependency on TLUtils.pm
65patchfiles-append   patch-texk_tetex_updmap.pl.diff
66
67# fix xdvipdfmx/freetype dfont issue (#30745)
68patchfiles-append   patch-texk_xdvipdfmx_src_cidtype2.c.diff
69
70# fix for clang compatibility
71patchfiles-append   patch-texk_ps2pkm_type1.c.diff
72
73# make luatex less sensitive to zlib version changes
74# (cf. http://bugs.debian.org/581818)
75patchfiles-append   patch-texk_web2c_luatexdir_luazlib_lzlib.c.diff
76
77# patches related to changes in install paths
78patchfiles-append   patch-texk_kpathsea_Makefile.in.diff \
79                    patch-texk_tetex_Makefile.in.diff \
80                    patch-texk_tetex_updmap-sys.sh.diff \
81                    patch-texk_tex4htk_Makefile.in.diff \
82                    patch-texk_texlive_context_mtxrun.diff \
83                    patch-texk_texlive_linked_scripts_Makefile.in.diff \
84                    patch-texk_xdvik_xdvi-sh.in.diff \
85                    patch-utils_chktex_Makefile.in.diff
86
87# fixes for makefile brokenness not otherwise specified
88patchfiles-append   patch-configure.diff \
89                    patch-libs-freetype-Makefile.in.diff \
90                    patch-libs_icu_Makefile.in.diff \
91                    patch-libs_icu_icu-4.6_configure.diff \
92                    patch-libs_icu_icu-4.6_tools_icuinfo_Makefile.in.diff \
93                    patch-texk_ptexenc_Makefile.in.diff
94
95post-patch {
96    reinplace "s|@@TEXMFMAIN@@|${texlive_texmfmain}|" ${worksrcpath}/texk/tetex/Makefile.in
97    reinplace "s|@@TEXMFMAIN@@|${texlive_texmfmain}|" ${worksrcpath}/texk/texlive/linked_scripts/Makefile.in
98    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/texlive/linked_scripts/Makefile.in
99    reinplace "s|@@TEXMFDIST@@|${texlive_texmfdist}|" ${worksrcpath}/texk/tex4htk/Makefile.in
100    reinplace "s|@@TEXLIVE_BINDIR@@|${texlive_bindir}|" ${worksrcpath}/texk/xdvik/xdvi-sh.in
101    reinplace "s|@@TEXMFMAIN@@|${texlive_texmfmain}|" ${worksrcpath}/utils/chktex/Makefile.in
102
103    # Defaults for the texmf search paths need to be compiled into
104    # libkpathsea -- really, just the location of texmf.cnf, which
105    # defines all the other paths. texlive normally finds this file
106    # using a bindir-relative path extracted from texmf.cnf, but this
107    # is both incorrect (it fails to find our texmf.cnf) and overkill
108    # (we know the absolute path of texmf.cnf).
109    #
110    # Accordingly, we patch the kpathsea makefile to not try to derive
111    # the default paths from texmf.cnf, and just provide our own
112    # paths.h with the right path substituted in.
113    delete ${worksrcpath}/texk/kpathsea/texmf.cnf
114    file copy ${filespath}/texk_kpathsea_paths.h ${worksrcpath}/texk/kpathsea/paths.h
115    reinplace "s|@@PREFIX@@|${prefix}|" ${worksrcpath}/texk/kpathsea/paths.h
116    reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|" ${worksrcpath}/texk/kpathsea/paths.h
117    reinplace "s|@@TEXMFSYSCONFIG@@|${texlive_texmfsysconfig}|" ${worksrcpath}/texk/texlive/context/mtxrun
118
119    if {![variant_isset atsui]} {
120        # Force configure to believe that Carbon API is
121        # unavailable. This test is actually used to determine whether
122        # ATSUI should be used.
123        reinplace "s|kpse_cv_have_Carbon=yes|kpse_cv_have_Carbon=no|" ${worksrcpath}/texk/web2c/configure
124        reinplace "s|kpse_cv_have_Carbon=yes|kpse_cv_have_Carbon=no|" ${worksrcpath}/texk/xdv2pdf/configure
125    }
126   
127    # Force xdvipdfmx to use multi-platform freetype API as freetype is not
128    # compiled with --with-old-mac-fonts. A patch helps xdvipdfmx accept dfont
129    # files that freetype can handle.
130    reinplace "s|kpse_cv_have_ApplicationServices=yes|kpse_cv_have_ApplicationServices=no|" ${worksrcpath}/texk/xdvipdfmx/configure
131}
132
133# llvm-gcc apparently fails on Xcode 4.0.x (#30758)
134if {${configure.compiler} == "llvm-gcc-4.2" &&
135    [rpm-vercomp $xcodeversion 4.1] < 0} {
136    configure.compiler gcc-4.2
137}
138
139
140# We use MacPorts-provided libraries instead of the ones included in
141# texlive whenever possible, to avoid redundancy and to better keep
142# current with respect to security updates and the like.
143#
144# Exceptions are freetype1 (not in MacPorts anymore) and icu (the
145# texlive version is non-standard)
146#
147# Many of the --with-system-* and --disable-* flags are actually
148# redundant because we've removed those components from the distfile,
149# but we leave them here for compatibility with the stock distfile.
150configure.args  --bindir=${texlive_bindir} \
151                --mandir=${texlive_bindir} \
152                --infodir=${prefix}/share/info \
153                --enable-shared \
154                --disable-multiplatform \
155                --disable-native-texlive-build \
156                --without-old-mac-fonts \
157                --with-banner-add="/MacPorts ${version}_${revision}" \
158                --with-system-freetype2 \
159                --without-system-freetype \
160                --without-system-icu \
161                --with-system-gd \
162                --with-system-libpng \
163                --with-libpng-includes=${prefix}/include \
164                --with-libpng-libdir=${prefix}/lib \
165                --with-system-ncurses \
166                --with-system-t1lib \
167                --with-t1lib-includes=${prefix}/include \
168                --with-t1lib-libdir=${prefix}/lib \
169                --with-system-xpdf \
170                --with-system-poppler \
171                --with-system-zlib \
172                --with-system-zziplib \
173                --disable-biber \
174                --disable-etex \
175                --disable-detex \
176                --disable-dvi2tty \
177                --disable-dvipng \
178                --disable-ps2eps \
179                --disable-psutils \
180                --disable-t1utils \
181                --disable-texinfo \
182                --disable-xindy \
183                --without-x \
184                --without-pdfopen
185
186configure.cppflags-delete   -I${prefix}/include
187configure.ldflags-delete    -L${prefix}/lib
188configure.cppflags-append   -isystem${prefix}/include
189configure.env-append        LIBRARY_PATH=${prefix}/lib
190
191# work around bug in texlive makefiles where $OBJC is not recorded
192# during configure phase
193pre-build {
194    append_list_to_environment_value build "OBJC" ${configure.objc}
195    append_list_to_environment_value build "OBJCFLAGS" ${configure.objcflags}
196    append_list_to_environment_value build "OBJCFLAGS" ${configure.objc_archflags}
197}
198
199post-destroot   {
200    # texmf and texmf-dist will be installed by other texlive ports
201    delete ${destroot}${prefix}/texmf
202    delete ${destroot}${prefix}/texmf-dist
203
204    # Do not install symlinks to scripts that we will not install
205    delete ${destroot}${texlive_bindir}/latexmk
206    delete ${destroot}${texlive_bindir}/tlmgr
207
208    # gzip manpages that are installed into texlive_bindir
209    foreach manpage [glob -directory ${destroot}${texlive_bindir} man*/*] {
210        # need to make sure it isn't a symlink
211        if {[file type $manpage] == "file"} {
212            system "gzip $manpage"
213        }
214    }
215
216    # Create version/arch-specific links to the texbin directory used
217    # by the TeXDist prefpane; it seems that future versions of the
218    # prefpane will want these.
219    xinstall -d ${destroot}${texlive_mactex_texdistdir}-${version}
220    if {[variant_isset universal]} {
221        ln -s ${texlive_mactex_texbindir} \
222            ${destroot}${texlive_mactex_texdistdir}-${version}/universal-darwin
223    } else {
224        ln -s ${texlive_mactex_texbindir} \
225            ${destroot}${texlive_mactex_texdistdir}-${version}/${configure.build_arch}-darwin
226    }
227    ln -s ${texlive_mactex_texdistdir}-${version} \
228          ${destroot}${texlive_mactex_texdistdir}
229}
230
231pre-activate {
232    if { [file exists ${texlive_texmfdist}/scripts/tex4ht/ht.sh]
233         && ![catch {set vers [lindex [registry_active texlive-htmlxml] 0]}]
234         && [rpm-vercomp [lindex $vers 1] 13822] == 0
235         && [lindex $vers 2] <3} {
236        set deactivate_proc registry_deactivate_composite
237        if {[info commands registry_deactivate_composite] == {}} {
238            set deactivate_proc registry_deactivate
239        }
240        $deactivate_proc texlive-htmlxml "" [list ports_nodepcheck 1]
241    }
242
243    if { [file exists ${texlive_texmfmain}/scripts/tetex/updmap.pl]
244         && ![catch {set vers [lindex [registry_active texlive-basic] 0]}]
245         && [rpm-vercomp [lindex $vers 1] 23152] < 0} {
246        set deactivate_proc registry_deactivate_composite
247        if {[info commands registry_deactivate_composite] == {}} {
248            set deactivate_proc registry_deactivate
249        }
250        $deactivate_proc texlive-basic "" [list ports_nodepcheck 1]
251    }
252}
253
254post-activate {
255    system "${texlive_bindir}/mktexlsr"
256}
257
258variant atsui description {Use ATSUI instead of freetype for XeTeX font rendering (forces 32-bit)} {
259    # ATSUI is a deprecated interface, not available on 64-bit archs,
260    # so force 32-bit build
261    supported_archs i386 ppc
262
263    # ...and on 10.7 and above, enough of the APIs are broken that we
264    # can't build xdv2pdf, and need to use a hack to make xetex build
265    if {${os.platform} == "darwin" && ${os.major} >= 11} {
266        configure.args-append --disable-xdv2pdf
267        patchfiles-append patch-texk_web2c_xetexdir_XeTeX_ext.h.diff
268    }
269}
270
271if {![variant_isset "atsui"]} {
272    notes-append "XeTeX is built without support for Apple Type Services for Unicode Imaging (ATSUI) or Apple Advanced Typography (AAT). To enable it, build texlive-bin with the +atsui variant. Note that this will force texlive and all of its dependencies to be built 32-bit."
273}
274
275variant x11 conflicts no_x11 description {Build with x11 support, using Xaw widgets for xdvi} {
276    depends_lib-append port:xorg-libXp
277    configure.args-delete --without-x --without-pdfopen
278    depends_lib-append port:xorg-libXaw
279    configure.args-append --with-xdvi-x-toolkit=xaw
280}
281
282variant motif requires x11 description {Use Motif to build xdvi} {
283    depends_lib-delete port:xorg-libXaw
284    configure.args-delete --with-xdvi-x-toolkit=xaw
285    depends_lib-append lib:libXm:openmotif
286    configure.args-append --with-xdvi-x-toolkit=motif
287}
288
289variant no_x11 conflicts x11 motif description {Legacy compatibility variant} {}
290
291if {![variant_isset no_x11]} {
292    default_variants    +x11
293}
294
295livecheck.type      regex
296livecheck.url       ${homepage}acquire.html
297livecheck.regex     "TeX Live (\[0-9\]+) "
Note: See TracBrowser for help on using the repository browser.