Revision: 103430 https://trac.macports.org/changeset/103430 Author: michaelld@macports.org Date: 2013-02-25 09:53:31 -0800 (Mon, 25 Feb 2013) Log Message: ----------- qt4-mac: * remove silly rev-bump warning: que sera, sera! * In QMake (the executable): + enable correct "-framework foo,bar" parsing as specified by Apple's LD when searching for QMake .prl files; + remove "/Library/Frameworks" as a default search path; + use "PREFIX/Library/Frameworks" and "PREFIX/lib" as a default search paths, where PREFIX is the MacPorts' install prefix. Modified Paths: -------------- trunk/dports/aqua/qt4-mac/Portfile Added Paths: ----------- trunk/dports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff Modified: trunk/dports/aqua/qt4-mac/Portfile =================================================================== --- trunk/dports/aqua/qt4-mac/Portfile 2013-02-25 17:32:16 UTC (rev 103429) +++ trunk/dports/aqua/qt4-mac/Portfile 2013-02-25 17:53:31 UTC (rev 103430) @@ -16,15 +16,8 @@ #conflicts qt3 qt3-mac qt4-mac-devel conflicts qt3 qt3-mac version 4.8.4 +revision 6 -# NOTE: Before doing a rev-bump due to an external dependency, please -# contact the maintainer and have him/her do it. I often have other -# changes to put in place, but hold off doing so until either a -# rev-bump is necessary or I have some critical changes. Rebuilding -# qt4-mac is quite time consuming, so I make every reasonable effort -# to require rebuilding it no more often than necessary. Thanks! -revision 5 - categories aqua platforms macosx maintainers michaelld openmaintainer @@ -144,6 +137,14 @@ patchfiles-append patch-qmake_project.cpp.diff +# (10.1) In QMake: (a) enable correct "-framework foo,bar" parsing as +# specified by Apple's LD; (b) disable "/Library/Frameworks" as a +# default search path; use "PREFIX/Library/Frameworks" and replace +# PREFIX in post-patch. Also set "PREFIX/lib" as a default library +# search path. + +patchfiles-append patch-qmake_generators_unix_unixmakke.cpp.diff + # (11) Allow easy replacement of MACOSX_DEPLOYMENT_TARGET: build for # just the user's current OS. @@ -329,6 +330,11 @@ reinplace "s,@QT_PLUGINS_DIR@,${qt_plugins_dir},g" \ ${worksrcpath}/tools/macdeployqt/macdeployqt/main.cpp + # fix PREFIX in QMake makefile generator + + reinplace "s,@PREFIX@,${qt_dir},g" \ + ${worksrcpath}/qmake/generators/unix/unixmake.cpp + # if no debug, then do not even build debug code if {![variant_isset debug]} { Added: trunk/dports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff =================================================================== --- trunk/dports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff (rev 0) +++ trunk/dports/aqua/qt4-mac/files/patch-qmake_generators_unix_unixmakke.cpp.diff 2013-02-25 17:53:31 UTC (rev 103430) @@ -0,0 +1,108 @@ +--- qmake/generators/unix/unixmake.cpp.orig 2013-02-24 21:46:23.000000000 -0500 ++++ qmake/generators/unix/unixmake.cpp 2013-02-25 11:40:24.000000000 -0500 +@@ -472,8 +472,9 @@ + UnixMakefileGenerator::findLibraries() + { + QList<QMakeLocalFileName> libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); +- frameworkdirs.append(QMakeLocalFileName("/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", "QMAKE_LIBS_PRIVATE", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -583,7 +584,9 @@ + UnixMakefileGenerator::processPrlFiles() + { + QList<QMakeLocalFileName> libdirs, frameworkdirs; ++ frameworkdirs.append(QMakeLocalFileName("@PREFIX@/Library/Frameworks")); + frameworkdirs.append(QMakeLocalFileName("/System/Library/Frameworks")); ++ libdirs.append(QMakeLocalFileName("@PREFIX@/lib")); + const QString lflags[] = { "QMAKE_LIBDIR_FLAGS", "QMAKE_FRAMEWORKPATH_FLAGS", "QMAKE_LFLAGS", "QMAKE_LIBS", QString() }; + for(int i = 0; !lflags[i].isNull(); i++) { + QStringList &l = project->values(lflags[i]); +@@ -627,13 +630,78 @@ + else + opt = l.at(++lit); + opt = opt.trimmed(); +- const QList<QMakeLocalFileName> dirs = frameworkdirs + libdirs; +- for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ ++ // See if this framework is specified as ++ // "foo,bar", which to Apple's LD means to look ++ // for "foo" with the addition "bar" first in all ++ // paths, then if not found do the same for just ++ // "foo". Tricky looking for "," but not "\," ++ ++#if 0 ++ warn_msg(WarnLogic, "out before: '%s'\n", opt.toLatin1().constData()); ++#endif ++ int num_cs = 0; ++ int loc_1 = -1; ++ int loc = opt.indexOf(","); ++ bool found = false; ++ while (!found && (loc != -1)) { ++ found = (loc == 0); ++ if (!found) { ++ found = (opt[loc-1] != '\\'); ++ } ++ if (found) { ++ if (loc_1 == -1) { ++ loc_1 = loc; ++ } ++ ++num_cs; ++ } else { ++ loc = opt.indexOf(",", loc); ++ } ++ } ++#if 0 ++ warn_msg(WarnLogic, "found == %s, loc == %d\n", ++ (found ? "true" : "false"), loc); ++#endif ++ if (found) { ++ // split into name and extension ++ if (num_cs > 1) { ++ warn_msg(WarnLogic, "When parsing -framework '%s', found more than one ',' in the name. Assuming the first ',' is used to delineate between the framework name and the optional extension.\n", opt.toLatin1().constData()); ++ } ++ QString ext = opt.mid(loc_1+1); ++ opt = opt.left(loc_1); ++ found = false; ++ const QList<QMakeLocalFileName> dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { ++ QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + ext + Option::prl_ext; ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s' with optional extension '%s': '%s'\n", opt.toLatin1().constData(), ext.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ found = true; ++ break; ++ } ++ } ++ } ++ // if not found yet, try the primary name ++ if (!found) { ++ const QList<QMakeLocalFileName> dirs = frameworkdirs + libdirs; ++ for(int dep_i = 0; dep_i < dirs.size(); ++dep_i) { + QString prl = dirs[dep_i].local() + "/" + opt + ".framework/" + opt + Option::prl_ext; +- if(processPrlFile(prl)) +- break; +- } +- } ++#if 0 ++ warn_msg(WarnLogic, "Looking for PRL '%s'\n", prl.toLatin1().constData()); ++#endif ++ if(processPrlFile(prl)) { ++#if 0 ++ warn_msg(WarnLogic, "Found PRL for framework '%s': '%s'\n", opt.toLatin1().constData(), prl.toLatin1().constData()); ++#endif ++ break; ++ } ++ } ++ } ++ } + } else if(!opt.isNull()) { + QString lib = opt; + processPrlFile(lib);