source: trunk/dports/tex/pTeX/Portfile @ 75159

Last change on this file since 75159 was 75159, checked in by rmstonecipher@…, 9 years ago

graphics/libpng upgraded version from 1.2.44 to 1.4.5 per ticket #23125, increased revision on all ports directly dependent upon libpng12.dylib

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 12.8 KB
Line 
1# $Id: Portfile 75159 2011-01-17 02:00:53Z rmstonecipher@macports.org $
2
3PortSystem      1.0
4
5name            pTeX
6version         20110103
7revision        2
8epoch           ${version}
9set ver_ptetex3     20080616
10set ver_dvipdfmx    20100328
11set ver_dvipsk      5.97-p1.7b-20090509
12set ver_jsclasses   100314
13set ver_txfonts     3.2.1
14set ver_pxfonts     1.1.1
15set ver_tipa        1.3-20090407
16set ver_cm-super    0.3.4-20080709
17set ver_fourier     1.4.1-20050130
18categories      tex print textproc japanese
19maintainers     takanori openmaintainer
20description     Japanese TeX (pTeX) processing environment
21long_description \
22                ${description}
23platforms       darwin
24homepage        http://www.nn.iij4u.or.jp/~tutimura/tex/ptetex.html
25master_sites    http://ftp.riken.go.jp/pub/tex-archive/obsolete/systems/unix/teTeX/3.0/distrib/:tetex \
26                http://ftp.yz.yamagata-u.ac.jp/pub/CTAN/obsolete/systems/unix/teTeX/3.0/distrib/:tetex \
27                http://dante.ctan.org/tex-archive/obsolete/systems/unix/teTeX/3.0/distrib/:tetex \
28                http://tug.ctan.org/tex-archive/obsolete/systems/unix/teTeX/3.0/distrib/:tetex \
29                http://tutimura.ath.cx/~nob/tex/ptetex/ptetex3/:ptetex3 \
30                macports::ptetex3 \
31                macports::dvipsk \
32                http://project.ktug.or.kr/dvipdfmx/snapshot/latest/:dvipdfmx \
33                http://project.ktug.or.kr/dvipdfmx/snapshot/archive/:dvipdfmx \
34                macports::dvipdfmx \
35                http://oku.edu.mie-u.ac.jp/~okumura/jsclasses/:jsclasses \
36                macports::jsclasses \
37                macports::misc \
38                http://svn.sourceforge.jp/svnroot/macports-jp/distfiles/pTeX/:mpjp
39#               http://ring.riken.jp/archives/text/TeX/ptex-win32/utils/:dvipsk
40distname        ptetex3-${ver_ptetex3}
41distfiles       tetex-src-3.0.tar.gz:tetex \
42                tetex-texmf-3.0po.tar.gz:tetex \
43                ${distname}${extract.suffix}:ptetex3 \
44                dvipdfmx-${ver_dvipdfmx}.tar.gz:dvipdfmx \
45                dvipsk-${ver_dvipsk}.tar.gz:dvipsk \
46                jsclasses-${ver_jsclasses}.zip:jsclasses \
47                txfonts-${ver_txfonts}.zip:misc \
48                pxfonts-${ver_pxfonts}.zip:misc \
49                cmap-gs871.tar.gz:misc \
50                mappingresources4pdf_2unicode-20091208.tar.Z:misc \
51                mappingresources4pdf_other-20091208.tar.Z:misc \
52                tipa-${ver_tipa}.zip:misc \
53                cm-super-${ver_cm-super}.zip:misc \
54                utopia-20061119.zip:misc \
55                fourier-GUT-${ver_fourier}.zip:misc \
56                mh-20071227.zip:mpjp
57patchfiles      patch-1check-archive.sh.diff \
58                patch-2extract-src.sh.diff \
59                patch-3extract-texmf.sh.diff \
60                patch-4make-install.sh.diff \
61                patch-7font-search.sh.diff \
62                patch-8test.sh.diff \
63                patch-common.sh.diff \
64                patch-md5sum_texsrc.traditional.diff
65checksums       tetex-src-3.0.tar.gz            rmd160 15a139f5f36993e4ed3583260e175cfb13ce7bcc \
66                tetex-texmf-3.0po.tar.gz        rmd160 a1e87733fa3cbef04e39a690ed8549aeaaddb241 \
67                ${distname}${extract.suffix}    rmd160 50bcf8986d1cb5f23e578ba97d7ade20bb05f3a2 \
68                dvipdfmx-${ver_dvipdfmx}.tar.gz rmd160 40a41a03776b5f4579b75e94ad2ac85d3742074e \
69                dvipsk-${ver_dvipsk}.tar.gz     rmd160 c15135bcd4c01143a921d5eaeadd43247738289e \
70                jsclasses-${ver_jsclasses}.zip  rmd160 7e2704ca941fa6e4cd4e0d200fd3387b4052f4e0 \
71                txfonts-${ver_txfonts}.zip      rmd160 e0881b33012ae10a7557ee773439df62e600e56d \
72                pxfonts-${ver_pxfonts}.zip      rmd160 9a2e8df4b779dab2c93704f0716f3d69dcbac6fe \
73                cmap-gs871.tar.gz               rmd160 1fb4a51914f6b17050d984414e0490d9a5e6edc9 \
74                mappingresources4pdf_2unicode-20091208.tar.Z rmd160 bc1b86e6a5f0e022f88070195eb3e01e167114a7 \
75                mappingresources4pdf_other-20091208.tar.Z    rmd160 1e2ea9af6be8b60c9a54963e542fa06ceb2daccd \
76                tipa-${ver_tipa}.zip            rmd160 ea4f393f8a2e151b0933829ba7d193761ca8433a \
77                cm-super-${ver_cm-super}.zip    rmd160 fc2f18c2b000725c8076bc6a52f0ccaf06dcecd1 \
78                utopia-20061119.zip             rmd160 c6d326323948c724c1d24ca9058171e732c1d247 \
79                fourier-GUT-${ver_fourier}.zip  rmd160 b95903070f38c545d8cccc39da38195e7a116d16 \
80                mh-20071227.zip                 rmd160 d9f585dc1df2913ea7e9f32c6de9362ac99a5254
81
82depends_lib     bin:perl:perl5 \
83                port:gd2 \
84                port:ghostscript-fonts-hiragino \
85                port:jpeg \
86                port:libiconv \
87                port:libpaper \
88                port:libpng \
89                port:ncurses \
90                port:t1lib \
91                port:zlib
92depends_build   port:nkf
93#               bin:bash:bash
94#               bin:bison:bison
95#               bin:flex:flex
96#               port:gmake
97#               port:gpatch
98depends_run     port:t1utils \
99                port:texi2html \
100                port:texinfo
101
102conflicts       texlive texlive_base texlive_texmf-minimal texlive_texmf-full texlive_texmf-docs
103
104if {![variant_isset euc] && ![variant_isset sjis] && ![variant_isset utf8]} {
105    default_variants    +utf8
106}
107if {![variant_isset no_x11] && ![variant_isset motif] && ![variant_isset xaw] && ![variant_isset xaw3d] && ![variant_isset nextaw]} {
108    default_variants    +motif
109}
110
111extract.only    ${distname}${extract.suffix}
112post-extract {
113    foreach f {cmap-gs871.tar.gz
114               mappingresources4pdf_2unicode-20091208.tar.Z
115               mappingresources4pdf_other-20091208.tar.Z} {
116        system "cd ${worksrcpath} && gzip -dc ${distpath}/${f} | tar --no-same-owner -xf -"
117    }
118    move ${worksrcpath}/MappingOther/Adobe-CNS1-ETen-B5 ${worksrcpath}/MappingOther/Adobe-CNS1-ETenms-B5
119}
120
121post-patch {
122    eval copy [glob ${filespath}/archive/*] ${worksrcpath}/archive/
123    eval copy [glob ${filespath}/security/*] ${worksrcpath}/security/
124    foreach f {dvipdfmx-${ver_dvipdfmx}.tar.gz
125               dvipsk-${ver_dvipsk}.tar.gz
126               txfonts-${ver_txfonts}.zip
127               pxfonts-${ver_pxfonts}.zip
128               tipa-${ver_tipa}.zip
129               cm-super-${ver_cm-super}.zip
130               utopia-20061119.zip
131               fourier-GUT-${ver_fourier}.zip
132               mh-20071227.zip} {
133        eval copy ${distpath}/${f} ${worksrcpath}/archive/
134    }
135    copy ${distpath}/jsclasses-${ver_jsclasses}.zip ${worksrcpath}/macro/
136    delete ${worksrcpath}/macro/jsclasses-071024.zip
137    delete ${worksrcpath}/archive/dvipdfmx-20070409.tar.gz
138    delete ${worksrcpath}/archive/dvipsk-5.96-p1.7b.tar.gz
139}
140
141configure.args  --without-texi2html \
142                --without-texinfo \
143                --with-system-gd \
144                --with-system-ncurses \
145                --with-system-pnglib \
146                --with-system-t1lib \
147                --with-system-zlib
148#               --enable-shared
149configure {
150    set fd [open [file join ${worksrcpath} my_option] w 0644]
151    puts ${fd} "TMP_PREFIX=${workpath}/temp"
152    puts ${fd} "SRC_DIR=${distpath}"
153    puts ${fd} "PREFIX=${prefix}"
154    puts ${fd} "DATADIR=${prefix}/share"
155    puts ${fd} "CONF_OPTION=\"\$CONF_OPTION ${configure.args}\""
156    if {[variant_isset sjis]} {
157        puts ${fd} "KANJI_CODE=SJIS"
158    } elseif {[variant_isset utf8]} {
159        puts ${fd} "KANJI_CODE=UTF8"
160    } else {
161        puts ${fd} "KANJI_CODE=EUC"
162    }
163    if {[variant_isset no_x11]} {
164        puts ${fd} "XDVI=echo"
165        puts ${fd} "PXDVI=echo"
166    }
167    puts ${fd} "CFLAGS=\"${configure.cflags}\""
168    puts ${fd} "CPPFLAGS=\"${configure.cppflags}\""
169    puts ${fd} "LDFLAGS=\"${configure.ldflags}\""
170    puts ${fd} "LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:${prefix}/lib\""
171    puts ${fd} "export CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH"
172    close ${fd}
173}
174
175build.target    all0
176use_parallel_build  no
177pre-build {
178    if {![variant_isset no_otf]} {build.target-append otf}
179    build.target-append babel fonty
180}
181
182test.run    yes
183
184destroot {
185    system "(cd ${workpath}/temp; tar -cf - bin include lib share) | (cd ${destroot}${prefix}; tar --no-same-owner -xf -)"
186    system "(cd ${workpath}/temp; tar -cf - info man) | (cd ${destroot}${prefix}/share; tar --no-same-owner -xf -)"
187    delete ${destroot}${prefix}/share/info/dir
188
189    copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-hiraginoEmbed.map
190    foreach {mori hira} {Ryumin-Light     HiraMinPro-W3.otf
191                         GothicBBB-Medium HiraKakuPro-W3.otf
192                         FutoMinA101-Bold HiraMinPro-W6.otf
193                         FutoGoB101-Bold  HiraKakuPro-W6.otf
194                         Jun101-Light     HiraMaruPro-W4.otf} {
195        reinplace "s|${mori}|${hira}|g" ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-hiraginoEmbed.map
196    }
197    foreach d {texmf texmf-config} {
198        if {[file exists ${destroot}${prefix}/share/${d}/web2c/updmap.cfg]} {
199            reinplace "s|^\\(KanjiMap morisawa.map\\)$|\\1\\\n#! KanjiMap morisawa-hiraginoEmbed.map|" ${destroot}${prefix}/share/${d}/web2c/updmap.cfg
200        }
201    }
202
203    # I would like to keep this backward compatibility for a while.
204    system "cd ${destroot}${prefix} && patch -p0 < ${filespath}/oldfmtfiles.diff"
205    foreach f {ptex platex} {
206        foreach e {euc jis sjis utf8} {
207            ln -s ptex ${destroot}${prefix}/bin/${f}-${e}
208        }
209    }
210
211    system "cd ${destroot}${prefix}/share/texmf/packages/jsclasses && patch -p0 < ${filespath}/minijs_sty-20100317.diff"
212
213    # Update ls-R, map and fmt files (before packaging)
214    set destroot_var "PATH=\"${destroot}${prefix}/bin:$env(PATH)\" TEXMFMAIN=${destroot}${prefix}/share/texmf LD_LIBRARY_PATH=${destroot}${prefix}/lib"
215    system "${destroot_var} mktexlsr"
216    if {![variant_isset no_hiragino]} {
217        system "${destroot_var} updmap-sys --setoption kanjiEmbed hiragino --nomkmap || true"
218        system "${destroot_var} updmap-sys --disable morisawa.map --nomkmap || true"
219        system "${destroot_var} updmap-sys --enable KanjiMap morisawa-hiraginoEmbed.map --nomkmap || true"
220        system "${destroot_var} updmap-sys"
221    }
222    system "${destroot_var} fmtutil-sys --all"
223
224    # Modify mktex.opt to force use of varfonts
225    reinplace "s|MT_FEATURES=appendonlydir|MT_FEATURES=appendonlydir:varfonts|g" ${destroot}${prefix}/share/texmf/web2c/mktex.opt
226
227    # Add a directory for local enhancements
228    xinstall -m 755 -d ${destroot}${prefix}/share/texmf-local
229    system "touch ${destroot}${prefix}/share/texmf-local/.ptetex3-${ver_ptetex3}"
230}
231post-destroot {
232    xinstall -m 755 -d ${destroot}${prefix}/share/doc
233    ln -s ../texmf/doc/ptetex ${destroot}${prefix}/share/doc/ptetex3
234}
235
236post-activate {
237    system "ranlib ${prefix}/lib/libkpathsea.a"
238    system "ranlib ${prefix}/lib/libptexenc.a"
239
240    system "${prefix}/bin/mktexlsr"
241
242    foreach f {tipa.map} {
243        system "${prefix}/bin/updmap-sys --enable MixedMap ${f} --nomkmap || true"
244    }
245    foreach f {cm-super-t1.map cm-super-ts1.map cm-super-t2a.map cm-super-t2b.map cm-super-t2c.map cm-super-x2.map fourier.map} {
246        system "${prefix}/bin/updmap-sys --enable Map ${f} --nomkmap || true"
247    }
248
249    system "${prefix}/bin/updmap-sys"
250    system "${prefix}/bin/fmtutil-sys --all"
251}
252
253universal_variant   no
254
255variant no_hiragino description {Do not depend on Hiragino fonts} {
256    depends_lib-delete port:ghostscript-fonts-hiragino
257    depends_lib-append bin:gs:ghostscript
258}
259
260variant no_otf description {Do not install otf.sty} {}
261
262variant euc conflicts sjis utf8 description {Set the default character encoding to EUC-JP} {}
263variant sjis conflicts euc utf8 description {Set the default character encoding to Shift_JIS} {}
264variant utf8 conflicts euc sjis description {Set the default character encoding to UTF-8} {}
265
266variant no_x11 conflicts motif xaw xaw3d nextaw {
267    depends_lib-delete port:fontconfig port:freetype port:jpeg port:libiconv
268    configure.args-append --without-x --without-xdvik
269}
270variant motif conflicts no_x11 xaw xaw3d nextaw description {Use Motif to build xdvi} {
271     depends_lib-append lib:libXm:openmotif
272     configure.args-append --with-xdvi-x-toolkit=motif
273}
274variant xaw conflicts no_x11 motif xaw3d nextaw description {Use Xaw to build xdvi} {
275    depends_lib-append port:xorg-libXaw
276    configure.args-append --with-xdvi-x-toolkit=xaw
277}
278variant xaw3d conflicts no_x11 motif xaw nextaw description {Use Xaw3d to build xdvi} {
279    depends_lib-append port:Xaw3d
280    configure.args-append --with-xdvi-x-toolkit=xaw3d
281}
282variant nextaw conflicts no_x11 motif xaw xaw3d description {Use neXtaw to build xdvi} {
283    depends_lib-append port:neXtaw
284    configure.args-append --with-xdvi-x-toolkit=neXtaw
285}
286
287platform darwin 9 {}
288
289livecheck.type      regex
290livecheck.url       "http://tutimura.ath.cx/~nob/tex/ptetex/ptetex3/?C=M;O=D"
291livecheck.version   ${ver_ptetex3}
292livecheck.regex     ptetex3-(\[0-9\]+)\\.tar
Note: See TracBrowser for help on using the repository browser.