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

Last change on this file since 109415 was 109415, checked in by ryandesign@…, 7 years ago

revbump ports that link with libgd in their default configuration to rebuild with gd2 @2.1.0 (libgd.3.dylib) (#39550)

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