Ignore:
Timestamp:
Aug 8, 2011, 6:23:42 AM (8 years ago)
Author:
dports@…
Message:

Update texlive ports to 2011 versions
[merge from /users/dports to trunk]

Major port changes this year include:

  • ConTeXt MkIV support: install texmfcnf.lua config file with the appropriate search paths; set the search path so that context knows how to find that file; keep the luatex cache (equivalent of ls-R) up to date
  • generate language.dat.lua for LuaTeX hyphenation with appropriate lua-specific option
  • move user-local texmf tree to ~/Library/texmf for MacTeX compatibility
  • add texlive.mktexlsr and texlive.use_mktexlsr commands to the portgroup
  • split distfiles into three pieces so that documentation and source do not need to be downloaded if they are not going to be installed (i.e. if +doc or +src variants not selected)
  • use a stripped source distfile for texlive-bin that does not contain the parts we don't build
  • fix symlinks ("texlinks") for generated formats; do not install ones that are not requested, and make sure those that are installed point to the right place
  • simplify variants for texlive-bin
  • and lots of things I'm forgetting
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/_resources/port1.0/group/texlive-1.0.tcl

    r77477 r82097  
    6868set texlive_texmfsysconfig "${prefix}/etc/texmf"
    6969
     70# user's local texmf tree.
     71# Note that this path is specified relative to the user's
     72# home directory, i.e. it begins with an implicit ~/
     73set texlive_texmfhome "Library/texmf"
     74
     75
    7076# location of binaries installed by texlive-bin
    7177#
     
    8591# pane: it can select the active TeX distribution by pointing the
    8692# /usr/texbin symlink here
     93#
     94# It also seems like the prefpane wants architecture-specific links,
     95# and may want version-specific ones in the future, so create those in
     96# ${texlive_mactex_texdistdir}.
    8797set texlive_mactex_texbindir "${prefix}/libexec/texlive/texbin"
     98set texlive_mactex_texdistdir "${prefix}/libexec/texlive/texdist"
     99
     100# update texmf file path databases (ls-R)
     101#
     102# This should be run in the post-activate/deactivate hooks of any port
     103# that installs texmf files. It updates the kpathsea database using
     104# mktexlsr (formerly texhash), as well as ConTeXt's cache.
     105proc texlive.mktexlsr {} {
     106    global prefix
     107
     108    # Run mktexlsr. If that's not available, something's wrong.
     109    system "${prefix}/bin/mktexlsr"
     110
     111    # If mtxrun is available (i.e. ConTeXt is installed), update its
     112    # cache too. If it's not installed, that's OK.
     113    if [file exists "${prefix}/bin/mtxrun"] {
     114        system "${prefix}/bin/mtxrun --generate"
     115    }
     116}
    88117
    89118# Remove dependencies on any texlive-documentation-* ports, for use by
     
    113142default texlive.maps {}
    114143
     144# Whether to regenerate all config files, maps, and formats after
     145# activation regardless of whether any new ones are installed.
    115146options texlive.forceupdatecnf
    116147default texlive.forceupdatecnf no
     148
     149# Whether to run mktexlsr after activation. Usually required if
     150# installing any texmf files.
     151options texlive.use_mktexlsr
     152default texlive.use_mktexlsr yes
    117153
    118154proc texlive.texmfport {} {
     
    125161    use_xz          yes
    126162
    127     global name master_sites
     163    global name master_sites distname extract.suffix
    128164    livecheck.type  regex
    129165    livecheck.url   ${master_sites}
    130     livecheck.regex ${name}-(\\d+)\\.tar
     166    livecheck.regex ${name}-(\\d+)-run\\.tar
    131167
    132168    depends_lib-append port:texlive-common port:texlive-bin
    133169
    134     variant doc description "Install documentation" { }
    135     variant src description "Install TeX source" { }
     170    # distfile is split into three parts, all of which extract into
     171    # $worksrcdir
     172    # - $distname-run contains the runtime files required to install the
     173    #   package, as well as the "tlpkginfo" directory containing metadata
     174    # - $distname-doc contains optional documentation files
     175    # - $distname-src contains optional source code for installed files
     176    # The latter two are only downloaded if the corresponding variant
     177    # is enabled. Currently, each package must have all three distfiles
     178    # even if some are empty.
     179    distfiles       ${distname}-run${extract.suffix}
     180
     181    variant doc description "Install documentation" {
     182        distfiles-append ${distname}-doc${extract.suffix}
     183    }
     184    variant src description "Install TeX source" {
     185        distfiles-append ${distname}-src${extract.suffix}
     186    }
    136187    default_variants +doc
    137188
     
    211262        }
    212263
    213         # create symlinks for any binaries activated by the port
    214         foreach bin ${texlive.binaries} {
    215             ln -s ${texlive_bindir}/$bin ${destroot}${prefix}/bin
    216             ln -s ${texlive_bindir}/$bin ${destroot}${texlive_mactex_texbindir}
    217         }
    218 
    219264        # install a documentation file containing the list of TeX
    220265        # packages installed. This also ensures that each port
     
    257302
    258303                # Simulate texlinks
    259                 if {![file exists ${destroot}${prefix}/bin/$fmtname]} {
     304                if {[lsearch -exact ${texlive.binaries} $fmtname] != -1} {
    260305                    # Decide what to link. Use the specified engine
    261306                    # unless a binary with the same name as the
    262                     # program exists (this can happen for metafont;
     307                    # format exists (this can happen for metafont;
    263308                    # see #28890)
    264                     if {[file exists ${texlive_bindir}/$fmtname]} {
     309                    #
     310                    # It's OK if the binary named $fmtname is a broken
     311                    # symlink, since we might be installing whatever
     312                    # it's pointing to, hence the use of 'file lstat'.
     313                    if {![catch {file lstat ${texlive_bindir}/$fmtname ignore}]} {
    265314                        set linksource ${texlive_bindir}/$fmtname
    266315                    } else {
     
    272321                    ln -s $linksource \
    273322                        ${destroot}${texlive_mactex_texbindir}/$fmtname
     323
     324                    # We've created the symlink for $fmtname; remove
     325                    # it from texlive.binaries so we don't try to do
     326                    # so again later.
     327                    texlive.binaries-delete $fmtname
    274328                }
    275329            }
     
    297351            set langdeffilename \
    298352                ${destroot}${texlive_texmfsysconfig}/language.d/10${name}.def
     353            set langluafilename \
     354                ${destroot}${texlive_texmfsysconfig}/language.d/10${name}.dat.lua
    299355            set langdatfile [open $langdatfilename "w"]
    300356            set langdeffile [open $langdeffilename "w"]
     357            set langluafile [open $langluafilename "w"]
     358           
    301359            foreach x ${texlive.languages} {
    302360                set langname [lindex $x 0]
     
    305363                set langrhmin [lindex $x 3]
    306364                set langsyns [lindex $x 4]
     365                set langpatt [lindex $x 5]
     366                set langhyph [lindex $x 6]
     367                set langspecial [lindex $x 7]
    307368
    308369                puts $langdatfile "$langname $langfile"
     
    314375                    puts $langdeffile "\\addlanguage{$syn}{$langfile}{}{$langlhmin}{$langrhmin}"
    315376                }
    316             }
     377
     378                puts $langluafile "\t\['$langname'\] = {"
     379                puts $langluafile "\t\tloader = '$langfile',"
     380                puts $langluafile "\t\tlefthyphenmin = $langlhmin,"
     381                puts $langluafile "\t\trighthyphenmin = $langrhmin,"
     382                set qsyns {}
     383                foreach syn $langsyns {
     384                    lappend qsyns "'$syn'"
     385                }
     386                set qsynlist [join $qsyns ", "]
     387                puts $langluafile "\t\tsynonyms = { $qsynlist },"
     388                if {$langpatt != ""} {
     389                    puts $langluafile "\t\tpatterns = '$langpatt',"
     390                }
     391                if {$langhyph != ""} {
     392                    puts $langluafile "\t\thyphenation = '$langhyph',"
     393                }
     394                if {$langspecial != ""} {
     395                    puts $langluafile "\t\tpatterns = '$langspecial',"
     396                }
     397                puts $langluafile "\t},\n"               
     398            }
     399           
    317400            close $langdatfile
    318401            close $langdeffile
     402            close $langluafile
     403        }
     404
     405        # create symlinks for any binaries activated by the port
     406        foreach bin ${texlive.binaries} {
     407            ln -s ${texlive_bindir}/$bin ${destroot}${prefix}/bin
     408            ln -s ${texlive_bindir}/$bin ${destroot}${texlive_mactex_texbindir}
    319409        }
    320410    }
    321411
    322412    post-activate {
    323         system "${texlive_bindir}/mktexlsr"
     413        if {${texlive.use_mktexlsr}} {
     414            texlive.mktexlsr
     415        }
     416       
    324417        if {${texlive.forceupdatecnf}} {
    325418            # If force was specified, update all the config files, and
     
    327420            system "${prefix}/libexec/texlive-update-cnf language.dat"
    328421            system "${prefix}/libexec/texlive-update-cnf language.def"
     422            system "${prefix}/libexec/texlive-update-cnf language.dat.lua"
    329423            system "${prefix}/libexec/texlive-update-cnf updmap.cfg"
    330424            system "${prefix}/libexec/texlive-update-cnf fmtutil.cnf"
     
    338432                system "${prefix}/libexec/texlive-update-cnf language.dat"
    339433                system "${prefix}/libexec/texlive-update-cnf language.def"
     434                system "${prefix}/libexec/texlive-update-cnf language.dat.lua"
    340435            }
    341436            if {${texlive.maps} != ""} {
     
    365460        # Update ls-R and any config files to reflect that the package
    366461        # is now gone
    367         system "${texlive_bindir}/mktexlsr"
     462        texlive.mktexlsr
    368463        if {${texlive.forceupdatecnf} || ${texlive.languages} != ""} {
    369464            system "${prefix}/libexec/texlive-update-cnf language.dat"
    370465            system "${prefix}/libexec/texlive-update-cnf language.def"
     466            system "${prefix}/libexec/texlive-update-cnf language.dat.lua"
    371467        }
    372468        if {${texlive.forceupdatecnf} || ${texlive.maps} != ""} {
Note: See TracChangeset for help on using the changeset viewer.