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

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

pTeX:

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