Ticket #42342: Portfile-LibreCAD.2.diff

File Portfile-LibreCAD.2.diff, 2.5 KB (added by librecad@…, 10 years ago)

New patch with suggested changes

  • Portfile

    old new  
    3232                    port:freetype
    3333
    3434if {${os.platform} eq "darwin" && ${os.major} < 13} {
    35     depends_lib
    36     pre-fetch {
    37         ui_error "${name} 2.x only works with OS X 10.9 Mavericks or later."
    38         ui_error "You might want to try a 1.x series release instead."
    39         error "incompatible OS X version"
    40     }
     35                    configure.compiler macports-gcc-4.8
     36                    # -r ensure's that we will build all Makefiles when QMake get's executed
     37                    configure.pre_args -r
     38
     39                    # Fixing -Xarch_X86_64 issues within the Makefile
     40                    post-configure  {
     41                        ui_info "Removing -Xarch_x86_64 from Makefiles"
     42                        fs-traverse Makefile ${worksrcpath} {
     43                            if {[string match "*/Makefile" ${Makefile}]} {
     44                                ui_info "Fixing Xarch ${Makefile}"
     45                                reinplace "s|-Xarch_x86_64||" ${Makefile}
     46                            }
     47                        }
     48                    }
    4149}
    4250
    4351variant universal {}
     
    4755                    LINK="${configure.cxx} [get_canonical_archflags cxx]"
    4856
    4957destroot {
     58    if {${os.platform} eq "darwin" && ${os.major} < 13} {
     59
     60        # copy libgcc files over to within the application, a bug in macdeployqt prevent's this from happening correctly
     61        set librecad "${worksrcpath}/LibreCAD.app/Contents/MacOS/LibreCAD"
     62        file mkdir ${worksrcpath}/LibreCAD.app/Contents/Frameworks
     63        foreach dep [exec otool -L ${librecad} | grep libgcc] {
     64            if [string match -nocase "*/libgcc*.dylib" ${dep}] {
     65                ui_info "Copy libgcc files over from ${dep} to ${worksrcpath}/LibreCAD.app/Contents/Frameworks"
     66                file copy ${dep} ${worksrcpath}/LibreCAD.app/Contents/Frameworks/
     67            }
     68        }
     69
     70        # Set these libgcc libraries to local
     71        # TODO: Put these in the foreach loop somehow
     72        system "install_name_tool -change /opt/local/lib/libgcc/libstdc++.6.dylib \
     73            @executable_path/../Frameworks/libstdc++.6.dylib ${librecad}"
     74        system "install_name_tool -change /opt/local/lib/libgcc/libgcc_s.1.dylib \
     75            @executable_path/../Frameworks/libgcc_s.1.dylib ${librecad}"
     76
     77    }
    5078    system -W ${worksrcpath} "macdeployqt LibreCAD.app"
    5179    copy ${worksrcpath}/LibreCAD.app ${destroot}${applications_dir}
    5280}