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

Last change on this file since 137621 was 137621, checked in by mf2k@…, 4 years ago

a2ps-j canna chasen chasen-base chasen-ipadic chasen-ipadic-sjis chasen-ipadic-utf8 chasen-naist-jdic chasen-naist-jdic-sjis chasen-naist-jdic-utf8 cocot darts dejavu-fonts disvf FDclone ghostscript ghostscript-fonts-hiragino gnushogi jnethack kakasi kinput2 lv makejvf nkf p5-nkf p5-text-chasen p5-text-kakasi pTeX smartmontools urw-fonts: Ports abandoned by takanori. (#47537)

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 18.2 KB
Line 
1# $Id: Portfile 137621 2015-06-15 14:56:57Z mf2k@macports.org $
2
3PortSystem      1.0
4
5name            pTeX
6version         20110314
7revision        11
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     nomaintainer
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:libpaper \
113                port:libpng \
114                port:ncurses \
115                port:perl5 \
116                port:t1lib \
117                port:zlib
118depends_build   port:ghostscript-fonts-hiragino \
119                port:nkf
120#               bin:bash:bash
121#               bin:bison:bison
122#               bin:flex:flex
123#               port:gmake
124#               port:gpatch
125depends_run     port:ghostscript-fonts-hiragino \
126                port:t1utils \
127                port:texi2html \
128                port:texinfo
129
130conflicts       texlive-common
131
132default_variants    +otf
133
134if {![variant_isset yu]} {
135    default_variants    +hiragino
136}
137
138if {[variant_isset euc] || [variant_isset sjis] || [variant_isset utf8]} {
139    # nop
140} else {
141    default_variants    +utf8
142}
143
144pre-fetch {
145    if {[variant_isset yu]} {
146        if {${os.platform} eq "darwin" && ${os.major} >= 13} {
147            # nop
148        } else {
149            return -code error "variant +yu is supported on Mavericks or later only"
150        }
151    }
152}
153
154extract.only    ${distname}${extract.suffix}
155post-extract {
156    foreach f {cmap-gs871.tar.gz
157               mappingresources4pdf_2unicode-20091208.tar.Z
158               mappingresources4pdf_other-20091208.tar.Z} {
159        system "cd ${worksrcpath} && gzip -dc ${distpath}/${f} | tar --no-same-owner -xf -"
160    }
161    #move ${worksrcpath}/MappingOther/Adobe-CNS1-ETen-B5 ${worksrcpath}/MappingOther/Adobe-CNS1-ETenms-B5
162}
163
164post-patch {
165    eval copy [glob ${filespath}/archive/*] ${worksrcpath}/archive/
166    eval copy [glob ${filespath}/security/*] ${worksrcpath}/security/
167    foreach f {dvipdfmx-${ver_dvipdfmx}.tar.gz
168               dvipsk-${ver_dvipsk}.tar.gz
169               txfonts-${ver_txfonts}.zip
170               pxfonts-${ver_pxfonts}.zip
171               tipa-${ver_tipa}.zip
172               cm-super-${ver_cm-super}.zip
173               utopia-${ver_utopia}.zip
174               fourier-GUT-${ver_fourier}.zip
175               mh-${ver_mh}.zip
176               xcolor-${ver_xcolor}.zip
177               pgf-${ver_pgf}.zip
178               beamer-${ver_beamer}.zip
179               hyperref.tds-${ver_hyperref}.zip
180               oberdiek.tds-${ver_oberdiek}.zip
181               ifxetex.tds-${ver_ifxetex}.zip
182               pstricks-${ver_pstricks}.zip} {
183        eval copy ${distpath}/${f} ${worksrcpath}/archive/
184    }
185    copy ${distpath}/jsclasses-${ver_jsclasses}.zip ${worksrcpath}/macro/
186    delete ${worksrcpath}/macro/jsclasses-071024.zip
187    copy ${distpath}/powerdot-${ver_powerdot}.zip ${worksrcpath}/macro/
188    delete ${worksrcpath}/macro/powerdot.tar.gz
189    delete ${worksrcpath}/archive/dvipdfmx-20070409.tar.gz
190    delete ${worksrcpath}/archive/dvipsk-5.96-p1.7b.tar.gz
191}
192
193compiler.blacklist  *clang*
194
195configure.args  --without-texi2html \
196                --without-texinfo \
197                --with-system-gd \
198                --with-system-ncurses \
199                --with-system-pnglib \
200                --with-system-t1lib \
201                --with-system-zlib \
202                --without-x \
203                --without-xdvik
204#               --enable-shared
205
206configure {
207    set fd [open [file join ${worksrcpath} my_option] w 0644]
208    puts ${fd} "TMP_PREFIX=${workpath}/temp"
209    puts ${fd} "SRC_DIR=${distpath}"
210    puts ${fd} "PREFIX=${prefix}"
211    puts ${fd} "DATADIR=${prefix}/share"
212    puts ${fd} "CONF_OPTION=\"\$CONF_OPTION ${configure.args}\""
213    if {[variant_isset sjis]} {
214        puts ${fd} "KANJI_CODE=SJIS"
215    } elseif {[variant_isset utf8]} {
216        puts ${fd} "KANJI_CODE=UTF8"
217    } else {
218        puts ${fd} "KANJI_CODE=EUC"
219    }
220    if {[variant_isset motif] || [variant_isset xaw] || [variant_isset xaw3d] || [variant_isset nextaw]} {
221        # nop
222    } else {
223        puts ${fd} "XDVI=echo"
224        puts ${fd} "PXDVI=echo"
225    }
226    puts ${fd} "CFLAGS=\"${configure.cflags}\""
227    puts ${fd} "CPPFLAGS=\"${configure.cppflags}\""
228    puts ${fd} "LDFLAGS=\"${configure.ldflags}\""
229    puts ${fd} "LD_LIBRARY_PATH=\"\$LD_LIBRARY_PATH:${prefix}/lib\""
230    puts ${fd} "export CFLAGS CPPFLAGS LDFLAGS LD_LIBRARY_PATH"
231
232# Ticket #35957, #39334
233    puts ${fd} "CC=\"${configure.cc}\""
234    puts ${fd} "CXX=\"${configure.cxx}\""
235    puts ${fd} "CPP=\"${configure.cpp}\""
236    puts ${fd} "export CC CXX CPP"
237
238    close ${fd}
239}
240
241build.target    all0
242use_parallel_build  no
243pre-build {
244    if {[variant_isset otf]} {build.target-append otf}
245    build.target-append babel fonty
246
247    foreach d {texmf .texmf-var .texmf-config} {
248        if {[file isdirectory "$env(HOME)/${d}"]} {
249            ui_msg ""
250            ui_msg " Personal texmf directory is detected. ($env(HOME)/${d}) "
251            ui_msg " Be careful. It may cause a build error. "
252            ui_msg ""
253        }
254    }
255}
256
257test.run    yes
258
259destroot {
260    system "(cd ${workpath}/temp; tar -cf - bin include lib share) | (cd ${destroot}${prefix}; tar --no-same-owner -xf -)"
261    system "(cd ${workpath}/temp; tar -cf - info man) | (cd ${destroot}${prefix}/share; tar --no-same-owner -xf -)"
262    delete ${destroot}${prefix}/share/info/dir
263
264    copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/ptex-hiragino.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/ptex-yu.map
265    copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-hiraginoEmbed.map
266    copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-yuEmbed.map
267    if {[variant_isset otf]} {
268        copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/otf-hiragino.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/otf-yu.map
269        copy ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/utf-hiragino.map ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/utf-yu.map
270    }
271
272    foreach {hira yu} {HiraMinPro-W3  YuMin-Medium.otf
273                       HiraKakuPro-W6 YuGo-Bold.otf} {
274        reinplace "s|${hira}|${yu}|g" ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/ptex-yu.map
275        if {[variant_isset otf]} {
276            reinplace "s|${hira}|${yu}|g" ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/utf-yu.map
277        }
278    }
279
280    foreach {mori hira yu} {Ryumin-Light     HiraMinPro-W3.otf  YuMin-Medium.otf
281                            GothicBBB-Medium HiraKakuPro-W3.otf YuGo-Medium.otf
282                            FutoMinA101-Bold HiraMinPro-W6.otf  YuMin-Demibold.otf
283                            FutoGoB101-Bold  HiraKakuPro-W6.otf YuGo-Bold.otf
284                            Jun101-Light     HiraMaruPro-W4.otf HiraMaruPro-W4.otf} {
285        reinplace "s|${mori}|${hira}|g" ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-hiraginoEmbed.map
286        reinplace "s|${mori}|${yu}|g"   ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/morisawa-yuEmbed.map
287        if {[variant_isset otf]} {
288            reinplace "s|${hira}|${yu}|g" ${destroot}${prefix}/share/texmf/fonts/map/dvipdfm/otf-yu.map
289        }
290    }
291    foreach d {texmf texmf-config} {
292        if {[file exists ${destroot}${prefix}/share/${d}/web2c/updmap.cfg]} {
293            reinplace "s|^\\(KanjiMap morisawa.map\\)$|\\1\\\n#! KanjiMap morisawa-hiraginoEmbed.map\\\n#! KanjiMap morisawa-yuEmbed.map|" ${destroot}${prefix}/share/${d}/web2c/updmap.cfg
294        }
295    }
296
297    # I would like to keep this backward compatibility for a while.
298    system "cd ${destroot}${prefix} && patch -p0 < ${filespath}/oldfmtfiles.diff"
299    foreach f {ptex platex} {
300        foreach e {euc jis sjis utf8} {
301            ln -s ptex ${destroot}${prefix}/bin/${f}-${e}
302        }
303    }
304
305    system "cd ${destroot}${prefix}/share/texmf/packages/jsclasses && patch -p0 < ${filespath}/minijs_sty-20100317.diff"
306
307    # Update ls-R, map and fmt files (before packaging)
308    set destroot_var "PATH=\"${destroot}${prefix}/bin:$env(PATH)\" TEXMFMAIN=${destroot}${prefix}/share/texmf LD_LIBRARY_PATH=${destroot}${prefix}/lib"
309    system "${destroot_var} mktexlsr"
310    system "${destroot_var} fmtutil-sys --all"
311
312    # Modify mktex.opt to force use of varfonts
313    reinplace "s|MT_FEATURES=appendonlydir|MT_FEATURES=appendonlydir:varfonts|g" ${destroot}${prefix}/share/texmf/web2c/mktex.opt
314
315    # Add a directory for local enhancements
316    xinstall -m 755 -d ${destroot}${prefix}/share/texmf-local
317    system "touch ${destroot}${prefix}/share/texmf-local/.ptetex3-${ver_ptetex3}"
318}
319post-destroot {
320    xinstall -m 755 -d ${destroot}${prefix}/share/doc
321    ln -s ../texmf/doc/ptetex ${destroot}${prefix}/share/doc/ptetex3
322}
323
324post-activate {
325    system "ranlib ${prefix}/lib/libkpathsea.a"
326    system "ranlib ${prefix}/lib/libptexenc.a"
327
328    system "${prefix}/bin/mktexlsr"
329
330    foreach f {tipa.map} {
331        system "${prefix}/bin/updmap-sys --enable MixedMap ${f} --nomkmap || true"
332    }
333    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} {
334        system "${prefix}/bin/updmap-sys --enable Map ${f} --nomkmap || true"
335    }
336
337    if {[variant_isset hiragino]} {
338        system "${prefix}/bin/updmap-sys --setoption kanjiEmbed hiragino --nomkmap || true"
339        system "${prefix}/bin/updmap-sys --disable morisawa.map --nomkmap || true"
340        system "${prefix}/bin/updmap-sys --enable KanjiMap morisawa-hiraginoEmbed.map --nomkmap || true"
341        system "${prefix}/bin/updmap-sys --disable morisawa-yuEmbed.map --nomkmap || true"
342    } elseif {[variant_isset yu]} {
343        system "${prefix}/bin/updmap-sys --setoption kanjiEmbed yu --nomkmap || true"
344        system "${prefix}/bin/updmap-sys --disable morisawa.map --nomkmap || true"
345        system "${prefix}/bin/updmap-sys --disable morisawa-hiraginoEmbed.map --nomkmap || true"
346        system "${prefix}/bin/updmap-sys --enable KanjiMap morisawa-yuEmbed.map --nomkmap || true"
347    } else {
348        system "${prefix}/bin/updmap-sys --setoption kanjiEmbed noEmbed --nomkmap || true"
349        system "${prefix}/bin/updmap-sys --enable morisawa.map --nomkmap || true"
350        system "${prefix}/bin/updmap-sys --disable morisawa-hiraginoEmbed.map --nomkmap || true"
351        system "${prefix}/bin/updmap-sys --disable morisawa-yuEmbed.map --nomkmap || true"
352    }
353
354    system "${prefix}/bin/updmap-sys"
355    system "${prefix}/bin/fmtutil-sys --all"
356}
357
358universal_variant   no
359
360variant hiragino conflicts yu description {Use Hiragino fonts for typesetting} {}
361variant yu conflicts hiragino description {Use Yu fonts for typesetting (experimental; not recommended)} {}
362
363variant otf description {Install otf.sty} {}
364
365variant euc conflicts sjis utf8 description {Set the default character encoding to EUC-JP} {}
366variant sjis conflicts euc utf8 description {Set the default character encoding to Shift_JIS} {}
367variant utf8 conflicts euc sjis description {Set the default character encoding to UTF-8} {}
368
369variant motif conflicts xaw xaw3d nextaw description {Use Motif widget toolkit to build xdvi} {
370    depends_lib-append port:fontconfig port:freetype port:jpeg port:libiconv
371    depends_lib-append lib:libXm:openmotif
372    configure.args-delete --without-x --without-xdvik
373    configure.args-append --with-xdvi-x-toolkit=motif
374}
375variant xaw conflicts motif xaw3d nextaw description {Use Xaw to build xdvi} {
376    depends_lib-append port:fontconfig port:freetype port:jpeg port:libiconv
377    depends_lib-append port:xorg-libXaw
378    configure.args-delete --without-x --without-xdvik
379    configure.args-append --with-xdvi-x-toolkit=xaw
380}
381variant xaw3d conflicts motif xaw nextaw description {Use Xaw3d to build xdvi} {
382    depends_lib-append port:fontconfig port:freetype port:jpeg port:libiconv
383    depends_lib-append port:Xaw3d
384    configure.args-delete --without-x --without-xdvik
385    configure.args-append --with-xdvi-x-toolkit=xaw3d
386}
387variant nextaw conflicts motif xaw xaw3d description {Use neXtaw to build xdvi} {
388    depends_lib-append port:fontconfig port:freetype port:jpeg port:libiconv
389    depends_lib-append port:neXtaw
390    configure.args-delete --without-x --without-xdvik
391    configure.args-append --with-xdvi-x-toolkit=neXtaw
392}
393
394platform darwin 9 {}
395
396notes "
397This port is based on (p)teTeX, which is no longer maintained.
398If there is no special reason, it is highly recommended to use TeXLive.
399"
400
401livecheck.type      regex
402livecheck.url       "http://tutimura.ath.cx/~nob/tex/ptetex/ptetex3/?C=M;O=D"
403livecheck.version   ${ver_ptetex3}
404livecheck.regex     ptetex3-(\[0-9\]+)\\.tar
Note: See TracBrowser for help on using the repository browser.