[117047] trunk/dports/cad/LibreCAD/Portfile

cal at macports.org cal at macports.org
Thu Feb 13 14:38:55 PST 2014


Revision: 117047
          https://trac.macports.org/changeset/117047
Author:   cal at macports.org
Date:     2014-02-13 14:38:55 -0800 (Thu, 13 Feb 2014)
Log Message:
-----------
LibreCAD: Fix build on systems < 10.9, closes #42342

Modified Paths:
--------------
    trunk/dports/cad/LibreCAD/Portfile

Modified: trunk/dports/cad/LibreCAD/Portfile
===================================================================
--- trunk/dports/cad/LibreCAD/Portfile	2014-02-13 22:14:24 UTC (rev 117046)
+++ trunk/dports/cad/LibreCAD/Portfile	2014-02-13 22:38:55 UTC (rev 117047)
@@ -32,12 +32,20 @@
                     port:freetype
 
 if {${os.platform} eq "darwin" && ${os.major} < 13} {
-    depends_lib
-    pre-fetch {
-        ui_error "${name} 2.x only works with OS X 10.9 Mavericks or later."
-        ui_error "You might want to try a 1.x series release instead."
-        error "incompatible OS X version"
-    }
+                    configure.compiler macports-gcc-4.8
+                    # -r ensure's that we will build all Makefiles when QMake get's executed
+                    configure.pre_args -r
+
+                    # Fixing -Xarch_X86_64 issues within the Makefile
+                    post-configure  {
+                        ui_info "Removing -Xarch_x86_64 from Makefiles"
+                        fs-traverse Makefile ${worksrcpath} {
+                            if {[string match "*/Makefile" ${Makefile}]} {
+                                ui_info "Fixing Xarch ${Makefile}"
+                                reinplace "s|-Xarch_x86_64||" ${Makefile}
+                            }
+                        }
+                    }
 }
 
 variant universal {}
@@ -47,6 +55,26 @@
                     LINK="${configure.cxx} [get_canonical_archflags cxx]"
 
 destroot {
+    if {${os.platform} eq "darwin" && ${os.major} < 13} {
+
+        # copy libgcc files over to within the application, a bug in macdeployqt prevent's this from happening correctly
+        set librecad "${worksrcpath}/LibreCAD.app/Contents/MacOS/LibreCAD"
+        file mkdir ${worksrcpath}/LibreCAD.app/Contents/Frameworks
+        foreach dep [exec otool -L ${librecad} | grep libgcc] {
+            if [string match -nocase "*/libgcc*.dylib" ${dep}] {
+                ui_info "Copy libgcc files over from ${dep} to ${worksrcpath}/LibreCAD.app/Contents/Frameworks"
+                file copy ${dep} ${worksrcpath}/LibreCAD.app/Contents/Frameworks/
+            }
+        }
+
+        # Set these libgcc libraries to local
+        # TODO: Put these in the foreach loop somehow
+        system "install_name_tool -change /opt/local/lib/libgcc/libstdc++.6.dylib \
+            @executable_path/../Frameworks/libstdc++.6.dylib ${librecad}"
+        system "install_name_tool -change /opt/local/lib/libgcc/libgcc_s.1.dylib \
+            @executable_path/../Frameworks/libgcc_s.1.dylib ${librecad}"
+
+    }
     system -W ${worksrcpath} "macdeployqt LibreCAD.app"
     copy ${worksrcpath}/LibreCAD.app ${destroot}${applications_dir}
 }
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.macosforge.org/pipermail/macports-changes/attachments/20140213/98d6dd40/attachment-0001.html>


More information about the macports-changes mailing list