generate_code("QtXmlPatterns")
if "phonon" in pyqt_modules:
- generate_code("phonon")
+ # check to see if phonon is installed by Qt or external to
+ # it. adding to the include path and library path will not
+ # hurt if Qt installed phonon, and will get the headers
+ # and library if phonon was installed external to Qt.
+ sout = get_command_stdout("pkg-config --cflags-only-I --libs phonon")
+ iflags = sout.read().strip()
+ sout = get_command_stdout("%s -query QT_INSTALL_PREFIX" % opts.qmake)
+ qt_install_prefix = sout.read().strip()
+ if sys.hexversion >= 0x03000000:
+ iflags = iflags.decode()
+ qt_install_prefix = qt_install_prefix.decode()
+ for f in iflags.split():
+ # look for flags outside the Qt install prefix only
+ if f.find(qt_install_prefix) == -1:
+ phononincdirs.append(tdir)
+ if not tdir.endswith("phonon"):
+ phononincdirs.append(tdir + "/phonon")
+ elif f.startswith("-L"):
+ phononlibdirs.append(f[2:])
+ cons_xtra_incdirs.append(phononincdirs)
+ cons_xtra_libdirs.append(phononlibdirs)
+ generate_code("phonon")
+ generate_code("phonon", extra_include_dirs=phononincdirs,
+ extra_lib_dirs=phononlibdirs)
if "QtAssistant" in pyqt_modules:
generate_code("QtAssistant")
dynamic_pylib = "--enable-shared" in config_args
- if glob.glob("%s/lib/libpython%d.%d*" % (ducfg["exec_prefix"], py_major, py_minor)):
- lib_dir_flag = quote("-L%s/lib" % ducfg["exec_prefix"])
- elif 'MULTIARCH' in ducfg and glob.glob('%s/lib/%s/libpython%d.%d*' % (ducfg['exec_prefix'], ducfg['MULTIARCH'], py_major, py_minor)):
- lib_dir_flag = quote('-L%s/lib/%s' % (ducfg['exec_prefix'], ducfg['MULTIARCH']))
- elif glob.glob("%s/libpython%d.%d*" % (ducfg["LIBDIR"], py_major, py_minor)):
- lib_dir_flag = quote("-L%s" % ducfg["LIBDIR"])
- sipconfig.inform("Qt Designer plugin disabled because Python library couldn't be found")
- opts.designer_plugin = False
- link = "%s -lpython%d.%d%s" % (lib_dir_flag, py_major, py_minor, abi)
+ link = "%s @@MACPORTS_PYTHON_FRAMEWORK@@" % sipcfg.build_macros().get('LFLAGS', '')
sipconfig.inform("The Qt Designer plugin was disabled because a dynamic Python library couldn't be found")
opts.designer_plugin = False
sipconfig.inform("SIP %s is being used." % sipcfg.sip_version_str)
sipconfig.inform("The Qt header files are in %s." % qt_incdir)
- sipconfig.inform("The %s Qt libraries are in %s." % (lib_type, qt_libdir))
+ if sys.platform == "darwin" and qt_framework:
+ sipconfig.inform("The %s Qt frameworks are in %s." % (lib_type, qt_frameworkdir))
+ sipconfig.inform("The %s Qt libraries are in %s." % (lib_type, qt_libdir))
sipconfig.inform("The Qt binaries are in %s." % qt_bindir)
sipconfig.inform("The Qt mkspecs directory is in %s." % qt_archdatadir)
sipconfig.inform("These PyQt modules will be built: %s." % ", ".join(pyqt_modules))
"qt_data_dir": qt_datadir,
"qt_archdata_dir": qt_archdatadir,
- "qt_lib_dir": qt_libdir
+ "qt_lib_dir": qt_libdir,
+ "qt_framework_dir": qt_frameworkdir