[140142] trunk/dports/lang/rust/Portfile

sean at macports.org sean at macports.org
Wed Sep 9 14:28:15 PDT 2015


Revision: 140142
          https://trac.macports.org/changeset/140142
Author:   sean at macports.org
Date:     2015-09-09 14:28:15 -0700 (Wed, 09 Sep 2015)
Log Message:
-----------
rust-src: add port for rust source code

The benefit of having this in a subport is that it is automatically kept in
line with the rust compiler version.

Modified Paths:
--------------
    trunk/dports/lang/rust/Portfile

Modified: trunk/dports/lang/rust/Portfile
===================================================================
--- trunk/dports/lang/rust/Portfile	2015-09-09 21:28:13 UTC (rev 140141)
+++ trunk/dports/lang/rust/Portfile	2015-09-09 21:28:15 UTC (rev 140142)
@@ -135,11 +135,38 @@
 
 destroot.args       VERBOSE=1
 post-destroot {
-    xinstall -d ${destroot}${prefix}/share/${name}
-    xinstall -m 644 ${worksrcpath}/src/etc/ctags.rust \
-        ${destroot}${prefix}/share/${name}
+    if {${subport} eq ${name}} {
+        xinstall -d ${destroot}${prefix}/share/${name}
+        xinstall -m 644 ${worksrcpath}/src/etc/ctags.rust \
+            ${destroot}${prefix}/share/${name}
+    }
 }
 
 livecheck.type      regex
 livecheck.url       ${homepage}/install.html
 livecheck.regex     {dist/rust-(\d\.\d)}
+
+subport rust-src {
+    # remove dependencies
+    depends_build
+    depends_lib
+
+    description     Source code for the rust programming language
+    long_description ${description}
+
+    use_configure no
+
+    build {}
+
+    destroot {
+        xinstall -d ${destroot}${prefix}/share/rust
+        move ${worksrcpath}/src ${destroot}${prefix}/share/rust/src
+
+        # correct the permissions
+        system -W ${destroot}${prefix}/share/rust "find . -type d -exec chmod 755 {} \\;"
+        system -W ${destroot}${prefix}/share/rust "find . -type f -exec chmod 644 {} \\;"
+
+        # delete the test directories (which for some god awful reason contains binaries)
+        system -W ${destroot}${prefix}/share/rust "find . -type d -name test -print0 | xargs -0 rm -rf"
+    }
+}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20150909/f284822f/attachment-0001.html>


More information about the macports-changes mailing list