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

Last change on this file was 153987, checked in by devans@…, 11 months ago

dependents of poppler: increment revision to rebuild with libpoppler.64.

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