[104080] trunk/dports/lang/rust

larryv at macports.org larryv at macports.org
Thu Mar 14 20:12:52 PDT 2013


Revision: 104080
          https://trac.macports.org/changeset/104080
Author:   larryv at macports.org
Date:     2013-03-14 20:12:52 -0700 (Thu, 14 Mar 2013)
Log Message:
-----------
rust: Use target consistent with the one used in the gcc and llvm ports.

Also specify the target with a configure arg instead of patch+reinplace.

Modified Paths:
--------------
    trunk/dports/lang/rust/Portfile
    trunk/dports/lang/rust/files/patch-configure.diff

Modified: trunk/dports/lang/rust/Portfile
===================================================================
--- trunk/dports/lang/rust/Portfile	2013-03-15 03:05:39 UTC (rev 104079)
+++ trunk/dports/lang/rust/Portfile	2013-03-15 03:12:52 UTC (rev 104080)
@@ -6,7 +6,7 @@
 
 name                rust
 version             0.5
-revision            3
+revision            4
 categories          lang devel
 platforms           darwin
 supported_archs     i386 x86_64
@@ -91,10 +91,6 @@
 if {[string first clang ${configure.compiler}] == -1} {
     patchfiles-append   patch-non_apple_gcc.diff
 }
-post-patch {
-    reinplace "s/__BUILD_ARCH__/${configure.build_arch}/g" \
-        ${worksrcpath}/configure
-}
 
 # Using MacPorts' LLVM currently results in a stage2 compiler that
 # segfaults during the build; until we fix this, we need Python. The
@@ -118,6 +114,13 @@
     }
 }
 
+platform darwin {
+    set cpu ${configure.build_arch}
+    if {${cpu} eq "i386"} {
+        set cpu i686
+    }
+    configure.pre_args-append --host-triple=${cpu}-apple-darwin${os.major}
+}
 configure.args      --disable-docs \
                     --enable-local-rust \
                     --local-rust-root=${workpath}/${stage0(distdir)}

Modified: trunk/dports/lang/rust/files/patch-configure.diff
===================================================================
--- trunk/dports/lang/rust/files/patch-configure.diff	2013-03-15 03:05:39 UTC (rev 104079)
+++ trunk/dports/lang/rust/files/patch-configure.diff	2013-03-15 03:12:52 UTC (rev 104080)
@@ -1,27 +1,8 @@
 diff --git a/configure b/configure
-index f2afa2d..93a2106 100755
+index f2afa2d..172984f 100755
 --- a/configure
 +++ b/configure
-@@ -234,17 +234,7 @@ need_cmd sed
- msg "inspecting environment"
- 
- CFG_OSTYPE=$(uname -s)
--CFG_CPUTYPE=$(uname -m)
--
--if [ $CFG_OSTYPE = Darwin -a $CFG_CPUTYPE = i386 ]
--then
--    # Darwin's `uname -s` lies and always returns i386. We have to use sysctl
--    # instead.
--    if sysctl hw.optional.x86_64 | grep -q ': 1'
--    then
--        CFG_CPUTYPE=x86_64
--    fi
--fi
-+CFG_CPUTYPE=__BUILD_ARCH__
- 
- # The goal here is to come up with the same triple as LLVM would,
- # at least for the subset of platforms we're willing to target.
-@@ -363,7 +353,7 @@ fi
+@@ -363,7 +363,7 @@ fi
  step_msg "looking for build programs"
  
  probe_need CFG_PERL        perl
@@ -30,7 +11,7 @@
  probe_need CFG_PYTHON      python2.7 python2.6 python2 python
  
  python_version=$($CFG_PYTHON -V 2>&1)
-@@ -382,8 +372,10 @@ else
+@@ -382,8 +382,10 @@ else
      probe_need CFG_GIT     git
  fi
  
@@ -43,7 +24,7 @@
  probe CFG_LD               ld
  probe CFG_LLVM_CONFIG      llvm-config
  probe CFG_VALGRIND         valgrind
-@@ -494,7 +486,7 @@ then
+@@ -494,7 +496,7 @@ then
      LLVM_VERSION=$($LLVM_CONFIG --version)
  
      case $LLVM_VERSION in
@@ -52,7 +33,7 @@
  	    msg "found ok version of LLVM: $LLVM_VERSION"
  	    ;;
  	(*)
-@@ -516,7 +508,7 @@ then
+@@ -516,7 +518,7 @@ then
                        | cut -d ' ' -f 2)
  
      case $CFG_CLANG_VERSION in
@@ -61,7 +42,7 @@
          step_msg "found ok version of CLANG: $CFG_CLANG_VERSION"
          CFG_C_COMPILER="clang"
          ;;
-@@ -727,20 +719,11 @@ do
+@@ -727,20 +729,11 @@ do
                     --enable-bindings=none --disable-threads \
                     --disable-pthreads"
  
@@ -69,15 +50,15 @@
 -        then
 -            LLVM_CXX_32="clang++ -m32"
 -            LLVM_CC_32="clang -m32"
-+        LLVM_CXX_32="$CXX -m32"
-+        LLVM_CC_32="$CC -m32"
- 
+-
 -            LLVM_CXX_64="clang++"
 -            LLVM_CC_64="clang"
 -        else
 -            LLVM_CXX_32="g++ -m32"
 -            LLVM_CC_32="gcc -m32"
--
++        LLVM_CXX_32="$CXX -m32"
++        LLVM_CC_32="$CC -m32"
+ 
 -            LLVM_CXX_64="g++"
 -            LLVM_CC_64="gcc"
 -        fi
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130314/4c76ff69/attachment.html>


More information about the macports-changes mailing list