예제 #1
0
def install_data(temp_dir: str, root_dir: str, prefix_dir: str):
    chdir_to_source_root()

    print('Checking dependencies')
    if not pkgconfig.installed('systemd', '>= 240'):
        print(
            'Systemd is not installed on this system. Please make systemd available to continue.'
        )
        sys.exit(4)

    print('Generating manual pages')
    manpage_files = make_manpages(temp_dir)

    print('Installing data')
    inst = Installer(root_dir, prefix_dir)
    sd_tmpfiles_dir = pkgconfig.variables('systemd')['tmpfilesdir']
    sd_system_unit_dir = pkgconfig.variables('systemd')['systemdsystemunitdir']
    man_dir = os.path.join('share', 'man', 'man1')

    inst.install('data/tmpfiles.d/debspawn.conf', sd_tmpfiles_dir)
    inst.install('data/services/debspawn-clear-caches.timer',
                 sd_system_unit_dir)
    inst.install('data/services/debspawn-clear-caches.service',
                 sd_system_unit_dir,
                 replace_vars=True)
    for mf in manpage_files:
        inst.install(mf, man_dir)
예제 #2
0
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')
예제 #3
0
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')
예제 #4
0
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
예제 #5
0
파일: setup.py 프로젝트: jakul/aggdraw
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
예제 #6
0
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'
예제 #7
0
파일: test.py 프로젝트: aragilar/pkgconfig
def test_variables():
    variables = pkgconfig.variables('fake-python')

    nt.assert_true('prefix' in variables)
    nt.assert_true('exec_prefix' in variables)
    nt.assert_true('libdir' in variables)
    nt.assert_true('includedir' in variables)

    nt.assert_true(variables['prefix'] == '/usr')
    nt.assert_true(variables['exec_prefix'] == '/usr')
    nt.assert_true(variables['libdir'] == '/usr/lib_python_foo')
    nt.assert_true(variables['includedir'] == '/usr/include')
예제 #8
0
def get_motr_libs_dir():
    try:
        # Motr devel rpm takes precedence over M0_SRC_DIR
        if pkgconfig.exists('motr'):
            return pkgconfig.variables('motr')['libdir']
    except EnvironmentError:
        # fall back to M0_SRC_DIR handling if `pkg-config` is not available in
        # the system
        pass

    libs_dir = get_motr_dir() + '/motr/.libs'
    libmotr = libs_dir + '/libmotr.so'
    assert P.isfile(libmotr), f'{libmotr}: No such file'
    return libs_dir
예제 #9
0
def get_motr_dir():
    try:
        # Motr devel rpm takes precedence over M0_SRC_DIR
        if pkgconfig.exists('motr'):
            return pkgconfig.variables('motr')['includedir']
    except EnvironmentError:
        # fall back to M0_SRC_DIR handling if `pkg-config` is not available in
        # the system
        pass

    d = os.environ.get('M0_SRC_DIR')
    if d:
        return d
    return P.normpath(P.dirname(P.abspath(__file__)) + '/../../cortx-motr')
예제 #10
0
import ctypes
import pkgconfig


# Loading pineppl library.
if not pkgconfig.exists('pineappl_capi'):
    raise RuntimeError('Cannot find the PineAPPL C-API, please make sure ' \
                       'the PineAPPL Rust library is properly installed and ' \
                       'that pkgconfig is able to access the pineappl.pc file.')

lib = pkgconfig.variables('pineappl_capi')['libdir'] + '/libpineappl_capi.so'
pineappl_lib = ctypes.CDLL(lib)

# Mirror C structures in python.
class pineappl_lumi(ctypes.Structure):
    pass


class pineappl_keyval(ctypes.Structure):
    pass


class pineappl_grid(ctypes.Structure):
    pass


# Specify the return and argument types.
pineappl_lib.pineappl_lumi_new.restype = ctypes.c_void_p
pineappl_lib.pineappl_keyval_new.restype = ctypes.c_void_p
pineappl_lib.pineappl_grid_new.restype = ctypes.c_void_p
pineappl_lib.pineappl_grid_read.restype = ctypes.c_void_p
예제 #11
0
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 += [
            '-DFINTS_REGISTRATION_KEY="8DEDB89E7B0F7DAE207CB948C"'
        ]
        sys.stderr.write('FinTS App registration enabled' + os.linesep)
    else:
        sys.stderr.write('FinTS App registration disabled' + os.linesep)