[92205] trunk/dports/devel/libunwind-headers/Portfile

jeremyhu at macports.org jeremyhu at macports.org
Sat Apr 21 15:45:45 PDT 2012


Revision: 92205
          https://trac.macports.org/changeset/92205
Author:   jeremyhu at macports.org
Date:     2012-04-21 15:45:44 -0700 (Sat, 21 Apr 2012)
Log Message:
-----------
libunwind-headers: Rewrite availability for Leopard and Tiger

Modified Paths:
--------------
    trunk/dports/devel/libunwind-headers/Portfile

Modified: trunk/dports/devel/libunwind-headers/Portfile
===================================================================
--- trunk/dports/devel/libunwind-headers/Portfile	2012-04-21 22:42:44 UTC (rev 92204)
+++ trunk/dports/devel/libunwind-headers/Portfile	2012-04-21 22:45:44 UTC (rev 92205)
@@ -7,6 +7,7 @@
 
 name                    libunwind-headers
 version                 30
+revision                1
 categories              devel
 maintainers             mfeiri openmaintainer
 homepage                http://opensource.apple.com/source/libunwind/
@@ -26,11 +27,36 @@
 
 xcode.target            libunwind-ld
 
-post-extract {
+post-patch { 
     reinplace "s|/usr/local|${prefix}|g" \
             ${worksrcpath}/libunwind.xcodeproj/project.pbxproj
     reinplace "s|/usr|${prefix}|g" \
             ${worksrcpath}/libunwind.xcodeproj/project.pbxproj
+
+    foreach header [glob ${worksrcpath}/*/{,*/}*.h{,pp}] {
+        if {${os.major} < 11} {
+            reinplace "s|__MAC_10_7|1070|g" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_7|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_7_AND_LATER|__attribute__((unavailable))|g" ${header}
+        }
+        if {${os.major} < 10} {
+            reinplace "s|__MAC_10_6|1060|g" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_6|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_6_AND_LATER|__attribute__((unavailable))|g" ${header}
+        }
+        if {${os.major} < 9} {
+            reinplace "s|__MAC_10_5|1050|g" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_\\(.\\)_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_5|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|" ${header}
+            reinplace "s|AVAILABLE_MAC_OS_X_VERSION_10_5_AND_LATER|__attribute__((unavailable))|g" ${header}
+
+            reinplace "s|Availability.h|AvailabilityMacros.h|g" ${header}
+            reinplace "s|__OSX_AVAILABLE_STARTING(10.*)|__attribute__((unavailable))|g" ${header}
+            reinplace "s|__OSX_AVAILABLE_BUT_DEPRECATED(10.*)|__attribute__((unavailable))|g" ${header}
+            reinplace "s|__OSX_AVAILABLE_STARTING(__MAC_10_\\(\[^,\]*\\),.*)|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|g" ${header}
+            reinplace "s|__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_\\(\[^,\]*\\),10.*)|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER|g" ${header}
+            reinplace "s|__OSX_AVAILABLE_BUT_DEPRECATED(__MAC_10_\\(\[^,\]*\\),__MAC_10_\\(\[^,\]*\\),.*)|AVAILABLE_MAC_OS_X_VERSION_10_\\1_AND_LATER_BUT_DEPRECATED_IN_MAC_OS_X_VERSION_10_\\2|g" ${header}
+        }
+    }
 }
 
 livecheck.type          regex
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20120421/b2d072f9/attachment.html>


More information about the macports-changes mailing list