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

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

texlive-bin: make the version/arch-specific texbin directory reflect
whether we built +universal

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