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

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

texlive-bin:

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