Revision
74717
Author
jmr@macports.org
Date
2010-12-30 08:19:22 -0800 (Thu, 30 Dec 2010)

Log Message

asymptote: add python variants to enable xasy (#21796), add build dep on texinfo (#25390), run mktexlsr in post-deactivate as well

Modified Paths

Diff

Modified: trunk/dports/graphics/asymptote/Portfile (74716 => 74717)


--- trunk/dports/graphics/asymptote/Portfile	2010-12-30 16:05:27 UTC (rev 74716)
+++ trunk/dports/graphics/asymptote/Portfile	2010-12-30 16:19:22 UTC (rev 74717)
@@ -23,6 +23,7 @@
 checksums       md5     6b3e32747e52b3af533a149bb0131b10 \
                 sha1    2062d6c76ae946347668d61cd320ad52f93e1a7c \
                 rmd160  3c880d59121d99ec2b1fb4dacfd3fe30dd96525d
+depends_build   port:texinfo
 depends_lib	port:readline \
                 port:texlive \
                 port:ghostscript \
@@ -32,7 +33,35 @@
                 port:ncurses \
                 port:boehmgc
 
+post-destroot {
+    set python.bin ""
+    if {[variant_isset python27]} {
+        set python.bin ${prefix}/bin/python2.7
+    } elseif {[variant_isset python26]} {
+        set python.bin ${prefix}/bin/python2.6
+    }
+    if {${python.bin} != ""} {
+        eval reinplace {"s|#!/usr/bin/env python|#!${python.bin}|"} \
+            [glob -directory ${destroot}${prefix}/share/${name}/GUI *.py]
+    } else {
+        delete ${destroot}${prefix}/bin/xasy
+    }
+}
+
 post-activate {
   # run `mktexlsr` to make sure the asymptote files are found:
   system "mktexlsr"
 }
+post-deactivate {
+  system "mktexlsr"
+}
+
+variant python26 conflicts python27 description {Enable xasy GUI using Python 2.6} {
+    depends_lib-append port:py26-tkinter port:py26-pil
+}
+variant python27 conflicts python26 description {Enable xasy GUI using Python 2.7} {
+    depends_lib-append port:py27-tkinter port:py27-pil
+}
+if {![variant_isset python26]} {
+    default_variants +python27
+}