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

Last change on this file since 138498 was 138498, checked in by devans@…, 5 years ago

binary dependents of libpoppler: increment revision to rebuild with libpoppler.53 after upgrade to poppler 0.34.0.

  • 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 138498 2015-07-10 05:18:32Z devans@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         2014
14revision        10
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 20140614
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-20140614-stripped.tar.xz \
48                    rmd160  f34ea0015a123e86c33afbfec506a121f1508925 \
49                    sha256  2efe3c2a15dc5c52d7bafc2cbee8b2b499cdc034bbdcb959d4989881734380e9 \
50                    tlpkg-TeXLive-20140614.tar.xz \
51                    rmd160  24dc163913fa7d523c93cfba60f79c87cfa0e056 \
52                    sha256  4064edbae6536b12a43d6598bd9ae23fa0426c148adaed1fd9c536118e6b9292
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:texlive-common
69
70depends_run     port:ghostscript
71
72depends_build   path:bin/perl:perl5 \
73                path:bin/pkg-config:pkgconfig
74
75# make luatex less sensitive to zlib version changes
76# (cf. http://bugs.debian.org/581818)
77patchfiles-append   patch-texk_web2c_luatexdir_luazlib_lzlib.c.diff
78
79# patches related to changes in install paths
80patchfiles-append  patch-texk_kpathsea_Makefile.in.diff \
81                   patch-texk_tex4htk_Makefile.in.diff \
82                   patch-texk_texlive_linked_scripts_Makefile.in.diff \
83                   patch-texk_texlive_tl_scripts_Makefile.in.diff \
84                   patch-texk_xdvik_xdvi-sh.in.diff \
85                   patch-texk_chktex_Makefile.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-graphite2 \
146                --with-system-harfbuzz \
147                --with-system-icu \
148                --with-libpaper-includes=${prefix}/include \
149                --with-libpaper-libdir=${prefix}/lib \
150                --with-system-libpng \
151                --with-libpng-includes=${prefix}/include \
152                --with-libpng-libdir=${prefix}/lib \
153                --with-system-ncurses \
154                --with-system-pixman \
155                --with-system-poppler \
156                --with-system-xpdf \
157                --with-system-zlib \
158                --with-system-zziplib \
159                --disable-biber \
160                --disable-etex \
161                --disable-detex \
162                --disable-dvi2tty \
163                --disable-dvipng \
164                --disable-lcdf-typetools \
165                --disable-ps2eps \
166                --disable-psutils \
167                --disable-t1utils \
168                --disable-texinfo \
169                --disable-xindy \
170                --without-x \
171                --without-pdfopen \
172                --enable-build-in-source-tree
173
174# makejvf has some invalid character encodings in one of its source
175# files, which cause certain versions of clang to hang (#38643). Using
176# -Wno-invalid-source-encoding avoids this problem.
177# It appears to be specific to Xcode 4.6, but there's no harm in
178# silencing the warning for all versions of clang.
179post-patch {
180    if {[string match *clang* ${configure.compiler}]} { 
181        reinplace "/^WARNING_CFLAGS =/s/$/ -Wno-invalid-source-encoding/" ${worksrcpath}/texk/makejvf/Makefile.in
182    }
183}
184
185configure.cppflags-delete   -I${prefix}/include
186configure.ldflags-delete    -L${prefix}/lib
187configure.cppflags-append   -isystem${prefix}/include
188configure.env-append        LIBRARY_PATH=${prefix}/lib
189
190# luajittex does not support ppc
191if {[variant_isset universal]} {
192    set merger_configure_args(ppc) --disable-luajittex
193    set merger_configure_args(ppc64) --disable-luajittex
194} else {
195    switch -- ${configure.build_arch} {
196        ppc -
197        ppc64 { configure.args-append --disable-luajittex }
198    }
199}
200
201
202# work around bug in texlive makefiles where $OBJC is not recorded
203# during configure phase
204build.env                   OBJC=${configure.objc} \
205                            OBJCFLAGS="${configure.objcflags} [get_canonical_archflags objc]" \
206                            OBJCXX=${configure.objcxx}
207
208if {[string match *clang* ${configure.cxx}]} {
209    build.env-append        OBJCXXFLAGS="${configure.objcxxflags} [get_canonical_archflags objcxx] -stdlib=${configure.cxx_stdlib}"
210} else {
211    build.env-append        OBJCXXFLAGS="${configure.objcxxflags} [get_canonical_archflags objcxx]"
212}
213
214post-destroot   {
215    # Anything that gets installed into texmf-dist will be installed
216    # by one of the texmf ports
217    delete ${destroot}${prefix}/share/texmf-dist
218    delete ${destroot}${texlive_texmfdist}
219
220    # Do not install symlinks to scripts that we don't install
221    delete ${destroot}${texlive_bindir}/latexmk
222    delete ${destroot}${texlive_bindir}/tlmgr   
223
224    # install the tlpkg/TeXLive perl module
225    xinstall -d ${destroot}${prefix}/share/tlpkg
226    copy ${workpath}/${tlpkgdistname} ${destroot}${prefix}/share/tlpkg/TeXLive
227
228    # gzip manpages that are installed into texlive_bindir
229    foreach manpage [glob -directory ${destroot}${texlive_bindir} man*/*] {
230        # need to make sure it isn't a symlink
231        if {[file type $manpage] == "file"} {
232            system "gzip $manpage"
233        }
234    }
235
236    # Create version/arch-specific links to the texbin directory used
237    # by the TeXDist prefpane; it seems that future versions of the
238    # prefpane will want these.
239    xinstall -d ${destroot}${texlive_mactex_texdistdir}-${version}
240    if {[variant_isset universal]} {
241        ln -s ${texlive_mactex_texbindir} \
242            ${destroot}${texlive_mactex_texdistdir}-${version}/universal-darwin
243    } else {
244        ln -s ${texlive_mactex_texbindir} \
245            ${destroot}${texlive_mactex_texdistdir}-${version}/${configure.build_arch}-darwin
246    }
247    ln -s ${texlive_mactex_texdistdir}-${version} \
248          ${destroot}${texlive_mactex_texdistdir}
249}
250
251post-activate {
252    system "${texlive_bindir}/mktexlsr"
253}
254
255variant x11 description {Build with x11 support, using Xaw widgets for xdvi} {
256    depends_lib-append port:xorg-libXp port:xpm
257    configure.args-delete --without-x --without-pdfopen
258    depends_lib-append port:xorg-libXaw port:xorg-libXi
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
269default_variants    +x11
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.