How to use the pkgconfig.variables function in pkgconfig

To help you get started, we’ve selected a few pkgconfig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_variables():
    variables = pkgconfig.variables('fake-python')

    assert 'prefix' in variables
    assert 'exec_prefix' in variables
    assert 'libdir' in variables
    assert 'includedir' in variables

    assert variables['prefix'] == '/usr'
    assert variables['exec_prefix'] == '/usr'
    assert variables['libdir'] == '/usr/lib_python_foo'
    assert variables['includedir'] == '/usr/include'

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.variables('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_variables():
    variables = pkgconfig.variables('fake-python')

    assert 'prefix' in variables
    assert 'exec_prefix' in variables
    assert 'libdir' in variables
    assert 'includedir' in variables

    assert variables['prefix'] == '/usr'
    assert variables['exec_prefix'] == '/usr'
    assert variables['libdir'] == '/usr/lib_python_foo'
    assert variables['includedir'] == '/usr/include'

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.variables('doesnotexist')
github monofox / python-aqbanking / setup.py View on Github external
cnt = f.read()
	f.close()
	return cnt

libraries = ['gwenhywfar', 'aqbanking']
depCompilationArgs = ['-Wunused-variable', '-Wunused-function', '-DPACKAGE_VERSION="' + PACKAGE_VERSION + '"']
depLibraryDirs = []
# check for aqbanking dependency
if not pkgconfig.exists('aqbanking'):
	sys.stderr.write('Need aqbanking development package installed for compilation.' + os.linesep)
	sys.exit(1)
else:
	for library in libraries:
		depCompilationArgs += pkgconfig.cflags(library).split(' ')
		depCompilationArgs += pkgconfig.libs(library).split(' ')
		libPath = pkgconfig.variables(library)['libdir']
		if libPath not in depLibraryDirs:
			depLibraryDirs.append(libPath)

	# furthermore remember the c++ gui!
	if StrictVersion(pkgconfig.modversion('aqbanking').replace('beta', '').replace('alpha', '')) >= StrictVersion('5.8.1'):
		depCompilationArgs.append('-DSUPPORT_APPREGISTRATION')

	#depCompilationArgs += ['-DFENQUEJOB']
	depCompilationArgs += ['-O0', '-g', '-std=gnu++11', '-Wunused-function', '-DDEBUGSTDERR']
	depCompilationArgs += ['-DAQBANKING6']
	depCompilationArgs += ['-DFINTS_REGISTRATION_KEY="2348723498724"']

module1 = Extension('aqbanking',
	#libraries = ['gwenhywfar', 'aqbanking', 'gwengui-cpp'],
	libraries = libraries + ['gwengui-cpp',],
	#include_dirs = ['/usr/include/gwenhywfar4', '/usr/include/aqbanking5', '/usr/local/include/gwenhywfar4', '/usr/local/include/aqbanking5'],
github pytroll / aggdraw / setup.py View on Github external
def _get_freetype_with_pkgconfig():
    print("Trying 'pkgconfig' to find freetype library...")
    try:
        import pkgconfig
        return pkgconfig.variables('freetype2')['prefix']
    except (ImportError, KeyError, ValueError):
        return None