[68968] trunk/dports/_resources/port1.0/group/texlive-1.0.tcl

dports at macports.org dports at macports.org
Fri Jun 18 15:16:41 PDT 2010


Revision: 68968
          http://trac.macports.org/changeset/68968
Author:   dports at macports.org
Date:     2010-06-18 15:16:40 -0700 (Fri, 18 Jun 2010)
Log Message:
-----------
texlive-1.0.tcl: fix installation with -doc variant (#25329):

  * remove dependencies on texlive-documentation-* ports when -doc is
    specified

  * install a file in $prefix/share/doc/texlive containing the list of
    TeX packages installed by each texmf port. Besides being
    ostensibly useful information, this keeps MacPorts from erroring
    out if no other files were installed

Modified Paths:
--------------
    trunk/dports/_resources/port1.0/group/texlive-1.0.tcl

Modified: trunk/dports/_resources/port1.0/group/texlive-1.0.tcl
===================================================================
--- trunk/dports/_resources/port1.0/group/texlive-1.0.tcl	2010-06-18 21:58:05 UTC (rev 68967)
+++ trunk/dports/_resources/port1.0/group/texlive-1.0.tcl	2010-06-18 22:16:40 UTC (rev 68968)
@@ -64,6 +64,18 @@
 # configuration data from texconfig
 set texlive_texmfsysconfig "${prefix}/etc/texmf"
 
+# Remove dependencies on any texlive-documentation-* ports, for use by
+# -doc variants
+proc texlive.removedocdepends {} {
+    global depends_lib
+    set toremove {}
+    foreach dep $depends_lib {
+        if [regexp {^port:texlive-documentation-} $dep] {
+            lappend toremove $dep
+        }
+    }
+    depends_lib-delete $toremove
+}
 
 #
 # For installing texmf ports
@@ -107,6 +119,11 @@
     variant src description "Install TeX source" { }
     default_variants +doc
 
+    if {![variant_isset "doc"]} {
+        # Skip any dependencies on texlive-documentation-* ports
+        texlive.removedocdepends
+    }
+    
     use_configure   no
 
     build           { }
@@ -154,6 +171,25 @@
             }
         }
 
+        # install a documentation file containing the list of TeX
+        # packages installed. This also ensures that each port
+        # provides at least one file, even if there's nothing to
+        # install (e.g. documentation ports with -doc)
+        xinstall -d ${destroot}${prefix}/share/doc/texlive
+        set docfile [open ${destroot}${prefix}/share/doc/texlive/${name} "w"]
+        puts $docfile "${name} version ${version} (MacPorts revision ${version}_${revision})"
+        puts $docfile "\nTeX Live packages contained in this port:"
+        set pkgfile [open ${worksrcpath}/tlpkginfo/pkgs]
+        while {[gets $pkgfile line] >= 0} {
+            set splitline [split $line]
+            set pkg [lindex $splitline 0]
+            set pkgdesc [join [lrange $splitline 1 end]]
+            puts $docfile "    $pkg: $pkgdesc"
+        }
+        close $pkgfile
+        close $docfile
+
+        # install fmtutil.cnf file
         if {${texlive.formats} != ""} {
             xinstall -d ${destroot}${texlive_texmfsysconfig}/fmtutil.d
             set fmtfilename \
@@ -185,6 +221,7 @@
             close $fmtfile
         }
 
+        # install updmap.cfg file
         if {${texlive.maps} != ""} {
             xinstall -d ${destroot}${texlive_texmfsysconfig}/updmap.d
             set mapfilename \
@@ -196,6 +233,7 @@
             close $mapfile
         }
 
+        # install languages.dat and languages.def files
         if {${texlive.languages} != ""} {
             xinstall -d ${destroot}${texlive_texmfsysconfig}/language.d
             set langdatfilename \
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20100618/11de56fa/attachment.html>


More information about the macports-changes mailing list