How to use pkgconfig - 10 common examples

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_cflags():
    flags = pkgconfig.cflags(PACKAGE_NAME)

    for flag in flags.split(' '):
        assert flag in ('-DGSEAL_ENABLE', '-I/usr/include/gtk-3.0')

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.cflags('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_libs():
    flags = pkgconfig.libs(PACKAGE_NAME)

    for flag in flags.split(' '):
        assert flag in ('-L/usr/lib_gtk_foo', '-lgtk-3')

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.libs('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_libs():
    flags = pkgconfig.libs(PACKAGE_NAME)

    for flag in flags.split(' '):
        assert flag in ('-L/usr/lib_gtk_foo', '-lgtk-3')

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.libs('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_parse():
    config = pkgconfig.parse("fake-gtk+-3.0 fake-python")

    assert ('GSEAL_ENABLE', None) in config['define_macros']
    assert '/usr/include/gtk-3.0' in config['include_dirs']
    assert '/usr/lib_gtk_foo' in config['library_dirs']
    assert '/usr/lib_python_foo' in config['library_dirs']
    assert 'gtk-3' in config['libraries']

    assert '/usr/include/python2.7' in config['include_dirs']

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.parse('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_parse():
    config = pkgconfig.parse("fake-gtk+-3.0 fake-python")

    assert ('GSEAL_ENABLE', None) in config['define_macros']
    assert '/usr/include/gtk-3.0' in config['include_dirs']
    assert '/usr/lib_gtk_foo' in config['library_dirs']
    assert '/usr/lib_python_foo' in config['library_dirs']
    assert 'gtk-3' in config['libraries']

    assert '/usr/include/python2.7' in config['include_dirs']

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.parse('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_exists():
    assert pkgconfig.exists(PACKAGE_NAME)
    assert pkgconfig.exists('fake-openssl')
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 matze / pkgconfig / test_pkgconfig.py View on Github external
def test_modversion():
    assert pkgconfig.modversion(PACKAGE_NAME) == '3.2.1'
    assert pkgconfig.modversion('fake-openssl') == '1.1.0j'

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.modversion('doesnotexist')
github matze / pkgconfig / test_pkgconfig.py View on Github external
def test_modversion():
    assert pkgconfig.modversion(PACKAGE_NAME) == '3.2.1'
    assert pkgconfig.modversion('fake-openssl') == '1.1.0j'

    with pytest.raises(pkgconfig.PackageNotFoundError):
        pkgconfig.modversion('doesnotexist')